Skip to content

Replace linear scan in BuilderIndexByPubkey with O(1) map#16813

Merged
terencechain merged 2 commits into
developfrom
state-native-builder-pubkey-index
May 21, 2026
Merged

Replace linear scan in BuilderIndexByPubkey with O(1) map#16813
terencechain merged 2 commits into
developfrom
state-native-builder-pubkey-index

Conversation

@terencechain

Copy link
Copy Markdown
Collaborator
  • Replace linear scan in BuilderIndexByPubkey with an O(1) pubkey→index map on BeaconState. Per-state, deep-copied on Copy()

@terencechain terencechain force-pushed the state-native-builder-pubkey-index branch from df0fd1e to 8ba2f8e Compare May 19, 2026 02:28
@github-project-automation github-project-automation Bot moved this to Unassigned in Gloas May 19, 2026

@potuz potuz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, would be good to have some extra eyes regarding the full copy path. I did my best effort to trace that the map is correctly initialized on every path that reads a state either from memory or DB (eg StateByRoot) and it seems fine.

@terencechain terencechain added this pull request to the merge queue May 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 21, 2026
@terencechain terencechain added this pull request to the merge queue May 21, 2026
Merged via the queue into develop with commit 7900115 May 21, 2026
23 checks passed
@terencechain terencechain deleted the state-native-builder-pubkey-index branch May 21, 2026 20:51
@github-project-automation github-project-automation Bot moved this from Unassigned to Done in Gloas May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants