Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Commit 5fe5feb

Browse files
ggonzalez94claude
andcommitted
fix(lib): thread proposal_id and chain_id into ShastaData
Pass batch_id and chain_id from the batch input through to the taiko-reth execution layer's ShastaData. This enables taiko-reth to conditionally skip the anchor success check for early mainnet Shasta proposals (1-7) where the anchor tx reverted during bootstrapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 11be15a commit 5fe5feb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

lib/src/builder.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ pub fn calculate_batch_blocks_final_header(input: &GuestBatchInput) -> Vec<Block
6464
&input.inputs[i],
6565
create_mem_db(&mut input.inputs[i].clone()).unwrap(),
6666
)
67-
.set_is_first_block_in_proposal(i == 0);
67+
.set_is_first_block_in_proposal(i == 0)
68+
.set_proposal_id(input.taiko.batch_id);
6869

6970
let mut execute_tx = vec![input.inputs[i].taiko.anchor_tx.clone().unwrap()];
7071
execute_tx.extend_from_slice(&pool_txs.0);
@@ -142,6 +143,8 @@ pub struct RethBlockBuilder<DB> {
142143
pub db: Option<DB>,
143144
/// Whether this is the first block in a proposal batch (for Shasta)
144145
pub is_first_block_in_proposal: bool,
146+
/// The proposal (batch) ID, used to skip anchor checks for early mainnet proposals.
147+
pub proposal_id: u64,
145148
}
146149

147150
impl<DB: Database<Error = ProviderError> + DatabaseCommit + OptimisticDatabase>
@@ -156,6 +159,7 @@ impl<DB: Database<Error = ProviderError> + DatabaseCommit + OptimisticDatabase>
156159
db: Some(db),
157160
input: input.clone(),
158161
is_first_block_in_proposal: true, // Default to true for single block execution
162+
proposal_id: 0,
159163
}
160164
}
161165

@@ -165,6 +169,12 @@ impl<DB: Database<Error = ProviderError> + DatabaseCommit + OptimisticDatabase>
165169
self
166170
}
167171

172+
/// Sets the proposal (batch) ID for anchor check overrides.
173+
pub fn set_proposal_id(mut self, proposal_id: u64) -> Self {
174+
self.proposal_id = proposal_id;
175+
self
176+
}
177+
168178
/// Executes all input transactions.
169179
pub fn execute_transactions(
170180
&mut self,
@@ -258,6 +268,8 @@ impl<DB: Database<Error = ProviderError> + DatabaseCommit + OptimisticDatabase>
258268
last_anchor_block_number: last_anchor_block_number_opt.unwrap(),
259269
is_force_inclusion: *is_force_inclusion,
260270
is_first_block_in_proposal: self.is_first_block_in_proposal,
271+
proposal_id: self.proposal_id,
272+
chain_id: self.input.chain_spec.chain_id,
261273
})
262274
} else {
263275
None

0 commit comments

Comments
 (0)