diff --git a/.changeset/fix_edge_case_where_a_node_incorrectly_sends_the_genesis_state_to_peers_while_syncing.md b/.changeset/fix_edge_case_where_a_node_incorrectly_sends_the_genesis_state_to_peers_while_syncing.md new file mode 100644 index 0000000..0699ac5 --- /dev/null +++ b/.changeset/fix_edge_case_where_a_node_incorrectly_sends_the_genesis_state_to_peers_while_syncing.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +# Fix edge case where a node incorrectly sends the genesis state to peers while syncing. diff --git a/syncer/syncer.go b/syncer/syncer.go index 83fc68d..132f1dc 100644 --- a/syncer/syncer.go +++ b/syncer/syncer.go @@ -680,6 +680,11 @@ func (s *Syncer) syncLoop(ctx context.Context) error { go func(p *Peer) { cs, headers, remaining, err := func() (consensus.State, []types.BlockHeader, uint64, error) { for _, id := range hist { + if id == (types.BlockID{}) { + // skip empty history entries which can occur when + // we don't have a full history of blocks. + continue + } cs, ok := s.cm.State(id) if !ok { return consensus.State{}, nil, 0, errors.New("missing state for history")