Unverified Commit 56d23666 authored by aaronbuchwald's avatar aaronbuchwald Committed by GitHub

core/state/snapshot: replace diffToDisk ideal batch size with 64MB (#27977)

parent 0ba2d3cf
...@@ -564,7 +564,7 @@ func diffToDisk(bottom *diffLayer) *diskLayer { ...@@ -564,7 +564,7 @@ func diffToDisk(bottom *diffLayer) *diskLayer {
// Ensure we don't delete too much data blindly (contract can be // 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 // huge). It's ok to flush, the root will go missing in case of a
// crash and we'll detect and regenerate the snapshot. // 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 { if err := batch.Write(); err != nil {
log.Crit("Failed to write storage deletions", "err", err) log.Crit("Failed to write storage deletions", "err", err)
} }
...@@ -590,7 +590,7 @@ func diffToDisk(bottom *diffLayer) *diskLayer { ...@@ -590,7 +590,7 @@ func diffToDisk(bottom *diffLayer) *diskLayer {
// Ensure we don't write too much data blindly. It's ok to flush, the // 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 // root will go missing in case of a crash and we'll detect and regen
// the snapshot. // the snapshot.
if batch.ValueSize() > ethdb.IdealBatchSize { if batch.ValueSize() > 64*1024*1024 {
if err := batch.Write(); err != nil { if err := batch.Write(); err != nil {
log.Crit("Failed to write storage deletions", "err", err) log.Crit("Failed to write storage deletions", "err", err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment