Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions packages/rs-drive-abci/src/abci/handler/process_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,5 +347,38 @@ where
elapsed_time_ms,
);

if request.height == 1 {
let root_proof = app
.platform()
.drive
.root_tree_proof(Some(transaction), platform_version)?;
tracing::info!(
invalid_tx_count,
valid_tx_count,
elapsed_time_ms,
storage_fees,
processing_fees,
"Processed proposal with {} transactions for height: {}, round: {} in {} ms, root proof is {}",
valid_tx_count + invalid_tx_count,
request.height,
request.round,
elapsed_time_ms,
hex::encode(&root_proof),
);
} else {
tracing::info!(
invalid_tx_count,
valid_tx_count,
elapsed_time_ms,
storage_fees,
processing_fees,
"Processed proposal with {} transactions for height: {}, round: {} in {} ms",
valid_tx_count + invalid_tx_count,
request.height,
request.round,
elapsed_time_ms,
);
}

Ok(response)
}
12 changes: 6 additions & 6 deletions packages/rs-drive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ enum-map = { version = "2.0.3", optional = true }
intmap = { version = "3.0.1", features = ["serde"], optional = true }
chrono = { version = "0.4.35", optional = true }
itertools = { version = "0.13", optional = true }
grovedb = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8", optional = true, default-features = false }
grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8", optional = true }
grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8" }
grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8", optional = true }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8" }
grovedb = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a", optional = true, default-features = false }
grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a", optional = true }
grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a" }
grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a", optional = true }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a" }

[dev-dependencies]
criterion = "0.5"
Expand Down
1 change: 1 addition & 0 deletions packages/rs-drive/src/drive/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod fetch_elements;
pub mod genesis_time;
/// Protocol version module
pub mod protocol_version;
mod root_tree_proof;

use crate::drive::RootTree;

Expand Down
21 changes: 21 additions & 0 deletions packages/rs-drive/src/drive/system/root_tree_proof/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use crate::drive::Drive;
use crate::error::Error;
use grovedb::{PathQuery, Query, TransactionArg};
use platform_version::version::PlatformVersion;

impl Drive {
/// Returns a tree proof of the root of the tree.
pub fn root_tree_proof(
&self,
transaction: TransactionArg,
platform_version: &PlatformVersion,
) -> Result<Vec<u8>, Error> {
let path_query = PathQuery::new_unsized(vec![], Query::new_range_full());
self.grove_get_proved_path_query(
&path_query,
transaction,
&mut vec![],
&platform_version.drive,
)
}
}
2 changes: 1 addition & 1 deletion packages/rs-platform-version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT"
thiserror = { version = "2.0.12" }
bincode = { version = "=2.0.0-rc.3" }
versioned-feature-core = { git = "https://github.com/dashpay/versioned-feature-core", version = "1.0.0" }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "221ca6ec6b8d2b192d334192bd5a7b2cab5b0aa8" }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a432801353c96cf771ca5c8dcd1c11b5f8c1a80a" }
once_cell = "1.19.0"

[features]
Expand Down