Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f4703d6
feat(swift-sdk): use SPV-synced quorums for Platform proof verification
QuantumExplorer Mar 31, 2026
ad6904a
refactor(rs-sdk-ffi): move SPV context provider from Swift to Rust
QuantumExplorer Mar 31, 2026
d9e478e
feat(platform-wallet): add pure-Rust SpvContextProvider
QuantumExplorer Mar 31, 2026
8d2bb27
fix: address CodeRabbit review feedback on SPV quorums PR
QuantumExplorer Apr 2, 2026
fa7e531
feat: use pure-Rust SpvContextProvider, bump rust-dashcore
QuantumExplorer Apr 2, 2026
54b6ed0
fix: eliminate race between didSet and handleNetworkSwitch
QuantumExplorer Apr 2, 2026
cfde224
fix: use try_read() instead of blocking_read(), add dep: prefix
QuantumExplorer Apr 2, 2026
6f67870
Merge v4.1-dev into feat/ios-spv-quorums; re-integrate SPV context pr…
shumkov Jul 11, 2026
05fd41d
style(platform-wallet-ffi): apply rustfmt; drop internal re-integrati…
shumkov Jul 11, 2026
3fad6f8
feat(swift-sdk): verify proofs against SPV quorums via attach-after-b…
shumkov Jul 13, 2026
600b440
feat(sdk): share context provider across SDK clones; live Auto/SPV/Tr…
shumkov Jul 13, 2026
9a2289a
test(sdk,rs-sdk-ffi): cover context-provider clone-sharing + install/…
shumkov Jul 13, 2026
584e68c
fix(rs-platform-wallet): reverse quorum hash to internal order for SP…
shumkov Jul 14, 2026
1deb36b
fix(rs-platform-wallet): guard byte-order via production helper + pin…
shumkov Jul 14, 2026
8263be0
fix(rs-sdk-ffi): install SPV quorum provider as a composite over trusted
shumkov Jul 14, 2026
a53b983
fix(swift-sdk): force SPV install in SPV mode instead of gating on ru…
shumkov Jul 14, 2026
a0fa683
fix(rs-platform-wallet): avoid block_in_place panic on a current-thre…
shumkov Jul 15, 2026
6fc782f
fix(rs-platform-wallet): fail closed on current-thread runtime, not a…
shumkov Jul 15, 2026
3a5e96e
refactor(sdk): add adaptive SPV context provider
shumkov Jul 15, 2026
ba2fbef
docs: remove adaptive SPV provider spec
shumkov Jul 15, 2026
d4046ca
refactor(sdk): separate adaptive and SPV providers
shumkov Jul 16, 2026
4961a0e
chore(sdk): remove unused HTTP dependency
shumkov Jul 16, 2026
fb4fa9d
Merge v5.1-dev into feat/ios-spv-quorums
shumkov Oct 20, 2026
984237a
fix(rs-sdk-ffi): forward quorum-key fetches and contract registration…
shumkov Oct 20, 2026
6eaa7a5
fix(sdk): import Arc in the read_contract example
shumkov Oct 20, 2026
44c17ea
fix(sdk-ffi): do not ban nodes while the SPV quorum source is unavail…
shumkov Oct 20, 2026
4438fc9
test(platform-wallet): exercise the SPV quorum bridge on every Tokio …
shumkov Oct 20, 2026
053c198
fix(swift-example-app): move the wallet manager onto the SDK a Docker…
shumkov Oct 20, 2026
e38a3d9
fix(swift-sdk): report the quorum source of a strict SPV SDK
shumkov Oct 20, 2026
0cb49ba
feat(sdk): add context providers that route quorum keys between SPV a…
shumkov Oct 20, 2026
ec91653
refactor(sdk): extract the trusted provider's local contract cache
shumkov Oct 20, 2026
57bd3bf
fix: build strict SPV without the trusted quorum service and hold the…
shumkov Oct 20, 2026
23c2dd5
fix(platform-wallet): reject quorum types that name no LLMQ type in t…
shumkov Oct 22, 2026
0e7dab3
fix(sdk): keep the newer contract when preloading known contracts
shumkov Oct 22, 2026
4c882fd
fix(swift-example-app): move the wallet manager onto the new network'…
shumkov Oct 22, 2026
308d5c6
fix(swift-example-app): show errors reported through AppState
shumkov Oct 22, 2026
a30f2b6
chore: merge v5.1-dev into feat/ios-spv-quorums
shumkov Oct 22, 2026
a93bb63
fix(swift-example-app): publish a rebuilt SDK and its network only af…
shumkov Oct 22, 2026
615bcbf
fix(sdk): report adaptive SDKs and their live quorum source in dash_s…
shumkov Oct 22, 2026
aed1878
chore: merge v5.1-dev into feat/ios-spv-quorums
shumkov Oct 28, 2026
9f75469
fix(swift-sdk): keep known-contract buffers valid for the whole FFI call
shumkov Oct 29, 2026
e7bcde6
fix(swift-example-app): shut down a replaced wallet manager before it…
shumkov Oct 29, 2026
9c0a9e7
chore: merge v5.1-dev into feat/ios-spv-quorums
shumkov Nov 6, 2026
78f5582
fix(sdk): report network and proof requirement through the routing pr…
shumkov Nov 6, 2026
d70239d
docs(sdk): say that Auto's fallback to the trusted provider can be fo…
shumkov Nov 6, 2026
31849a0
docs(swift-sdk): describe Auto quorum mode's forceable fallback
shumkov Nov 6, 2026
6d20526
docs(sdk): build the SDK with the provider in the with_fallback example
shumkov Nov 6, 2026
d3ffc6e
fix(platform-wallet): stop counting a masternode list behind the head…
shumkov Nov 6, 2026
1ab26d6
docs(sdk): describe the context provider as fixed at build
shumkov Nov 6, 2026
593e2df
docs(platform-wallet): say a non-clean shutdown bars a successor from…
shumkov Nov 9, 2026
2526d89
fix(platform-wallet-ffi): report a non-clean manager shutdown from de…
shumkov Nov 9, 2026
1bcb15d
fix(kotlin-sdk): log the report of an incomplete manager teardown
shumkov Nov 9, 2026
ed0b3fd
feat(swift-sdk): report whether destroy stopped every worker
shumkov Nov 9, 2026
cd8e2c0
test(swift-example-app): pin that activate refuses a replacement whil…
shumkov Nov 9, 2026
e15b2df
revert: move the replaced manager's shutdown handling out of this PR
shumkov Nov 9, 2026
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
5 changes: 5 additions & 0 deletions Cargo.lock

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

14 changes: 8 additions & 6 deletions book/src/sdk/builder-pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct SdkBuilder {
core_password: Zeroizing<String>,
proofs: bool,
version: &'static PlatformVersion,
context_provider: Option<Box<dyn ContextProvider>>,
context_provider: Option<Arc<dyn ContextProvider>>,
metadata_height_tolerance: Option<u64>,
metadata_time_tolerance_ms: Option<u64>,
cancel_token: CancellationToken,
Expand Down Expand Up @@ -107,7 +107,7 @@ impl SdkBuilder {
mut self,
context_provider: C,
) -> Self {
self.context_provider = Some(Box::new(context_provider));
self.context_provider = Some(Arc::new(context_provider));
self
}

Expand Down Expand Up @@ -185,7 +185,7 @@ pub struct Sdk {
inner: SdkInstance,
proofs: bool,
internal_cache: Arc<InternalSdkCache>,
context_provider: ArcSwapOption<Box<dyn ContextProvider>>,
context_provider: Arc<dyn ContextProvider>,
metadata_last_seen_height: Arc<atomic::AtomicU64>,
metadata_height_tolerance: Option<u64>,
metadata_time_tolerance_ms: Option<u64>,
Expand Down Expand Up @@ -219,9 +219,11 @@ does not know (or care) whether it is talking to a real network or a mock.

### Thread Safety

`Sdk` is `Clone` and thread-safe. It uses `Arc` for shared state and `ArcSwapOption`
for the context provider (which allows lock-free reads). The mock mode uses `tokio::Mutex`
for the mock client since mock state is modified in async contexts.
`Sdk` is `Clone` and thread-safe. It uses `Arc` for shared state, the context
provider included: the provider is fixed when `build()` runs, which refuses one
for another network or one that requires proofs while they are off, and clones
share it. The mock mode uses `tokio::Mutex` for the mock client since mock state
is modified in async contexts.

### Nonce Management

Expand Down
4 changes: 1 addition & 3 deletions packages/dash-platform-balance-checker/src/main_trusted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ async fn main() -> Result<()> {
// Build SDK with mock core (context provider will handle everything)
let sdk = SdkBuilder::new(AddressList::from_iter(addresses))
.with_core("127.0.0.1", 1, "mock", "mock") // Mock values, won't be used
.with_context_provider(context_provider)
.build()?;

// Set our trusted context provider
sdk.set_context_provider(context_provider)?;

// Fetch the identity
println!("Fetching identity with proof verification...");
match Identity::fetch(&sdk, identity_id).await {
Expand Down
6 changes: 5 additions & 1 deletion packages/rs-context-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ version.workspace = true
edition = "2021"
authors = ["sam@dash.org"]
license = "MIT"
description = "Context provider traits for Dash Platform SDK"
description = "Context provider traits and quorum-source routing for Dash Platform SDK"

[dependencies]
arc-swap = "1.7.1"
dash-async = { path = "../rs-dash-async" }
dpp = { path = "../rs-dpp", default-features = false }
drive = { path = "../rs-drive", default-features = false, features = [
Expand All @@ -16,5 +17,8 @@ thiserror = "1.0"
hex = { version = "0.4", optional = true }
serde_json = { version = "1.0", optional = true }

[dev-dependencies]
tokio = { version = "1", features = ["macros", "rt"] }

[features]
mocks = ["hex", "serde_json", "dpp/serde-conversion"]
11 changes: 8 additions & 3 deletions packages/rs-context-provider/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
//! Context provider traits for Dash Platform SDK
//! Context providers for Dash Platform SDK
//!
//! This crate provides the core traits for context providers that are used
//! to fetch network state, data contracts, and quorum public keys.
//! to fetch network state, data contracts, and quorum public keys, and the
//! [`routing`] providers that choose between an SPV client and a trusted
//! provider for quorum keys.

pub mod error;
pub mod provider;
pub mod routing;

pub use error::ContextProviderError;
pub use provider::{ContextProvider, DataContractProvider, QuorumKeyFuture};
pub use provider::{
platform_activation_height, ContextProvider, DataContractProvider, QuorumKeyFuture,
};

#[cfg(feature = "mocks")]
pub use provider::MockContextProvider;
10 changes: 10 additions & 0 deletions packages/rs-context-provider/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ use {
pub type QuorumKeyFuture =
Pin<Box<dyn Future<Output = Result<Option<[u8; 48]>, ContextProviderError>> + Send + 'static>>;

/// The Core height at which Platform activated (its L1 locked height) on
/// `network`.
pub fn platform_activation_height(network: Network) -> CoreBlockHeight {
match network {
Network::Mainnet => 2_132_092,
Network::Testnet => 1_090_319,
Network::Devnet | Network::Regtest => 1,
}
}

/// Interface between the Sdk and state of the application.
///
/// ContextProvider is called by the [FromProof](crate::FromProof) trait (and similar) to get information about
Expand Down
Loading
Loading