implement kirills suggestion fix#830
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a safety check in EthereumLowerBoundErrorHandler to skip lower-bound updates when the parsed tag exceeds the upstream's current head height (or when head height is unknown), preventing erroneous bound updates from malformed/oversized tag values (e.g. the referenced Base prod incident). Tests are updated accordingly.
Changes:
- Compare parsed tag against
upstream.getHead().getCurrentHeight()before callingupdateLowerBound, with warn logs for skip cases. - Add unit tests for both new skip conditions (parsed exceeds head, head height null), plus a regression test for a Base incident value in the state handler.
- Update existing tests to mock
Upstream.getHead()via a helper, and switch tomockito-kotlinmock.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/kotlin/io/emeraldpay/dshackle/upstream/error/EthereumLowerBoundErrorHandler.kt | Guards updateLowerBound with head-height check and adds warning logs. |
| src/test/kotlin/io/emeraldpay/dshackle/upstream/error/EthereumStateLowerBoundErrorHandlerTest.kt | Adds skip-condition tests and a Base-incident regression test; introduces mockUpstreamWithHead helper. |
| src/test/kotlin/io/emeraldpay/dshackle/upstream/error/EthereumTraceLowerBoundErrorHandlerTest.kt | Adds skip-condition tests and a mockUpstreamWithHead helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a1a6d7e to
366a2f8
Compare
KirillPamPam
approved these changes
May 15, 2026
a10zn8
approved these changes
May 15, 2026
This file contains hidden or 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
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.