Skip to content

Commit

Permalink
state: apply storage barrier for debug purpose storage trie builder
Browse files Browse the repository at this point in the history
  • Loading branch information
qianbin committed Jul 14, 2021
1 parent b0cbe48 commit 93468d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,13 @@ func (s *State) BuildStorageTrie(addr thor.Address) (*muxdb.Trie, error) {

trie := s.db.NewSecureTrie(StorageTrieName(thor.Blake2b(addr[:])), root)

barrier := s.getStorageBarrier(addr)

// traverse journal to filter out storage changes for addr
s.sm.Journal(func(k, v interface{}) bool {
switch key := k.(type) {
case storageKey:
if key.addr == addr {
if key.barrier == barrier && key.addr == addr {
err = saveStorage(trie, key.key, v.(rlp.RawValue))
if err != nil {
return false
Expand Down

0 comments on commit 93468d8

Please sign in to comment.