Skip to content

Add back snow accepter queue #1992

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Add back snow accepter queue #1992

wants to merge 8 commits into from

Conversation

aaronbuchwald
Copy link
Collaborator

@aaronbuchwald aaronbuchwald commented Mar 20, 2025

Adds back the async accepter queue into the snow package.

This moves potentially heavy-weight operations during Accept from blocking the consensus thread to a separate async accepter. As this code moves around a few pieces, I also added some improved comments around subscription guarantees (so that we are clear about reliable notifications #1145). This guarantees at least once delivery of block accept notifications.

This adds a new field lastProcessedBlock, which is the last block that the snow package used the chain to mark as accepted and produce an instance of the accepted block type.

A few extra notes on this PR:

  • adds SyncAccept to the snow block type, which accepts a block and waits for async work on that block to complete (ensure "effects" of Accept occur before tests check for them)
  • There's no clear way for an async thread on an AvalancheGo VM to signal that it a fatal error. To handle fatal errors on the async accepter thread, we use RecoverAndPanic from AvalancheGo's logger and also make sure to call Shutdown on the VM, so we clean up resources before propagating the panic (open to alternative suggestions on the best way to signal fatal here)

@aaronbuchwald aaronbuchwald self-assigned this Mar 24, 2025
@aaronbuchwald aaronbuchwald added this to the v0.0.19 milestone Apr 10, 2025
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

Successfully merging this pull request may close these issues.

1 participant