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

rpcdaemon: add STOP opcode as last opcode in specific success cases #2262

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

lupin012
Copy link
Contributor

@lupin012 lupin012 commented Aug 23, 2024

Synthesise OP_STOP as last opcode in trace and debug API if execution is successful and last opcode executed is NOT in [OP_SELFDESTRUCT, OP_RETURN, OP_STOP]

@canepat canepat self-requested a review August 26, 2024 10:22
@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Aug 26, 2024
@canepat canepat changed the title rpcdaemon: add STOP opcode as last opcode, if last opcode is not STOP/SELDESTRUC… rpcdaemon: add STOP opcode as last opcode in specific success cases Aug 26, 2024
@canepat canepat marked this pull request as ready for review August 26, 2024 10:23
@@ -778,6 +780,23 @@ void VmTraceTracer::on_execution_end(const evmc_result& result, const silkworm::
}
break;
}

/* EVM WA: EVMONE add OP_STOP at the end of tx if not present but doesn't notify to the tracer. Add sw to add STOP to the op list */
if (result.status_code == EVMC_SUCCESS && last_opcode_ && last_opcode_ != OP_SELFDESTRUCT && last_opcode_ != OP_RETURN && last_opcode_ != OP_STOP) {
Copy link
Member

Choose a reason for hiding this comment

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

I suggest extracting this condition in a dedicated function not to repeat it twice. Next PR is fine

@canepat canepat merged commit b15f938 into master Aug 26, 2024
5 checks passed
@canepat canepat deleted the add_stop_on_last_opcode branch August 26, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants