Skip to content
Open
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
2,458 changes: 1,164 additions & 1,294 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/check-features/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
toml = "0.8.12"
toml = "1.2"
2 changes: 1 addition & 1 deletion packages/rs-context-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dpp = { path = "../rs-dpp", default-features = false }
drive = { path = "../rs-drive", default-features = false, features = [
"verify",
] }
thiserror = "1.0"
thiserror = "2.0"
tracing = "0.1.41"
hex = "0.4"
serde_json = { version = "1.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-dapi-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tracing = "0.1.41"
tokio = { version = "1.40", default-features = false }
sha2 = { version = "0.10", optional = true }
hex = { version = "0.4.3", optional = true }
lru = { version = "0.16.3" }
lru = { version = "0.19.0" }
serde = { version = "1.0.219", optional = true, features = ["derive"] }
serde_json = { version = "1.0.140", optional = true }
chrono = { version = "0.4.38", features = ["serde"] }
Expand Down
6 changes: 3 additions & 3 deletions packages/rs-dapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tonic = "0.14.2"
# HTTP framework for JSON-RPC and metrics endpoints
axum = "0.8.4"
tower = "0.5.2"
tower-http = { version = "0.6.6", features = ["cors", "trace"] }
tower-http = { version = "0.7.1", features = ["cors", "trace"] }

# Serialization
serde = { version = "1.0.219", features = ["derive"] }
Expand Down Expand Up @@ -62,7 +62,7 @@ sha2 = "0.10"
async-trait = "0.1"

# WebSocket support for Tenderdash events
tokio-tungstenite = { version = "0.21", features = ["native-tls"] }
tokio-tungstenite = { version = "0.30", features = ["native-tls"] }
url = "2.5"

# ZMQ for real-time blockchain events
Expand Down Expand Up @@ -111,7 +111,7 @@ rs-dapi-client = { path = "../rs-dapi-client", default-features = false }
tempfile = "3.13.0"
# Lets a test move the clock past a deadline instead of waiting for it.
tokio = { version = "1.47.0", features = ["test-util"] }
serial_test = "3.1.1"
serial_test = "4.0.1"
test-case = "3.3.1"
# Decodes dapi-grpc's FILE_DESCRIPTOR_SET in the metrics allowlist test.
prost-types = "0.14"
Expand Down
4 changes: 2 additions & 2 deletions packages/rs-dapi/src/clients/tenderdash_websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl TenderdashWebSocketClient {
});

ws_sender
.send(Message::Text(subscribe_msg.to_string()))
.send(Message::Text(subscribe_msg.to_string().into()))
.await?;

// Subscribe to new block events
Expand All @@ -156,7 +156,7 @@ impl TenderdashWebSocketClient {
}
});
ws_sender
.send(Message::Text(subscribe_block_msg.to_string()))
.send(Message::Text(subscribe_block_msg.to_string().into()))
.await?;

debug!("Subscribed to Tenderdash transaction events");
Expand Down
25 changes: 21 additions & 4 deletions packages/rs-dpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ chrono = { version = "0.4.35", default-features = false, features = [
"wasmbind",
"clock",
] }
chrono-tz = { version = "0.8", optional = true }
chrono-tz = { version = "0.10", optional = true }
ciborium = { version = "0.2.2", optional = true }
dashcore = { workspace = true, features = [
"rand",
Expand All @@ -49,7 +49,7 @@ getrandom = { version = "0.2", features = ["js"] }

hex = { version = "0.4" }
integer-encoding = { version = "4.0.0" }
itertools = { version = "0.13" }
itertools = { version = "0.15" }
jsonschema = { git = "https://github.com/dashpay/jsonschema-rs", rev = "aacc1ab5140daac30eb65d376852f01f5381979d", default-features = false, features = [
"draft202012",
], optional = true }
Expand All @@ -69,6 +69,11 @@ serde_repr = { version = "0.1.7" }
sha2 = { version = "0.10" }
thiserror = { version = "2.0.17" }
url = { version = "2.5", optional = true }
# Consensus-critical exact pin: ICU 2.4 (Unicode 18) changes `format: "uri"` validity via `url` host parsing; see test should_refuse_a_format_uri_value_whose_host_holds_a_code_point_unassigned_in_unicode_17.
icu_normalizer = { version = "=2.2.0", default-features = false, optional = true }
icu_normalizer_data = { version = "=2.2.0", default-features = false, optional = true }
icu_properties = { version = "=2.2.0", default-features = false, optional = true }
icu_properties_data = { version = "=2.2.0", default-features = false, optional = true }
Comment on lines +72 to +76

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: The ICU pin does not freeze the complete behavior dependency graph

The four exact ICU pins constrain the normalizer and property data packages, but their manifests still allow supporting packages such as icu_provider, icu_locale_core, zerovec, litemap, and related crates to move within their compatible ranges. The current lockfile resolves those packages to 2.2.0, but a later lockfile refresh can change them without changing any of the four exact pins. Since these packages implement data-provider and normalization support behavior used by the URL/IDNA path, the manifest does not fully establish the stated consensus freeze. Pin the complete relevant ICU closure, or document why each remaining floating package cannot affect the URI verdict and extend the guard if needed.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality)

# The native document validator reproduces the JSON Schema validator with the crates it uses
# regex-syntax is the parser the `regex` crate uses; it must match the version `regex` pulls in
regex-syntax = { version = "0.8.11", optional = true }
Expand All @@ -89,7 +94,7 @@ nohash-hasher = "0.2.0"
rust_decimal = { version = "1.39.0", optional = true }
rust_decimal_macros = { version = "1.39.0", optional = true }
indexmap = { version = "2.7.0", features = ["serde"] }
strum = { version = "0.26", features = ["derive"] }
strum = { version = "0.28", features = ["derive"] }
json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true }
once_cell = "1.19.0"
tracing = { version = "0.1.41" }
Expand Down Expand Up @@ -123,7 +128,15 @@ getrandom_03 = { package = "getrandom", version = "0.3", features = ["wasm_js"]
getrandom_04 = { package = "getrandom", version = "0.4", features = ["wasm_js"] }

[package.metadata.cargo-machete]
ignored = ["getrandom_03", "getrandom_04", "blst"]
ignored = [
"getrandom_03",
"getrandom_04",
"blst",
"icu_normalizer",
"icu_normalizer_data",
"icu_properties",
"icu_properties_data",
]

[features]
default = ["state-transitions"]
Expand Down Expand Up @@ -241,6 +254,10 @@ json-schema-validation = [
validation-schema = [
"platform-value-json",
"dep:url",
"dep:icu_normalizer",
"dep:icu_normalizer_data",
"dep:icu_properties",
"dep:icu_properties_data",
"dep:regex-syntax",
"dep:num-cmp",
"dep:fraction",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,35 @@ fn should_accept_an_ordinary_format_regex_value_at_both_protocol_versions() {
assert!(format_regex_errors(value, protocol_version_14).is_empty());
}

/// Validation errors for a document `{ "u": value }` against a type whose `u` is a
/// `format: uri` string, at `platform_version`. The contract is registered then read anew,
/// so the protocol version decides which validator checks the value.
fn format_uri_errors(value: &str, platform_version: &PlatformVersion) -> Vec<ConsensusError> {
let contract = item_contract(platform_value!({
"u": { "type": "string", "format": "uri", "maxLength": 40, "position": 0 },
}));
document_errors(
&read_anew(&contract),
platform_value!({ "u": value }),
platform_version,
)
}

/// Pins consensus to the Unicode 17 ICU data behind `url`'s IDNA host mapping: U+0558 is
/// unassigned there, so a host holding it is not a URI. A failure means a dependency update
/// changed consensus.
#[test]
fn should_refuse_a_format_uri_value_whose_host_holds_a_code_point_unassigned_in_unicode_17() {
let latest = PlatformVersion::latest();
let protocol_version_14 = PlatformVersion::get(14).expect("expected protocol version 14");
let value = "https://a\u{0558}b.com/";
assert!(!format_uri_errors(value, latest).is_empty());
assert!(!format_uri_errors(value, protocol_version_14).is_empty());
// An ASCII host is a URI at both protocol versions.
assert!(format_uri_errors("https://ab.com/", latest).is_empty());
assert!(format_uri_errors("https://ab.com/", protocol_version_14).is_empty());
}
Comment on lines +610 to +623

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Add a regression test for schema metadata URI validation

The added guard exercises only a document property with format: "uri". Contract schema registration separately validates $schema and each $vocabulary key with Url::parse in packages/rs-dpp/src/data_contract/document_type/schema/validation_schema/v0/mod.rs:539-546. The PR description identifies those metadata URLs as another consensus-sensitive surface, but a future URL/ICU change could alter their registration verdict without affecting the new document-value test. Add registration tests using the same Unicode edge case for $schema and $vocabulary.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality)


/// A pattern that parses but that the `regex` crate does not compile under its default size
/// limit.
const PATTERN_BEYOND_THE_SIZE_LIMIT: &str = "^\\p{L}{400}$";
Expand Down
14 changes: 7 additions & 7 deletions packages/rs-drive-abci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ drive = { path = "../rs-drive", default-features = false, features = [
"server",
"grovedb_operations_logging",
] }
thiserror = "1.0.64"
thiserror = "2.0"
rand = "0.8.5"
tempfile = "3.3.0"
hex = "0.4.3"
Expand All @@ -32,7 +32,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = ["abci"] }
simple-signer = { path = "../simple-signer", features = ["state-transitions"] }
rust_decimal = "1.39.0"
rust_decimal_macros = "1.39.0"
mockall = { version = "0.13", optional = true }
mockall = { version = "0.15", optional = true }
prost = { version = "0.14", default-features = false }
tracing = { version = "0.1.41", default-features = false, features = [] }
clap = { version = "4.4.10", features = ["derive"] }
Expand Down Expand Up @@ -61,13 +61,13 @@ time = { version = "0.3", optional = true, features = [
] }

lazy_static = "1.4.0"
itertools = { version = "0.13" }
file-rotate = { version = "0.7.3" }
itertools = { version = "0.15" }
file-rotate = { version = "0.8.0" }
reopen = { version = "1.0.3" }
delegate = { version = "0.13" }
regex = { version = "1.8.1" }
metrics = { version = "0.24" }
metrics-exporter-prometheus = { version = "0.16", default-features = false, features = [
metrics-exporter-prometheus = { version = "0.18", default-features = false, features = [
"http-listener",
] }
url = { version = "2.3.1" }
Expand All @@ -80,7 +80,7 @@ tokio = { version = "1.40", features = [
tokio-util = { version = "0.7" }
derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] }
async-trait = "0.1.77"
console-subscriber = { version = "0.4", optional = true }
console-subscriber = { version = "0.5", optional = true }
dashcore-crypto = { workspace = true, features = ["bls"], optional = true }
grovedb-commitment-tree = { workspace = true }
nonempty = "0.11"
Expand Down Expand Up @@ -121,7 +121,7 @@ strategy-tests = { path = "../strategy-tests" }
grovedb-commitment-tree = { workspace = true, features = ["client"] }
assert_matches = "1.5.0"
drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] }
mockall = { version = "0.13" }
mockall = { version = "0.15" }
dash-platform-macros = { path = "../rs-dash-platform-macros" }
libc = "0.2"

Expand Down
34 changes: 32 additions & 2 deletions packages/rs-drive-abci/src/logging/destination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,21 @@ impl TryFrom<&LogConfig> for FileRotate<AppendTimestamp> {
let content_limit = ContentLimit::Time(TimeFrequency::Daily);
let compression = file_rotate::compression::Compression::OnRotate(2);
// Only owner can see logs
let mode = Some(0o600);
let mut open_options = OpenOptions::new();
open_options
.read(true)
.create(true)
.append(true)
.mode(0o600);
let path = PathBuf::from(&config.destination.to_string());

let f = FileRotate::new(path, suffix_scheme, content_limit, compression, mode);
let f = FileRotate::new(
path,
suffix_scheme,
content_limit,
compression,
Some(open_options),
);

Ok(f)
}
Expand Down Expand Up @@ -473,4 +484,23 @@ mod tests {

assert!(validate_log_path(&file_path).is_ok());
}

#[test]
fn should_create_rotated_log_file_readable_only_by_owner() {
let dir = tempdir().unwrap();
let file_path = dir.path().join("drive-abci.log");
let config = LogConfig {
destination: LogDestination::File(file_path.clone()),
max_files: 3,
..Default::default()
};

let mut rotate =
FileRotate::<AppendTimestamp>::try_from(&config).expect("create rotated log file");
rotate.write_all(b"entry\n").unwrap();
rotate.flush().unwrap();

let mode = fs::metadata(&file_path).unwrap().permissions().mode() & 0o777;
assert_eq!(mode, 0o600);
}
}
9 changes: 4 additions & 5 deletions packages/rs-drive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,22 @@ derive_more = { version = "1.0", features = ["from"] }
hex = { version = "0.4.3" }

# optional dependencies
parking_lot = { version = "0.12.1", optional = true }
parking_lot = { version = "0.13", optional = true }
ciborium = { version = "0.2.2", optional = true }
arc-swap = { version = "1.7.0", optional = true }
serde = { version = "1.0.219", features = ["derive"], optional = true }
rand = { version = "0.8.4", features = ["small_rng"], optional = true }
moka = { version = "0.12", features = [
"future",
"futures-util",
"sync",
], optional = true }
bs58 = { version = "0.5.0", optional = true }
base64 = { version = "0.22.1", optional = true }
tempfile = { version = "3", optional = true }
enum-map = { version = "2.0.3", optional = true }
enum-map = { version = "3.1.0", optional = true }
intmap = { version = "3.0.1", features = ["serde"], optional = true }
chrono = { version = "0.4.35", optional = true }
itertools = { version = "0.13", optional = true }
itertools = { version = "0.15", optional = true }
grovedb = { workspace = true, optional = true }
# `TreeType` for the tree-type rules shared by the index walkers and
# `drive::document::layout`. grovedb re-exports it only with its `minimal`
Expand All @@ -66,7 +65,7 @@ grovedb-version = { workspace = true }
grovedb-epoch-based-storage-flags = { workspace = true }

[dev-dependencies]
criterion = "0.5"
criterion = "0.8"
platform-version = { path = "../rs-platform-version", features = [
"mock-versions",
] }
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive/benches/document_average_worst_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
//! - `DASH_PLATFORM_AVG_BENCH_BATCH_SIZE`: inserts per commit;
//! defaults to 2 500.

use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion};
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use dpp::block::block_info::BlockInfo;
use dpp::data_contract::accessors::v0::DataContractV0Getters;
use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters;
Expand All @@ -63,6 +63,7 @@ use std::borrow::Cow;
use std::collections::BTreeMap;
use std::env;
use std::fs;
use std::hint::black_box;
use std::path::PathBuf;
use std::time::Instant;

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive/benches/document_count_worst_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! - `DASH_PLATFORM_COUNT_BENCH_REBUILD=1`: remove and rebuild the fixture.
//! - `DASH_PLATFORM_COUNT_BENCH_BATCH_SIZE`: inserts per transaction; defaults to 10,000.

use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion};
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use dpp::block::block_info::BlockInfo;
use dpp::data_contract::accessors::v0::DataContractV0Getters;
use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters;
Expand All @@ -36,6 +36,7 @@ use std::borrow::Cow;
use std::collections::BTreeMap;
use std::env;
use std::fs;
use std::hint::black_box;
use std::path::PathBuf;
use std::time::Instant;

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive/benches/document_sum_worst_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! - `DASH_PLATFORM_SUM_BENCH_REBUILD=1`: remove and rebuild the fixture.
//! - `DASH_PLATFORM_SUM_BENCH_BATCH_SIZE`: inserts per transaction; defaults to 10,000.

use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion};
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use dpp::block::block_info::BlockInfo;
use dpp::data_contract::accessors::v0::DataContractV0Getters;
use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters;
Expand All @@ -32,6 +32,7 @@ use dpp::platform_value::{platform_value, Value};
use dpp::version::PlatformVersion;
use drive::config::DriveConfig;
use drive::drive::Drive;
use std::hint::black_box;
// NOTE: these types are the proposed sum-query surface. They don't exist
// in `drive::query` yet — landing them is part of the sum-tree feature.
// Named to parallel the count surface (`DriveDocumentCountQuery`,
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-platform-encryption/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cbc = "0.1"
chacha20poly1305 = { version = "0.10", default-features = false, features = ["alloc"] }
hmac = "0.12"
sha2 = "0.10"
thiserror = "1.0"
thiserror = "2.0"

[dev-dependencies]
# Tests generate keypairs via secp256k1's RNG helpers (`generate_keypair`,
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-platform-serialization-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ proc-macro = true

[dependencies]
proc-macro2 = "1.0.56"
virtue = "0.0.17"
virtue = "0.0.19"
quote = "1.0.37"
syn = "2.0.75"
2 changes: 1 addition & 1 deletion packages/rs-platform-wallet-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dash-context-provider = { path = "../rs-context-provider" }

# FFI utilities
once_cell = "1.19"
parking_lot = { version = "0.12", features = ["send_guard"] }
parking_lot = { version = "0.13", features = ["send_guard"] }
lazy_static = "1.4"
tokio = { version = "1", features = ["rt-multi-thread"] }
tokio-metrics = { workspace = true, optional = true }
Expand Down
Loading
Loading