Skip to content

Commit

Permalink
Fix crash with non-consecutive Babe epoch numbers (#1695)
Browse files Browse the repository at this point in the history
* Fix crash with non-consecutive Babe epoch numbers

* PR link
  • Loading branch information
tomaka authored Mar 4, 2024
1 parent 60fc60e commit d5e6e20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
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

0 comments on commit d5e6e20

Please sign in to comment.