Skip to content

Commit

Permalink
update to recent reth commit and drop custom revm fork
Browse files Browse the repository at this point in the history
ralexstokes committed Nov 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ffa4ab2 commit 34a0e9d
Showing 3 changed files with 159 additions and 168 deletions.
288 changes: 142 additions & 146 deletions Cargo.lock
25 changes: 9 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -17,21 +17,14 @@ version = "0.3.0"
ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "b9baee3f3b9fc76bd9b5bc22b78edc05446af815" }
beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "b9baee3f3b9fc76bd9b5bc22b78edc05446af815" }

reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth-rpc-types = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth-interfaces = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
reth = { git = "https://github.com/paradigmxyz/reth", rev = "5dd5555c5c7d8e43420e273e7005b8af63a847a5" }
revm = "3.5.0"
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth-rpc-types = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth-interfaces = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
reth = { git = "https://github.com/paradigmxyz/reth", rev = "0a3884ba81579a775a0305be3a6621cd6782176a" }
revm = { git = "https://github.com/bluealloy/revm", rev = "1609e07c68048909ad1682c98cf2b9baa76310b5" }

eyre = "0.6.8"

[patch.crates-io]
# We patch `revm-primitives` so that all generated files go into the expected place ("OUT_DIR") which
# works well with rust `nix` builders and does not work well otherwise.
# TODO: It looks like later versions of this crate remove the problematic build script and so once `reth` updates
# (which indirectly uses this dependency) then we can drop this patch.
revm-primitives = { git = "https://github.com/ralexstokes/revm", rev = "929530a5b2575c97f3c055f4f8d8b9ba273cb3dd" }
14 changes: 8 additions & 6 deletions mev-build-rs/src/reth_builder/payload_builder.rs
Original file line number Diff line number Diff line change
@@ -14,14 +14,15 @@ use ethers::{
};
use reth_interfaces::RethError;
use reth_primitives::{
constants::{BEACON_NONCE, EMPTY_OMMER_ROOT},
proofs, Address, Block, Bytes, ChainSpec, Header, IntoRecoveredTransaction, Receipt, Receipts,
constants::{BEACON_NONCE, EMPTY_OMMER_ROOT_HASH},
proofs,
revm::{compat::into_reth_log, env::tx_env_with_recovered},
Address, Block, Bytes, ChainSpec, Header, IntoRecoveredTransaction, Receipt, Receipts,
TransactionSigned, TransactionSignedEcRecovered, Withdrawal, B256, U256,
};
use reth_provider::{BundleStateWithReceipts, StateProvider, StateProviderFactory};
use reth_revm::{
database::StateProviderDatabase, env::tx_env_with_recovered, into_reth_log,
state_change::post_block_withdrawals_balance_increments,
database::StateProviderDatabase, state_change::post_block_withdrawals_balance_increments,
};
use revm::{
db::{states::bundle_state::BundleRetention, WrapDatabaseRef},
@@ -123,7 +124,7 @@ fn assemble_payload_with_payments(

let header = Header {
parent_hash: context.build.parent_hash,
ommers_hash: EMPTY_OMMER_ROOT,
ommers_hash: EMPTY_OMMER_ROOT_HASH,
beneficiary: context.build.block_env.coinbase,
state_root,
transactions_root,
@@ -277,7 +278,8 @@ impl<'a> ExecutionContext<'a> {
self.receipts.push(Some(receipt));

let base_fee = self.build.base_fee();
let fee = tx.effective_tip_per_gas(base_fee).expect("fee is valid; execution succeeded");
let fee =
tx.effective_tip_per_gas(Some(base_fee)).expect("fee is valid; execution succeeded");
self.total_fees += U256::from(fee) * U256::from(gas_used);

self.executed_txs.push(tx.into_signed());

0 comments on commit 34a0e9d

Please sign in to comment.