Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

fix(native): ensure buckets use valid references #202

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading