input-output-hk / mithril

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

Store block range roots in db #1650

Closed Alenar closed 4 months ago

Alenar commented 4 months ago

Content

This PR add block range root (aka a BlockRange and it's associated transactions merkle root) computation and storage.

This step is added to the CardanoTransactionImporter of signer & aggregator nodes after the import of the transactions.

Other changes:

Pre-submit checklist

Issue(s)

Closes #1633

github-actions[bot] commented 4 months ago

Test Results

    3 files  ± 0     43 suites  ±0   8m 16s :stopwatch: -15s   972 tests +44    972 :white_check_mark: +44  0 :zzz: ±0  0 :x: ±0  1 066 runs  +44  1 066 :white_check_mark: +44  0 :zzz: ±0  0 :x: ±0 

Results for commit b0decd81. ± Comparison against base commit 86c172ce.

This pull request removes 15 and adds 59 tests. Note that renamed tests count towards both. ``` mithril-aggregator ‑ database::repository::cardano_transaction_repository::tests::repository_store_transactions_doesnt_erase_existing_data mithril-aggregator ‑ services::cardano_transactions_importer::tests::if_all_half_are_stored_the_other_half_is_parsed_and_stored mithril-aggregator ‑ services::cardano_transactions_importer::tests::if_all_stored_nothing_is_parsed_and_stored mithril-aggregator ‑ services::cardano_transactions_importer::tests::importing_twice_starting_with_nothing_in_a_real_db_should_yield_the_transactions_in_same_order mithril-common ‑ cardano_transaction_parser::tests::test_instantiate_parser_with_allow_unparsable_block_should_log_warning mithril-common ‑ cardano_transaction_parser::tests::test_instantiate_parser_without_allow_unparsable_block_should_not_log_warning mithril-common ‑ cardano_transaction_parser::tests::test_parse_expected_number_of_transactions mithril-common ‑ cardano_transaction_parser::tests::test_parse_from_lower_bound_until_upper_bound mithril-common ‑ cardano_transaction_parser::tests::test_parse_should_error_with_unparsable_block_format mithril-common ‑ cardano_transaction_parser::tests::test_parse_should_log_error_with_unparsable_block_format … ``` ``` mithril-aggregator ‑ database::record::block_range_root::tests::hydrate_fail_if_invalid_block_range_in_row mithril-aggregator ‑ database::record::block_range_root::tests::hydrate_succeed_if_valid_block_range_in_row mithril-aggregator ‑ database::record::interval_without_block_range_root::tests::db_with_both_block_range_and_transactions_yield_a_range mithril-aggregator ‑ database::record::interval_without_block_range_root::tests::db_with_last_transaction_block_number_below_the_end_of_the_last_block_range_yield_an_error mithril-aggregator ‑ database::record::interval_without_block_range_root::tests::db_with_last_transaction_block_number_right_at_the_end_of_the_last_block_range_yield_none mithril-aggregator ‑ database::record::interval_without_block_range_root::tests::db_with_only_block_range_and_no_transactions_yield_none mithril-aggregator ‑ database::record::interval_without_block_range_root::tests::db_with_only_transactions_yield_a_range mithril-aggregator ‑ database::record::interval_without_block_range_root::tests::db_without_block_range_nor_transactions_yield_none mithril-aggregator ‑ database::repository::cardano_transaction_repository::tests::repository_get_block_interval_without_block_range_root mithril-aggregator ‑ database::repository::cardano_transaction_repository::tests::repository_get_transactions_in_range_blocks … ```

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