From f5100a2a1df1ffe451dc33c1f86234d32cb3c16d Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Fri, 5 Apr 2024 12:58:29 +1100 Subject: [PATCH] fix(events): order entries by insertion order when selecting Fixes: https://github.com/filecoin-project/lotus/issues/11823 --- chain/events/filter/index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain/events/filter/index.go b/chain/events/filter/index.go index d3dd1a085..e04a403bc 100644 --- a/chain/events/filter/index.go +++ b/chain/events/filter/index.go @@ -557,7 +557,7 @@ func (ei *EventIndex) prefillFilter(ctx context.Context, f *eventFilter, exclude s = s + " WHERE " + strings.Join(clauses, " AND ") } - s += " ORDER BY event.height DESC" + s += " ORDER BY event.height DESC, event_entry._rowid_ ASC" stmt, err := ei.db.Prepare(s) if err != nil {