Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle stacks reorg #1568

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading