Skip to content

Commit

Permalink
sync: use current header (instead of block) to determine if london/or…
Browse files Browse the repository at this point in the history
…ion is activated when using snap sync
  • Loading branch information
iquidus committed Mar 31, 2023
1 parent ba040ba commit 7c6a3c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eth/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func (cs *chainSyncer) startSync(op *chainSyncOp) {

// doSync synchronizes the local blockchain with a remote peer.
func (h *handler) doSync(op *chainSyncOp) error {
isLondon := false
if op.mode == downloader.SnapSync {
// Before launch the snap sync, we have to ensure user uses the same
// txlookup limit.
Expand All @@ -225,10 +226,13 @@ func (h *handler) doSync(op *chainSyncOp) error {
h.chain.SetTxLookupLimit(*stored)
log.Warn("Update txLookup limit", "provided", limit, "updated", *stored)
}
// use header to determine if london is enabled
isLondon = h.chain.Config().IsLondon(h.chain.CurrentHeader().Number)
} else {
// use block to determine if london is enabled
isLondon = h.chain.Config().IsLondon(h.chain.CurrentBlock().Number())
}

startBlock := h.chain.CurrentBlock()
isLondon := h.chain.Config().IsLondon(startBlock.Number())
// Run the sync cycle, and disable fast sync if we're past the pivot block
err := h.downloader.Synchronise(op.peer.ID(), op.head, op.td, op.mode, isLondon)
if err != nil {
Expand Down

0 comments on commit 7c6a3c0

Please sign in to comment.