Skip to content

Commit 1bc3da5

Browse files
committed
fix
1 parent f8e7e87 commit 1bc3da5

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

core/state/state_sizer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ func (t *SizeTracker) iterateTable(closed chan struct{}, prefix []byte, name str
535535
iter := t.db.NewIterator(prefix, nil)
536536
defer iter.Release()
537537

538-
log.Info("Iterating state", "category", name)
538+
log.Debug("Iterating state", "category", name)
539539
for iter.Next() {
540540
count++
541541
bytes += int64(len(iter.Key()) + len(iter.Value()))
@@ -557,7 +557,7 @@ func (t *SizeTracker) iterateTable(closed chan struct{}, prefix []byte, name str
557557
log.Error("Iterator error", "category", name, "err", err)
558558
return 0, 0, err
559559
}
560-
log.Info("Finished state iteration", "category", name, "count", count, "size", common.StorageSize(bytes), "elapsed", common.PrettyDuration(time.Since(start)))
560+
log.Debug("Finished state iteration", "category", name, "count", count, "size", common.StorageSize(bytes), "elapsed", common.PrettyDuration(time.Since(start)))
561561
return count, bytes, nil
562562
}
563563

core/state/state_sizer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestSizeTracker(t *testing.T) {
6262

6363
state.AddBalance(addr2, uint256.NewInt(2000), tracing.BalanceChangeUnspecified)
6464
state.SetNonce(addr2, 2, tracing.NonceChangeUnspecified)
65-
state.SetCode(addr2, []byte{0x60, 0x80, 0x60, 0x40, 0x52})
65+
state.SetCode(addr2, []byte{0x60, 0x80, 0x60, 0x40, 0x52}, tracing.CodeChangeUnspecified)
6666

6767
state.AddBalance(addr3, uint256.NewInt(3000), tracing.BalanceChangeUnspecified)
6868
state.SetNonce(addr3, 3, tracing.NonceChangeUnspecified)
@@ -92,7 +92,7 @@ func TestSizeTracker(t *testing.T) {
9292
}
9393

9494
if i%3 == 0 {
95-
newState.SetCode(testAddr, []byte{byte(i), 0x60, 0x80, byte(i + 1), 0x52})
95+
newState.SetCode(testAddr, []byte{byte(i), 0x60, 0x80, byte(i + 1), 0x52}, tracing.CodeChangeUnspecified)
9696
}
9797

9898
root, _, err := newState.CommitWithUpdate(blockNum, true, false)
@@ -160,7 +160,7 @@ func TestSizeTracker(t *testing.T) {
160160
}
161161

162162
if i%3 == 0 {
163-
newState.SetCode(testAddr, []byte{byte(i), 0x60, 0x80, byte(i + 1), 0x52})
163+
newState.SetCode(testAddr, []byte{byte(i), 0x60, 0x80, byte(i + 1), 0x52}, tracing.CodeChangeUnspecified)
164164
}
165165

166166
root, update, err := newState.CommitWithUpdate(blockNum, true, false)

eth/api_debug.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -458,17 +458,17 @@ func (api *DebugAPI) StateSize() (interface{}, error) {
458458
}
459459

460460
return map[string]interface{}{
461-
"stateRoot": stats.StateRoot,
462-
"blockNumber": hexutil.Uint64(stats.BlockNumber),
463-
"accounts": hexutil.Uint64(stats.Accounts),
464-
"accountBytes": hexutil.Uint64(stats.AccountBytes),
465-
"storages": hexutil.Uint64(stats.Storages),
466-
"storageBytes": hexutil.Uint64(stats.StorageBytes),
467-
"accountTrienodes": hexutil.Uint64(stats.AccountTrienodes),
468-
"accountTrienodeBytes": hexutil.Uint64(stats.AccountTrienodeBytes),
469-
"storageTrienodes": hexutil.Uint64(stats.StorageTrienodes),
470-
"storageTrienodeBytes": hexutil.Uint64(stats.StorageTrienodeBytes),
471-
"contractCodes": hexutil.Uint64(stats.ContractCodes),
472-
"contractCodeBytes": hexutil.Uint64(stats.ContractCodeBytes),
461+
"stateRoot": stats.StateRoot,
462+
"blockNumber": hexutil.Uint64(stats.BlockNumber),
463+
"accounts": hexutil.Uint64(stats.Accounts),
464+
"accountBytes": hexutil.Uint64(stats.AccountBytes),
465+
"storages": hexutil.Uint64(stats.Storages),
466+
"storageBytes": hexutil.Uint64(stats.StorageBytes),
467+
"accountTrienodes": hexutil.Uint64(stats.AccountTrienodes),
468+
"accountTrienodeBytes": hexutil.Uint64(stats.AccountTrienodeBytes),
469+
"storageTrienodes": hexutil.Uint64(stats.StorageTrienodes),
470+
"storageTrienodeBytes": hexutil.Uint64(stats.StorageTrienodeBytes),
471+
"contractCodes": hexutil.Uint64(stats.ContractCodes),
472+
"contractCodeBytes": hexutil.Uint64(stats.ContractCodeBytes),
473473
}, nil
474474
}

0 commit comments

Comments
 (0)