feat: configurable max slot deep count #276
Merged
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.
Add a new
CL_API_MAX_SLOT_DEEP_COUNT
env variable that specifies a maximum number of slots that the app uses to find a not missed consensus-layer slot.Previously, this number was hard-coded in the appropriate constant in the
ConsensusProviderService
. As after the Pectra hardfork on Holeksy blocks became proposed significantly more rarely than usual, it became possible not to have any proposed blocks in the closest 32 slots, and so, the app gave up trying to find the closed proposed block and threw the error.Now it is possible to configure this depth for cases like we see now on Holesky and extend this depth to any necessary value. So the app can look deeper into the slots chain and find the next (or previous) proposed block.
Also, some minor refactoring has been done in the
ConsensusProviderService
and fixed incorrect numbers in the error message that is shown when the app cannot find the closest proposed block. Previously in case of such errors, the error message always looked like "Error when trying to get next not missed block header. From N to N" because of the recursive call.