Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-7756 Trace updates #8006

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Dec 9, 2024

PR description

Update tracing for EIP-7756 changes, mostly swapping hex format and numbers for opcode and gas members.

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:

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

new StandardJsonTracer(out, showMemory, true, true, false),
// FIXME // REVIEWME do we want to change the JSON
// debug calls to use EIP-7756 values for gas and opcode?
new StandardJsonTracer(out, showMemory, true, true, false, true),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to extend this to JSON-RPC calls? Currently this only impacts CLI tools (and those have a CLI override flag).

Copy link
Contributor

@lu-pinto lu-pinto Mar 24, 2025

Choose a reason for hiding this comment

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

I think having current behaviour with EIP-3155 is what makes most sense for RPC given that EIP-7756 is backwards incompatible with the current format. We have seen users complain about non conformity with other clients so any slight deviation is a problem. For instance EIP-7756 makes gasCost a number instead of an Hex string and makes op a Hex number which was previously a number.

It's best to go with no changes to RPC right now and we can just remove that flag once EOF goes in.

@shemnon shemnon force-pushed the eip-7756/gas-as-numbers branch from 1470a95 to 338e491 Compare December 15, 2024 04:02
@shemnon shemnon marked this pull request as draft December 15, 2024 04:07
Copy link

github-actions bot commented Feb 2, 2025

This pr is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Feb 2, 2025
@shemnon shemnon force-pushed the eip-7756/gas-as-numbers branch from 4a767bc to d656bdd Compare February 2, 2025 07:11
@github-actions github-actions bot removed the Stale label Feb 3, 2025
Update tracing for EIP-7756 changes, mostly swapping hex format and
numbers for opcode and gas members.

Signed-off-by: Danno Ferrin <[email protected]>
EIP-3155 and EIP-7756 call for "stateRoot" where we use "postHash".

Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
@shemnon shemnon force-pushed the eip-7756/gas-as-numbers branch from d656bdd to 21d844a Compare February 18, 2025 15:50
Copy link

This pr is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Mar 21, 2025
@@ -199,6 +199,13 @@ void setBytes(final String optionValue) {
scope = INHERIT)
final Boolean showJsonAlloc = false;

@Option(
names = {"--eip-3155", "--trace.eip-3155"},
Copy link
Contributor

@lu-pinto lu-pinto Mar 24, 2025

Choose a reason for hiding this comment

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

I'm not even sure if it's not worth having the default unchanged and adding a flag to display EIP-7756 style. That feels more natural to me since this PR is going into main.

EDIT: this EIP is actually backwards incompatible so another reason to leave the defaults as is.

if (eip3155strict) {
sb.append("\"op\":").append(opcode).append(",");
} else {
sb.append("\"op\":\"").append(fastHexByte(opcode)).append("\",");
Copy link
Contributor

@lu-pinto lu-pinto Mar 24, 2025

Choose a reason for hiding this comment

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

Correct me if I'm wrong but fastHexByte is the same as "0x" + Integer.toHexString(opcode) why not use JDK features?

@lu-pinto lu-pinto removed the Stale label Mar 24, 2025
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