From 86d757d905b4ae06afc2a59ed8769d16c12838b2 Mon Sep 17 00:00:00 2001 From: aaronbuchwald Date: Fri, 25 Aug 2023 15:42:25 -0400 Subject: [PATCH] core/state/snapshot: increase batch size during diffToDisk (#816) --- core/state/snapshot/snapshot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index ae1cd73a30..519be4c581 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -635,7 +635,7 @@ func diffToDisk(bottom *diffLayer) (*diskLayer, bool, error) { // Ensure we don't delete too much data blindly (contract can be // huge). It's ok to flush, the root will go missing in case of a // crash and we'll detect and regenerate the snapshot. - if batch.ValueSize() > ethdb.IdealBatchSize { + if batch.ValueSize() > 64*1024*1024 { if err := batch.Write(); err != nil { log.Crit("Failed to write storage deletions", "err", err) } @@ -661,7 +661,7 @@ func diffToDisk(bottom *diffLayer) (*diskLayer, bool, error) { // Ensure we don't write too much data blindly. It's ok to flush, the // root will go missing in case of a crash and we'll detect and regen // the snapshot. - if batch.ValueSize() > ethdb.IdealBatchSize { + if batch.ValueSize() > 64*1024*1024 { if err := batch.Write(); err != nil { log.Crit("Failed to write storage deletions", "err", err) }