Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Revert 009: restore the envelope-summary columns and drop execution_optimistic.

---------------------------------------------------------------------
-- execution_payload
---------------------------------------------------------------------
ALTER TABLE beacon_api_eth_v1_events_execution_payload_local ON CLUSTER '{cluster}'
DROP COLUMN IF EXISTS execution_optimistic,
ADD COLUMN IF NOT EXISTS state_root FixedString(66)
COMMENT 'Execution state root' CODEC(ZSTD(1)) AFTER block_hash,
ADD COLUMN IF NOT EXISTS slot_number Nullable(UInt64)
COMMENT 'EIP-7843 SLOTNUM: the execution payload slot_number field (typically equals the beacon slot)' CODEC(ZSTD(1)) AFTER state_root;

ALTER TABLE beacon_api_eth_v1_events_execution_payload ON CLUSTER '{cluster}'
DROP COLUMN IF EXISTS execution_optimistic,
ADD COLUMN IF NOT EXISTS state_root FixedString(66)
COMMENT 'Execution state root' CODEC(ZSTD(1)) AFTER block_hash,
ADD COLUMN IF NOT EXISTS slot_number Nullable(UInt64)
COMMENT 'EIP-7843 SLOTNUM: the execution payload slot_number field (typically equals the beacon slot)' CODEC(ZSTD(1)) AFTER state_root;

---------------------------------------------------------------------
-- execution_payload_gossip
---------------------------------------------------------------------
ALTER TABLE beacon_api_eth_v1_events_execution_payload_gossip_local ON CLUSTER '{cluster}'
ADD COLUMN IF NOT EXISTS state_root FixedString(66)
COMMENT 'Execution state root' CODEC(ZSTD(1)) AFTER block_hash,
ADD COLUMN IF NOT EXISTS slot_number Nullable(UInt64)
COMMENT 'EIP-7843 SLOTNUM: the execution payload slot_number field (typically equals the beacon slot)' CODEC(ZSTD(1)) AFTER state_root;

ALTER TABLE beacon_api_eth_v1_events_execution_payload_gossip ON CLUSTER '{cluster}'
ADD COLUMN IF NOT EXISTS state_root FixedString(66)
COMMENT 'Execution state root' CODEC(ZSTD(1)) AFTER block_hash,
ADD COLUMN IF NOT EXISTS slot_number Nullable(UInt64)
COMMENT 'EIP-7843 SLOTNUM: the execution payload slot_number field (typically equals the beacon slot)' CODEC(ZSTD(1)) AFTER state_root;
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- EIP-7732 ePBS execution_payload / execution_payload_gossip event reshape.
--
-- The beacon-APIs execution_payload and execution_payload_gossip SSE events
-- carry a FLAT summary of a revealed payload, not a full
-- SignedExecutionPayloadEnvelope (see apis/eventstream/index.yaml):
--
-- execution_payload: {slot, builder_index, block_hash, block_root, execution_optimistic}
-- execution_payload_gossip: {slot, builder_index, block_hash, block_root}
--
-- These tables were originally modelled by extracting a summary from the full
-- envelope, and so carry two columns the flat event cannot populate:
-- * state_root (not in the event -- only nimbus emits an extra all-zero one)
-- * slot_number (not in the event, and the event slot is already stored)
-- Drop both. Add execution_optimistic to the execution_payload table (the gossip
-- event does not carry it, so its table is left without the column).
--
-- The tables are empty (the events never parsed), so these ALTERs touch no data.

---------------------------------------------------------------------
-- execution_payload (SSE, fires on import into fork-choice)
---------------------------------------------------------------------
ALTER TABLE beacon_api_eth_v1_events_execution_payload_local ON CLUSTER '{cluster}'
DROP COLUMN IF EXISTS state_root,
DROP COLUMN IF EXISTS slot_number,
ADD COLUMN IF NOT EXISTS execution_optimistic Bool
COMMENT 'Whether the node considered the payload optimistically imported' CODEC(ZSTD(1)) AFTER block_hash;

ALTER TABLE beacon_api_eth_v1_events_execution_payload ON CLUSTER '{cluster}'
DROP COLUMN IF EXISTS state_root,
DROP COLUMN IF EXISTS slot_number,
ADD COLUMN IF NOT EXISTS execution_optimistic Bool
COMMENT 'Whether the node considered the payload optimistically imported' CODEC(ZSTD(1)) AFTER block_hash;

---------------------------------------------------------------------
-- execution_payload_gossip (SSE, fires on gossip validation)
---------------------------------------------------------------------
ALTER TABLE beacon_api_eth_v1_events_execution_payload_gossip_local ON CLUSTER '{cluster}'
DROP COLUMN IF EXISTS state_root,
DROP COLUMN IF EXISTS slot_number;

ALTER TABLE beacon_api_eth_v1_events_execution_payload_gossip ON CLUSTER '{cluster}'
DROP COLUMN IF EXISTS state_root,
DROP COLUMN IF EXISTS slot_number;
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ require (
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9
github.com/creasty/defaults v1.8.0
github.com/ethereum/go-ethereum v1.17.3
github.com/ethpandaops/beacon v0.69.1-0.20260514032911-81b9ef3395fd
github.com/ethpandaops/beacon v0.69.1-0.20260708064159-77f719eed8c0
github.com/ethpandaops/ethcore v0.0.0-20260514003726-f67d7a6e9f91
github.com/ethpandaops/ethwallclock v0.4.0
github.com/ethpandaops/go-eth2-client v0.1.6-0.20260703015600-af3297cb0c0d
github.com/ethpandaops/go-eth2-client v0.1.6-0.20260708064136-c504b7edf763
github.com/failsafe-go/failsafe-go v0.9.6
github.com/ferranbt/fastssz v1.0.0
github.com/go-co-op/gocron/v2 v2.16.6
Expand Down Expand Up @@ -284,7 +284,7 @@ require (
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 // indirect
github.com/prysmaticlabs/gohashtree v0.0.5-beta // indirect
github.com/quic-go/qpack v0.6.0 // indirect
github.com/quic-go/quic-go v0.59.0 // indirect
github.com/quic-go/quic-go v0.59.1 // indirect
github.com/quic-go/webtransport-go v0.10.0 // indirect
github.com/quipo/dependencysolver v0.0.0-20170801134659-2b009cb4ddcc // indirect
github.com/r3labs/sse/v2 v2.10.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJ
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8=
github.com/ethereum/go-ethereum v1.17.3-0.20260507223249-73944e329925 h1:d0kQnVKgCER1xIEYB0ucuNLfq4PtBZw+abMceZKUO8g=
github.com/ethereum/go-ethereum v1.17.3-0.20260507223249-73944e329925/go.mod h1:f2EhRwqewIZkGoQekywI2Y2RZAMTSavLNkD9qItFy1A=
github.com/ethpandaops/beacon v0.69.1-0.20260514032911-81b9ef3395fd h1:AaLk72yt995XuS+Hmo+KimdBT+3e8hoe2oQwX7xmaHA=
github.com/ethpandaops/beacon v0.69.1-0.20260514032911-81b9ef3395fd/go.mod h1:vrxMPxDejPbdEyHr4o3ajDYP2sasPXkw40Hv/x90fg8=
github.com/ethpandaops/beacon v0.69.1-0.20260708064159-77f719eed8c0 h1:RdGykGEU48ilh2LKN0Q0hUq8ie6bgnYOygvWlOboE1U=
github.com/ethpandaops/beacon v0.69.1-0.20260708064159-77f719eed8c0/go.mod h1:XusS7Kqt+TmnC2hokdekBlXckahjT+fAVI5RWz/KuoU=
github.com/ethpandaops/ethcore v0.0.0-20260514003726-f67d7a6e9f91 h1:Ul0YjpD4MWCTN41Vj70ad19PP0zsIdLuMJhvu/N+fPU=
github.com/ethpandaops/ethcore v0.0.0-20260514003726-f67d7a6e9f91/go.mod h1:+wq6Rg1Fmu9JCHO2nA+LyKdpNQm2vMGnwqftGWbftiU=
github.com/ethpandaops/ethereum-package-go v0.8.1 h1:VN5l8UXveyw7gp0Glj8BRzS/D5RKyvhLeaoi/C5Jy5M=
github.com/ethpandaops/ethereum-package-go v0.8.1/go.mod h1:LQThCwlCeeNBTdXOFV+xSwudoced53x+o/Orya3Y+oo=
github.com/ethpandaops/ethwallclock v0.4.0 h1:+sgnhf4pk6hLPukP076VxkiLloE4L0Yk1yat+ZyHh1g=
github.com/ethpandaops/ethwallclock v0.4.0/go.mod h1:y0Cu+mhGLlem19vnAV2x0hpFS5KZ7oOi2SWYayv9l24=
github.com/ethpandaops/go-eth2-client v0.1.6-0.20260703015600-af3297cb0c0d h1:oVn/pm1SOqW2nPfKGeYm4ZQYD9yYWjyYr76QSbC+Zj8=
github.com/ethpandaops/go-eth2-client v0.1.6-0.20260703015600-af3297cb0c0d/go.mod h1:97Oq3omOQSGPPYgrbsOIIw2Pc4T5Ph21f8ZRyHJQBHU=
github.com/ethpandaops/go-eth2-client v0.1.6-0.20260708064136-c504b7edf763 h1:X2uGwhivgMlTRYw55bLrkRlCddLD70WFG6aVcEcxnpo=
github.com/ethpandaops/go-eth2-client v0.1.6-0.20260708064136-c504b7edf763/go.mod h1:97Oq3omOQSGPPYgrbsOIIw2Pc4T5Ph21f8ZRyHJQBHU=
github.com/failsafe-go/failsafe-go v0.9.6 h1:vPSH2cry0Ee5cnR9wc9qshCDO6jdrMA9elBJNwyo4Uk=
github.com/failsafe-go/failsafe-go v0.9.6/go.mod h1:IeRpglkcwzKagjDMh90ZhN2l4Ovt3+jemQBUbThag54=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
Expand Down Expand Up @@ -724,8 +724,8 @@ github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h
github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y=
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
github.com/quic-go/quic-go v0.59.1 h1:0Gmua0HW1Tv7ANR7hUYwRyD0MG5OJfgvYSZasGZzBic=
github.com/quic-go/quic-go v0.59.1/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
github.com/quic-go/webtransport-go v0.10.0 h1:LqXXPOXuETY5Xe8ITdGisBzTYmUOy5eSj+9n4hLTjHI=
github.com/quic-go/webtransport-go v0.10.0/go.mod h1:LeGIXr5BQKE3UsynwVBeQrU1TPrbh73MGoC6jd+V7ow=
github.com/quipo/dependencysolver v0.0.0-20170801134659-2b009cb4ddcc h1:hK577yxEJ2f5s8w2iy2KimZmgrdAUZUNftE1ESmg2/Q=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"
"time"

"github.com/ClickHouse/ch-go/proto"

"github.com/ethpandaops/xatu/pkg/clickhouse/route"
"github.com/ethpandaops/xatu/pkg/proto/xatu"
)
Expand Down Expand Up @@ -62,32 +60,18 @@ func (b *beaconApiEthV1EventsExecutionPayloadBatch) appendRuntime(event *xatu.De
}

func (b *beaconApiEthV1EventsExecutionPayloadBatch) appendPayload(event *xatu.DecoratedEvent) {
envelope := event.GetEthV1EventsExecutionPayload()

msg := envelope.GetMessage()
payload := event.GetEthV1EventsExecutionPayload()

b.BlockRoot.Append([]byte(msg.GetBeaconBlockRoot()))
b.BlockRoot.Append([]byte(payload.GetBlockRoot()))
b.BlockHash.Append([]byte(payload.GetBlockHash()))

if builderIndex := msg.GetBuilderIndex(); builderIndex != nil {
if builderIndex := payload.GetBuilderIndex(); builderIndex != nil {
b.BuilderIndex.Append(builderIndex.GetValue())
} else {
b.BuilderIndex.Append(0)
}

if payload := msg.GetPayload(); payload != nil {
b.BlockHash.Append([]byte(payload.GetBlockHash()))
b.StateRoot.Append([]byte(payload.GetStateRoot()))

if sn := payload.GetSlotNumber(); sn != nil {
b.SlotNumber.Append(proto.NewNullable[uint64](sn.GetValue()))
} else {
b.SlotNumber.Append(proto.Nullable[uint64]{})
}
} else {
b.BlockHash.Append(nil)
b.StateRoot.Append(nil)
b.SlotNumber.Append(proto.Nullable[uint64]{})
}
b.ExecutionOptimistic.Append(payload.GetExecutionOptimistic())
}

func (b *beaconApiEthV1EventsExecutionPayloadBatch) appendAdditionalData(
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"
"time"

"github.com/ClickHouse/ch-go/proto"

"github.com/ethpandaops/xatu/pkg/clickhouse/route"
"github.com/ethpandaops/xatu/pkg/proto/xatu"
)
Expand Down Expand Up @@ -62,32 +60,16 @@ func (b *beaconApiEthV1EventsExecutionPayloadGossipBatch) appendRuntime(event *x
}

func (b *beaconApiEthV1EventsExecutionPayloadGossipBatch) appendPayload(event *xatu.DecoratedEvent) {
envelope := event.GetEthV1EventsExecutionPayloadGossip()

msg := envelope.GetMessage()
payload := event.GetEthV1EventsExecutionPayloadGossip()

b.BlockRoot.Append([]byte(msg.GetBeaconBlockRoot()))
b.BlockRoot.Append([]byte(payload.GetBlockRoot()))
b.BlockHash.Append([]byte(payload.GetBlockHash()))

if builderIndex := msg.GetBuilderIndex(); builderIndex != nil {
if builderIndex := payload.GetBuilderIndex(); builderIndex != nil {
b.BuilderIndex.Append(builderIndex.GetValue())
} else {
b.BuilderIndex.Append(0)
}

if payload := msg.GetPayload(); payload != nil {
b.BlockHash.Append([]byte(payload.GetBlockHash()))
b.StateRoot.Append([]byte(payload.GetStateRoot()))

if sn := payload.GetSlotNumber(); sn != nil {
b.SlotNumber.Append(proto.NewNullable[uint64](sn.GetValue()))
} else {
b.SlotNumber.Append(proto.Nullable[uint64]{})
}
} else {
b.BlockHash.Append(nil)
b.StateRoot.Append(nil)
b.SlotNumber.Append(proto.Nullable[uint64]{})
}
}

func (b *beaconApiEthV1EventsExecutionPayloadGossipBatch) appendAdditionalData(
Expand Down
Loading
Loading