Skip to content

debug trace alignment: storage encoding#10117

Merged
macfarla merged 7 commits intobesu-eth:mainfrom
macfarla:fix/debug-trace-storage-error
Mar 27, 2026
Merged

debug trace alignment: storage encoding#10117
macfarla merged 7 commits intobesu-eth:mainfrom
macfarla:fix/debug-trace-storage-error

Conversation

@macfarla
Copy link
Copy Markdown
Contributor

  • memory words and storage keys/values are 0x prefixed and left-padded to 32 bytes per the execution-apis opcode tracer spec.
  • error type is String rather than String[] with a single element
    Refs debug RPC endpoints standardization #10115 - addresses 2,4

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

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
  • hive tests: Engine or other RPCs modified?

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Copilot AI review requested due to automatic review settings March 27, 2026 03:10
@macfarla macfarla added the RPC label Mar 27, 2026
@macfarla macfarla changed the title Fix/debug trace storage error debug trace alignement: storage encoding Mar 27, 2026
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

Updates debug trace output formatting to match the execution-apis opcode tracer spec (32-byte, 0x-prefixed storage keys/values) and adjusts the error field to serialize as a single string.

Changes:

  • Normalize storage keys/values in struct logs and trace JSON fixtures to 0x-prefixed, left-padded 32-byte hex.
  • Add a helper (toBytes32Hex) used for storage formatting.
  • Change StructLogWithError.error from String[] to nullable String in JSON output.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java Formats storage entries as bytes32 hex via new helper.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogWithError.java Changes JSON error field type from array to string and omits when null.
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java Updates expectations for new storage encoding.
ethereum/api/src/test/resources/.../debug_traceBlock_default.json Updates expected trace storage encoding to bytes32 hex.
ethereum/api/src/test/resources/.../debug_traceBlock_disableMemory.json Updates expected trace storage encoding to bytes32 hex.
ethereum/api/src/test/resources/.../debug_traceBlock_disableStack.json Updates expected trace storage encoding to bytes32 hex.

@macfarla macfarla changed the title debug trace alignement: storage encoding debug trace alignment: storage encoding Mar 27, 2026
@macfarla macfarla self-assigned this Mar 27, 2026
@macfarla macfarla removed their assignment Mar 27, 2026
Copy link
Copy Markdown
Contributor

@usmansaleem usmansaleem 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 macfarla merged commit 4790c97 into besu-eth:main Mar 27, 2026
46 checks passed
@macfarla macfarla deleted the fix/debug-trace-storage-error branch March 27, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants