Skip to content

Commit

Permalink
fix snapshot reverts (#183)
Browse files Browse the repository at this point in the history
* fixed potential wrong logs

Co-authored-by: lmittmann <[email protected]>
  • Loading branch information
lmittmann and lmittmann committed Aug 22, 2024
1 parent 54aeeda commit 1a5b458
Show file tree
Hide file tree
Showing 17 changed files with 9,949 additions and 6,122 deletions.
6,885 changes: 6,885 additions & 0 deletions w3vm/testdata/w3vm/1_15049997.json

Large diffs are not rendered by default.

2,909 changes: 2,909 additions & 0 deletions w3vm/testdata/w3vm/1_15049998.json

Large diffs are not rendered by default.

5,023 changes: 0 additions & 5,023 deletions w3vm/testdata/w3vm/1_15054997.json

This file was deleted.

975 changes: 0 additions & 975 deletions w3vm/testdata/w3vm/1_15054998.json

This file was deleted.

13 changes: 11 additions & 2 deletions w3vm/testdata/w3vm/1_18999999.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -564,7 +564,16 @@
"0x3cf9e625387a35863280e064db9b57c0cf8013d2": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0",
"0x3": "0x0",
"0x4": "0x0",
"0x6564f0f61db94b028346b448c3cfd5686e858cca9b9024dc372e3a5d3df93a30": "0x0",
"0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5": "0x0",
"0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x0",
"0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0": "0x0"
}
},
"0x3d60b5990a58f59798462ec644af57b3c0d0fb08": {
"nonce": "0x3a",
Expand Down
2 changes: 1 addition & 1 deletion w3vm/testdata/w3vm/1_19000000.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down
7 changes: 5 additions & 2 deletions w3vm/testdata/w3vm/1_19000001.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -2589,7 +2589,10 @@
"0xd3d67d7e406b56bf0c2ecd65cbbd78bef698e0db": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0"
}
},
"0xd46557dcd77c874ef7e516af6f26e6e79c831a8e": {
"nonce": "0x1",
Expand Down
7 changes: 5 additions & 2 deletions w3vm/testdata/w3vm/1_19000002.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -2509,7 +2509,10 @@
"0xd11453dd8f6ef02f472b358adefee93259b41cf5": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0"
}
},
"0xd19d4b5d358258f05d7b411e21a1460d11b0876f": {
"nonce": "0x1",
Expand Down
18 changes: 15 additions & 3 deletions w3vm/testdata/w3vm/1_19000003.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -360,7 +360,10 @@
"0x2256256526d0c615bd36cae5f3f4a074e4d84ccf": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0"
}
},
"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599": {
"nonce": "0x1",
Expand Down Expand Up @@ -2013,7 +2016,16 @@
"0xacc0ad1a43696b24008703b5c5f0efb07f4d6cec": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0",
"0x2": "0x0",
"0x3": "0x0",
"0x4": "0x0",
"0x7": "0x0",
"0x8": "0x0",
"0x9": "0x0"
}
},
"0xae7ab96520de3a18e5e111b5eaab095312d7fe84": {
"nonce": "0x1",
Expand Down
14 changes: 11 additions & 3 deletions w3vm/testdata/w3vm/1_19000004.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -1993,7 +1993,10 @@
"0xa3fef2777e17619cfbadf95c00def0c90d0d604d": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0"
}
},
"0xa478c80868ee5910ef116b4602e03afa37c61bad": {
"nonce": "0x91",
Expand Down Expand Up @@ -2199,7 +2202,12 @@
"0xb408cc5e16de613c89d873ce82f743ac5d90b67d": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0",
"0x33": "0x0",
"0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50": "0x0"
}
},
"0xb4b0ea46fe0e9e8eab4afb765b527739f2718671": {
"nonce": "0x1",
Expand Down
13 changes: 11 additions & 2 deletions w3vm/testdata/w3vm/1_19000005.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -3026,7 +3026,16 @@
"0xd63d5e1ee237af770d4fa529ac815c0dc6e53275": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0",
"0x2": "0x0",
"0x3": "0x0",
"0x4": "0x0",
"0x7": "0x0",
"0x8": "0x0",
"0x9": "0x0"
}
},
"0xd8a287c82b4ace763582ceef09222dee7bcd4140": {
"nonce": "0x1e2",
Expand Down
2 changes: 1 addition & 1 deletion w3vm/testdata/w3vm/1_19000006.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down
25 changes: 21 additions & 4 deletions w3vm/testdata/w3vm/1_19000007.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down Expand Up @@ -168,7 +168,10 @@
"0x0ccf1cd9bf101d2690818878bcd16d0ef8d2ddee": {
"nonce": "0x0",
"balance": "0x263162b5d20ed3",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0"
}
},
"0x0dfba37c5dc1149be766f3b7fd25ee3eda087f1b": {
"nonce": "0x670",
Expand Down Expand Up @@ -1068,7 +1071,12 @@
"0x45e7899634140f3b490d0d5e8315cebdd62d5093": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0",
"0x1": "0x0",
"0x3": "0x0"
}
},
"0x46340b20830761efd32832a74d7169b29feb9758": {
"nonce": "0x9d90b6",
Expand Down Expand Up @@ -1641,7 +1649,16 @@
"0x7a94e3038b29b99fde0925fa3263aeb38b51e3b6": {
"nonce": "0x0",
"balance": "0x0",
"code": "0x"
"code": "0x",
"storage": {
"0x0": "0x0",
"0x2": "0x0",
"0x3": "0x0",
"0x4": "0x0",
"0x7": "0x0",
"0x8": "0x0",
"0x9": "0x0"
}
},
"0x7ac070f096c6e20931c3dc54f927446be232618b": {
"nonce": "0x1",
Expand Down
2 changes: 1 addition & 1 deletion w3vm/testdata/w3vm/1_19000008.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d34e0decbe79293ca5",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x0000000000000000000000000000000000000001": {
Expand Down
2 changes: 1 addition & 1 deletion w3vm/testdata/w3vm/1_19999999.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"accounts": {
"0x0000000000000000000000000000000000000000": {
"nonce": "0x0",
"balance": "0x2d48a339d420097f171",
"balance": "0x2d4df65069095449d6f",
"code": "0x"
},
"0x43506849d7c04f9138d1a2050bbf3a0c054402dd": {
Expand Down
2 changes: 1 addition & 1 deletion w3vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func (v *VM) apply(msg *w3types.Message, isCall bool, hooks *tracing.Hooks) (*Re

var txHash common.Hash
binary.BigEndian.PutUint64(txHash[:], v.txIndex)
v.db.SetTxContext(txHash, int(v.txIndex))
v.txIndex++
v.db.SetTxContext(txHash, 0)

gp := new(core.GasPool).AddGas(coreMsg.GasLimit)
evm := vm.NewEVM(*v.opts.blockCtx, *txCtx, v.db, v.opts.chainConfig, vm.Config{
Expand Down
Loading

0 comments on commit 1a5b458

Please sign in to comment.