debug trace alignment: storage encoding#10117
Merged
macfarla merged 7 commits intobesu-eth:mainfrom Mar 27, 2026
Merged
Conversation
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Contributor
There was a problem hiding this comment.
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.errorfromString[]to nullableStringin 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. |
.../api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java
Show resolved
Hide resolved
.../api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java
Show resolved
Hide resolved
...main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogWithError.java
Show resolved
Hide resolved
...main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogWithError.java
Show resolved
Hide resolved
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
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.
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:
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests