Skip to content

lib/babe: first slot of network should be set on finalization of block 1 #1624

@noot

Description

@noot

Describe the bug

  • the first slot of the network is determined by when block 1 was built
  • however gossamer currently sets the first slot of the network in 2 places (if an authority node), when just after building block 1 OR when importing block 1. this potentially results in being unable to validate imported blocks or the BABE algorithm becoming un-synced from the network as the first slot is set incorrectly
  • the first slot number should be set on finalization of block 1, instead of build/import
  • in the case where block 1 has not yet been finalized, there should be some list of unfinalized blocks with block number 1. when verifying a block and block 1 is not yet finalized, it should first use the slot number of block 1 on the canonical chain (which is what currently happens) as the first slot, but if that errors, try using other pending block 1.

sub-issue of #1587

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions