Skip to content

feat(fct_block_head): gloas payload hash from execution_payload events - #298

Closed
samcm wants to merge 4 commits into
masterfrom
fix/gloas-engine-newpayload-correlation
Closed

feat(fct_block_head): gloas payload hash from execution_payload events#298
samcm wants to merge 4 commits into
masterfrom
fix/gloas-engine-newpayload-correlation

Conversation

@samcm

@samcm samcm commented Jul 17, 2026

Copy link
Copy Markdown
Member

On gloas (ePBS) networks the beacon block no longer embeds the execution payload, so fct_block_head.execution_payload_block_hash is empty — and every engine timing model correlates snooper events against that column, so the int_engine_*/fct_engine_* tables stayed empty on the glamsterdam devnets even with raw snooper data flowing.

Fix at the source: fct_block_head coalesces the payload hash from the beacon_api_eth_v1_events_execution_payload SSE events (new external model, copied verbatim from release/glamsterdam-devnet-7) when the block table carries none. Every consumer of the column is repaired at once — an earlier revision of this PR patched int_engine_new_payload instead, but the fct engine models correlate independently, so the column had to be fixed where it's produced.

  • Dependency is OR-grouped with beacon_api_eth_v2_beacon_block, so networks where the events table is empty or absent schedule exactly as before (CBT skips empty/erroring OR-group members).
  • The coalesce prefers the block's own embedded hash: pre-gloas history, gloas history, and mixed fork histories work in one query. Final '' arm keeps the FixedString(66) column non-NULL.
  • No comment semicolons — CBT's statement splitter cuts on ; inside comments (found the hard way in prod).

Tested against live ClickHouse via panda: on devnet-7, 299/299 blocks in the last hour resolve a payload hash through the enrichment; the identical rendered INSERT parses through ClickHouse's full analysis. This change is already live on release/glamsterdam-devnet-{6,7} (65c3415) feeding the devnet deployments.

Deploy sequencing for this master PR: the events table ships with gloas-era xatu (007_gloas_epbs_support, on xatu release branches only today). The rendered SQL references the table unconditionally, so don't roll a master build containing this to networks whose raw DB lacks the table (mainnet/sepolia/hoodi default) until that xatu migration lands there.

Known follow-up (out of scope): int_engine_get_blobs correlates via beacon_api_eth_v1_beacon_blob, which is empty under PeerDAS — needs a versioned-hash mapping from another source.

https://claude.ai/code/session_01J2ShnSwGwH4iZuXXwbLgvP

…payload events

On gloas (ePBS) networks the beacon block no longer embeds the execution
payload, so fct_block_head.execution_payload_block_hash is empty and every
snooper observation was dropped for lack of slot context - the engine
timings tables stayed empty on glamsterdam devnets even with raw data
flowing.

Map each revealed payload's block hash to its beacon block root via the
beacon_api_eth_v1_events_execution_payload SSE events and coalesce that
into block_context. The events table only exists on networks running
gloas-era xatu, so it is referenced through EXTERNAL_CLUSTER behind a
GLOAS_PAYLOAD_EVENTS_DATABASE env gate instead of a declared dependency:
deployments opt in by setting the env to the raw database holding the
table, and everywhere else the template renders the exact same SQL as
before.

Verified against live data: glamsterdam-devnet-7 correlates 99.7% of
23k engine events over 2h (42 nodes); on mainnet the gated-off rendering
returns checksum-identical results to the current model.

Claude-Session: https://claude.ai/code/session_01J2ShnSwGwH4iZuXXwbLgvP
@samcm
samcm requested a review from Savid as a code owner July 17, 2026 08:04
…ndency

Correlation now works on every network with no opt-in: the
execution_payload events external is a declared dependency, OR-grouped
with beacon_api_eth_v2_beacon_block so networks where the table is empty
or absent schedule unaffected, and the coalesce prefers the block's own
embedded payload hash so mixed pre/post-gloas histories work in one query.

Requires the gloas event-table migrations to exist on a network's raw
database before this model rolls there; the glamsterdam devnets already
have them.

Claude-Session: https://claude.ai/code/session_01J2ShnSwGwH4iZuXXwbLgvP
samcm added a commit that referenced this pull request Jul 17, 2026
On gloas the beacon block no longer embeds the execution payload, so
fct_block_head carries no execution_payload_block_hash and every engine
snooper observation was dropped for lack of slot context. Map each
revealed payload's block hash to its beacon block root via the
execution_payload SSE events and coalesce it into block_context; the
coalesce prefers the block's own embedded hash so pre-gloas history is
untouched. The events dependency is OR-grouped with the beacon block
table so networks without payload events schedule unaffected.

Verified against live devnet-7 data: 99.7% of 23k engine events over 2h
correlate to slots (42 nodes); on mainnet data the rendering returns
checksum-identical results to the previous model. Same change is PR #298
against master, blocked there until the gloas raw tables exist beyond
the devnets.

Claude-Session: https://claude.ai/code/session_01J2ShnSwGwH4iZuXXwbLgvP
samcm added 2 commits July 17, 2026 18:50
CBT's statement splitter cuts on semicolons without comment awareness.

Claude-Session: https://claude.ai/code/session_01J2ShnSwGwH4iZuXXwbLgvP
The engine fct models correlate against fct_block_head independently of
int_engine_new_payload, so the int-level patch left them empty on gloas.
Coalesce the payload hash into fct_block_head from the execution_payload
SSE events and revert the int model - every consumer of the column is
repaired at once.

Claude-Session: https://claude.ai/code/session_01J2ShnSwGwH4iZuXXwbLgvP
@samcm samcm changed the title feat(int_engine_new_payload): correlate gloas payloads via execution_payload events feat(fct_block_head): gloas payload hash from execution_payload events Jul 17, 2026
@samcm

samcm commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Closing — this lives on release/glamsterdam-devnet-{6,7} (65c3415), which is what the devnet CBT deployments run, and it'll reach master when the release branch merges back as part of gloas prep. No point maintaining a separate master copy until then.

@samcm samcm closed this Jul 17, 2026
@samcm
samcm deleted the fix/gloas-engine-newpayload-correlation branch July 17, 2026 09:25
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