Skip to content

Commit

Permalink
sync with protocol change
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft committed Aug 8, 2024
1 parent 2535a5d commit 70c1bab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub static TAIKO_DEV: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
#[cfg(feature = "taiko")]
(Hardfork::Hekla, ForkCondition::Block(0)),
#[cfg(feature = "taiko")]
(Hardfork::Ontake, ForkCondition::Block(9999999)), //todo
(Hardfork::Ontake, ForkCondition::Block(20)), //todo
]),
deposit_contract: None,
..Default::default()
Expand Down
19 changes: 17 additions & 2 deletions crates/ethereum/evm/src/taiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub struct TaikoData {
pub l2_contract: Address,
/// base fee sharing ratio
pub basefee_ratio: u8,
/// base fee adjustment quotient
pub basefee_adj_quotient: u8,
/// gas issuance per second
pub gas_issue_per_sec: u32,
}

/// Anchor tx gas limit
Expand Down Expand Up @@ -190,12 +194,23 @@ pub fn check_anchor_tx_ontake(
"L1 state root mismatch"
);
ensure!(anchor_call._anchorBlockId == taiko_data.l1_header.number, "L1 block number mismatch");
ensure!(anchor_call._anchorStateRoot == taiko_data.l1_header.state_root, "L1 state root mismatch");
ensure!(
anchor_call._anchorStateRoot == taiko_data.l1_header.state_root,
"L1 state root mismatch"
);
// The parent gas used input needs to match the gas used value of the parent block
ensure!(
anchor_call.parentGasUsed == taiko_data.parent_header.gas_used as u32,
anchor_call._parentGasUsed == taiko_data.parent_header.gas_used as u32,
"parentGasUsed mismatch"
);
ensure!(
anchor_call._gasIssuancePerSecond == taiko_data.gas_issue_per_sec,
"gas issuance per second mismatch"
);
ensure!(
anchor_call._basefeeAdjustmentQuotient == taiko_data.basefee_adj_quotient,
"basefee adjustment quotient mismatch"
);

Ok(())
}

0 comments on commit 70c1bab

Please sign in to comment.