Conversation
barnabasbusa
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proper Withdrawals Indexing
Summary
Replaces the lightweight
el_withdrawalstable (written exclusively by the EL tx indexer) with a first-classwithdrawalstable indexed from the beacon chain, with granular withdrawal type classification. Fee recipient rewards are moved out of the withdrawals system entirely and stored as fields onel_blocks.Changes
Schema & Data Model
withdrawalstable withblock_uid,block_idx,type,orphaned,fork_id,validator(NOT NULL),account_id,amount(Gwei). Primary key(block_uid, block_idx).el_blocks:fee_amount,fee_amount_raw,fee_account_id— fee recipient rewards are no longer tracked as withdrawals.20260402000000_withdrawals-index.sql): Creates new table, seeds CL withdrawals fromel_withdrawals, migrates fee data toel_blocks, drops old table. Both SQLite and PostgreSQL.db/el_withdrawals.goand allElWithdrawal/ElWithdrawalFiltertypes.Withdrawal Type Classification
Four withdrawal types, classified during beacon block indexing:
pending_partial_withdrawalsin state)Type detection uses the state simulator to count pending partial withdrawals per block (they appear first in the execution payload per spec), then checks validator exit status and amount threshold for full vs sweep classification.
Beacon Indexer
buildDbWithdrawalsextracts withdrawals from execution payload, classifies types using sim state, resolves account IDs (persist path creates missing accounts using the existing transaction; read path only looks up existing ones).persistBlockWithdrawalswired intopersistBlockChildObjects, also callsUpdateWithdrawalsForkIdto keep fee recipient entries (written by EL indexer) in sync during reorgs/finalization.GetDbWithdrawalsonBlockfor chain service cache access, reconstructs sim from epoch stats on the read path.EL Tx Indexer
withdrawalstable at all.el_blocksrecord (fee_amount,fee_amount_raw,fee_account_id).processBlockRewardssimplified to only collect fee data.Chain Service
GetWithdrawalsByFilterin newservices/chainservice_withdrawals.go— cache + DB pagination pattern (same as voluntary exits/slashings). No fee recipient merging needed.WithdrawalFiltersupports multi-type filtering (Types []uint8), validator name search, account ID with address fallback for cached blocks.GetWithdrawalRequestsByFilternow properly passesMinAmount/MaxAmountto both pending tx and cached request operation filters.UI — Withdrawals Overview (
/validators/withdrawals)/validators/el_withdrawals?f=&f.type=1&f.orphaned=1.UI — Withdrawals Filtered List (
/validators/withdrawals/filtered)UI — Exits Overview (
/validators/exits)/validators/el_withdrawals?f=&f.type=2&f.orphaned=1for full list.UI — Validator Detail Page
UI — Address Detail Page
el_blocksbyfee_account_id.UI — Breadcrumbs
Home / Validators / <Action>with child pages underHome / Validators / <Action> / <Page>.Other
formatEthFromGweiPtemplate function added for configurable decimal precision (withdrawals use 6 decimals).