tari-project / tari-dan

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

feat(consensus)!: implement preshards and shard groups #1092

Closed sdbondi closed 2 months ago

sdbondi commented 2 months ago

Description

feat!(consensus): implement preshards and shard groups Implement JMT for each shard.

Motivation and Context

Divide the shard space into a number of preshards. Each VN committee is responsible for a group (1 or more) preshards.

How Has This Been Tested?

Existing tests, updated Substate address unit tests, manually

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

Look at the shard group in the database, and check the shared state_tree table

Breaking Changes

BREAKING CHANGE: sharding model changed and not backward compatible

github-actions[bot] commented 2 months ago

Test Results (CI)

555 tests  +8   555 :white_check_mark: +8   1h 30m 19s :stopwatch: - 29m 22s  65 suites ±0     0 :zzz: ±0    2 files   ±0     0 :x: ±0 

Results for commit 42029e79. ± Comparison against base commit 0ff6cbf2.

This pull request removes 1 and adds 9 tests. Note that renamed tests count towards both. ``` tari_dan_common_types ‑ substate_address::tests::shard_range ``` ``` tari_dan_common_types ‑ num_preshards::export_bindings_numpreshards tari_dan_common_types ‑ shard_group::export_bindings_shardgroup tari_dan_common_types ‑ shard_group::tests::encode_decode tari_dan_common_types ‑ shard_group::tests::to_substate_address_range tari_dan_common_types ‑ substate_address::tests::shard_group_to_substate_address_range::it_works tari_dan_common_types ‑ substate_address::tests::to_shard_group::it_returns_the_correct_shard_group tari_dan_common_types ‑ substate_address::tests::to_shard_group::it_returns_the_correct_shard_group_for_odd_num_committees tari_dan_common_types ‑ substate_address::tests::to_shard_group::it_returns_the_correct_shard_group_generic tari_state_tree::test ‑ hash_allows_putting_in_same_version ```

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