This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
Incorrect stateDiff in trace_replaytransaction #6520
Labels
F2-bug 🐞
The client fails to follow expected behavior.
M4-core ⛓
Core client code / Rust.
M6-rpcapi 📣
RPC API.
P5-sometimesoon 🌲
Issue is worth doing soon.
Milestone
Problem:
The problem relates to the trace_replaytransaction RPC call.
If A has balance 1000 and B has balance 1000, there are two storage keys with both a value of 1000 in the storage of the contract. In theory, if A sends 500 tokens to B, there should be a stateDiff like this:
But what I get is this:
The
from
fields are incorrectReal on chain example (for TX 0xbba6a...):
The above Tx has the following ethon:msgPayload:
The token contract is Account
0x5e575279bf9f4acf0a130c186861454247394c06
this means that Account
0x2730826691bb0e970ef1608d5a3b944c29db7ed5
sends12637381652300000000000
Golem units to Account0x2730826691bb0e970ef1608d5a3b944c29db7ed5
.As can be seen here (line 32), the token contract that is the ethon:to of the ethon:Tx uses a `mapping (address => uint256) balances;) for storing the golem token
If account
0x5e575279bf9f4acf0a130c186861454247394c06
successfully sends something, its balance cannot be 0 before the transfer. However, in the stateDiff it is:Here is the full result of
curl --data '{"method":"trace_replayTransaction","params":["0xbba6a4ca0ee856f6d0cab991e60fcade2db2b5745b6afee321b899dd37eedd80",["trace","stateDiff"]],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
https://gist.github.com/jo-tud/8efbe903e81f7271ffc79d8b133ddac2
The text was updated successfully, but these errors were encountered: