near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.33k stars 632 forks source link

chore: don't log error on genesis state sync dump #12463

Closed Longarithm closed 1 week ago

Longarithm commented 1 week ago

Looks like state sync dump doesn't work at genesis, because latest final block is non-existent 111...111. State sync at genesis doesn't make sense; however, it leads to very spammy logs all the time at startup:

0.146s ERROR state_sync_dump: Failed to get the latest epoch shard_id=ShardId(1) err=DBNotFoundErr("BLOCK HEADER: 11111111111111111111111111111111")
0.146s ERROR state_sync_dump: Failed to get the current state err=DBNotFoundErr("BLOCK HEADER: 11111111111111111111111111111111") shard_id=ShardId(1)
...

So I just return None if final block sync is 111... or sync hash doesn't exist. Later, the "next state sync state" is set to None anyway, so there are no changes in behaviour.