eth/catalyst: don't snap sync if network is at genesis

This commit is contained in:
lightclient 2025-09-18 20:27:51 +02:00
parent 8a171dce1f
commit de71036ace
No known key found for this signature in database
GPG key ID: 657913021EF45A6A

View file

@ -729,8 +729,13 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
// into the database directly will conflict with the assumptions of snap sync // into the database directly will conflict with the assumptions of snap sync
// that it has an empty db that it can fill itself. // that it has an empty db that it can fill itself.
if api.eth.SyncMode() != ethconfig.FullSync { if api.eth.SyncMode() != ethconfig.FullSync {
// If the client is started at genesis of a test network with snap sync
// enabled, just try to import the block since there is nothing to sync.
if block.NumberU64() != 1 {
return api.delayPayloadImport(block), nil return api.delayPayloadImport(block), nil
} }
api.eth.SetSynced()
}
if !api.eth.BlockChain().HasBlockAndState(block.ParentHash(), block.NumberU64()-1) { if !api.eth.BlockChain().HasBlockAndState(block.ParentHash(), block.NumberU64()-1) {
api.remoteBlocks.put(block.Hash(), block.Header()) api.remoteBlocks.put(block.Hash(), block.Header())
log.Warn("State not available, ignoring new payload") log.Warn("State not available, ignoring new payload")