-
-
Notifications
You must be signed in to change notification settings - Fork 470
fix: skip already-seen data columns in zero-peer publish warning #9580
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
Open
lodekeeper
wants to merge
4
commits into
ChainSafe:unstable
Choose a base branch
from
lodekeeper:fix/gloas-data-column-zero-peers-warning
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8a2f604
fix: skip already-seen data columns in zero-peer publish warning
lodekeeper aff57d1
fix(api): only suppress zero-peer column warning for gossip-sourced c…
lodekeeper cb30d1c
fix: catch PublishError.Duplicate in publishDataColumnSidecar instead…
lodekeeper 3fe6662
refactor(chain): drop now-unused getColumnSource
lodekeeper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/beacon-node/test/unit/api/impl/beacon/blocks/utils.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import {describe, expect, it} from "vitest"; | ||
| import {countColumnsPublishedWithZeroPeers} from "../../../../../../src/api/impl/beacon/blocks/utils.js"; | ||
|
|
||
| describe("api - beacon - blocks - countColumnsPublishedWithZeroPeers", () => { | ||
| it("counts newly introduced columns published to zero peers", () => { | ||
| // none of the columns were already in the seen cache, all reached zero peers | ||
| expect(countColumnsPublishedWithZeroPeers([0, 0, 0], [false, false, false])).toBe(3); | ||
| }); | ||
|
|
||
| it("ignores zero-peer columns that were already in the seen cache (benign duplicates)", () => { | ||
| // the buildoor case: peers gossiped every column to us first, so all publishes are duplicates | ||
| expect(countColumnsPublishedWithZeroPeers([0, 0, 0], [true, true, true])).toBe(0); | ||
| }); | ||
|
|
||
| it("only counts newly introduced zero-peer columns in a mixed batch", () => { | ||
| // index 0: newly introduced, zero peers -> counted | ||
| // index 1: already present, zero peers -> benign duplicate, not counted | ||
| // index 2: newly introduced, reached peers -> not counted | ||
| // index 3: already present, reached peers -> not counted | ||
| expect(countColumnsPublishedWithZeroPeers([0, 0, 5, 5], [false, true, false, true])).toBe(1); | ||
| }); | ||
|
|
||
| it("never counts columns that reached at least one peer", () => { | ||
| expect(countColumnsPublishedWithZeroPeers([1, 2, 3], [false, false, false])).toBe(0); | ||
| }); | ||
|
|
||
| it("returns 0 for an empty batch", () => { | ||
| expect(countColumnsPublishedWithZeroPeers([], [])).toBe(0); | ||
| }); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses
addColumn()returningfalseas proof that a peer already gossiped the column, butPayloadEnvelopeInputcan also be pre-populated from non-gossip paths such as execution-enginegetBlobsV2, req/resp, or recovery. In those cases the laterpublishDataColumnSidecar()can still return 0 because there are no topic peers, yet the column is excluded from the reorg-risk warning, and the earlier non-gossip population path does not report this zero-peer condition.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — you're right, and it's reachable. I was keying the suppression off cache presence (
addColumn()returningfalse), but the payload-envelope cache is also populated by non-gossip paths — verified:engine/getBlobsV2 (util/execution.ts),recovery(util/dataColumns.ts), and req/resp by-range/by-root — all into the samepayloadInput. Those columns aren't necessarily on the network, so a 0-peer publish of them is a real propagation failure that my check was silently suppressing.Fixed in aff57d1: added
PayloadEnvelopeInput.getColumnSource()and now suppress the warning only when the already-present column was gossip-sourced (a peer actively pushed it to us → it's propagating). Columns cached fromengine/recovery/req_respstill count toward the zero-peer warning. Added a regression test for the non-gossip case.