Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adopt columns into the BN, except column syncing #6945

Open
wants to merge 62 commits into
base: unstable
Choose a base branch
from

Conversation

agnxsh
Copy link
Contributor

@agnxsh agnxsh commented Feb 22, 2025

Continued from the columns branch. This branch essentially attempts to add column support to the nimbus-eth2 CL post FULU_FORK_EPOCH. However it does NOT contain column syncing baked into existing SyncManager

Note that all column related mechanics, are gated to and after the Fulu fork, would be helpful to have more eyes on the gating.

Copy link

github-actions bot commented Feb 22, 2025

Unit Test Results

       12 files   -        3    2 089 suites   - 525   1h 1m 34s ⏱️ - 13m 47s
  6 411 tests ±       0    5 890 ✔️ ±       0  521 💤 ±  0  0 ±0 
35 673 runs   - 8 933  35 019 ✔️  - 8 869  654 💤  - 64  0 ±0 

Results for commit 0c77fb2. ± Comparison against base commit 3a91604.

♻️ This comment has been updated with latest results.

@agnxsh agnxsh changed the title init: Column syncer adopt columns into the BN, except column syncing Mar 3, 2025
@agnxsh agnxsh marked this pull request as ready for review March 3, 2025 13:05
@agnxsh agnxsh requested review from tersec and cheatfate March 4, 2025 12:13
@@ -291,7 +291,8 @@ proc setTail*(chandle: var ChainFileHandle, bdata: BlockData) =
chandle.data.tail = Opt.some(bdata)

proc store*(chandle: ChainFileHandle, signedBlock: ForkedSignedBeaconBlock,
blobs: Opt[BlobSidecars]): Result[void, string] =
blobs: Opt[BlobSidecars]):
Result[void, string] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its better not to change format style at all. Because this style contradicts with style nph prefers and contradicts with style Nim developers using.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apologies, must've overlooked while undoing a few things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -550,6 +551,7 @@ proc decodeBlob(
return err("Incorrect blob format")
ok(blob)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its some quirk CRLF here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -128,7 +128,8 @@ proc setTail*(clist: ChainListRef, bdata: BlockData) =
clist.handle = Opt.some(handle)

proc store*(clist: ChainListRef, signedBlock: ForkedSignedBeaconBlock,
blobs: Opt[BlobSidecars]): Result[void, string] =
blobs: Opt[BlobSidecars]):
Result[void, string] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem with style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -169,7 +170,8 @@ proc checkBlobs(signedBlock: ForkedSignedBeaconBlock,

proc addBackfillBlockData*(
clist: ChainListRef, signedBlock: ForkedSignedBeaconBlock,
blobsOpt: Opt[BlobSidecars]): Result[void, VerifierError] =
blobsOpt: Opt[BlobSidecars]):
Result[void, VerifierError] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more style problem.

cfg: RuntimeConfig
getBeaconTime: GetBeaconTimeFn
cfg*: RuntimeConfig
getBeaconTime*: GetBeaconTimeFn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this become public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/status-im/nimbus-eth2/pull/6945/files#diff-3e73e1b595d5405f6872e00dd9f4ee2b238648b617dd2d29a670a09767b5659dR2249-R2251

we don't use RequestManager blob loop post FULU_FORK_EPOCH,is there a better way to do it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my point of view detection of current fork should not be done by time... I think it should be done from what we have in database, if our database is in Electra fork why we start request columns with RequestManager for pre-Fulu fork data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, fixing that

untrustedBlockVerifier =
proc(signedBlock: ForkedSignedBeaconBlock, blobs: Opt[BlobSidecars],
maybeFinalized: bool): Future[Result[void, VerifierError]] {.
maybeFinalized: bool):
Future[Result[void, VerifierError]] {.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert all the style changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if accumulatedDataColumns.len == 0:
# no data columns were sent for this post Fulu block, yet
return await blockProcessor[].addBlock(MsgSource.gossip, signedBlock,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message source is definitely not gossip.

if not blobQuarantine[].hasBlobs(forkyBlck):
# We don't have all the blobs for this block, so we have
# to put it in blobless quarantine.
if not quarantine[].addBlobless(dag.finalizedHead.slot, forkyBlck):
err(VerifierError.UnviableFork)
return err(VerifierError.UnviableFork)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think return is needed here.

else:
err(VerifierError.MissingParent)
return err(VerifierError.MissingParent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto as above.

elif dataColumnQuarantine[].supernode and
accumulatedDataColumns.len >= (dataColumnQuarantine[].custody_columns.len div 2):
# We have seen 50%+ data columns, we can attempt to add this block
let dataColumns = dataColumnQuarantine[].popDataColumns(forkyBlck.root, forkyBlck)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this operation will require costly process of rebuilding columns which could take 800ms it should not be part of verification process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't perform reconstruction here

@@ -1321,7 +1358,15 @@ proc addElectraMessageHandlers(

proc addFuluMessageHandlers(
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
node.addElectraMessageHandlers(forkDigest, slot)
node.addCapellaMessageHandlers(forkDigest, slot)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be comment while Fulu message handlers procedure starts with call to Capella handlers instead of Deneb or Electra.

@@ -2160,6 +2246,9 @@ proc run(node: BeaconNode) {.raises: [CatchableError].} =

node.startLightClient()
node.requestManager.start()
if node.network.getBeaconTime().slotOrZero.epoch >=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks suspicious to me, are we trying to detect specific fork using time? Why we are not detecting our current fork using database?

rman.dataColumnLoopFuture = rman.requestManagerDataColumnLoop()
if not(isNil(rman.blobLoopFuture)):
rman.blobLoopFuture.cancelSoon()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancelSoon should not be used you should cancel it with cancelAndWait() before spawning new loop.

@@ -24,7 +24,8 @@ type
GetBoolCallback* = proc(): bool {.gcsafe, raises: [].}
ProcessingCallback* = proc() {.gcsafe, raises: [].}
BlockVerifier* = proc(signedBlock: ForkedSignedBeaconBlock,
blobs: Opt[BlobSidecars], maybeFinalized: bool):
blobs: Opt[BlobSidecars],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style changes are totally unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tersec
Copy link
Contributor

tersec commented Mar 4, 2025

@tersec
Copy link
Contributor

tersec commented Mar 5, 2025

If one updates this to unstable now that #6981 has been merged, it should fix the CI issue related to version-2-2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants