-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
vgorkavenko
approved these changes
Mar 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.