From 70c1bab0d2683470f7c5fb4ae7b155c0a1710bdb Mon Sep 17 00:00:00 2001 From: smtmfft Date: Thu, 8 Aug 2024 10:01:30 +0800 Subject: [PATCH] sync with protocol change --- crates/chainspec/src/spec.rs | 2 +- crates/ethereum/evm/src/taiko.rs | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/crates/chainspec/src/spec.rs b/crates/chainspec/src/spec.rs index 835e8690811f..2e6c35a099c4 100644 --- a/crates/chainspec/src/spec.rs +++ b/crates/chainspec/src/spec.rs @@ -155,7 +155,7 @@ pub static TAIKO_DEV: Lazy> = 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() diff --git a/crates/ethereum/evm/src/taiko.rs b/crates/ethereum/evm/src/taiko.rs index d157417903e2..05f833c76052 100644 --- a/crates/ethereum/evm/src/taiko.rs +++ b/crates/ethereum/evm/src/taiko.rs @@ -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 @@ -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(()) }