Skip to content

collator-protocol: Re-advertise collations when peer authority IDs are updated#10891

Merged
bkchr merged 9 commits intomasterfrom
lexnv/update-ids
Jan 30, 2026
Merged

collator-protocol: Re-advertise collations when peer authority IDs are updated#10891
bkchr merged 9 commits intomasterfrom
lexnv/update-ids

Conversation

@lexnv
Copy link
Copy Markdown
Contributor

@lexnv lexnv commented Jan 23, 2026

The collator protocol contained a race-condition which could manifest as "Collation wasn't advertised".

A given peer ("A") can connect before the new authority keys are received via UpdatedAuthorityIds (nk -- new key).

  • T0: peer A connectsPeerConnected
  • T1: peer A sends its current view PeerViewChange
    • Peer A wants the block N
  • T2: validator_group.should_advertise_to: checks peer A for key nK (the new key)
    • We don't have this key stored and therefore return ShouldAdvertiseTo::NotAuthority
  • T3: UpdatedAuthorityIds arrives with (peer A, [nK])

At this point, we have the collation, peer A wants to collation, we know peer A is an authority but we never send the collation back. Then, the collation will expire with "Collation wasn't advertised".

To close the gap, the UpdatedAuthorityIds events will trigger a re-advertisement of collations

  • note: if the advertisement was already sent, the logic does not resend it (achieved in should_advertise_to).

Part of the stabilization of:

lexnv added 2 commits January 23, 2026 12:50
…e updated

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Jan 23, 2026
@lexnv lexnv added the T0-node This PR/Issue is related to the topic “node”. label Jan 23, 2026
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/21287736978
Failed job name: fmt

lexnv and others added 2 commits January 23, 2026 13:31
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv
Copy link
Copy Markdown
Contributor Author

lexnv commented Jan 30, 2026

/cmd prdoc --audience node_dev --bump patch

github-actions bot and others added 5 commits January 30, 2026 11:15
…relay_parents

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Copy link
Copy Markdown
Contributor

@alexggh alexggh left a comment

Choose a reason for hiding this comment

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

Fix looks correct, but UpdatedAuthorityIds is not something we should receive that often, because the AuthorityIds usually change only around session boundary when you get new peers that you might not discover yet.

How often did this happen ?

@bkchr bkchr added this pull request to the merge queue Jan 30, 2026
Merged via the queue into master with commit a9c09b0 Jan 30, 2026
241 of 243 checks passed
@bkchr bkchr deleted the lexnv/update-ids branch January 30, 2026 18:32
@lexnv lexnv added the A4-backport-stable2506 Pull request must be backported to the stable2506 release branch label Mar 9, 2026
@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for stable2506:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-10891-to-stable2506
git worktree add --checkout .worktree/backport-10891-to-stable2506 backport-10891-to-stable2506
cd .worktree/backport-10891-to-stable2506
git reset --hard HEAD^
git cherry-pick -x a9c09b0bf857037584f8439908cf68e34abf1ee9
git push --force-with-lease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2506 Pull request must be backported to the stable2506 release branch T0-node This PR/Issue is related to the topic “node”.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants