Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9a10b7a
fix(sdk): prevent nonce cache regression on broadcast failure
lklimek Feb 19, 2026
d29905b
refactor(sdk): strip nonce upper bits at fetch instead of on every re…
lklimek Feb 19, 2026
18dff6c
clippy: remove unused Sdk::parse_proof, Sdk::parse_proof_with_metadata
lklimek Feb 19, 2026
1f3d4f1
fix(sdk): force nonce re-fetch when cache drifts too far ahead of pla…
lklimek Feb 19, 2026
8aae8c2
refactor(sdk): extract shared nonce cache logic into get_or_fetch_non…
lklimek Feb 19, 2026
65e69be
fix(sdk): release nonce cache lock during platform fetch and preserve…
lklimek Feb 19, 2026
5b28ecc
test(sdk): add edge-case tests for nonce cache logic
lklimek Feb 19, 2026
28653d3
Merge branch 'v3.1-dev' into fix/sdk-nonce-cache-regression
lklimek Feb 20, 2026
e76f8f8
Merge branch 'v3.1-dev' into fix/sdk-nonce-cache-regression
lklimek Feb 23, 2026
603d9ec
refactor(sdk): encapsulate nonce cache into dedicated NonceCache struct
lklimek Feb 23, 2026
d1225cc
fix(sdk): replace BTreeMap with LruCache in NonceCache to fix TOCTOU …
lklimek Feb 23, 2026
f7ca660
fix(sdk): harden NonceCache with overflow guard, three-phase locking,…
lklimek Feb 23, 2026
d54fb16
fix(sdk): return IdentityNonceNotFound instead of defaulting to nonce 0
lklimek Feb 23, 2026
dbcd192
refactor(sdk): improve NonceCache code quality and add missing test
lklimek Feb 23, 2026
f6b03f0
fix(sdk): harden NonceCache drift calculation and add concurrency tests
lklimek Feb 23, 2026
ce2e7ef
fix(wasm-sdk): handle NonceOverflow and IdentityNonceNotFound error v…
lklimek Feb 23, 2026
3167478
fix(sdk): preserve cached nonce on refresh to prevent tx duplicate on…
lklimek Feb 23, 2026
9a4f1d7
refactor(sdk): address review findings on NonceCache refresh
lklimek Feb 23, 2026
730c3e7
refactor(sdk): remove closures from NonceCache public API, take &Sdk …
lklimek Feb 23, 2026
4607b13
Merge branch 'v3.1-dev' into fix/sdk-nonce-cache-regression
lklimek Feb 24, 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
4 changes: 2 additions & 2 deletions packages/rs-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dotenvy = { version = "0.15.7", optional = true }
envy = { version = "0.4.2", optional = true }
futures = { version = "0.3.30" }
derive_more = { version = "1.0", features = ["from"] }
lru = { version = "0.16.3", optional = true }
lru = { version = "0.16.3" }
bip37-bloom-filter = { git = "https://github.com/dashpay/rs-bip37-bloom-filter", branch = "develop" }
zeroize = { version = "1.8", features = ["derive"] }

Expand Down Expand Up @@ -92,7 +92,7 @@ mocks = [
"drive-proof-verifier/mocks",
"dep:dotenvy",
"dep:envy",
"dep:lru",

"zeroize/serde",
]

Expand Down
16 changes: 16 additions & 0 deletions packages/rs-sdk/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ pub enum Error {
/// Invalid credit transfer configuration
#[error("Invalid credit transfer: {0}")]
InvalidCreditTransfer(String),
/// Identity nonce overflow: the nonce has reached its maximum value and
/// cannot be incremented further without wrapping to zero.
#[error("Identity nonce overflow: nonce has reached the maximum value ({0})")]
NonceOverflow(u64),
/// Identity nonce not found on Platform.
///
/// Platform returned no nonce for the requested identity (or identity–
/// contract pair). This usually means the queried DAPI node has not yet
/// indexed the identity — for example right after identity creation or
/// when the node is lagging behind the chain tip.
///
/// **Recovery**: retry the state transition; the SDK will re-fetch the
/// nonce from a (potentially different) DAPI node on the next attempt.
#[error("Identity nonce not found on platform: {0}")]
IdentityNonceNotFound(String),

/// Generic error
// TODO: Use domain specific errors instead of generic ones
#[error("SDK error: {0}")]
Expand Down
Loading
Loading