diff --git a/CHANGELOG.md b/CHANGELOG.md index f7b8f972a27..56421ef500c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Upgrade go-f3 to 0.7.1 to resolve Tipset not found errors when trying to establish instance start time ([filecoin-project/lotus#12651](https://github.com/filecoin-project/lotus/pull/12651)). - Try harder in the F3 participation loop to participate using the same lotus node ([filecoin-project/lotus#12664](https://github.com/filecoin-project/lotus/pull/12664)). - The mining loop will now correctly "stick" to the same upstream lotus node for all operations pertaining to mining a single block ([filecoin-project/lotus#12665](https://github.com/filecoin-project/lotus/pull/12665)). +- Make the ordering of event output for `eth_` APIs and `GetActorEventsRaw` consistent, sorting ascending on: epoch, message index, event index and original event entry order. ([filecoin-project/lotus#12623](https://github.com/filecoin-project/lotus/pull/12623)) ## Deps diff --git a/chain/index/events.go b/chain/index/events.go index 0a1836f7b96..a1eb84a4280 100644 --- a/chain/index/events.go +++ b/chain/index/events.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "math" - "sort" "strings" "github.com/ipfs/go-cid" @@ -418,10 +417,6 @@ func (si *SqliteIndexer) GetEventsForFilter(ctx context.Context, f *EventFilter) return nil, nil } - // collected event list is in inverted order since we selected only the most recent events - // sort it into height order - sort.Slice(ces, func(i, j int) bool { return ces[i].Height < ces[j].Height }) - return ces, nil } @@ -597,6 +592,6 @@ func makePrefillFilterQuery(f *EventFilter) ([]any, string, error) { } // retain insertion order of event_entry rows - s += " ORDER BY tm.height DESC, ee._rowid_ ASC" + s += " ORDER BY tm.height ASC, tm.message_index ASC, e.event_index ASC, ee._rowid_ ASC" return values, s, nil }