mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 20:11:21 +00:00
Ensure no in-memory execution when --experimental.overlay=false (#4708)
* Ensure no in-memory execution when --experimental.overlay=false * bump log level * canExtendInMemory -> canExtendFork * forgot to FeedHeaderPoS * small simplification
This commit is contained in:
parent
8c27879a6b
commit
af58e427f1
@ -587,9 +587,9 @@ func verifyAndSaveNewPoSHeader(
|
||||
|
||||
currentHeadHash := rawdb.ReadHeadHeaderHash(tx)
|
||||
canExtendCanonical := header.ParentHash == currentHeadHash
|
||||
canExtendInMemory := cfg.memoryOverlay && (cfg.forkValidator.ExtendingForkHeadHash() == (common.Hash{}) || header.ParentHash == cfg.forkValidator.ExtendingForkHeadHash())
|
||||
canExtendFork := cfg.forkValidator.ExtendingForkHeadHash() == (common.Hash{}) || header.ParentHash == cfg.forkValidator.ExtendingForkHeadHash()
|
||||
|
||||
if canExtendInMemory || !canExtendCanonical {
|
||||
if cfg.memoryOverlay && (canExtendFork || !canExtendCanonical) {
|
||||
status, latestValidHash, validationError, criticalError := cfg.forkValidator.ValidatePayload(tx, header, body, canExtendCanonical)
|
||||
if criticalError != nil {
|
||||
return &privateapi.PayloadStatus{CriticalError: criticalError}, false, criticalError
|
||||
@ -608,11 +608,16 @@ func verifyAndSaveNewPoSHeader(
|
||||
}, success, nil
|
||||
}
|
||||
|
||||
// OK, we're on the canonical chain
|
||||
if err := headerInserter.FeedHeaderPoS(tx, header, headerHash); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
if !canExtendCanonical {
|
||||
log.Info("Side chain or something weird", "parentHash", header.ParentHash, "currentHead", currentHeadHash)
|
||||
return &privateapi.PayloadStatus{Status: remote.EngineStatus_ACCEPTED}, true, nil
|
||||
}
|
||||
|
||||
// OK, we're on the canonical chain
|
||||
if requestStatus == engineapi.New {
|
||||
cfg.hd.SetPendingPayloadHash(headerHash)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user