Skip to content

Commit

Permalink
fix: handle reorg in epoch 3.0 (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard authored Sep 27, 2024
1 parent 1bdc272 commit be42dd9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions components/stacks-network/src/chains_coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,18 @@ pub async fn start_chains_coordinator(
StacksChainEvent::ChainUpdatedWithMicroblocksReorg(_) => {
unreachable!() // TODO(lgalabru): good enough for now - code path unreachable in the context of Devnet
}
StacksChainEvent::ChainUpdatedWithReorg(_) => {
unreachable!() // TODO(lgalabru): good enough for now - code path unreachable in the context of Devnet
StacksChainEvent::ChainUpdatedWithReorg(data) => {
// reorgs should not happen in devnet
// tests showed that it can happen in epoch 3.0 but should not
// this patch allows to handle it, but further investigation will be done
// with blockchain team in order to avoid this
devnet_event_tx
.send(DevnetEvent::warning("Stacks reorg received".to_string()))
.expect("Unable to send reorg event");
match data.blocks_to_apply.last() {
Some(known_tip) => known_tip.clone(),
None => unreachable!(),
}
}
};

Expand Down

0 comments on commit be42dd9

Please sign in to comment.