Skip to content

Commit 7569de3

Browse files
committed
reset
1 parent 6542227 commit 7569de3

File tree

4 files changed

+8
-74
lines changed

4 files changed

+8
-74
lines changed

core/state/statedb.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,11 +1464,3 @@ func (s *StateDB) Witness() *stateless.Witness {
14641464
func (s *StateDB) AccessEvents() *AccessEvents {
14651465
return s.accessEvents
14661466
}
1467-
1468-
func (s *StateDB) BeginTrieDepthWindow() {
1469-
trie.StateDepthMetricsStartBlock()
1470-
}
1471-
1472-
func (s *StateDB) EndTrieDepthWindow() {
1473-
trie.StateDepthMetricsEndBlock()
1474-
}

core/state_processor.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
6464
allLogs []*types.Log
6565
gp = new(GasPool).AddGas(block.GasLimit())
6666
)
67-
// Start the trie depth metrics window
68-
statedb.BeginTrieDepthWindow()
69-
defer statedb.EndTrieDepthWindow()
7067

7168
// Mutate the block and state according to any hard-fork specs
7269
if p.config.DAOForkSupport && p.config.DAOForkBlock != nil && p.config.DAOForkBlock.Cmp(block.Number()) == 0 {

trie/trie.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"bytes"
2222
"errors"
2323
"fmt"
24-
"slices"
2524

2625
"github.com/ethereum/go-ethereum/common"
2726
"github.com/ethereum/go-ethereum/core/types"
@@ -330,10 +329,6 @@ func (t *Trie) update(key, value []byte) error {
330329

331330
func (t *Trie) insert(n node, prefix, key []byte, value node) (bool, node, error) {
332331
if len(key) == 0 {
333-
if t.owner == (common.Hash{}) {
334-
stateDepthAggregator.record(int64(len(prefix)))
335-
}
336-
337332
if v, ok := n.(valueNode); ok {
338333
return !bytes.Equal(v, value.(valueNode)), value, nil
339334
}
@@ -476,7 +471,10 @@ func (t *Trie) delete(n node, prefix, key []byte) (bool, node, error) {
476471
// always creates a new slice) instead of append to
477472
// avoid modifying n.Key since it might be shared with
478473
// other nodes.
479-
return true, &shortNode{slices.Concat(n.Key, child.Key), child.Val, t.newFlag()}, nil
474+
if t.owner == (common.Hash{}) {
475+
stateDepthAggregator.record(int64(len(prefix) + len(key)))
476+
}
477+
return true, &shortNode{concat(n.Key, child.Key...), child.Val, t.newFlag()}, nil
480478
default:
481479
return true, &shortNode{n.Key, child, t.newFlag()}, nil
482480
}
@@ -533,7 +531,10 @@ func (t *Trie) delete(n node, prefix, key []byte) (bool, node, error) {
533531
// Replace the entire full node with the short node.
534532
// Mark the original short node as deleted since the
535533
// value is embedded into the parent now.
536-
t.opTracer.onDelete(append(prefix, byte(pos)))
534+
t.tracer.onDelete(append(prefix, byte(pos)))
535+
if t.owner == (common.Hash{}) {
536+
stateDepthAggregator.record(int64(len(prefix) + 1))
537+
}
537538

538539
k := append([]byte{byte(pos)}, cnode.Key...)
539540
return true, &shortNode{k, cnode.Val, t.newFlag()}, nil

trie/trie_metrics.go

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)