Skip to content

Commit

Permalink
fix: unable to execute to Cancun due to bug in post_block_beneficiari…
Browse files Browse the repository at this point in the history
…es (#1476)
  • Loading branch information
KolbyML authored Sep 23, 2024
1 parent 42947e4 commit c238aca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions trin-execution/src/evm/post_block_beneficiaries.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use alloy_consensus::constants::ETH_TO_WEI;
use alloy_consensus::constants::{ETH_TO_WEI, GWEI_TO_WEI};
use alloy_primitives::Address;
use revm::{db::State, Evm};
use revm_primitives::SpecId;
Expand Down Expand Up @@ -42,7 +42,8 @@ pub fn process_withdrawals(block: &ProcessedBlock, beneficiaries: &mut HashMap<A
if withdrawal.amount == 0 {
continue;
}
*beneficiaries.entry(withdrawal.address).or_default() += withdrawal.amount as u128;
*beneficiaries.entry(withdrawal.address).or_default() +=
withdrawal.amount as u128 * GWEI_TO_WEI as u128;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion trin-execution/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async fn main() -> anyhow::Result<()> {
tx.send(()).expect("signal ctrl_c should never fail");
});

let end_block = get_spec_block_number(SpecId::SHANGHAI);
let end_block = get_spec_block_number(SpecId::CANCUN);
trin_execution
.process_range_of_blocks(end_block, Some(rx))
.await?;
Expand Down

0 comments on commit c238aca

Please sign in to comment.