Skip to content

cmd/evm: rename t8n args to improve clarity when tracing#23934

Merged
holiman merged 3 commits into
ethereum:masterfrom
lightclient:fix-t8n-trace-defaults
Nov 24, 2021
Merged

cmd/evm: rename t8n args to improve clarity when tracing#23934
holiman merged 3 commits into
ethereum:masterfrom
lightclient:fix-t8n-trace-defaults

Conversation

@lightclient

Copy link
Copy Markdown
Member

Apologizes for another PR - my new commits weren't coming through in #23933.

Okay I misunderstood the meaning of the args tracer.nomemory and tracer.noreturndata. I understand now that it is preferred that memory and return data are not printed by default. Given this, I think the flag name are confusing. I didn't realize until looking deeply into this that --tracer.nomemory=false is a valid argument. I would've assumed the flag did not take a value and was a simple on/off switch, and therefore assumed the correct default behavior for these values should be on. Others have also encountered this.

For these reasons, I propose renaming them to tracer.memory and tracer.returndata to avoid the double-negative flag tracer.nomemory=false.

@holiman

holiman commented Nov 22, 2021

Copy link
Copy Markdown
Contributor

Yeah, this is obviously the preferred approach, and we would have done that if we weren't so averse to making API changes. The "proper" way to do this is to have both flags in parallel for a while, and print an error message when the deprecated (nomemory) flag is used.

@lightclient lightclient force-pushed the fix-t8n-trace-defaults branch from f6b7759 to 95b2a38 Compare November 22, 2021 15:26
@lightclient

Copy link
Copy Markdown
Member Author

Good point @holiman. I added the flags back and marked them as deprecated. I also decided to return an error if the flags are used in a conflicting manner. Not sure you handle situations in the past, but I can remove if you prefer.

@holiman

holiman commented Nov 23, 2021

Copy link
Copy Markdown
Contributor

Please add a printout whenever the deprecated flag is used, telling the user to use the new format instead.

@holiman holiman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@holiman holiman added this to the 1.10.13 milestone Nov 24, 2021
@holiman holiman merged commit 0a7672f into ethereum:master Nov 24, 2021
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Nov 24, 2021
)

* cmd/evm: rename t8n args to improve clarity when tracing

* cmd/evm: add back removed tracing flags and note that they are deprecated

* cmd/evm: add warning when using deprecated flag

@WEEDAVIE1990 WEEDAVIE1990 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cmd/evm/main.go

yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
)

* cmd/evm: rename t8n args to improve clarity when tracing

* cmd/evm: add back removed tracing flags and note that they are deprecated

* cmd/evm: add warning when using deprecated flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants