Skip to content

Owner-route finalize slot account cleanup - #44

Draft
ArthurPaivaT wants to merge 1 commit into
mainfrom
perf/owner-routed-finalize-cleanup
Draft

ArthurPaivaT wants to merge 1 commit into
mainfrom
perf/owner-routed-finalize-cleanup

Conversation

@ArthurPaivaT

Copy link
Copy Markdown
Contributor
  • Routes the finalize-slot account cleanup by owner and pubkey together instead of by pubkey alone, so on the owner-partitioned accounts tables each delete prunes to a single partition rather than scanning all of them.
  • Resolves the owner from the in-memory owner map, not the incoming block, so a changed-owner account is deleted under its previous owner. The map already holds the prior owner plus that slot's changed owners, so this needs no extra database read.
  • The whole path is inert unless the owner map is enabled.

Indexer (crates/index, crates/core)

  • AccountsReceivedPerBlock now carries the per-account owners and the closed-cleanup pubkey and owner lists.
  • New helper closed_cleanup_pairs builds the closed-account delete set from the map plus the slot's changed owners.
  • Two new query files: cleanupWithOwner.sql for open rows (slot strictly below the finalized slot) and cleanupClosedWithOwner.sql for closed rows (slot at or below).
  • Owner routing runs only when every pubkey in the batch has a resolved owner. Otherwise it falls back to the previous pubkey-only path.

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