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

chore: make artificially shortened executions count as successes #3204

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

joonazan
Copy link
Contributor

Currently, successful validations are reported as reverts, which is super confusing.

Why this is safe:

  • TracerExecutionStopReason::Finished is only emitted on success, Errors always emit Abort instead
  • Some of the removed code was just dead code. self.result was checked twice.

I'd rather fix the strange behaviour than emulate it to make ShadowVm line up.

@joonazan
Copy link
Contributor Author

Turns out that TracerExecutionStopReason::Finished is produced when a transaction ends even though the tracer can't know at that point if the bootloader ran out of gas before finishing the whole thing. In that case the old code that reports "maybe out of gas" is correct but we need to run it only in that special case.

I'm not sure what the best way to accomplish that is. We could maybe change TracerExecutionStopReason to have a success, failure and tx ended variant. I think I prefer giving DefaultExecutionTracer enough info to be able to detect failure.

Also, it would be nice if the bootloader had "did not finish" as the default value of the result instead of failure.

@joonazan
Copy link
Contributor Author

I ended up with a pretty hacky fix. I would have preferred to make the validation tracer tell the result tracer that there has been no out of gas but that isn't done as easily.

perekopskiy
perekopskiy previously approved these changes Oct 31, 2024
slowli
slowli previously approved these changes Oct 31, 2024
Copy link
Contributor

@slowli slowli left a comment

Choose a reason for hiding this comment

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

Also, it would be nice if the bootloader had "did not finish" as the default value of the result instead of failure.

Wouldn't help with historical bootloader versions (IIUC, they may be used in the oneshot executor).

@joonazan joonazan dismissed stale reviews from slowli and perekopskiy via 42c0220 October 31, 2024 12:05
@joonazan joonazan requested a review from slowli October 31, 2024 12:06
@joonazan joonazan added this pull request to the merge queue Oct 31, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 31, 2024
@joonazan joonazan added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit f1328c0 Oct 31, 2024
33 checks passed
@joonazan joonazan deleted the jms-tracer-finish-is-success branch October 31, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants