Skip to content

Commit 13baa25

Browse files
committed
feat(consensus)!: implements state merkle root
1 parent 9a9bd6e commit 13baa25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4066
-707
lines changed

.license.ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
./dan_layer/storage_sqlite/src/global/schema.rs
77
./dan_layer/state_store_sqlite/src/schema.rs
88
./dan_layer/wallet/storage_sqlite/src/schema.rs
9-
./scripts/env_sample
9+
./scripts/env_sample

Cargo.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ members = [
2626
"dan_layer/p2p",
2727
"dan_layer/rpc_state_sync",
2828
"dan_layer/state_store_sqlite",
29+
"dan_layer/state_tree",
2930
"dan_layer/storage_lmdb",
3031
"dan_layer/storage_sqlite",
3132
"dan_layer/storage",
@@ -87,6 +88,7 @@ tari_networking = { path = "networking/core" }
8788
tari_rpc_framework = { path = "networking/rpc_framework" }
8889
tari_rpc_macros = { path = "networking/rpc_macros" }
8990
tari_state_store_sqlite = { path = "dan_layer/state_store_sqlite" }
91+
tari_state_tree = { path = "dan_layer/state_tree" }
9092
tari_swarm = { path = "networking/swarm" }
9193
tari_template_abi = { version = "0.3.0", path = "dan_layer/template_abi" }
9294
tari_template_builtin = { path = "dan_layer/template_builtin" }

bindings/src/types/Account.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* // Copyright 2024 The Tari Project
3+
* // SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
16
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
27
import type { SubstateId } from "./SubstateId";
38

bindings/src/types/Claims.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* // Copyright 2024 The Tari Project
3+
* // SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
16
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
27
import type { JrpcPermissions } from "./JrpcPermissions";
38

bindings/src/types/JrpcPermission.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* // Copyright 2024 The Tari Project
3+
* // SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
16
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
27
import type { ComponentAddress } from "./ComponentAddress";
38
import type { ResourceAddress } from "./ResourceAddress";

bindings/src/types/JrpcPermissions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* // Copyright 2024 The Tari Project
3+
* // SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
16
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
27
import type { JrpcPermission } from "./JrpcPermission";
38

bindings/src/types/TransactionStatus.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* // Copyright 2024 The Tari Project
3+
* // SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
16
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
27

38
export type TransactionStatus =

dan_layer/common_types/src/hasher.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ impl TariHasher {
4545
}
4646

4747
pub fn result(self) -> FixedHash {
48-
let hash: [u8; 32] = self.hasher.finalize().into();
49-
hash.into()
48+
self.finalize_into_array().into()
49+
}
50+
51+
pub fn finalize_into_array(self) -> [u8; 32] {
52+
self.hasher.finalize().into()
5053
}
5154

5255
fn hash_writer(&mut self) -> impl Write + '_ {

dan_layer/consensus/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ license.workspace = true
1010
[dependencies]
1111
tari_dan_common_types = { workspace = true }
1212
tari_dan_storage = { workspace = true }
13+
tari_engine_types = { workspace = true }
1314
tari_transaction = { workspace = true }
1415
tari_epoch_manager = { workspace = true }
16+
tari_state_tree = { workspace = true }
1517

1618
# Used for PublicKey and Signature and Network enum
1719
tari_common = { workspace = true }

0 commit comments

Comments
 (0)