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

improve: AttestationStatusWatch::next_batch_to_attest non-optional (BFT-496) #165

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Jul 31, 2024

What ❔

AttestationStatusWatch must be initialised with a BatchNumber, it cannot have None any more. AttestationStatusRunner::new was replaced with the AttestationStatusRunner::init method which asynchronously polls the API until the first value is returned, and then returns itself along with the AttestationStatusWatch it created. This can then be passed to the Executor, while the AttestationStatusRunner::run will keep the status up to date in the background.

Why ❔

In the review of #161 it was observed that the Executor can wait until this data is available. In theory it is only unavailable if the main node API is down, in which case an external node couldn't pull Genesis either and would probably fail during startup, or if the Genesis itself is still under construction in the database, which is a transient state under which an external node as mentioned would not start, and apparently the main node doesn't need the Executor to get over it. By removing None as an option for next_batch_to_attest the state is easier to reason about.

@aakoshh aakoshh requested a review from pompon0 as a code owner July 31, 2024 14:12
@aakoshh aakoshh changed the title improve: AttestationStatusWatch cannot have None improve: AttestationStatusWatch::next_batch_to_attest non-optional (BFT-496) Jul 31, 2024
@aakoshh aakoshh marked this pull request as draft July 31, 2024 14:17
@aakoshh aakoshh marked this pull request as ready for review July 31, 2024 14:24
@aakoshh aakoshh merged commit 638b23e into main Jul 31, 2024
5 checks passed
@aakoshh aakoshh deleted the bft-496-no-none-in-status branch July 31, 2024 14:44
brunoffranca pushed a commit that referenced this pull request Aug 2, 2024
## What ❔

`AttestationRunner::init` should not try to initialise the
`AttestationStatus` from the API. Let it be `None` and do the init in
the background.

This is partially undoing what
#165 did.

## Why ❔

The rollout procedure to mainnet was that the EN goes first, then the
main node. The EN cannot start without the main node API.
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

Successfully merging this pull request may close these issues.

2 participants