Skip to content

fix(core): announce slot lifecycle to geyser plugins - #747

Open
snehendu098 wants to merge 1 commit into
solana-foundation:mainfrom
snehendu098:fix/announce-slot-lifecycle
Open

fix(core): announce slot lifecycle to geyser plugins#747
snehendu098 wants to merge 1 commit into
solana-foundation:mainfrom
snehendu098:fix/announce-slot-lifecycle

Conversation

@snehendu098

Copy link
Copy Markdown

Fixes #719

GeyserSlotStatus declared 2 of agave's 7 variants and only the Confirmed and Rooted were emitted. Processed was declared but never emitted. Consumers that reconstruct block data start tracking a slot only on a lifecycle status and drop block data for untracked slots, so the blocks metadata and entries surfpool produces get discarded on arrival

What I did was announce each newly opened slot with CreatedBank, plus on at startup for the genesis slot. I also emit Processed which is not really needed here but #719 actually depends on it. I can drop it also

Regression test drives five blocks through confirm_current_block and asserts every NotifyBlockMetadata and NotifyEntry is for a slot announced beforehand. Before the fix: block metadata for slot 32 was emitted before the slot was announced.

I verified with a geyser plugin logging every callback over approx 54 slots created_bank went from 0 to 55, and all 109 block-metadata, entry and transaction events landed on an announced slot

Note: I added FirstShredReceived and Completed but never emit them, as surfpool has no gossip layer. I kept them because the enum's doc comment says it mirrors agave's SlotStatus. I can trim that to only what's emitted also

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR expands Surfpool’s Geyser slot-status model and announces each slot before emitting its block data.

  • Announces the initial slot after startup and each newly opened slot during block confirmation.
  • Emits Processed status for the slot that just executed.
  • Maps the remaining Agave slot-status variants into plugin callbacks.
  • Adds a regression test covering lifecycle announcements before block metadata and entries.

Confidence Score: 5/5

The code changes appear safe to merge, with no concrete runtime or security failure identified.

Slot lifecycle notifications remain ordered on the single Geyser event channel, and normal block production advances slots sequentially with consistent parent relationships.

Important Files Changed

Filename Overview
crates/core/src/runloops/mod.rs Announces the initial slot and maps all declared lifecycle variants to Agave plugin statuses; no actionable defect was established.
crates/core/src/surfnet/mod.rs Extends the internal Geyser status enum to mirror the additional Agave lifecycle variants.
crates/core/src/surfnet/svm.rs Emits CreatedBank and Processed during block confirmation and adds an ordering regression test; the steady-state slot and parent relationships are consistent.

Reviews (1): Last reviewed commit: "fix(core): announce slot lifecycle to ge..." | Re-trigger Greptile

@MicaiahReid
MicaiahReid self-requested a review August 11, 2026 21:08
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.

slots / blocks / blocksMeta subscriptions deliver nothing

1 participant