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

PrestateTracer returns wrong balance for tx sender #20537

Closed
s1na opened this issue Jan 9, 2020 · 0 comments · Fixed by #22038
Closed

PrestateTracer returns wrong balance for tx sender #20537

s1na opened this issue Jan 9, 2020 · 0 comments · Fixed by #22038
Assignees

Comments

@s1na
Copy link
Contributor

s1na commented Jan 9, 2020

The prestateTracer reverts the value transfer of a transaction in result:

this.prestate[toHex(ctx.to)].balance = '0x'+toBal.subtract(ctx.value).toString(16);
this.prestate[toHex(ctx.from)].balance = '0x'+fromBal.add(ctx.value).toString(16);

But it doesn't revert the gas bought here:

st.state.SubBalance(st.msg.From(), mgval)

and therefore returns the tx sender's balance - (gasPrice * gasLimit).

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 a pull request may close this issue.

2 participants