Skip to content

Commit

Permalink
Merge pull request #274 from ralexstokes/bugfix-from-271
Browse files Browse the repository at this point in the history
Bugfix from #271
  • Loading branch information
ralexstokes authored Oct 23, 2024
2 parents 9e2b415 + 6d6188b commit 38620f4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
5 changes: 0 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.0.8" }
alloy = { version = "0.4.2", features = ["consensus", "eips", "signers", "signer-local", "signer-mnemonic"] }
alloy = { version = "0.4.2", features = [
"consensus",
"eips",
"signers",
"signer-local",
"signer-mnemonic",
] }

futures = "0.3.21"
tokio = "1.0"
Expand Down Expand Up @@ -62,6 +68,3 @@ sha2 = "0.10.8"
rand = "0.8.5"

clap = "4.1.4"

[patch.crates-io]
libffi-sys = { git = "https://github.com/tov/libffi-rs", rev = "d0704d634b6f3ffef5b6fc7e07fe965a1cff5c7b" }
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions mev-build-rs/src/payload/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fn append_payment<Client: StateProviderFactory>(
tx_env,
);
// NOTE: adjust gas limit to allow for payment transaction
env.block.gas_limit += U256::from(BASE_TX_GAS_LIMIT);
env.block.gas_limit += U256::from(gas_limit);
let mut evm = revm::Evm::builder().with_db(&mut db).with_env_with_handler_cfg(env).build();

let ResultAndState { result, state } =
Expand Down Expand Up @@ -258,13 +258,13 @@ impl PayloadBuilder {
proposal_attributes.proposer_gas_limit,
payload_config.parent_block.gas_limit,
);
// NOTE: reserve enough gas for the final payment transaction
block_env.gas_limit = U256::from(gas_limit) - U256::from(BASE_TX_GAS_LIMIT);

block_env.coinbase = proposal_attributes.proposer_fee_recipient;
} else {
block_env.coinbase = self.0.fee_recipient;
// NOTE: reserve enough gas for the final payment transaction,
// regardless of EOA or smart contract
// TODO: check recipient ahead of time to determine this here, rather than leave some
// gas on the table
block_env.gas_limit = U256::from(gas_limit) - U256::from(PAYMENT_TO_CONTRACT_GAS_LIMIT);
}
block_env.coinbase = self.0.fee_recipient;

(cfg_env, block_env)
}
Expand Down

0 comments on commit 38620f4

Please sign in to comment.