diff --git a/beacon_chain/consensus_object_pools/block_clearance.nim b/beacon_chain/consensus_object_pools/block_clearance.nim index 7aeb1a9d24..1d010acec8 100644 --- a/beacon_chain/consensus_object_pools/block_clearance.nim +++ b/beacon_chain/consensus_object_pools/block_clearance.nim @@ -509,9 +509,7 @@ proc addBackfillBlockData*( withBlck(parentBlock): forkyBlck.message.state_root clearanceBlock = BlockSlotId.init(parent.bid, forkyBlck.message.slot) - updateFlags1 = dag.updateFlags - # {skipLastStateRootCalculation} flag here could improve performance by - # 100%, but its not enough. + updateFlags1 = dag.updateFlags + {skipLastStateRootCalculation} if not updateState(dag, dag.clearanceState, clearanceBlock, true, cache, updateFlags1): @@ -519,6 +517,8 @@ proc addBackfillBlockData*( "database corrupt?", clearanceBlock = shortLog(clearanceBlock) return err(VerifierError.MissingParent) + dag.clearanceState.setStateRoot(trustedStateRoot) + let proposerVerifyTick = Moment.now() if not(isNil(onStateUpdated)): diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index b92c333239..4ad67fd3c9 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -381,14 +381,11 @@ proc initFullNode( else: dag.tail.slot - proc getUntrustedBackfillSlot(): Slot = + func getUntrustedBackfillSlot(): Slot = if clist.tail.isSome(): clist.tail.get().blck.slot else: - getLocalWallSlot() - - func getUntrustedFrontfillSlot(): Slot = - getFirstSlotAtFinalizedEpoch() + dag.tail.slot func getFrontfillSlot(): Slot = max(dag.frontfill.get(BlockId()).slot, dag.horizon) @@ -531,7 +528,7 @@ proc initFullNode( dag.cfg.DENEB_FORK_EPOCH, dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS, SyncQueueKind.Backward, getLocalHeadSlot, getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getUntrustedBackfillSlot, - getUntrustedFrontfillSlot, isWithinWeakSubjectivityPeriod, + getFrontfillSlot, isWithinWeakSubjectivityPeriod, clistPivotSlot, untrustedBlockVerifier, maxHeadAge = 0, shutdownEvent = node.shutdownEvent, flags = syncManagerFlags) diff --git a/beacon_chain/sync/sync_overseer.nim b/beacon_chain/sync/sync_overseer.nim index 0eee00623a..738e8cb398 100644 --- a/beacon_chain/sync/sync_overseer.nim +++ b/beacon_chain/sync/sync_overseer.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2025 Status Research & Development GmbH +# Copyright (c) 2018-2024 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -184,7 +184,7 @@ proc updatePerformance(overseer: SyncOverseerRef, startTick: Moment, # Update status string overseer.statusMsg = Opt.some( - "fill: " & timeleft.toTimeLeftString() & " (" & + timeleft.toTimeLeftString() & " (" & (done * 100).formatBiggestFloat(ffDecimal, 2) & "%) " & overseer.avgSpeed.formatBiggestFloat(ffDecimal, 4) & "slots/s (" & $dag.head.slot & ")") @@ -418,15 +418,6 @@ proc mainLoop*( clist = overseer.clist currentSlot = overseer.beaconClock.now().slotOrZero() - notice "Sync overseer starting", - wall_slot = currentSlot, - dag_head_slot = dag.head.slot, - dag_finalized_head_slot = dag.finalizedHead.slot, - dag_horizon = dag.horizon(), - dag_backfill_slot = dag.backfill.slot, - untrusted_tail = shortLog(clist.tail), - untrusted_head = shortLog(clist.head) - if overseer.isWithinWeakSubjectivityPeriod(currentSlot): # Starting forward sync manager/monitor. overseer.forwardSync.start() @@ -495,8 +486,6 @@ proc mainLoop*( quit 1 overseer.untrustedInProgress = false - # Reset status bar - overseer.statusMsg = Opt.none(string) # When we finished state rebuilding process - we could start forward # SyncManager which could perform finish sync.