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

Sidecar: ConsensusState container #58

Closed
mempirate opened this issue Jun 4, 2024 · 1 comment
Closed

Sidecar: ConsensusState container #58

mempirate opened this issue Jun 4, 2024 · 1 comment
Assignees
Labels
C: bolt-sidecar Component: bolt-sidecar
Milestone

Comments

@mempirate
Copy link
Contributor

mempirate commented Jun 4, 2024

Context

Just like we have execution state to validate commitment requests against, we should have a consensus state container. This consensus state will be used to validate commitments against the consensus state. The module should live in src/state/consensus.rs.

The consensus state should have access to a beacon client that it can use to query the beacon chain with. Just like ExecutionState, it should have a fn update_head(&mut self, head: ChainHead) that it will use to update its internal state with. We will have a separate HeadTracker actor that will initiate these update calls.

The validate_request method

To validate a request, we need to

  • Check if the target slot is one of our proposer slots (need access to a live lookahead + the registry)
  • Check if the request hasn't passed the slot deadline (i.e. timestamp of prev update + some configurable deadline like 6s)

If validate_request passes, we can continue validation on the execution state.

@mempirate mempirate added the C: bolt-sidecar Component: bolt-sidecar label Jun 4, 2024
@mempirate mempirate added this to the v0.1 milestone Jun 4, 2024
@merklefruit
Copy link
Collaborator

Proposer duties & lookahead window

Another useful part of the consensus state container is to keep an updated view of the lookahead at all times:

  1. have a notion of consensus Epoch with a start_slot property and its associated proposer_duties
  2. at the beginning of a new epoch, fetch its proposer duties to make sure we have always up to date info
  3. for every new slot (so when the update_head method is called on the ConsensusState) check if the current epoch is over. If it is, then fetch new proposer duties

In the future, this will also be cross-integrated with the on-chain Registry to make sure that we are registered before accepting commitments.

@namn-grg namn-grg self-assigned this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-sidecar Component: bolt-sidecar
Projects
None yet
Development

No branches or pull requests

3 participants