Skip to content

Commit

Permalink
[rooch-networkgh-1685] prepare for grouping and submiting multi-block…
Browse files Browse the repository at this point in the history
…s for chain reorg.
  • Loading branch information
Feliciss committed May 20, 2024
1 parent ec156ad commit c0b87b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/rooch-executor/src/actor/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl ExecutorActor {
block_body,
} = l1_block;
match RoochMultiChainID::try_from(chain_id.id())? {
// TODO: wait 2 blocks for `submit_new_block` for bitcoin chain reorg
RoochMultiChainID::Bitcoin => {
let action = VerifiedMoveAction::Function {
call: BitcoinModule::create_submit_new_block_call_bytes(
Expand Down
2 changes: 2 additions & 0 deletions crates/rooch-types/src/bitcoin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ impl<'a> BitcoinModule<'a> {
Ok(height)
}

// TODO: two blocks for chain reorg
pub fn create_submit_new_block_call(block_height: u64, block: bitcoin::Block) -> FunctionCall {
let block_hash = block.block_hash();
let block = crate::bitcoin::types::Block::from(block);
Expand All @@ -192,6 +193,7 @@ impl<'a> BitcoinModule<'a> {
)
}

// TODO: two hashes for chain reorg
pub fn create_submit_new_block_call_bytes(
block_height: u64,
block_hash: Vec<u8>,
Expand Down

0 comments on commit c0b87b9

Please sign in to comment.