Conversation
| return | ||
|
|
||
| withBlck(blckOpt.get()): | ||
| when (consensusFork >= ConsensusFork.Fulu) and |
There was a problem hiding this comment.
This is just exactly consensusFork == ConsensusFork.Fulu.
| sidecars.add(s[]) | ||
|
|
||
| data_column_kzg_batch_verifications.inc() | ||
| let batchRes = verify_data_column_sidecar_kzg_proofs(sidecars) |
There was a problem hiding this comment.
let batchRes = verify_data_column_sidecar_kzg_proofs(pending.mapIt(it[]))and can remove all of
var sidecars = newSeqOfCap[fulu.DataColumnSidecar](pending.len)
for s in pending:
sidecars.add(s[])which clarifies the logic. But I don't understand why it needs this at all ref fulu.DataColumnSidecar to fulu.DataColumnSidecar conversion at all, since
- speedup block processing with batch verification #8302 appears to deliberately add overloads for both
openArray[fulu.DataColumnSidecar]andopenArray[ref fulu.DataColumnSidecar]:nimbus-eth2/beacon_chain/spec/peerdas_helpers.nim
Lines 591 to 609 in 6286825
| self.blockProcessor.enqueueBlock(MsgSource.gossip, forkyBlck, cres) | ||
| else: | ||
| raiseAssert "Wrong fork for columns: " & $consensusFork | ||
| let batchThreshold = max(self.dataColumnQuarantine[].custodyColumns.len, 1) |
There was a problem hiding this comment.
When is self.dataColumnQuarantine[].custodyColumns.len < 4? But if it's not, then this max doesn't do anything. What is it accomplishing?
| self.pendingGloasColumnSidecars.add(newClone(dataColumnSidecar)) | ||
|
|
||
| let batchThreshold = | ||
| max(self.gloasColumnQuarantine[].custodyColumns.len, 1) |
There was a problem hiding this comment.
Same question about the purpose of max here: this only matters if self.gloasColumnQuarantine[].custodyColumns.len is 0, but that should never happen. If it does, there are bigger problems.
There was a problem hiding this comment.
i.e. a network with 0 custody columns also means not doing anything with gloasColumnQuarantine or columnQuarantine at all, not just tweaking around the edges.
|
|
||
| data_column_kzg_batch_verifications.inc() | ||
| let batchRes = verify_data_column_sidecar_kzg_proofs( | ||
| sidecars, commitmentsOpt.get()) |
There was a problem hiding this comment.
let batchRes = verify_data_column_sidecar_kzg_proofs(
pending.mapIt(it[]), commitmentsOpt.get())makes the logic clearer here by connecting it to its inputs more directly and simply. But it raises the same question of why do this ref to non-ref conversion at all, per https://github.com/status-im/nimbus-eth2/pull/8314/changes#r3121047564
| else: | ||
| raiseAssert "Wrong fork for columns: " & $consensusFork | ||
|
|
||
| proc flushPendingColumnSidecars*(self: var Eth2Processor) = |
There was a problem hiding this comment.
Would be clearer to name this flushFuluPendingColumnSidecars. For legacy reasons a number of column-related functions were written before any support for Gloas existed, and something with functionName became functionNameWithGloas without renaming the original function, and there's an argument for that, but there isn't a viable one for newly written functions.
| # Non-KZG checks passed — park the sidecar in the pending buffer. KZG | ||
| # proofs are verified in a single batched call once the buffer has grown | ||
| # to the number of columns this node custodies, i.e. the largest batch | ||
| # we can reasonably expect to assemble per slot. |
There was a problem hiding this comment.
This doesn't suffice for gossip validation:
- [REJECT] The sidecar's
kzg_commitmentsfield inclusion proof is valid as verified byverify_data_column_sidecar_inclusion_proof(sidecar).- [REJECT] The sidecar's column data is valid as verified by
verify_data_column_sidecar_kzg_proofs(sidecar).
| self.blockProcessor.enqueuePayload(dataColumnSidecar.beacon_block_root) | ||
| # Non-KZG checks passed — park the sidecar in the pending buffer. KZG | ||
| # proofs are verified in a single batched call once the buffer has grown | ||
| # to the number of columns this node custodies. |
There was a problem hiding this comment.
This doesn't suffice for gossip validation:
- [REJECT] The sidecar is valid as verified by
verify_data_column_sidecar(sidecar, bid.blob_kzg_commitments).- [REJECT] The sidecar's column data is valid as verified by
verify_data_column_sidecar_kzg_proofs(sidecar, bid.blob_kzg_commitments).- [IGNORE] The sidecar is the first sidecar for the tuple
(sidecar.beacon_block_root, sidecar.index)with valid kzg proof.
No description provided.