Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(consensus): global substates in dedicated shard #1269

Conversation

ksrichard
Copy link
Collaborator

@ksrichard ksrichard commented Jan 28, 2025

Description

We reserve a specific shard (0) for all the global substates, so regardless of which shard it would be in calculated from it's address, we use the hardcoded shard.

Motivation and Context

When a node loses all of its data or behind a lot the tip of chain, then it synchronizes the chain, but in this case we do not have the templates all the time as a substates as it is not guaranteed that templates shard is falling into the shard group's range (where the actual VN is).

How Has This Been Tested?

Scenarios

New VN added to swarm

  1. Start a local swarm with 15 members
  2. Create a new account in DAN wallet (http://127.0.0.1:12038/ in this setup)
  3. Deploy a new template to the local network
    Using CLI (example):
$ tari deploy --account acc counter -y                                                                                                                                                                                                                                                                                      
✅ Init configuration and directories
✅ Refresh project templates repository
✅ Refresh wasm templates repository
✅ Building WASM template project "counter"
✅ Deploying project "counter" to local network
⭐ Your new template's address: 443c620320c79aa3ed89f559f54a42986718b0c7089bddcc3561b5efed06da13
  1. Check if template presents on VNs (just check some randomly from both committees)
  2. Add a new VN by clicking Add VN on swarm UI (http://127.0.0.1:8080/)
  3. Mine (using Mine button on the same UI on top) until new epoch and new VN is available
  4. Check if the template is synced to the new VN

VN gets out of sync / loose data

  1. Start a local swarm with 15 members
  2. Create a new account in DAN wallet (http://127.0.0.1:12038/ in this setup)
  3. Deploy a new template to the local network
    Using CLI (example):
$ tari deploy --account acc counter -y                                                                                                                                                                                                                                                                                      
✅ Init configuration and directories
✅ Refresh project templates repository
✅ Refresh wasm templates repository
✅ Building WASM template project "counter"
✅ Deploying project "counter" to local network
⭐ Your new template's address: 443c620320c79aa3ed89f559f54a42986718b0c7089bddcc3561b5efed06da13
  1. Check if template presents on VNs (just check some randomly from both committees)
  2. Select a VN which is not in the 0-X shard group and make sure the template presents as well on the VN
  3. Mine until next epoch
  4. Delete data of the VN by clicking on Delete Data button at the VN (it will stop the VN as well)
  5. Start VN again and check if it catches up and contains the template

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

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

Copy link

github-actions bot commented Jan 28, 2025

Test Results (CI)

619 tests  +25   610 ✅ +16   3h 36m 19s ⏱️ + 2h 3m 17s
 68 suites +13     0 💤 ± 0 
  2 files   + 1     9 ❌ + 9 

For more details on these failures, see this check.

Results for commit 794c646. ± Comparison against base commit ddc4632.

♻️ This comment has been updated with latest results.

@ksrichard ksrichard marked this pull request as ready for review January 28, 2025 14:03
ksrichard and others added 2 commits January 29, 2025 08:57
…-shard

* development:
  fix(consensus)!: remove substate value when substate is DOWN (tari-project#1274)
  feat(consensus): skip to local accept phase for aborted transactions (tari-project#1273)
  chore: update package.json for wallet client (tari-project#1272)
  chore: update package.json for wallet client (tari-project#1271)
  feat!: accumulate leader fees in substate, impl claim fees in wallet (tari-project#1270)
@sdbondi sdbondi force-pushed the feature/global-substates-in-dedicated-shard branch from cff9c40 to 12a5487 Compare February 6, 2025 13:35
sdbondi
sdbondi previously approved these changes Feb 6, 2025
@sdbondi sdbondi enabled auto-merge February 6, 2025 13:37
sdbondi
sdbondi previously approved these changes Feb 6, 2025
@sdbondi sdbondi force-pushed the feature/global-substates-in-dedicated-shard branch from fb943fd to a062dea Compare February 7, 2025 04:55
sdbondi
sdbondi previously approved these changes Feb 7, 2025
sdbondi
sdbondi previously approved these changes Feb 7, 2025
sdbondi
sdbondi previously approved these changes Feb 7, 2025
@sdbondi sdbondi added this pull request to the merge queue Feb 7, 2025
Merged via the queue into tari-project:development with commit 6e1e4e5 Feb 7, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants