Closed mempirate closed 22 hours ago
Another useful part of the consensus state container is to keep an updated view of the lookahead at all times:
Epoch
with a start_slot
property and its associated proposer_duties
update_head
method is called on the ConsensusState
) check if the current epoch is over. If it is, then fetch new proposer dutiesIn the future, this will also be cross-integrated with the on-chain Registry to make sure that we are registered before accepting commitments.
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 afn update_head(&mut self, head: ChainHead)
that it will use to update its internal state with. We will have a separateHeadTracker
actor that will initiate these update calls.The
validate_request
methodTo validate a request, we need to
If
validate_request
passes, we can continue validation on the execution state.