diff --git a/core/state/statedb.go b/core/state/statedb.go index 3f55b8fb27..809a3a31b7 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -21,6 +21,7 @@ import ( "fmt" "maps" "math/big" + "slices" "sort" "time" @@ -205,6 +206,9 @@ func (s *StateDB) Logs() []*types.Log { for _, lgs := range s.logs { logs = append(logs, lgs...) } + slices.SortFunc(logs, func(a, b *types.Log) int { + return int(a.Index) - int(b.Index) + }) return logs }