input-output-hk / mithril

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

Handle rollbacks when reading blocks from the chain #1748

Closed Alenar closed 3 weeks ago

Alenar commented 3 weeks ago

Content

This PR implement on the transaction importer rollback logic. If a Rollback event is received, the importer will:

Pre-submit checklist

Issue(s)

Closes #1724

github-actions[bot] commented 3 weeks ago

Test Results

    3 files  ± 0     44 suites  +1   8m 47s :stopwatch: -1s 1 058 tests +22  1 058 :white_check_mark: +22  0 :zzz: ±0  0 :x: ±0  1 156 runs  +22  1 156 :white_check_mark: +22  0 :zzz: ±0  0 :x: ±0 

Results for commit f7da0e6d. ± Comparison against base commit 5c692e20.

This pull request removes 7 and adds 29 tests. Note that renamed tests count towards both. ``` mithril-persistence ‑ database::query::cardano_transaction::delete_cardano_transaction::tests::test_prune_all_data_if_given_block_number_is_larger_than_stored_number_of_block mithril-persistence ‑ database::query::cardano_transaction::delete_cardano_transaction::tests::test_prune_data_of_below_given_blocks mithril-persistence ‑ database::query::cardano_transaction::delete_cardano_transaction::tests::test_prune_keep_all_tx_of_last_block_if_given_number_of_block_is_zero mithril-persistence ‑ database::query::cardano_transaction::delete_cardano_transaction::tests::test_prune_work_even_without_transactions_in_db mithril-signer::state_machine ‑ test_create_single_signature mithril-signer::state_machine ‑ test_extensions::certificate_handler::tests::register_signer mithril-signer::state_machine ‑ test_extensions::certificate_handler::tests::retrieve_pending_certificate ``` ``` mithril-aggregator ‑ services::cardano_transactions_importer::tests::when_rollbackward_should_remove_block_ranges mithril-aggregator ‑ services::cardano_transactions_importer::tests::when_rollbackward_should_remove_transactions mithril-common ‑ cardano_block_scanner::dumb_block_scanner::tests::dumb_scanned_construct_a_streamer_based_on_its_stored_chain_scanned_blocks mithril-common ‑ cardano_block_scanner::dumb_block_scanner::tests::polling_with_can_return_roll_backward mithril-common ‑ chain_observer::fake_observer::tests::test_decrease_block_number mithril-common ‑ chain_observer::fake_observer::tests::test_increase_block_number mithril-persistence ‑ database::query::block_range_root::delete_block_range_root::tests::test_keep_block_range_when_block_number_is_just_before_range_start mithril-persistence ‑ database::query::block_range_root::delete_block_range_root::tests::test_prune_all_data_if_given_block_number_is_lower_than_stored_number_of_block mithril-persistence ‑ database::query::block_range_root::delete_block_range_root::tests::test_prune_block_range_when_block_number_is_block_range_start mithril-persistence ‑ database::query::block_range_root::delete_block_range_root::tests::test_prune_block_range_when_block_number_is_in_block_range … ```

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