input-output-hk / mithril

Stake-based threshold multi-signatures protocol
https://mithril.network
Apache License 2.0
116 stars 36 forks source link

Consistent transactions sort #1672

Closed Alenar closed 2 months ago

Alenar commented 2 months ago

Content

This PR changes the order of retrieval of the Cardano transactions from the database.

Before we used SQLite rowid but this order isn't guaranteed to be consistent across node since it depends on the order of insertion in the database. To solve this issue this PR change the order to the use the transaction block_number then its transaction_hash.

An composite index on those columns is added to ensure a fast retrieval, plus a benchmark is added to measure the retrieval performances.

Pre-submit checklist

Comments

Issue(s)

Closes #1657

github-actions[bot] commented 2 months ago

Test Results

    3 files  ±0     43 suites  ±0   8m 37s :stopwatch: +4s   979 tests +1    979 :white_check_mark: +1  0 :zzz: ±0  0 :x: ±0  1 073 runs  +1  1 073 :white_check_mark: +1  0 :zzz: ±0  0 :x: ±0 

Results for commit 24d5c95b. ± Comparison against base commit 936ffe2b.

:recycle: This comment has been updated with latest results.