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

@ -144,7 +144,7 @@ func (t *SecureTrie) GetKey(shaKey []byte) []byte {
//
// Committing flushes nodes from memory. Subsequent Get calls will load nodes
// from the database.
func (t *SecureTrie) Commit(onleaf LeafCallback) (root common.Hash, err error) {
func (t *SecureTrie) Commit(onleaf LeafCallback) (common.Hash, int, error) {
// Write all the pre-images to the actual disk database
if len(t.getSecKeyCache()) > 0 {
if t.trie.db.preimages != nil { // Ugly direct check but avoids the below write lock