From 1cd89976aa5e2568a626a2993e1d1bdaaec8a7b6 Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 12 Sep 2024 10:49:44 +0800 Subject: [PATCH] Problem: estimates map can't write in parallel (#15) Solution: - change to slice --- mvmemory.go | 2 +- stm.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mvmemory.go b/mvmemory.go index 600315d..16fb612 100644 --- a/mvmemory.go +++ b/mvmemory.go @@ -31,7 +31,7 @@ func NewMVMemory( func NewMVMemoryWithEstimates( block_size int, stores map[storetypes.StoreKey]int, - storage MultiStore, scheduler *Scheduler, estimates map[int]MultiLocations, + storage MultiStore, scheduler *Scheduler, estimates []MultiLocations, ) *MVMemory { data := make([]MVStore, len(stores)) for key, i := range stores { diff --git a/stm.go b/stm.go index faa9424..313e419 100644 --- a/stm.go +++ b/stm.go @@ -30,7 +30,7 @@ func ExecuteBlockWithEstimates( stores map[storetypes.StoreKey]int, storage MultiStore, executors int, - estimates map[int]MultiLocations, // txn -> multi-locations + estimates []MultiLocations, // txn -> multi-locations txExecutor TxExecutor, ) error { if executors < 0 {