From cd65ccad96f612b33d8fc2630e0d3d9c9bb66bdd Mon Sep 17 00:00:00 2001 From: cui Date: Fri, 24 Jul 2026 16:19:35 +0800 Subject: [PATCH] eth/downloader: hold pivotLock when marking pivot committed (#35405) commitPivotBlock updated committed without pivotLock, while other pivot transitions serialize through that lock. Take the lock around the store to keep pivot commitment consistent with pivotHeader updates. --- eth/downloader/downloader.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index e99de20701..1c7c35a420 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -1109,7 +1109,9 @@ func (d *Downloader) commitPivotBlock(result *fetchResult) error { if err := d.blockchain.SnapSyncComplete(block.Hash(), d.snapSyncer.Version() == snap.SNAP2); err != nil { return err } + d.pivotLock.Lock() d.committed.Store(true) + d.pivotLock.Unlock() // The chain has obtained a stateful head by committing the pivot block, // the mission of the snap sync is regarded as accomplished and the mode