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

[Merge] Support execution_optimistic flag in REST API #4968

Closed
ajsutton opened this issue Feb 10, 2022 · 2 comments
Closed

[Merge] Support execution_optimistic flag in REST API #4968

ajsutton opened this issue Feb 10, 2022 · 2 comments
Assignees

Comments

@ajsutton
Copy link
Contributor

Description

Implement changes to reflect optimistic sync status as per ethereum/beacon-APIs#190

Need to make sure this only shows up when bellatrix is enabled.

@ajsutton
Copy link
Contributor Author

This turns out to be a fair bit of work. We can ensure the new field doesn't appear when bellatrix isn't enabled with:

  @JsonInclude(Include.NON_NULL)
  @JsonProperty("execution_optimistic")
  public final Boolean execution_optimistic;

and then setting it to null when it shouldn't appear.

However there's quite a few changes required to be able to return optimistic blocks/states and track if the chain head was optimistic at the time we gathered the data.

Firstly, we currently based most requests on the fully validated chain head so while retrieving blocks by root would currently include optimistic blocks, retrieving by slot wouldn't return anything after the fully validated head. We may want to change things so that we actually only track one chain head - the optimistic head, along with a record of whether the chain head is optimistic or not. With the REST API moving over to include optimistic blocks, I'm not sure there's a need to not update the chain head - we would need to adjust the Syncing log messages. We already explicitly check if the relevant block is optimistic and refuse to publish blocks and attestations.

Then for returning if the data was affected by optimistic sync, we need to ensure we do it in a thread safe way. We may change between optimistic and normal sync while we're executing the query so need to get the chain head and whether it's optimistic in an atomic operation to ensure they're consistent.

Likely we'd need to update BlockSelector and StateSelector to return both the block/state and a flag indicating if it's optimistic or not.

@ajsutton
Copy link
Contributor Author

ajsutton commented Mar 9, 2022

Need to add execution_optimistic to the finalized_head event.

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