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

eth/tracers: Add support for REVERT/SELFDESTRUCT in evmdis_tracer #24016

Merged
merged 3 commits into from Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions eth/tracers/js/internal/tracers/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions eth/tracers/js/internal/tracers/evmdis_tracer.js
Expand Up @@ -71,12 +71,12 @@
opinfo["ops"] = [];
this.stack.push(opinfo);
break;
case "RETURN":
case "RETURN": case "REVERT":
Copy link
Contributor

Choose a reason for hiding this comment

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

This tracer is also using SUICIDE, as opposed to SELFDESTRUCT -- I think this tracer is kind of bitrotted. Also, it was written to be used along with disasm (https://github.com/Arachnid/evmdis ) which hasn't been updated since 2018.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I was going to submit a PR renaming SUICIDE in multiple places, but decided to put a stop to creating new PRs for now 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed this instance of suicide here.

var out = log.stack.peek(0).valueOf();
var outsize = log.stack.peek(1).valueOf();
frame.return = log.memory.slice(out, out + outsize);
break;
case "STOP": case "SUICIDE":
case "STOP": case "SELFDESTRUCT":
frame.return = log.memory.slice(0, 0);
break;
case "JUMPDEST":
Expand Down