Skip to content

implement kirills suggestion fix#830

Merged
EugeneDrpc merged 2 commits into
masterfrom
fix-crazy-lowerbounds
May 15, 2026
Merged

implement kirills suggestion fix#830
EugeneDrpc merged 2 commits into
masterfrom
fix-crazy-lowerbounds

Conversation

@EugeneDrpc
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 calling updateLowerBound, 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 to mockito-kotlin mock.

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.

@EugeneDrpc EugeneDrpc force-pushed the fix-crazy-lowerbounds branch from a1a6d7e to 366a2f8 Compare May 15, 2026 13:57
@EugeneDrpc EugeneDrpc merged commit 6bf8680 into master May 15, 2026
1 check passed
@EugeneDrpc EugeneDrpc deleted the fix-crazy-lowerbounds branch May 15, 2026 14:05
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.

4 participants