Skip to content

PrestateTracer returns wrong balance for tx sender #20537

@s1na

Description

@s1na

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions