Skip to content

Commit 0380e22

Browse files
committed
recordingDB: use wasmStore
1 parent 74a5816 commit 0380e22

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arbitrum/recordingdb.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ var (
3232
type RecordingKV struct {
3333
inner *trie.Database
3434
diskDb ethdb.KeyValueStore
35+
wasmDb ethdb.KeyValueStore
3536
readDbEntries map[common.Hash][]byte
3637
enableBypass bool
3738
}
3839

39-
func newRecordingKV(inner *trie.Database, diskDb ethdb.KeyValueStore) *RecordingKV {
40-
return &RecordingKV{inner, diskDb, make(map[common.Hash][]byte), false}
40+
func newRecordingKV(inner *trie.Database, diskDb ethdb.KeyValueStore, wasmDb ethdb.KeyValueStore) *RecordingKV {
41+
return &RecordingKV{inner, diskDb, wasmDb, make(map[common.Hash][]byte), false}
4142
}
4243

4344
func (db *RecordingKV) Has(key []byte) (bool, error) {
@@ -57,10 +58,10 @@ func (db *RecordingKV) Get(key []byte) ([]byte, error) {
5758
res, err = db.diskDb.Get(key)
5859
} else if ok, _ := rawdb.IsActivatedAsmKey(key); ok {
5960
// Arbitrum: the asm is non-consensus
60-
return db.diskDb.Get(key)
61+
return db.wasmDb.Get(key)
6162
} else if ok, _ := rawdb.IsActivatedModuleKey(key); ok {
6263
// Arbitrum: the module is non-consensus (only its hash is)
63-
return db.diskDb.Get(key)
64+
return db.wasmDb.Get(key)
6465
} else {
6566
err = fmt.Errorf("recording KV attempted to access non-hash key %v", hex.EncodeToString(key))
6667
}
@@ -273,7 +274,7 @@ func (r *RecordingDatabase) PrepareRecording(ctx context.Context, lastBlockHeade
273274
}
274275
finalDereference := lastBlockHeader // dereference in case of error
275276
defer func() { r.Dereference(finalDereference) }()
276-
recordingKeyValue := newRecordingKV(r.db.TrieDB(), r.db.DiskDB())
277+
recordingKeyValue := newRecordingKV(r.db.TrieDB(), r.db.DiskDB(), r.db.WasmStore())
277278

278279
recordingStateDatabase := state.NewDatabase(rawdb.NewDatabase(recordingKeyValue))
279280
var prevRoot common.Hash

0 commit comments

Comments
 (0)