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!: replace utxo MMR with SMT #5854

Merged
merged 9 commits into from
Nov 2, 2023
Merged

feat!: replace utxo MMR with SMT #5854

merged 9 commits into from
Nov 2, 2023

Conversation

SWvheerden
Copy link
Collaborator

Description

This replaces the UTXO MMR and the Roaring bitmap with a single SMT.

Motivation and Context

See: tari-project/rfcs#105 as to why the SMT is the better choice.
CRoaring, the library that is used by Tari for the roaring bitmap also has a few security issues such as panicking on certain random inputs.

How Has This Been Tested?

Manual, and unit tests

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

@ghpbot-tari-project ghpbot-tari-project added the CR-too_long Changes Requested - Your PR is too long label Oct 23, 2023
@github-actions
Copy link

github-actions bot commented Oct 25, 2023

Test Results (CI)

1 240 tests   1 240 ✔️  9m 31s ⏱️
     39 suites         0 💤
       1 files           0

Results for commit dd29cfb.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Oct 25, 2023
@github-actions
Copy link

github-actions bot commented Oct 25, 2023

Test Results (Integration tests)

31 tests   31 ✔️  14m 48s ⏱️
11 suites    0 💤
  2 files      0

Results for commit dd29cfb.

♻️ This comment has been updated with latest results.

@SWvheerden SWvheerden changed the title [wip] feat!: replace utxo MMR with SMT feat!: replace utxo MMR with SMT Nov 2, 2023
@SWvheerden SWvheerden force-pushed the feature-smt branch 2 times, most recently from 5e5955b to ccf9fd6 Compare November 2, 2023 06:56
SWvheerden and others added 9 commits November 2, 2023 15:01
Description
---
This replaces the UTXO MMR and the Roaring bitmap with a single SMT. 

Motivation and Context
---
See: tari-project/rfcs#105 as to why the SMT is
the better choice.

How Has This Been Tested?
---
Manual
Description
---
Fixes rewind/reorg for sparse merkle tree
Description
---
Fixes horizon sync by selecting the correct tip smt and sending the
correct starting header

Motivation and Context
---
Horizon sync starts at height 1 technically as the node already has the
genesis block.

How Has This Been Tested?
---
Manual
Description
---
Fixes a resize issue with horizon sync mode

Motivation and Context
---
Lmdb only resizes on transactions, and not pure table changes in our
code, this changes the tip smt to always use the transactions, as this
call might be large.

How Has This Been Tested?
---
manual
Description
---
Updates the SMT branch with code review

---------

Co-authored-by: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com>
Description
---
final hazop code review for SMT
@SWvheerden SWvheerden merged commit ca74c29 into development Nov 2, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR-too_long Changes Requested - Your PR is too long P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants