tari-project / tari-dan

BSD 3-Clause "New" or "Revised" License
7 stars 16 forks source link

feat!: state checkpoint sync, fixes, epoch change #1067

Closed sdbondi closed 2 months ago

sdbondi commented 3 months ago

Description

feat: adds state sync fix: remove block sync feat: start new chain at each epoch fix: fixes bug that drops consensus messages (inbound messaging not cancel safe) fix: scope JMT to epoch/shard fix: only emit epoch changed event once scanning to tip has completed fix: swarm mines more initial blocks when registering many vns fix: bug that caused block signature to disappear after unparking the block feat: adds state checkpoint call test: fix epoch change and state sync cucumbers

Motivation and Context

State sync fetches state transitions and applies them to the local state db. Syncing historical blocks is not feasible across changing shards/epochs and this is removed in this PR.

Closes #1070 Closes #1037

Outstanding items:

How Has This Been Tested?

Manually:

  1. 2 validators, mine to next epoch
  2. 2 validators, send transactions, delete data of one vn and resync
  3. 4 validators, delete data from one validator, leader failures, epoch change, resync validator
  4. [TODO] new validator joining network
  5. [TODO] multishard test

What process can a PR reviewer use to test or verify this change?

Swarm, mine to next epoch

Breaking Changes

github-actions[bot] commented 3 months ago

Test Results (CI)

543 tests  +3   543 :white_check_mark: +4   2h 17m 47s :stopwatch: - 10m 24s  64 suites ±0     0 :zzz: ±0    2 files   ±0     0 :x:  - 1 

Results for commit b92c808a. ± Comparison against base commit c3608c36.

This pull request removes 3 and adds 6 tests. Note that renamed tests count towards both. ``` Scenario: EpochEnd and EpochStart commands are used on epoch change: tests/features/epoch_change.feature:8:3 Scenario: New validator node registers and syncs: tests/features/block_sync.feature:7:3 tari_dan_storage ‑ consensus_models::command::export_bindings_epochevent ``` ``` Scenario: EndEpoch command is used on epoch change: tests/features/epoch_change.feature:8:3 Scenario: New validator node registers and syncs: tests/features/state_sync.feature:7:3 consensus_tests ‑ consensus::deferred_input_conflict consensus_tests ‑ consensus::epoch_change consensus_tests ‑ consensus::inputs_depend_on_outputs_multishard tari_dan_storage ‑ consensus_models::state_transition::tests::to_and_from_bytes ```

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