Skip to content
Merged
Changes from 1 commit
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: 5 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"maps"
"slices"
"sort"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -264,6 +265,10 @@ func (s *StateDB) Logs() []*types.Log {
for _, lgs := range s.logs {
logs = append(logs, lgs...)
}
// Due to the map iteration is not stable, we need to sort the logs by TxIndex, then the LogsHash result is stable.
sort.Slice(logs, func(i, j int) bool {
return logs[i].TxIndex < logs[j].TxIndex
})
return logs
}

Expand Down
Loading