Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry: Build blocks on a schedule #338

Open
samcm opened this issue Jun 21, 2024 · 0 comments
Open

Sentry: Build blocks on a schedule #338

samcm opened this issue Jun 21, 2024 · 0 comments

Comments

@samcm
Copy link
Member

samcm commented Jun 21, 2024

Similar to how the sentry can fetch fork choice debug payloads, we can add the ability to build blocks on a schedule. Using https://ethereum.github.io/beacon-APIs/#/Validator/produceBlockV3 we can derive a new event that contains the block and any useful data, like the sum of tips from the execution payload, or how attestations were packed. This needs to be configurable on an interval or at slot times, just like the existing fork choice implementation.

Implementation steps:

  • Create a new event the event_ingester proto file called BEACON_API_ETH_V3_VALIDATORS_BEACON_BLOCK.
    • The event should contain the same content as BEACON_API_ETH_V2_BEACON_BLOCK
    • The additional_data should contain the same fields as the BEACON_API_ETH_V2_BEACON_BLOCK event, along with a field containing the sum of tips from the execution payload, and how long it took to build the block.
  • pkg/server's event-ingester needs support for the new event. We don't need to do any cache deduplicate checking.
  • pkg/sentry will be the compoenent that is actually fetching the block.
    • Like the existing fork-choice fetching, we need to add config to build the block:
      • on an interval
      • at a specific time in the slot
    • Use s.beacon.Node().Service() to get the go-eth2-client service, and create a new Block serivce that'll let us produce blocks. We need to fetch blocks for the current slot, so use the wallclock to get the current slot when requesting a new block.
    • Sum the tips from the execution payload of the new block, and add it to additional data. You can see how we're creating BEACON_API_ETH_V2_BEACON_BLOCK events as a reference.
    • Export the events.
  • All the docker compose components will need to be updated to support the new event.
    • Add the topic to kafka
    • Add the new event to vector-http-kafka
    • Create a migration for clickhouse. Use the existing canonical_beacon_blocks table as a starting point. Add an additional column for the tips additional data.
    • Add support for the new event in vector-kafka-clickhouse. Make sure you add all the new fields from the migration.
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

No branches or pull requests

1 participant