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

fix: wrong returned gas used and handler crash in debug APIs #276

Merged
merged 2 commits into from
May 24, 2023

Conversation

minh-bq
Copy link
Contributor

@minh-bq minh-bq commented May 17, 2023

  • fix: wrong returned gas used of system transaction in debug

When using debug APIs, system transaction goes through ApplyMessage which
currently accounts for instrinsicGas and refund while normal flow through
Finalize/FinalizeAndAssemble does not. This commit adds an IsSystemTransaction to
evm's config, when system transaction goes through ApplyMessage, turn on this
flag so that gasUsed does not account for intrinsicGas and refund.

  • eth/tracers: fix flatCallTracer crasher

FlatCallTracer had a crasher when it was passed onlyTopCall: true as config.
This PR ignores config fields inherited from the normal call tracer.

When using debug APIs, system transaction goes through ApplyMessage which
currently accounts for instrinsicGas and refund while normal flow through
Finalize/FinalizeAndAssemble does not. This commit adds an IsSystemTransaction to
evm's config, when system transaction goes through ApplyMessage, turn on this
flag so that gasUsed does not account for intrinsicGas and refund.
@minh-bq minh-bq requested a review from DNK90 May 17, 2023 07:37
FlatCallTracer had a crasher when it was passed `onlyTopCall: true` as config.
This PR ignores config fields inherited from the normal call tracer.
@minh-bq minh-bq merged commit a6dd8e4 into axieinfinity:master May 24, 2023
@minh-bq minh-bq deleted the fix/tracer branch May 24, 2023 07:17
andicrypt pushed a commit to andicrypt/ronin that referenced this pull request Nov 1, 2023
…inity#276)

* fix: wrong returned gas used of system transaction in debug APIs

When using debug APIs, system transaction goes through ApplyMessage which
currently accounts for instrinsicGas and refund while normal flow through
Finalize/FinalizeAndAssemble does not. This commit adds an IsSystemTransaction to
evm's config, when system transaction goes through ApplyMessage, turn on this
flag so that gasUsed does not account for intrinsicGas and refund.

* eth/tracers: fix flatCallTracer crasher (#27304)

FlatCallTracer had a crasher when it was passed `onlyTopCall: true` as config.
This PR ignores config fields inherited from the normal call tracer.
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.

2 participants