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

Fix crash with non-consecutive Babe epoch numbers #1695

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions lib/src/chain/chain_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,6 @@ impl<'a> ChainInformationRef<'a> {
} else {
return Err(ValidityError::MissingBabeSlotStartNumber);
}
if finalized_block_epoch_information.epoch_index + 1
!= finalized_next_epoch_transition.epoch_index
{
return Err(ValidityError::NonLinearBabeEpochs);
}
}

if finalized_block_epoch_information.is_none()
Expand Down Expand Up @@ -617,8 +612,6 @@ pub enum ValidityError {
/// Finalized block is block number 0, and a Babe epoch information has been provided. This
/// would imply the existence of a block -1 and below.
UnexpectedBabeFinalizedEpoch,
/// Next Babe epoch number does not immediately follow current Babe epoch number.
NonLinearBabeEpochs,
/// Finalized block is not number 0, but no Babe epoch information has been provided.
NoBabeFinalizedEpoch,
/// The slot of the finalized block is inferior to the start slot of the epoch it belongs to.
Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed

- Fix crash when extracting the database of a chain when the current Babe epoch number doesn't immediately follow the previous Babe epoch number. ([#1695](https://github.com/smol-dot/smoldot/pull/1695))

## 2.0.21 - 2024-02-06

### Changed
Expand Down
Loading