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

Verify correct behavior for multiple skipped blocks in sequence #787

Open
jsync-swirlds opened this issue Mar 6, 2025 · 0 comments
Open

Comments

@jsync-swirlds
Copy link
Contributor

Persona

As a Consensus Node

Request

I want to receive skip block and acknowledgements correctly

Goal

So that I can properly process acknowledgements and avoid sending unnecessary blocks

Technical Notes

With multiple publishers sending to a single block node, it is conceivable, though unlikely, that a particular publisher might send a block header that is 2 or more blocks behind the current block "leader".
We wish to ensure that the publisher receives a skip block message for each block header, and also receives an acknowledgement for every block "skipped" in this way.

Note, this is distinct from a Publisher that is "behind" (i.e. sends a header older than the last persisted and verified block known to this block node). The response in that case is a BlockAcknowledgement with the block_already_exists flag and the last known verified block as block_number. The Publisher should resume after the indicated block, in that case.

Example Sequence

The following is a highly unlikely example sequence that reflects correct behaviors in a relatively extreme scenario.

sequenceDiagram
participant BlockLeader
participant Publisher
participant BlockNode

BlockLeader->>BlockNode: Send Header for block 45
Publisher->>BlockNode: Send Header for block 40
Note over BlockNode: There are 5 streams in progress, from 40-45, so 40 is not yet "behind"
BlockNode->>Publisher: SkipBlock[40]
Publisher->>BlockNode: Send Header for block 41
BlockNode->>Publisher: SkipBlock[41]
Publisher->>BlockNode: Send Header for block 42
BlockNode->>Publisher: SkipBlock[42]
Publisher->>BlockNode: Send Header for block 43
Note over BlockNode: Block 40 completes streaming and is verified
BlockNode->>Publisher: Acknowledge block 40
BlockNode->>Publisher: SkipBlock[43]
Publisher->>BlockNode: Send Header for block 44
BlockNode->>Publisher: SkipBlock[44]
Note over BlockNode: Block 41 completes streaming and is verified
BlockNode->>Publisher: Acknowledge block 41
Note over BlockNode: Block 42 completes streaming and is verified
BlockNode->>Publisher: Acknowledge block 42
Note over BlockNode: Block 43 completes streaming and is verified
BlockNode->>Publisher: Acknowledge block 43
Publisher->>BlockNode: Send Header for block 45
BlockNode->>Publisher: SkipBlock[45]
Note over BlockNode: Block 44 completes streaming and is verified
BlockNode->>Publisher: Acknowledge block 44
BlockLeader->>BlockNode: Send Header for block 46
Publisher->>BlockNode: Send Header for block 46
BlockNode->>Publisher: SkipBlock[46]
Note over BlockNode: Block 45 completes streaming and is verified
BlockNode->>Publisher: Acknowledge block 45
Loading
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

No branches or pull requests

1 participant