-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Description
System information
Geth version: 1.11.5
CL client & version: e.g. lighthouse@v4.1.0
OS & Version: Linux
Expected behaviour
When calling debug_traceCall
with a transaction, I should receive a diff which shows me all changes made to storage when this tx is executed
Actual behaviour
When a storage slot is zeroed OR unchanged it is not included in the post
output. There appears to be no way to disambiguate these two cases.
Steps to reproduce the behaviour
Check https://etherscan.io/tx/0x5ca691b0415722b95b596b2cfd45cee7572540e456accd8478445e40c86ab778#statechange
For the frxETH token, we can see that two storage slots were changed- one increased and one is zeroed.
When I check the trace output of this call:
❯ cat trace.json | jq '.result.pre."0x5e8422345238f34275888049021821e8e08caa1f".storage'
{
"0x1a7ad90a4b0c412d59e4127bd2d2f5276514c60aee7c77da0d8c2b326ef7c489": "0x000000000000000000000000000000000000000000000ae7e214f3a3b33f4e37",
"0xb953595e5003b3f7c54e53b6f59502915a6d381e159e09dbe5056b4bfbdaca80": "0x000000000000000000000000000000000000000000000002b2926891c6ddd518"
}
❯ cat trace.json | jq '.result.post."0x5e8422345238f34275888049021821e8e08caa1f".storage'
{
"0x1a7ad90a4b0c412d59e4127bd2d2f5276514c60aee7c77da0d8c2b326ef7c489": "0x000000000000000000000000000000000000000000000aea94a75c357a1d234f"
}
There is only one slot in the post
output, showing the slot that increased. The second changed slot (which was zeroed) is not included in the output.
From #25422 (comment) I can see this change was intentional, but I don't understand how it is trivial to fix this problem given that the output gives no indication as to why the slot is not included in post
- it could either be unchanged by the tx or it could be zero'd