Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix from #271 #274

Merged
merged 5 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading