Skip to content

Comments

feat(cannon): implement consolidation requests iterator for Electra fork#517

Open
samcm wants to merge 5 commits intomasterfrom
feat/execution-requests-consolidations
Open

feat(cannon): implement consolidation requests iterator for Electra fork#517
samcm wants to merge 5 commits intomasterfrom
feat/execution-requests-consolidations

Conversation

@samcm
Copy link
Member

@samcm samcm commented May 20, 2025

Summary

This PR implements end-to-end support for EIP-7251 consolidation requests in the Xatu monitoring system:

Adds ConsolidationRequest deriver in Cannon to extract consolidation requests from beacon blocks starting from the Electra fork
Implements server event handler for processing consolidation request events
Updates protocol buffer integration with new event type constants (Event number 61, CannonType number 14)
Creates ClickHouse migration (062) for canonical_beacon_block_consolidation_request table storage
Updates Vector configuration for complete Kafka and ClickHouse routing pipeline
Adds configuration example in example_cannon.yaml

Architecture Overview

The implementation follows the established Xatu pattern for beacon block derivers:

Beacon Block (Electra+) → Cannon ConsolidationRequest Deriver → Protocol Buffer Event → 
Server Event Ingester → Kafka Topic → Vector Processing → ClickHouse Storage

Key Components

ConsolidationRequest Deriver (pkg/cannon/deriver/beacon/eth/v2/consolidation_request.go)

  • Activates on spec.DataVersionElectra fork
  • Extracts consolidation requests from ExecutionRequests.consolidations
  • Creates individual events for each consolidation request with position tracking
  • Handles pre-Electra blocks gracefully (returns empty slice)

Protocol Buffer Integration

  • Added BEACON_API_ETH_V2_BEACON_BLOCK_CONSOLIDATION_REQUEST = 61 to Event enum
  • Added BEACON_API_ETH_V2_BEACON_BLOCK_CONSOLIDATION_REQUEST = 14 to CannonType enum
  • Uses existing ElectraExecutionRequestConsolidation message with StringValue wrappers

ClickHouse Schema

Table: canonical_beacon_block_consolidation_request

Key Fields:

  • source_address (FixedString(42)) - Source Ethereum address
  • source_pubkey (FixedString(98)) - Source BLS public key
  • target_pubkey (FixedString(98)) - Target BLS public key
  • position_in_block (UInt32) - Position within block's consolidation requests
  • Standard block metadata (slot, epoch, block_root, etc.)
  • Full client metadata for observability

Data Pipeline

  • Kafka routing: beacon-api-eth-v2-beacon-block-consolidation-request topic
  • Vector processing: Field mapping and timestamp conversion
  • ClickHouse sink: Batch ingestion with compression and health checks

EIP-7251 Context

Consolidation requests enable validator stake consolidation on Ethereum post-Electra fork. Each request contains:

  • source_address: ExecutionAddress initiating the consolidation
  • source_pubkey: BLS public key of the source validator
  • target_pubkey: BLS public key of the target validator

This monitoring capability is essential for tracking validator consolidation operations and network analytics.

Test plan

  • Go build compiles successfully
  • Protocol buffers generate without errors
  • Code follows project conventions and linting rules
  • Database migration syntax validated
  • Vector configuration updated with proper routing
  • Configuration example includes consolidation request deriver

Integration testing will be possible once Electra fork activates and consolidation requests are available in beacon blocks.

🤖 Generated with Claude Code

samcm and others added 2 commits May 20, 2025 14:59
This implements end-to-end support for EIP-7251 consolidation requests in Xatu:

- Add ConsolidationRequest deriver in Cannon to extract consolidation requests from beacon blocks starting from Electra fork
- Implement server event handler for processing consolidation request events
- Add protocol buffer integration and event type constants
- Create ClickHouse migration (062) for canonical_beacon_block_consolidation_request table
- Update Vector configuration for Kafka and ClickHouse routing
- Add configuration example in example_cannon.yaml

The consolidation request contains source_address, source_pubkey, and target_pubkey fields as defined in EIP-7251, enabling monitoring and analytics of validator consolidation operations on the network.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@samcm samcm requested a review from Savid as a code owner May 20, 2025 05:16
samcm and others added 3 commits May 20, 2025 15:30
Use natural ORDER BY (slot_start_date_time, meta_network_name, block_root, position_in_block)
for uniqueness instead of requiring a separate unique_key column. This combination provides
guaranteed uniqueness since each block_root is unique and each consolidation request within
a block has a unique position_in_block.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
feat: add new documentation for the rules system
refactor: move LLM rule files from .cursor/rules to llms/rules
docs: add LLM guidelines for ClickHouse migrations directory

feat(proto): add new CannonType and CannonLocation for consolidation requests by epoch

refactor(proto): add new message type for beacon block consolidation request epoch

This commit introduces a new message type `CannonLocationEthV2BeaconBlockConsolidationRequestEpoch` to the protobuf definition. This new message is specifically designed to handle requests for beacon block consolidation based on epoch, providing a more granular and specific request type for this operation. This change improves the clarity and organization of the protobuf messages by creating a dedicated type for this specific request.

refactor(proto): rename CreateExecutionNodeRecordStatus to ListStalledExecutionNodeRecords

feat(proto): add CannonLocationEthV2BeaconBlockConsolidationRequestEpoch message

feat(proto): add new cannon type and location for beacon block consolidation request epoch
refactor(docs): update Claude markdown files to point to new llms directory for rules
feat(persistence): add marshal and unmarshal support for new cannon location type
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