Skip to content

Commit 43f86c4

Browse files
committed
fix: recovery
1 parent 8fbd4a9 commit 43f86c4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • shasta/src/node/proposal_manager

shasta/src/node/proposal_manager/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ impl BatchManager {
488488

489489
let txs = txs.to_vec();
490490

491+
// Store block data for checkpoint before block is moved
492+
let block_hash = block.header.hash_slow();
493+
let block_state_root = block.header.state_root();
494+
491495
// TODO validate block params
492496
self.batch_builder
493497
.recover_from(
@@ -500,6 +504,15 @@ impl BatchManager {
500504
is_forced_inclusion,
501505
)
502506
.await?;
507+
508+
// Surge: Set the checkpoint for the recovered block
509+
// This is the L2 block state that should be used as checkpoint for the proposal
510+
self.batch_builder.set_proposal_checkpoint(Checkpoint {
511+
blockNumber: U48::from(block_height),
512+
stateRoot: block_state_root,
513+
blockHash: block_hash,
514+
})?;
515+
503516
Ok(())
504517
}
505518

0 commit comments

Comments
 (0)