Skip to content

Commit

Permalink
fix: unable to execute to Cancun due to bug in post_block_beneficiaries
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML committed Sep 23, 2024
1 parent 2932dc8 commit ad0c412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions trin-execution/src/evm/post_block_beneficiaries.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use alloy_consensus::constants::ETH_TO_WEI;
use alloy_primitives::Address;
use alloy_consensus::constants::{ETH_TO_WEI, GWEI_TO_WEI};
use alloy_primitives::{Address, U256};
use revm::{db::State, Evm};
use revm_primitives::SpecId;
use trin_evm::spec_id::get_spec_block_number;
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() +=
(U256::from(withdrawal.amount) * U256::from(GWEI_TO_WEI)).to::<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 ad0c412

Please sign in to comment.