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

Synthetic block proposals #1486

Closed
corverroos opened this issue Nov 28, 2022 · 0 comments
Closed

Synthetic block proposals #1486

corverroos opened this issue Nov 28, 2022 · 0 comments
Labels

Comments

@corverroos
Copy link
Contributor

corverroos commented Nov 28, 2022

Problem to be solved

We had one failed block proposal in our core team canary cluster and we couldn't find the reason. It seems related to networking, possibly the bandwidth requirements of beacon blocks.

The problem with block proposals are that they are rare. Debugging problems with rare flows in production is very hard.

Proposed solution

Introduce the concept of synthetic duties, so synthetic block proposals. See reference for synthetic testing.

What is synthetic duties?

  • Synthetic duties are additional fake duties that are scheduled in a cluster, specifically production clusters.
  • A deterministic function will determine if the synthetic duties needs to be scheduled when a normal duties isn't scheduled for that epoch/period.
  • The cluster will perform that duty like it is a normal duty.
  • The cluster will swallow the synthetic duty instead of finally broadcasting it to the beacon node.
  • This will reproduce rare duties on regular bases, allowing easy debugging and problem identification.
  • The BN should be oblivious to these duties, except for the additional fetch requests to get the unsigned data.
  • Note that even though broadcasting unexpected block proposals isn't penalised, it may have side-effects like p2p score. We therefore swallow these submissions to reduce noise.

Why synthetic duties in production and not more production-like simnet clusters?

  • Testing in production is all about leverage.
  • One leverages everything in the production cluster: network, hardware, load, monitoring, alerts, human attention.
  • Reproducing all of this in a simnet clusters is very hard.
  • We can even use this is user clusters if they require it (to debug failed proposal in their specific environment).

Suggested solution:

  • Enable this via a opt-in flag: synthetic_duties. Note this is not a feature flag since feature flags are for staged rollouts, this will always be opt-in and never be on-by-default.
  • For v1, we only include block proposals, v2 can include sync committees.
  • Implement this in eth2wrap via a functional option WithSyntheticDuties().
  • When fetching block proposal duties for an epoch, if no duty is present in the result, pick a deterministic slot for the synthetic proposal and cache the fact that this duty is synthetic.
  • When fetching unsigned blocks, if the duty is synthetic, replace the graffiti in the request with SYNTHETIC DUTY: DO NOT SUBMIT.
  • When submitting blocks, if the block graffiti indicates it is synthetic, swallow it. This ensures that peers without cached synthetic duties do not submit either.

Out of Scope

This will impact production metrics. We ignore this for now, except for instrumenting the fact that synthetic is enabled.

obol-bulldozer bot pushed a commit that referenced this issue Nov 29, 2022
Adds support for deterministic synthetic proposer duties to eth2wrap package.

TODO: add tests and wire in subsequent PRs.

category: feature
ticket: #1486
@OisinKyne OisinKyne added the test label Nov 29, 2022
obol-bulldozer bot pushed a commit that referenced this issue Dec 1, 2022
Adds a unit test for synthetic proposals.

category: test
ticket: #1486
obol-bulldozer bot pushed a commit that referenced this issue Dec 6, 2022
Wire synthetic block proposals via the config flag `--synthetic-block-proposals`. Also enable this by default in compose, it replaces beaconmock scheduled deterministic duties.

category: feature
ticket: #1486
obol-bulldozer bot pushed a commit that referenced this issue Dec 9, 2022
Query previous blocks to propose as synthetic blocks since only proposers can query the block_proposal endpoint.

category: bug
ticket: #1486
obol-bulldozer bot pushed a commit that referenced this issue Dec 12, 2022
Always use `head` when querying `validators_by_pubkey` since this is an expensive call and head mitigates against needing to parse and fetch previous state. It also mitigates against errors when querying slots that are too old. Also add TODOs to introduce a cache like Vouch does. Also do this vmock.

category: refactor
ticket: #1486
obol-bulldozer bot pushed a commit that referenced this issue Dec 13, 2022
Cache and use correct fee recipients in synthetic blocks.

category: bug
ticket: #1486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants