Skip to content

test(platform-wallet): CR-001 — SPV mn-list sync readiness#3614

Merged
lklimek merged 4 commits intofeat/rs-platform-wallet-e2efrom
test/cr-001-spv-mn-list-readiness
May 8, 2026
Merged

test(platform-wallet): CR-001 — SPV mn-list sync readiness#3614
lklimek merged 4 commits intofeat/rs-platform-wallet-e2efrom
test/cr-001-spv-mn-list-readiness

Conversation

@Claudius-Maginificent
Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Implements CR-001 — SPV mn-list sync readiness per tests/e2e/TEST_SPEC.md (Status: PASS-pending-validation). Foundation for every other Core (CR) test — pins the SPV-readiness contract before any Core operation runs.

What was done?

  • Added packages/rs-platform-wallet/tests/e2e/cases/cr_001_spv_mn_list_sync_readiness.rs.
  • Registered cr_001 in cases/mod.rs alphabetically (before cr_003_*).
  • Test waits ≤ 180 s for spv::wait_for_mn_list_synced, reads mn-list height, asserts > 0, asserts the SPV runtime reports started.
  • Skips with informative log when PLATFORM_WALLET_E2E_DISABLE_SPV=1 (operator escape hatch).
  • #[ignore]-tagged per repo convention; runs only with --ignored.

Spec divergence note

The spec entry mentions SpvHealth::status() -> Enum with a Ready variant. That accessor does not exist in the current codebase — the test uses SpvRuntime::is_started() == true as the available proxy, with an inline comment. Follow-up: either add SpvHealth::status() (small public API addition) or update the spec line to match is_started().

How Has This Been Tested?

  • cargo build --tests --no-default-features — clean
  • cargo build --tests — clean
  • cargo clippy --tests --all-features -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • cargo test --test e2e cr_001 -- --list shows the test discoverable
  • NOT run against testnet (testnet validation held while rust-dashcore docs: make more copy-pastable, and use proper markdown blocks #470 DKG cycle clears)

Breaking Changes

None.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed (TEST_SPEC entry already exists at PASS-pending-validation; flipping to PASS happens after testnet green)

Related

🤖 Co-authored by Claudius the Magnificent AI Agent

Pins the SPV-readiness contract per TEST_SPEC: wait <= 180s for
mn-list sync, assert height > 0 and SPV runtime is started.

Note: spec mentions SpvHealth::status() -> Enum but that accessor
does not exist in the codebase yet; using SpvRuntime::is_started()
as the available proxy with an inline comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f854a35f-52af-48b9-95fc-78e870b87f7b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/cr-001-spv-mn-list-readiness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lklimek and others added 2 commits May 7, 2026 21:27
…V directly

The Config::disable_spv field lives on fix/...e2e-qa-fixes-v1
(commit d1d81a3) — not on this branch. Reading the env var
inline keeps PR #3614 atomic and self-compiling on its base.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er (#3614 review)

Address audit findings on PR #3614 (CR-001 SPV mn-list readiness):

- F-001 (LOW): the harness never reads PLATFORM_WALLET_E2E_DISABLE_SPV;
  E2eContext::build always starts SPV and stores it in ctx.spv(). Reword
  the PRE-pin comment to drop the misleading harness-gate claim and frame
  the .expect as defence-in-depth against future harness changes.

- F-002 (LOW): MN_LIST_SYNC_TIMEOUT (180 s) is not an enforced ceiling.
  framework::spv::wait_for_mn_list_synced raises every requested timeout
  to COLD_CACHE_TIMEOUT_FLOOR (600 s). Update the constant doc and module
  header to describe the actual effective wait, with the spec's 180 s
  framed as informational warm-cache target.

- F-003 (LOW): promote the 11-line truthy-env parser out of the test body
  into framework::config so future SPV-gated cases reuse one source of
  truth. Adds vars::DISABLE_SPV constant, a private is_truthy_env helper
  shared by SPV-style boolean flags, and a public spv_disabled_from_env()
  consumed by CR-001. Includes a unit test exercising the truthy/falsy
  matrix on a unique probe-only env-var key.

No production-code changes; SPV is still always started by the harness.
The .expect strings keep their PRE/POST-pin invariant framing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lklimek lklimek marked this pull request as ready for review May 8, 2026 13:12
@lklimek lklimek requested a review from QuantumExplorer as a code owner May 8, 2026 13:12
@lklimek lklimek merged commit 25e48dd into feat/rs-platform-wallet-e2e May 8, 2026
1 of 3 checks passed
@lklimek lklimek deleted the test/cr-001-spv-mn-list-readiness branch May 8, 2026 13:12
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.

2 participants