Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
e586f38
More work
cheatfate Aug 12, 2025
c6459bd
More changes.
cheatfate Aug 20, 2025
067ddda
Add sync access to engine events.
cheatfate Aug 21, 2025
5b99aac
Add groupSidecars(DataColumnsByRootIdentifier).
cheatfate Aug 25, 2025
857e772
Addressing some TODOs in overseer.
cheatfate Aug 25, 2025
bf06e68
Add missing shortLog()
cheatfate Aug 25, 2025
78dbed2
Replace one more TODO.
cheatfate Aug 25, 2025
b899fbc
Addressing column intersection TODO.
cheatfate Aug 25, 2025
1f0e774
Add event handlers.
cheatfate Aug 25, 2025
c893ab0
Update events implementation.
cheatfate Aug 26, 2025
36a147b
Add some debugging logs.
cheatfate Aug 26, 2025
39528dd
Fix crash.
cheatfate Aug 26, 2025
39ec1f6
Fix some issues and add some more debug logging.
cheatfate Aug 27, 2025
3d62ae2
Move all the blocks received on `range` step to the BlockBuffer.
cheatfate Aug 27, 2025
ca6b13e
Upgrade BlockBuffer.
cheatfate Sep 1, 2025
9fbde2c
Fix assertion crash.
cheatfate Sep 1, 2025
fb4fef5
Fix how sidecars checking procedures.
cheatfate Sep 2, 2025
2422c28
Do fixes of byroot sync.
cheatfate Sep 2, 2025
89037d2
Fix compilation issues.
cheatfate Sep 2, 2025
c29c37b
Add loop pause when there is no work to do.
cheatfate Sep 3, 2025
b876ddd
Fix incremental math.
cheatfate Sep 3, 2025
8cf9ea3
Make blobs and columns lists in logs smaller.
cheatfate Sep 3, 2025
43b21fe
Actively reload how columns/blobs are logged.
cheatfate Sep 3, 2025
525df64
Investigation of peer's endless loop issue.
cheatfate Sep 3, 2025
2995d76
Add performance meters.
cheatfate Sep 4, 2025
c86fa08
Fix performance counter issues.
cheatfate Sep 4, 2025
1993522
Add finalization event pruning.
cheatfate Sep 5, 2025
ac47e4a
Post rebase fixes.
cheatfate Sep 5, 2025
6393014
Add more conditions to peerPause.
cheatfate Sep 5, 2025
e1afa93
Fix missing dag access.
cheatfate Sep 5, 2025
89ed9ff
Add earliest_available_slot handling.
cheatfate Sep 8, 2025
cf428f3
Add some debugging logs.
cheatfate Sep 8, 2025
72cdf43
Fix compilation issue.
cheatfate Sep 8, 2025
a596f27
Add more debugging statements.
cheatfate Sep 8, 2025
beca872
Move debugging statements.
cheatfate Sep 8, 2025
e6cd11d
Add some more information to debug logging.
cheatfate Sep 8, 2025
6c67548
Change SyncQueue[T].push method to return number of slots advanced.
cheatfate Sep 9, 2025
638afce
Add debug information about current checkpoints stored in dag.
cheatfate Sep 10, 2025
3a96411
Restore inclusion proof verifications.
cheatfate Sep 10, 2025
586fd82
Add async control to block buffer.
cheatfate Sep 15, 2025
840f696
Do not enter block range downloading in case when block buffer is alm…
cheatfate Sep 15, 2025
6ee448d
Add more debugging on RangeBuffer.
cheatfate Sep 15, 2025
3b03397
Use RangeBuffer shortLog.
cheatfate Sep 15, 2025
83483c7
Fix block buffer advance when empty responses being processed.
cheatfate Sep 15, 2025
286f502
Fix sync_queue cyrillic C characters.
cheatfate Sep 16, 2025
3672a28
Remove block_buffer asynchronous handlers.
cheatfate Sep 16, 2025
4fa615f
Removal of Checkpoints from SyncDag, maintain single Queues structure.
cheatfate Sep 18, 2025
2c3012d
Removal of checkpoints part 2.
cheatfate Sep 18, 2025
b988ba9
Fix pruning for blockBuffer and blobQuarantine.
cheatfate Sep 18, 2025
6ec2edb
Add more debugging statements.
cheatfate Sep 18, 2025
3b6ca92
Add logs for investigation lighthouse issue with range response.
cheatfate Sep 18, 2025
544bc35
Fix getSidecarSlot().
cheatfate Sep 18, 2025
6398857
More changes in getSidecarSlot().
cheatfate Sep 20, 2025
fb7ccc5
Address runtime crash.
cheatfate Sep 20, 2025
1bd2b90
Make SyncQueue return negative integer when rewind is happen.
cheatfate Sep 21, 2025
3b16817
Address all the warnings.
cheatfate Sep 21, 2025
5645d56
Validate early empty sidecar responses.
cheatfate Sep 21, 2025
8bad86c
Add more debugging output.
cheatfate Sep 22, 2025
ff51325
More debugging output.
cheatfate Sep 22, 2025
9c7a336
Add SyncQueue synchronization after rewinds.
cheatfate Sep 22, 2025
ada7edf
Make block_buffer accept blocks before initSlot.
cheatfate Sep 22, 2025
07d40b2
VerifierError.MissingSidecars should not affect failures count.
cheatfate Sep 23, 2025
eaa3a71
Disable byRoot syncing while rangeSync is active.
cheatfate Sep 23, 2025
70a93a2
Post-rebase fixes.
cheatfate Sep 23, 2025
4aab55f
Fix peer management in Overseer.
cheatfate Sep 23, 2025
6de5e10
Update pause detector.
cheatfate Sep 23, 2025
472943f
Fix block_buffer.peekRange() returns incorrect number of blocks.
cheatfate Sep 24, 2025
3ec07f8
Fix compilation.
cheatfate Sep 24, 2025
bcf0296
More fixes to block_buffer.peekRange().
cheatfate Sep 24, 2025
f8af907
Add parent_root into slimLog(blocks).
cheatfate Sep 25, 2025
dc11aa5
Add SyncQueue synchronization for blocks loop.
cheatfate Sep 26, 2025
75bd78b
Fix sidecars step should not be active when sidecars are not needed.
cheatfate Sep 26, 2025
84090e0
Sidecars check should be done before request has been made.
cheatfate Sep 26, 2025
89bc854
Remove initSlot from BlockRangeBuffer.
cheatfate Sep 29, 2025
906e5a7
Fix blocks queue should not rewind sidecars queue, if its not running…
cheatfate Sep 29, 2025
7c67faa
Add SyncPushResponse result for SyncQueue.push().
cheatfate Sep 29, 2025
c826b2d
Add one more step in debugging MissingParent error returned by BlockP…
cheatfate Sep 30, 2025
ee1b67e
Add more debugging statements to SyncQueue.
cheatfate Sep 30, 2025
0473f30
Make requests non-relevant more strict.
cheatfate Oct 1, 2025
4fe6877
Add more debug statements to verifiers.
cheatfate Oct 1, 2025
a29aca6
Fix compilation issue.
cheatfate Oct 1, 2025
2589755
Add blob index checking to response utils.
cheatfate Oct 1, 2025
fefe180
Disable blob/column quarantine pruning in sidecars step.
cheatfate Oct 1, 2025
005f98c
Add blob_quarantine logging.
cheatfate Oct 2, 2025
a63c920
Disable rewind syncing for blocks step.
cheatfate Oct 3, 2025
f70ce65
Add blob/column quarantine pruning for failing/empty requests.
cheatfate Oct 4, 2025
c399242
Add more debug logging to blob/column quarantine.
cheatfate Oct 4, 2025
a64623b
Store blobs/columns in quarantine right before pushing request to avo…
cheatfate Oct 5, 2025
e426073
Dissect ColumnMap from blob_quarantine to its own module.
cheatfate Oct 5, 2025
800b5b2
Move BlockBuffer tests to test suite.
cheatfate Oct 6, 2025
ae59535
Add BlockBuffer invalidation.
cheatfate Oct 6, 2025
09c77fd
Update backfill queues in updateQueues().
cheatfate Oct 7, 2025
704453e
Post-rebase fixes.
cheatfate Oct 7, 2025
2df2c15
MissingSidecars should not affect rewinds.
cheatfate Oct 7, 2025
6ce6305
Add more debugging values to overseer.
cheatfate Oct 7, 2025
d2a1e0b
Remove sync_dag debugging logs.
cheatfate Oct 7, 2025
4f61fd8
Start root sync earlier.
cheatfate Oct 7, 2025
fd553d7
Fix issue with block validation response check.
cheatfate Oct 7, 2025
5db99f7
Update performance counters.
cheatfate Oct 7, 2025
dc2076b
Fix crash.
cheatfate Oct 7, 2025
7b9f34f
Remove code duplicates from performance counters.
cheatfate Oct 8, 2025
bb81c14
Some fixes for roots syncing.
cheatfate Oct 8, 2025
e96f49d
Add peerLog logging.
cheatfate Oct 8, 2025
efe4606
Fix sidecars syncer conditions.
cheatfate Oct 9, 2025
c411b58
Remove peer_log.
cheatfate Oct 9, 2025
1ea5fa2
Remove some debugging log statements.
cheatfate Oct 9, 2025
26dd5af
Missing sidecars helper functions.
cheatfate Oct 10, 2025
ee237cc
Simplify getMissingSidecarIndices(columns).
cheatfate Oct 13, 2025
e3b8925
Post rebase fixes.
cheatfate Oct 13, 2025
caccd17
Add missing sidecar indices to logs, so it possible to track columns …
cheatfate Oct 13, 2025
b8cb80e
Fix test_quarantine.
cheatfate Oct 13, 2025
ebdc4f5
Add some columns debugging statements.
cheatfate Oct 13, 2025
ee24188
Attempt to fix weird chronicles assertion.
cheatfate Oct 14, 2025
8b4fb87
Fix column distribution and rate logging.
cheatfate Oct 14, 2025
cfe2416
Fix `You should not pop so many requests` assertion crash and start u…
cheatfate Oct 14, 2025
3ba4d80
Add quarantine shortLog to check what is happening.
cheatfate Oct 14, 2025
f7d5ae2
Add shortLog(columns).
cheatfate Oct 14, 2025
310e39b
Do not request columns if we already have it.
cheatfate Oct 14, 2025
35002c7
Fix new columns calculations.
cheatfate Oct 14, 2025
59de5e5
One more fix.
cheatfate Oct 14, 2025
0a2ca9e
Optimize getMissingSidecarIndices() and introduce getMissingColumnsMa…
cheatfate Oct 15, 2025
0977500
Some updates to blob_quarantine.
cheatfate Oct 15, 2025
d1700a4
Add SyncDag path to main debug log statement.
cheatfate Oct 15, 2025
eab16e8
Investigating blobs in columns age, more logs and fixes.
cheatfate Oct 16, 2025
e55a50c
Still unclear where columns are lost.
cheatfate Oct 16, 2025
bbcfcef
Remove blob quarantine processing after finalization.
cheatfate Oct 16, 2025
2ee721c
Fix: Do not remove blobs/columns on MissingSidecars/MissingParent err…
cheatfate Oct 16, 2025
a800b10
Fix compilation issue.
cheatfate Oct 16, 2025
4feb0fc
Log full root map to understand why there missing blocks.
cheatfate Oct 17, 2025
8019af2
Fix use sidecarless quarantine as source of blocks too.
cheatfate Oct 19, 2025
6a2578d
Fix BlockBuffer not properly handles MissingParent detection.
cheatfate Oct 20, 2025
a34a93e
Fix not-in-range detection for sidecars queue.
cheatfate Oct 20, 2025
358f3b1
Fix compilation problem.
cheatfate Oct 20, 2025
78be9f6
Enable earliest_avalailable_slot check.
cheatfate Oct 20, 2025
0d4d366
Add peer_map to by root sidecars requests.
cheatfate Oct 20, 2025
c48bd89
Earliest available slot is only for columns, not blocks.
cheatfate Oct 20, 2025
4221147
Post-rebase fixes.
cheatfate Oct 21, 2025
bd5a0de
Add MissingSidecars cleanups.
cheatfate Oct 21, 2025
de0f138
Fix pruning errors.
cheatfate Oct 21, 2025
d0d192f
Proper backfill check.
cheatfate Oct 21, 2025
be9295d
One more fix to backfill detection algorithm.
cheatfate Oct 22, 2025
fbf9b08
Update backfill queue limits calculation.
cheatfate Oct 22, 2025
a367f50
Fix compilation error.
cheatfate Oct 22, 2025
dfe7614
One more calculation update.
cheatfate Oct 22, 2025
b1e9d62
Refactor sidecars queue limits calculation methods.
cheatfate Oct 22, 2025
d9482b0
Add edge cases handling.
cheatfate Oct 22, 2025
2e1c57a
Make one edge-case non-fatal to avoid syncing being stuck.
cheatfate Oct 23, 2025
17ed060
Post-rebase fixes.
cheatfate Oct 23, 2025
2ffa8da
Eliminate useless changes.
cheatfate Oct 23, 2025
bf58aaf
Fix block monitoring event loop.
cheatfate Oct 23, 2025
83b8c80
Increase period when rootsync starts.
cheatfate Oct 23, 2025
6304c44
Fix SECONDS_PER_SLOT issue.
cheatfate Oct 24, 2025
122bcd9
Tuning getStatusPeriod() function to be more precise in edge-cases.
cheatfate Oct 24, 2025
7fe9dee
Remove unnecessary helpers.
cheatfate Oct 24, 2025
799b0c3
Do some BlockBuffer adding refactoring and fixing tests.
cheatfate Oct 24, 2025
15a20e1
Update AllTests.
cheatfate Oct 24, 2025
67a4b8a
SLOT_DURATION.
cheatfate Oct 24, 2025
35cd5c5
Fix REST handlers.
cheatfate Oct 24, 2025
05a0ba4
Fix peer's status stale information should not appear too early.
cheatfate Oct 27, 2025
d852cf1
Initialize SyncDag with genesis root/slot to avoid downloading.
cheatfate Oct 28, 2025
6d4c827
Genesis is special case not an ordinary root.
cheatfate Oct 28, 2025
64e5a55
One more place for genesis handling.
cheatfate Oct 28, 2025
dd9baf3
Another one more genesis fix.
cheatfate Oct 28, 2025
3b0ccea
Fix crash when backfill is not needed.
cheatfate Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions AllTests-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@ AllTests-mainnet
+ atSlot sanity OK
+ parent sanity OK
```
## BlocksRangeBuffer test suite
```diff
+ Add and query blocks test [backward] OK
+ Add and query blocks test [forward] OK
+ Block insertion test [backward] OK
+ Block insertion test [forward] OK
+ Buffer advance test [backward] OK
+ Buffer advance test [forward] OK
+ Buffer invalidate test [backward] OK
+ Buffer invalidate test [forward] OK
+ Range peek real test cases [forward] OK
+ Range peek test [backward] OK
+ Range peek test [forward] OK
```
## ColumnMap test suite
```diff
+ and() operation test OK
Expand Down Expand Up @@ -990,29 +1004,19 @@ AllTests-mainnet
## SyncManager test suite
```diff
+ [SyncManager] groupBlobs() test OK
+ [SyncQueue# & Backward] Combination of missing parent and good blocks [3 peers] test OK
+ [SyncQueue# & Backward] Empty responses should not advance queue until other peers will no OK
+ [SyncQueue# & Backward] Empty responses should not be accounted [3 peers] test OK
+ [SyncQueue# & Backward] Failure request push test OK
+ [SyncQueue# & Backward] Invalid block [3 peers] test OK
+ [SyncQueue# & Backward] Smoke [3 peers] test OK
+ [SyncQueue# & Backward] Smoke [single peer] test OK
+ [SyncQueue# & Backward] Unviable block [3 peers] test OK
+ [SyncQueue# & Backward] epochFilter() test OK
+ [SyncQueue# & Forward] Combination of missing parent and good blocks [3 peers] test OK
+ [SyncQueue# & Forward] Empty responses should not advance queue until other peers will not OK
+ [SyncQueue# & Forward] Empty responses should not be accounted [3 peers] test OK
+ [SyncQueue# & Forward] Failure request push test OK
+ [SyncQueue# & Forward] Invalid block [3 peers] test OK
+ [SyncQueue# & Forward] Smoke [3 peers] test OK
+ [SyncQueue# & Forward] Smoke [single peer] test OK
+ [SyncQueue# & Forward] Unviable block [3 peers] test OK
+ [SyncQueue# & Forward] epochFilter() test OK
+ [SyncQueue#Backward] Combination of missing parent and good blocks [3 peers] test OK
+ [SyncQueue#Backward] Empty responses should not advance queue until other peers will not c OK
+ [SyncQueue#Backward] Empty responses should not be accounted [3 peers] test OK
+ [SyncQueue#Backward] Failure request push test OK
+ [SyncQueue#Backward] Invalid block [3 peers] test OK
+ [SyncQueue#Backward] Missing parent and exponential rewind [3 peers] test OK
+ [SyncQueue#Backward] Smoke [3 peers] test OK
+ [SyncQueue#Backward] Smoke [single peer] test OK
+ [SyncQueue#Backward] Unviable block [3 peers] test OK
+ [SyncQueue#Backward] epochFilter() test OK
+ [SyncQueue#Backward] getRewindPoint() test OK
+ [SyncQueue#Forward] Missing parent and exponential rewind [3 peers] test OK
+ [SyncQueue#Forward] getRewindPoint() test OK
+ [SyncQueue] checkBlobsResponse() test OK
+ [SyncQueue] checkResponse() test OK
+ [SyncQueue] hasEndGap() test OK
```
Expand Down
7 changes: 4 additions & 3 deletions beacon_chain/beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import
./spec/datatypes/[base, altair],
./spec/eth2_apis/dynamic_fee_recipients,
./spec/signatures_batch,
./sync/[sync_manager, request_manager, sync_types, validator_custody],
./sync/[sync_overseer2, sync_manager, request_manager, sync_types, validator_custody],
./validators/[
action_tracker, message_router, validator_monitor, validator_pool,
keystore_management],
Expand All @@ -41,13 +41,14 @@ export
eth2_network, el_manager, request_manager, sync_manager,
eth2_processor, optimistic_processor, blockchain_dag, block_quarantine,
base, message_router, validator_monitor, validator_pool,
consensus_manager, dynamic_fee_recipients, sync_types
consensus_manager, dynamic_fee_recipients, sync_types, sync_overseer2

type
EventBus* = object
headQueue*: AsyncEventQueue[HeadChangeInfoObject]
blocksQueue*: AsyncEventQueue[EventBeaconBlockObject]
blockGossipQueue*: AsyncEventQueue[EventBeaconBlockGossipObject]
blockGossipPeerQueue*: AsyncEventQueue[EventBeaconBlockGossipPeerObject]
phase0AttestQueue*: AsyncEventQueue[phase0.Attestation]
singleAttestQueue*: AsyncEventQueue[SingleAttestation]
exitQueue*: AsyncEventQueue[SignedVoluntaryExit]
Expand Down Expand Up @@ -100,7 +101,7 @@ type
syncManager*: SyncManager[Peer, PeerId]
backfiller*: SyncManager[Peer, PeerId]
untrustedManager*: SyncManager[Peer, PeerId]
syncOverseer*: SyncOverseerRef
syncOverseer*: SyncOverseerRef2
processor*: ref Eth2Processor
batchVerifier*: ref BatchVerifier
blockProcessor*: ref BlockProcessor
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/beacon_node_light_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ proc initLightClient*(
optimisticProcessor = initOptimisticProcessor(
cfg.timeParams, getBeaconTime, optimisticHandler)

shouldInhibitSync = func(): bool =
shouldInhibitSync = proc(): bool =
if isNil(node.syncOverseer):
false
else:
Expand Down
40 changes: 38 additions & 2 deletions beacon_chain/consensus_object_pools/block_pools_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import
# Standard library
std/[tables, hashes],
# Status libraries
chronicles,
results,
chronicles, libp2p/peerid, results,
# Internals
../spec/[signatures_batch, forks, helpers],
".."/[beacon_chain_db, era_db],
Expand Down Expand Up @@ -46,6 +45,9 @@ type
Duplicate
## We've seen this value already, can't add again

MissingSidecars
## We do not have sidecars at the moment

OnBlockCallback* =
proc(data: ForkedTrustedSignedBeaconBlock) {.gcsafe, raises: [].}
OnBlockGossipCallback* =
Expand Down Expand Up @@ -336,6 +338,30 @@ type
slot*: Slot
block_root* {.serializedFieldName: "block".}: Eth2Digest

EventBeaconBlockGossipPeerObject* = object
blck*: ForkedSignedBeaconBlock
src*: PeerId

template OnBlockAddedCallback*(kind: static ConsensusFork): auto =
when kind == ConsensusFork.Gloas:
typedesc[OnGloasBlockAdded]
elif kind == ConsensusFork.Fulu:
typedesc[OnFuluBlockAdded]
elif kind == ConsensusFork.Electra:
typedesc[OnElectraBlockAdded]
elif kind == ConsensusFork.Deneb:
typedesc[OnDenebBlockAdded]
elif kind == ConsensusFork.Capella:
typedesc[OnCapellaBlockAdded]
elif kind == ConsensusFork.Bellatrix:
typedesc[OnBellatrixBlockAdded]
elif kind == ConsensusFork.Altair:
typedesc[OnAltairBlockAdded]
elif kind == ConsensusFork.Phase0:
typedesc[OnPhase0BlockAdded]
else:
static: raiseAssert "Unreachable"

template timeParams*(dag: ChainDAGRef): TimeParams =
dag.cfg.timeParams

Expand Down Expand Up @@ -470,3 +496,13 @@ func init*(t: typedesc[EventBeaconBlockGossipObject],
slot: forkyBlck.message.slot,
block_root: forkyBlck.root
)

func init*(
t: typedesc[EventBeaconBlockGossipPeerObject],
v: ForkySignedBeaconBlock,
s: PeerId
): EventBeaconBlockGossipPeerObject =
EventBeaconBlockGossipPeerObject(
blck: ForkedSignedBeaconBlock.init(v),
src: s
)
163 changes: 83 additions & 80 deletions beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import
./spec/datatypes/[altair, bellatrix, phase0],
./spec/[
engine_authentication, weak_subjectivity, peerdas_helpers],
./sync/[sync_protocol, light_client_protocol, sync_overseer, validator_custody],
./sync/[sync_protocol, light_client_protocol, sync_overseer2, validator_custody],
./validators/[keystore_management, beacon_validators],
./[
beacon_node, beacon_node_light_client, buildinfo, deposits,
Expand Down Expand Up @@ -535,56 +535,57 @@ proc initFullNode(
{SyncManagerFlag.NoGenesisSync}
else:
{}
syncManager = newSyncManager[Peer, PeerId](
node.network.peerPool,
dag.cfg.DENEB_FORK_EPOCH,
dag.cfg.FULU_FORK_EPOCH,
dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA,
SyncQueueKind.Forward, getLocalHeadSlot,
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
getFrontfillSlot, isWithinWeakSubjectivityPeriod,
dag.tail.slot, blockVerifier, forkAtEpoch,
shutdownEvent = node.shutdownEvent,
flags = syncManagerFlags)
backfiller = newSyncManager[Peer, PeerId](
node.network.peerPool,
dag.cfg.DENEB_FORK_EPOCH,
dag.cfg.FULU_FORK_EPOCH,
dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA,
SyncQueueKind.Backward, getLocalHeadSlot,
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
getFrontfillSlot, isWithinWeakSubjectivityPeriod,
dag.backfill.slot, blockVerifier, forkAtEpoch, maxHeadAge = 0,
shutdownEvent = node.shutdownEvent,
flags = syncManagerFlags)
clistPivotSlot =
if clist.tail.isSome():
clist.tail.get().blck.slot()
else:
getLocalWallSlot()
# syncManager = newSyncManager[Peer, PeerId](
# node.network.peerPool,
# dag.cfg.DENEB_FORK_EPOCH,
# dag.cfg.FULU_FORK_EPOCH,
# dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
# dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA,
# SyncQueueKind.Forward, getLocalHeadSlot,
# getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
# getFrontfillSlot, isWithinWeakSubjectivityPeriod,
# dag.tail.slot, blockVerifier, forkAtEpoch,
# shutdownEvent = node.shutdownEvent,
# flags = syncManagerFlags)
# backfiller = newSyncManager[Peer, PeerId](
# node.network.peerPool,
# dag.cfg.DENEB_FORK_EPOCH,
# dag.cfg.FULU_FORK_EPOCH,
# dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
# dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA,
# SyncQueueKind.Backward, getLocalHeadSlot,
# getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
# getFrontfillSlot, isWithinWeakSubjectivityPeriod,
# dag.backfill.slot, blockVerifier, forkAtEpoch, maxHeadAge = 0,
# shutdownEvent = node.shutdownEvent,
# flags = syncManagerFlags)
# clistPivotSlot =
# if clist.tail.isSome():
# clist.tail.get().blck.slot()
# else:
# getLocalWallSlot()
eaSlot = dag.head.slot
untrustedManager = newSyncManager[Peer, PeerId](
node.network.peerPool,
dag.cfg.DENEB_FORK_EPOCH,
dag.cfg.FULU_FORK_EPOCH,
dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA,
SyncQueueKind.Backward, getLocalHeadSlot,
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getUntrustedBackfillSlot,
getFrontfillSlot, isWithinWeakSubjectivityPeriod,
clistPivotSlot, untrustedBlockVerifier, forkAtEpoch, maxHeadAge = 0,
shutdownEvent = node.shutdownEvent,
flags = syncManagerFlags)
erSlot = dag.head.slot
# untrustedManager = newSyncManager[Peer, PeerId](
# node.network.peerPool,
# dag.cfg.DENEB_FORK_EPOCH,
# dag.cfg.FULU_FORK_EPOCH,
# dag.cfg.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
# dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA,
# SyncQueueKind.Backward, getLocalHeadSlot,
# getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getUntrustedBackfillSlot,
# getFrontfillSlot, isWithinWeakSubjectivityPeriod,
# clistPivotSlot, untrustedBlockVerifier, forkAtEpoch, maxHeadAge = 0,
# shutdownEvent = node.shutdownEvent,
# flags = syncManagerFlags)
router = (ref MessageRouter)(
processor: processor,
network: node.network)
requestManager = RequestManager.init(
node.network, supernode, custodyColumns,
dag.cfg.DENEB_FORK_EPOCH, getBeaconTime, (proc(): bool = syncManager.inProgress),
quarantine, blobQuarantine, dataColumnQuarantine, rmanBlockVerifier,
rmanBlockLoader, rmanBlobLoader, rmanDataColumnLoader)
# requestManager = RequestManager.init(
# node.network, supernode, custodyColumns,
# dag.cfg.DENEB_FORK_EPOCH, getBeaconTime, (proc(): bool = syncManager.inProgress),
# quarantine, blobQuarantine, dataColumnQuarantine, rmanBlockVerifier,
# rmanBlockLoader, rmanBlobLoader, rmanDataColumnLoader)
validatorCustody = ValidatorCustodyRef.init(node.network, dag, custodyColumns,
dataColumnQuarantine)

Expand Down Expand Up @@ -647,22 +648,18 @@ proc initFullNode(
node.batchVerifier = batchVerifier
node.blockProcessor = blockProcessor
node.consensusManager = consensusManager
node.requestManager = requestManager
node.validatorCustody = validatorCustody
node.syncManager = syncManager
node.backfiller = backfiller
node.untrustedManager = untrustedManager
node.syncOverseer = SyncOverseerRef.new(node.consensusManager,
node.validatorMonitor,
config,
getBeaconTime,
node.list,
node.beaconClock,
node.eventBus.optFinHeaderUpdateQueue,
node.network.peerPool,
node.batchVerifier,
syncManager, backfiller,
untrustedManager)
# node.requestManager = requestManager
# node.syncManager = syncManager
# node.backfiller = backfiller
# node.untrustedManager = untrustedManager
node.syncOverseer =
SyncOverseerRef2.new(node.network, node.consensusManager, config,
getBeaconTime, node.beaconClock, blockProcessor,
quarantine, blobQuarantine, dataColumnQuarantine,
node.eventBus.blockGossipPeerQueue,
node.eventBus.blocksQueue,
node.eventBus.finalQueue)
node.router = router

await node.addValidators()
Expand Down Expand Up @@ -766,6 +763,7 @@ proc init*(
headQueue: newAsyncEventQueue[HeadChangeInfoObject](),
blocksQueue: newAsyncEventQueue[EventBeaconBlockObject](),
blockGossipQueue: newAsyncEventQueue[EventBeaconBlockGossipObject](),
blockGossipPeerQueue: newAsyncEventQueue[EventBeaconBlockGossipPeerObject](),
phase0AttestQueue: newAsyncEventQueue[phase0.Attestation](),
singleAttestQueue: newAsyncEventQueue[SingleAttestation](),
exitQueue: newAsyncEventQueue[SignedVoluntaryExit](),
Expand Down Expand Up @@ -1813,8 +1811,6 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
.pruneAfterFinalization(
node.dag.finalizedHead.slot.epoch()
)
node.processor.blobQuarantine[].pruneAfterFinalization(
node.dag.finalizedHead.slot.epoch(), node.dag.needsBackfill())
node.processor.quarantine[].pruneAfterFinalization(
node.dag.finalizedHead.slot.epoch(), node.dag.needsBackfill())

Expand Down Expand Up @@ -2149,7 +2145,7 @@ proc onSlotStart(node: BeaconNode, wallTime: BeaconTime,
node.consensusManager[].updateHead(wallSlot)

await node.handleValidatorDuties(lastSlot, wallSlot)
node.requestManager.switchToColumnLoop()
# node.requestManager.switchToColumnLoop()
await onSlotEnd(node, wallSlot)

# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#registration-dissemination
Expand Down Expand Up @@ -2289,20 +2285,27 @@ proc installMessageValidators(node: BeaconNode) =
# beacon_block
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.8/specs/phase0/p2p-interface.md#beacon_block
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/gloas/p2p-interface.md#beacon_block
node.network.addValidator(
getBeaconBlocksTopic(digest), proc (
signedBlock: consensusFork.SignedBeaconBlock,
src: PeerId,
): ValidationResult =
if node.shouldSyncOptimistically(node.currentSlot):
toValidationResult(
node.optimisticProcessor.processSignedBeaconBlock(
signedBlock))
else:
toValidationResult(
node.processor[].processSignedBeaconBlock(
MsgSource.gossip, signedBlock)))

when consensusFork >= ConsensusFork.Gloas:
debugGloasComment " "
else:
node.network.addValidator(
getBeaconBlocksTopic(digest), proc (
signedBlock: consensusFork.SignedBeaconBlock,
src: PeerId,
): ValidationResult =
if node.shouldSyncOptimistically(node.currentSlot):
toValidationResult(
node.optimisticProcessor.processSignedBeaconBlock(
signedBlock))
else:
let res =
toValidationResult(
node.processor[].processSignedBeaconBlock(
MsgSource.gossip, signedBlock))
if res == ValidationResult.Accept:
node.eventBus.blockGossipPeerQueue.emit(
EventBeaconBlockGossipPeerObject.init(signedBlock, src))
res)
# beacon_attestation_{subnet_id}
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/gloas/p2p-interface.md#beacon_attestation_subnet_id
Expand Down Expand Up @@ -2571,7 +2574,7 @@ proc run*(node: BeaconNode, stopper: StopFuture) {.raises: [CatchableError].} =
wallSlot = wallTime.slotOrZero(node.dag.timeParams)

node.startLightClient()
node.requestManager.start()
# node.requestManager.start()
node.syncOverseer.start()

waitFor node.updateGossipStatus(wallSlot)
Expand Down
Loading
Loading