Skip to content

feat: Soft failure reason for evm op results#9109

Merged
usmansaleem merged 8 commits intobesu-eth:mainfrom
usmansaleem:soft_failure_op_result_2
Aug 26, 2025
Merged

feat: Soft failure reason for evm op results#9109
usmansaleem merged 8 commits intobesu-eth:mainfrom
usmansaleem:soft_failure_op_result_2

Conversation

@usmansaleem
Copy link
Copy Markdown
Contributor

PR description

Add Soft failure reason for evm op results. This will help in tracer implementations such as call tracer which need soft failure reasons.

** New File:**
SoftFailureReason

Main Modifications:

org.hyperledger.besu.evm.operation.Operation
org.hyperledger.besu.evm.operation.AbstractCallOperation#execute

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Copy link
Copy Markdown
Contributor

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

This PR introduces a soft failure reason mechanism for EVM operation results to help tracer implementations distinguish between different types of failures that don't halt execution.

  • Adds a new SoftFailureReason interface with predefined failure types
  • Enhances OperationResult to include optional soft failure reason information
  • Updates AbstractCallOperation to set specific soft failure reasons for insufficient balance and max call depth scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
SoftFailureReason.java New interface defining soft failure reasons with default implementations
Operation.java Enhanced OperationResult to include optional SoftFailureReason field
AbstractCallOperation.java Updated to set soft failure reasons for balance and depth check failures

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: Usman Saleem <usman@usmans.info>
Copy link
Copy Markdown
Contributor

@Gabriel-Trintinalia Gabriel-Trintinalia left a comment

Choose a reason for hiding this comment

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

LGTM

@macfarla
Copy link
Copy Markdown
Contributor

what is a soft failure?

@usmansaleem
Copy link
Copy Markdown
Contributor Author

@macfarla soft failures doesn't cause a revert or transaction to fail. For example, not enough balance or if calls depth is more than 1024. A good example of "soft failure" is https://github.com/hyperledger/besu/blob/main/evm/src/main/java/org/hyperledger/besu/evm/operation/AbstractExtCallOperation.java#L206 as well.

@usmansaleem usmansaleem merged commit 7fa3c55 into besu-eth:main Aug 26, 2025
46 checks passed
@usmansaleem usmansaleem deleted the soft_failure_op_result_2 branch August 26, 2025 07:00
siladu pushed a commit to siladu/besu that referenced this pull request Aug 28, 2025
Add soft failure reasons for evm operation results.

Signed-off-by: Usman Saleem <usman@usmans.info>
jflo pushed a commit to jflo/besu that referenced this pull request Sep 8, 2025
Add soft failure reasons for evm operation results.

Signed-off-by: Usman Saleem <usman@usmans.info>
jflo pushed a commit to jflo/besu that referenced this pull request Sep 8, 2025
Add soft failure reasons for evm operation results.

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: jflo <justin+github@florentine.us>
georgereuben pushed a commit to georgereuben/besu that referenced this pull request Sep 16, 2025
Add soft failure reasons for evm operation results.

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: georgereuben <reubengeorge101@gmail.com>
georgereuben pushed a commit to georgereuben/besu that referenced this pull request Sep 16, 2025
Add soft failure reasons for evm operation results.

Signed-off-by: Usman Saleem <usman@usmans.info>
Signed-off-by: georgereuben <reubengeorge101@gmail.com>
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