Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed May 9, 2024
1 parent 9b9bceb commit 37d9fc1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ zstd-codec = [
"dep:zstd"
]
clap = ["dep:clap"]
bsc = ["revm-primitives/bsc"]
optimism = [
"reth-codecs/optimism",
"revm-primitives/optimism",
Expand Down
6 changes: 5 additions & 1 deletion crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ cfg-if = "1.0.0"
reth-trie.workspace = true

[features]
bsc = ["revm/bsc"]
bsc = [
"revm/bsc",
"reth-interfaces/bsc",
"reth-provider/bsc",
]
test-utils = ["dep:reth-trie"]
optimism = [
"revm/optimism",
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/bsc/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ where
fn with_state_and_provider<
'a,
SP: StateProvider + 'a,
P: HeaderProvider + ParliaSnapshotReader + ParliaSnapshotWriter + 'a,
P: HeaderProvider + ParliaSnapshotReader + ParliaSnapshotWriter,
>(
&'a self,
sp: SP,
Expand Down
9 changes: 2 additions & 7 deletions crates/revm/src/bsc/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ where
total_difficulty: U256,
) -> Result<Vec<Receipt>, BlockExecutionError> {
self.init_env(&block.header, total_difficulty);
let (mut system_tx, mut receipts, mut cumulative_gas_used) =
let (mut system_txs, mut receipts, mut cumulative_gas_used) =
self.execute_transactions_and_get_system_txs(block, total_difficulty)?;

self.finalize(&block.header, &mut system_tx, &mut receipts, &mut cumulative_gas_used)?;
self.finalize(&block.header, &mut system_txs, &mut receipts, &mut cumulative_gas_used)?;
// Check if gas used matches the value set in header.
if block.gas_used != cumulative_gas_used {
let receipts = Receipts::from_block_receipt(receipts);
Expand Down Expand Up @@ -557,11 +557,6 @@ where
todo!()
}

// perf: do not execute empty blocks
if block.body.is_empty() {
return Ok((Vec::new(), Vec::new(), 0))
}

let mut cumulative_gas_used = 0;
let mut system_txs = Vec::with_capacity(2);
let mut receipts = Vec::with_capacity(block.body.len());
Expand Down
4 changes: 3 additions & 1 deletion crates/stages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ pprof = { workspace = true, features = [
] }

[features]
bsc = []
bsc = [
"reth-revm/bsc",
]
test-utils = [
"reth-interfaces/test-utils",
"reth-db/test-utils",
Expand Down

0 comments on commit 37d9fc1

Please sign in to comment.