From 2c34a6d3869bd72f74cd46263434f438de321f7c Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Tue, 19 Nov 2024 15:24:05 +0530 Subject: [PATCH] Changes based on PR comments --- core/state/statedb.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 9a5a6ee8f..acdad2048 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1342,11 +1342,14 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er s.arbExtraData.activatedWasms = make(map[common.Hash]ActivatedWasm) } - if wasmCodeWriter.ValueSize() > 0 { - if err := wasmCodeWriter.Write(); err != nil { - log.Crit("Failed to commit dirty stylus codes", "error", err) + workers.Go(func() error { + if wasmCodeWriter.ValueSize() > 0 { + if err := wasmCodeWriter.Write(); err != nil { + log.Crit("Failed to commit dirty stylus codes", "error", err) + } } - } + return nil + }) // Wait for everything to finish and update the metrics if err := workers.Wait(); err != nil { return common.Hash{}, err