Skip to content

Require dual-provider agreement for nullifier range sync#111

Open
p0mvn wants to merge 4 commits into
v2-updatesfrom
codex/dual-provider-range-agreement
Open

Require dual-provider agreement for nullifier range sync#111
p0mvn wants to merge 4 commits into
v2-updatesfrom
codex/dual-provider-range-agreement

Conversation

@p0mvn

@p0mvn p0mvn commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require at least two lightwalletd providers for nullifier sync paths
  • fetch each requested block range from two providers and compare canonical (height, nullifier) payloads before commit
  • fail closed on any divergence and include mismatch diagnostics, plus add unit tests for agreement and mismatch branches

Test plan

  • cargo test -p nf-ingest sync_nullifiers
  • cargo check -p nf-server

p0mvn added 2 commits June 4, 2026 22:57
Fetch each range from two lightwalletd providers, compare canonical payloads, and fail closed on any mismatch so checkpoint progress only advances on agreement. Add coverage for agreement and mismatch branches plus explicit provider-count guards in sync entrypoints.
Keep env-provided non-empty LWD_URLS values verbatim and only expand to default providers when using the default CLI URL fallback, with regression tests covering env pinning and empty-env fallback behavior.
Comment thread nf-ingest/src/config.rs
Comment on lines +49 to +60
if let Ok(env_urls) = std::env::var("LWD_URLS") {
if !env_urls.trim().is_empty() {
return env_urls.split(',').map(|u| u.trim().to_string()).collect();
}
}

if urls.len() == 1 && urls[0] == DEFAULT_SINGLE_LWD_URL {
if cli_url == DEFAULT_SINGLE_LWD_URL {
DEFAULT_LWD_URLS.iter().map(|s| s.to_string()).collect()
} else {
urls
vec![cli_url.to_string()]
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: drive-by fixing endpoint selection

Require exact index height matches for historical exports, enforce checkpoint offset usage in pir-export, and remove unreachable legacy rebuild code to eliminate mislabeled snapshot artifacts.
@p0mvn p0mvn changed the title Require dual-provider agreement for nullifier range sync Harden nullifier sync and snapshot export integrity Jun 5, 2026
@p0mvn p0mvn changed the title Harden nullifier sync and snapshot export integrity Require dual-provider agreement for nullifier range sync Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant