From 651ae291dc0e1cd992ba24e7b709b92d748f7e87 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Wed, 28 Feb 2024 20:05:04 +0800 Subject: [PATCH] triedb/pathdb: address comment --- triedb/pathdb/nodebuffer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/triedb/pathdb/nodebuffer.go b/triedb/pathdb/nodebuffer.go index 3cab27abae..8f84c2b442 100644 --- a/triedb/pathdb/nodebuffer.go +++ b/triedb/pathdb/nodebuffer.go @@ -214,7 +214,7 @@ func (b *nodebuffer) allocBatch(db ethdb.KeyValueStore) ethdb.Batch { metasize += len(nodes) * (len(rawdb.TrieNodeStoragePrefix) + common.HashLength) // database key prefix + owner } } - return db.NewBatchWithSize(int(float64(uint64(metasize)+b.size) * 1.1)) // extra 10% for potential pebble internal stuff + return db.NewBatchWithSize((metasize + int(b.size)) * 11 / 10) // extra 10% for potential pebble internal stuff } // flush persists the in-memory dirty trie node into the disk if the configured