core, light, tests, trie: add state metrics (#23433)

This commit is contained in:
gary rong
2021-08-25 03:00:42 +08:00
committed by GitHub
parent a789dcc978
commit a5a5237178
15 changed files with 131 additions and 75 deletions

View File

@@ -217,7 +217,7 @@ func (c *ChtIndexerBackend) Process(ctx context.Context, header *types.Header) e
// Commit implements core.ChainIndexerBackend
func (c *ChtIndexerBackend) Commit() error {
root, err := c.trie.Commit(nil)
root, _, err := c.trie.Commit(nil)
if err != nil {
return err
}
@@ -454,7 +454,7 @@ func (b *BloomTrieIndexerBackend) Commit() error {
b.trie.Delete(encKey[:])
}
}
root, err := b.trie.Commit(nil)
root, _, err := b.trie.Commit(nil)
if err != nil {
return err
}

View File

@@ -125,9 +125,9 @@ func (t *odrTrie) TryDelete(key []byte) error {
})
}
func (t *odrTrie) Commit(onleaf trie.LeafCallback) (common.Hash, error) {
func (t *odrTrie) Commit(onleaf trie.LeafCallback) (common.Hash, int, error) {
if t.trie == nil {
return t.id.Root, nil
return t.id.Root, 0, nil
}
return t.trie.Commit(onleaf)
}