Skip to content

Commit 58f65c6

Browse files
authored
trie: copy preimage store pointer in StateTrie.Copy (#31158)
This fixes an error where executing `evm run --dump ...` omits preimages from the dump (because the statedb used for execution is a copy of another instance).
1 parent da71839 commit 58f65c6

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

cmd/evm/testdata/evmrun/3.out.1.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"root": "b444481d1367188172f8c6091e948aaa68bae763fd26d6b9e994306a66bf69f9",
33
"accounts": {
4-
"pre(0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142)": {
4+
"0x0000000000000000000000007265636569766572": {
55
"balance": "0",
66
"nonce": 0,
77
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
88
"codeHash": "0x3e48ef54b89079a075f3b8fc253c657a86b110a7aed3568c1517b10edf2c3eb6",
99
"code": "0x6040",
10+
"address": "0x0000000000000000000000007265636569766572",
1011
"key": "0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142"
1112
}
1213
}

cmd/evm/testdata/evmrun/4.out.1.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"root": "b444481d1367188172f8c6091e948aaa68bae763fd26d6b9e994306a66bf69f9",
33
"accounts": {
4-
"pre(0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142)": {
4+
"0x0000000000000000000000007265636569766572": {
55
"balance": "0",
66
"nonce": 0,
77
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
88
"codeHash": "0x3e48ef54b89079a075f3b8fc253c657a86b110a7aed3568c1517b10edf2c3eb6",
99
"code": "0x6040",
10+
"address": "0x0000000000000000000000007265636569766572",
1011
"key": "0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142"
1112
}
1213
}

trie/secure_trie.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ func (t *StateTrie) Copy() *StateTrie {
275275
trie: *t.trie.Copy(),
276276
db: t.db,
277277
secKeyCache: t.secKeyCache,
278+
preimages: t.preimages,
278279
}
279280
}
280281

0 commit comments

Comments
 (0)