ChainSafe / ChainSafe/gossamer

update `handle_our_view_change`

Open
#4,253 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

### Description

- Adds new leaves:
For each new relay parent (block) added to the view, it:
- Fetches session and node feature info.
- Constructs and inserts a new PerRelayParent state (including assignments and claim queue).
- Activates the leaf in the implicit view and ensures all relevant ancestors are also initialized.
- Removes old leaves:
For each relay parent removed from the view, it:
- Removes it from the active leaves and implicit view.
- Cleans up all associated state (assignments, per-relay-parent state, collation requests, fetched candidates).
- Cancels any ongoing collation requests for that relay parent.
- Cleans up blocked collations:
- Removes any blocked seconding requests that are no longer relevant.
- Prunes peer advertisements:
For each peer, removes advertisements that are no longer relevant to the current view or assignments.
- Disconnects peers that are no longer relevant to the validator's current assignments.

### Links

https://github.com/paritytech/polkadot-sdk/blob/3ff1b1db36260cbc47297ab753e2dcec1f5999fd/polkadot/node/network/collator-protocol/src/validator_side/mod.rs#L1259

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.