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 develop branch to goerli #247

Merged
merged 8 commits into from
Mar 7, 2024
Merged

Conversation

AlexanderLukin
Copy link
Contributor

No description provided.

vgorkavenko and others added 8 commits March 5, 2024 22:51
When the support of the Dencun fork was released on Goerli, there was a
problem with nodes. The primary node was not updated properly, so, in
response to this request `eth/v1/beacon/headers/finalized` it always
returned an incorrect finalized slot that was far behind the actual
latest finalized slot. In this case, the app waited for 7 minutes and
then switched to the fallback node. The fallback node worked correctly
and returned the correct finalized slot, so, the app could process the
next epoch using the response from the fallback node. But this correct
latest slot returned by the fallback node was stored in the
`this.latestSlot`, and then, on the next worker cycle, when the app
tried to use a primary node that was not working correctly, the app
again got a slot that was far behind from the latest. The app saw that
this "latest" slot was not greater than the slot stored in the
`this.latestSlot` variable, so, the `this.latestSlot` variable was not
updated and kept storing the correct latest slot returned by the
fallback node on the previous worker cycle. Because of this fact, this
condition below
``` if (processingState.epoch <= Math.trunc(this.latestSlot.slot /
this.config.get('FETCH_INTERVAL_SLOTS')))
```
became true and the app didn't switch to the fallback node anymore. So,
the app got stuck and couldn't process the next epochs.

Now we introduce the assumption that any nodes (primary or fallback)
must never return a slot that is less than the slot that the app already
processed on the previous worker cycles. If the app sees this case, it
assumes that the node that returns such a slot is not working correctly
and switches to the fallback node.

Also the condition in this check
``` if (processingState.epoch < Math.trunc(this.latestSlot.slot /
this.config.get('FETCH_INTERVAL_SLOTS')))
```
is now changed from `<=` to `<`. This is because if the currently
processing epoch stays equal to the latest finalized epoch for a long
time (more than 7 minutes), the app should consider this situation
incorrect and switch to the fallback node.
Rename `latestSlot` local constant to `nodeLatestSlot`.
…unfinalized-case

fix: conditions for long non-changing slot in `getLatestBlockHeader`
Log an error if the node returns a slot that is less than the last
finalized slot in the chain.

Add slot number to the error message that indicates that the last slot
hasn't changed for a long time.
…t-stuck

chore: add error logging in case of wrong slot
# Conflicts:
#	src/common/consensus-provider/consensus-provider.service.ts
@AlexanderLukin AlexanderLukin merged commit 12802cc into goerli Mar 7, 2024
5 checks passed
@AlexanderLukin AlexanderLukin deleted the goerli-merge-conflict branch March 7, 2024 07:50
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