Skip to content

Commit

Permalink
fix(native): ensure buckets use valid references
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk-3 committed Dec 19, 2024
1 parent 8963e3a commit ea7061e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fhevm-engine/fhevm-go-native/fhevm/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,13 @@ func (dbApi *EvmStorageComputationStore) InsertComputationBatch(evmStorage Chain
// his ciphertexts to be evaluated
buckets := make(map[int64][]*ComputationToInsert)
// index the buckets
for _, comp := range computations {
for ind, comp := range computations {
if buckets[comp.CommitBlockId] == nil {
buckets[comp.CommitBlockId] = make([]*ComputationToInsert, 0)
}
buckets[comp.CommitBlockId] = append(buckets[comp.CommitBlockId], &comp)
buckets[comp.CommitBlockId] = append(buckets[comp.CommitBlockId], &computations[ind])
}

// collect all their keys and sort because golang doesn't traverse map
// in deterministic order
allKeys := make([]int, 0)
Expand Down

0 comments on commit ea7061e

Please sign in to comment.