Skip to content

fix(consensus)!: use jmt crate - #1472

Draft
sdbondi wants to merge 6 commits into
tari-project:developmentfrom
sdbondi:consensus-state-jmt
Draft

fix(consensus)!: use jmt crate #1472
sdbondi wants to merge 6 commits into
tari-project:developmentfrom
sdbondi:consensus-state-jmt

Conversation

@sdbondi

@sdbondi sdbondi commented Jun 23, 2025

Copy link
Copy Markdown
Member

Description

Motivation and Context

How Has This Been Tested?

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

@sdbondi

sdbondi commented Jun 23, 2025

Copy link
Copy Markdown
Member Author

On hold for now due to the amount of work involved, the JMT restoration procedure is different and will require a rethink for state sync.

@github-actions

github-actions Bot commented Jun 23, 2025

Copy link
Copy Markdown

Test Results (CI)

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit dadd07e.

♻️ This comment has been updated with latest results.

@sdbondi
sdbondi force-pushed the consensus-state-jmt branch from 2641069 to ade9321 Compare June 23, 2025 07:05
sdbondi added a commit that referenced this pull request Aug 13, 2025
Description
---
fix(state_sync)!: sync state version

Motivation and Context
---
The shard state version is now synchronised across validators. However,
this invariant is not enforced by consensus.
A future PR (or the change to the JMT #1472) may enforce this in future.

This is the first part that enables clients to periodically sync state
changes using a (shard, state_version) tuple.

How Has This Been Tested?
---
Manually by deleting a validator node's data and restarting it,
observing sync logs and checking the database against the sync node

What process can a PR reviewer use to test or verify this change?
---
Sync should work as before

Breaking Changes
---

- [ ] None
- [x] Requires data directory to be deleted
- [ ] Other - Please specify

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- New Features
- State transitions now include a version, enabling more robust syncing
and auditing.
- State sync processes per-version batches with a defined maximum batch
size, improving performance and stability.

- Refactor
- Streamlined state-sync flow with clearer progress and completion
logging.

- Chores
- RPC protocol updated; legacy state-sync messages removed. Ensure peers
are upgraded for compatibility.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@sdbondi
sdbondi force-pushed the consensus-state-jmt branch from ade9321 to 8e511ec Compare August 15, 2025 05:21
@coderabbitai

coderabbitai Bot commented Aug 15, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sdbondi
sdbondi force-pushed the consensus-state-jmt branch from 8e511ec to e16f3d2 Compare August 15, 2025 05:21
* development: (141 commits)
  fix(db-inspector): improve state tree table (tari-project#1693)
  fix(epoch-oracle): greatly reduce base layer epoch sync times (tari-project#1692)
  docs: add readme for running individual cuke tests (tari-project#1691)
  chore: v0.17.0 (tari-project#1690)
  chore: update tari_crypto in libp2p fork (tari-project#1689)
  fix(consensus)!: re-request foreign proposals after timeout + other fixes (tari-project#1687)
  fix(swarm): remove signalling server (tari-project#1688)
  refactor: remove validator node cli (tari-project#1684)
  chore: delete unneeded crates (tari-project#1685)
  fix(indexer): improve cache handling and clean up (tari-project#1686)
  docs: add vn cli docs (tari-project#1683)
  fix: remove expect on close connection (tari-project#1679)
  fix: remove another expect (tari-project#1681)
  chore: don't show warning on first start (tari-project#1677)
  fix(consensus): correct request value flags for sync (tari-project#1682)
  fix(consensus): more explicit vote equivocation detection (tari-project#1676)
  chore(deps): bump actions/download-artifact from 6 to 7 (tari-project#1675)
  chore(deps): bump actions/upload-artifact from 5 to 6 (tari-project#1674)
  feat(wallet): use mmap to read value lookup file (tari-project#1673)
  feat(engine): implement template upgrades/migrations (tari-project#1671)
  ...
* development: (21 commits)
  chore(deps): bump react-router and react-router-dom in /applications/tari_swarm_daemon/webui (tari-project#1716)
  chore: move state store tests (tari-project#1718)
  fix(consensus)!: fix determinism bug in current epoch (tari-project#1715)
  fix(engine): reduce memory for WASM calls + ensure threads disable (tari-project#1717)
  fix(engine): makes CreateAccount instruction idempotent (tari-project#1714)
  fix(consensus)!: single byte entity ID + fixes (tari-project#1708)
  fix: upgrade notify (fixes tari-project#1200) (tari-project#1710)
  fix(ci): remove nightly-2025-06-25 cargo check (tari-project#1709)
  chore(deps): bump rsa from 0.9.8 to 0.9.10 (tari-project#1704)
  fix(epochoracle): remove base layer only function from oracle trait (tari-project#1707)
  refactor(indexer/client): minor improvement to API consistency (tari-project#1706)
  fix: cargo fmt (tari-project#1705)
  chore: remove unused deps, update webrtc (tari-project#1703)
  chore: rename typescript-bindings to ootle-ts-bindings (tari-project#1701)
  fix!: correct typescript type for ExtraData (tari-project#1702)
  fix(cucumber): fixes over faucet max errors & vn not reg (tari-project#1699)
  fix: replace json5 with serde_json5 (fix tari-project#1648) (tari-project#1700)
  fix(template_builtin): adds liquidity pool template with tests (tari-project#1697)
  fix: change cucumber_log to macro to get proper line numbers (tari-project#1696)
  fix: add list-headers to grpc for cucumber (tari-project#1695)
  ...
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.

2 participants