Skip to content

test(ledger-suite-orchestrator): drop the StateMachine test fixture - #10956

Draft
gregorydemay wants to merge 1 commit into
ic_DEFI-2262_3_cketh-pocket-icfrom
ic_DEFI-2262_4_lso-drop-state-machine
Draft

test(ledger-suite-orchestrator): drop the StateMachine test fixture#10956
gregorydemay wants to merge 1 commit into
ic_DEFI-2262_3_cketh-pocket-icfrom
ic_DEFI-2262_4_lso-drop-state-machine

Conversation

@gregorydemay

@gregorydemay gregorydemay commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Completes the DEFI-2262 PocketIC migration for rs/ethereum: with the ckETH minter's integration tests now running on PocketIC, nothing in rs/ethereum still uses the ledger-suite-orchestrator's StateMachine-based test fixture. This PR deletes it, along with the now-unused ic-state-machine-tests, ic-types, ic-management-canister-types-private, and assert_matches dependencies, leaving PocketIC as the orchestrator's sole test harness.

  • Removed the StateMachine-based LedgerSuiteOrchestrator/flow/universal_canister fixture from ledger-suite-orchestrator/test_utils; the pocket_ic module (added in test(ledger-suite-orchestrator): migrate integration tests to PocketIC #10949) is now the crate's only fixture.
  • Kept the environment-agnostic helpers the pocket_ic module and cketh still import at their existing paths (wasm loaders, init-arg builders, usdc()/usdt(), constants).
  • Dropped the now-unused ic-state-machine-tests, ic-types, ic-management-canister-types-private, and assert_matches dependencies from Cargo.toml/BUILD.bazel.

📚 PR stack

  1. test(ledger-suite-orchestrator): migrate integration tests to PocketIC #10949 — test(ledger-suite-orchestrator): migrate integration tests to PocketIC
  2. test(cketh): deduplicate signed-transaction literals in integration tests #10950 — test(cketh): deduplicate signed-transaction literals in integration tests
  3. test(cketh): migrate integration tests to PocketIC #10955 — test(cketh): migrate integration tests to PocketIC
  4. test(ledger-suite-orchestrator): drop the StateMachine test fixture #10956 — test(ledger-suite-orchestrator): drop the StateMachine test fixture 👈 you are here

🤖 Generated with Claude Code

Nothing in rs/ethereum consumes the old StateMachine-based fixture
(lib.rs's LedgerSuiteOrchestrator, flow.rs, universal_canister.rs) now
that both LSO and cketh integration tests run on PocketIC. Delete it
and the now-unused ic-state-machine-tests, ic-types, and
ic-management-canister-types-private dependencies, keeping only the
environment-agnostic helpers (wasm loaders, init-arg builders,
supported_erc20_tokens/usdc/usdt, constants) that the pocket_ic module
and cketh still import at their existing paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes the legacy ic-state-machine-tests-based test fixture from rs/ethereum/ledger-suite-orchestrator/test_utils, leaving the existing PocketIC fixture as the only supported test harness and cleaning up now-unused dependencies.

Changes:

  • Deleted the StateMachine-based flow and universal_canister fixtures and removed the StateMachine LedgerSuiteOrchestrator helper implementation from test_utils/src/lib.rs.
  • Kept the environment-agnostic helpers (wasm loaders, init-arg builders, token helpers/constants) at their existing crate-root paths.
  • Dropped unused dependencies (ic-state-machine-tests, ic-types, ic-management-canister-types-private, assert_matches) from Cargo + Bazel, and updated Cargo.lock.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rs/ethereum/ledger-suite-orchestrator/test_utils/src/universal_canister.rs Deleted the StateMachine-based universal canister helper (PocketIC version remains under pocket_ic/).
rs/ethereum/ledger-suite-orchestrator/test_utils/src/lib.rs Removed StateMachine fixture exports/impls; retained shared helper APIs/constants used by PocketIC + ckETH.
rs/ethereum/ledger-suite-orchestrator/test_utils/src/flow.rs Deleted the StateMachine-based flow/assertion helpers (PocketIC equivalents remain under pocket_ic/).
rs/ethereum/ledger-suite-orchestrator/test_utils/Cargo.toml Removed unused StateMachine-era dependencies.
rs/ethereum/ledger-suite-orchestrator/test_utils/BUILD.bazel Removed unused Bazel deps corresponding to the deleted fixture.
Cargo.lock Reflected the dependency removals for ic-ledger-suite-orchestrator-test-utils.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/ethereum/ledger-suite-orchestrator/test_utils/Cargo.toml
Comment thread rs/ethereum/ledger-suite-orchestrator/test_utils/src/lib.rs
Comment thread rs/ethereum/ledger-suite-orchestrator/test_utils/src/lib.rs
@gregorydemay

Copy link
Copy Markdown
Contributor Author

🤖🧐 VERDICT: CHANGES_REQUESTED — 0 blockers, 0 mediums, 3 nits; CI pending (Bazel Test All, Bazel Test All on RBE, Cargo Build Linux, Cargo Lint Linux, Build IC, Bazel Run Fuzzers still running). The review substance is clean — the only thing standing between this and READY is green CI.

Review details

Verdict rationale

Nothing in the diff needs to change. CHANGES_REQUESTED is bookkeeping: my rules make a non-green CI a hard block on READY, and six jobs were still pending when I looked. Everything that has reported so far passes (Bazel Test arm64-linux, Bazel Test arm64-darwin, Autofix, Lock Generate, Candid compatibility checks, Check PULL_REQUEST_BAZEL_TARGETS, …). Re-review once the remaining jobs land.

The three questions a deletion PR has to answer

1. Was anything still needed deleted? No.
I enumerated every symbol surviving in test_utils/src/lib.rs and found a live consumer for each — the pocket_ic module (GIT_COMMIT_HASH, MAX_TICKS, the four wasm loaders, default_init_arg, MINTER_PRINCIPAL, the Ledger* re-exports), tests/tests.rs (GIT_COMMIT_HASH_UPGRADE, NNS_ROOT_PRINCIPAL, cketh_installed_canisters, tweak_ledger_suite_wasms, usdc/usdt/usdc_erc20_contract/usdt_erc20_contract), and cketh (supported_erc20_tokens, usdc, CKERC20_TRANSFER_FEE, pocket_ic::LedgerSuiteOrchestrator, pocket_ic::flow::call_ledger_icrc1_total_supply). The remaining private items (modify_wasm, is_gzipped_blob, ledger_init_arg, archive_wasm, ledger_get_blocks_disabled_wasm) are used inside the crate.

Conversely, every deleted symbol is gone repo-wide: new_state_machine, out_of_band_upgrade, stop_canister, assert_reply, AddErc20TokenFlow, ManagedCanistersAssert, UniversalCanister, CanisterHttpQuery have no reference outside the pocket_ic module's own (differently-typed) namesakes, and no file anywhere imports …test_utils::flow or …test_utils::universal_canister at the old root paths.

2. Was anything dead kept? Three pre-existing dead deps — see the inline nit on Cargo.toml. They predate the stack, so leaving them is legitimate surgical scope; I flagged them as a nit rather than a medium.

3. The sweep claims — one holds as stated, one needs restating.

Grep sweep: holds. grep -rn "state_machine_tests\|StateMachine\|state_machine" rs/ethereum returns 10 hits: 9 are historical git-log excerpts inside cketh/mainnet/*_upgrade_*.md proposal records (immutable by nature) and 1 is the explanatory comment at cketh/test_utils/src/lib.rs:941 — a cketh file, out of this PR's component scope. No Rust code in rs/ethereum mentions StateMachine.

Bazel sweep: the substantive criterion is met, but the plan's literal wording is unachievable. rdeps(//rs/ethereum/..., //rs/state_machine_tests) is not empty — it lists the four integration_tests targets. The reason is not a leftover: somepath(//rs/ethereum/ledger-suite-orchestrator:integration_tests, //rs/state_machine_tests) shows exactly one edge chain, integration_tests → //:pocket-ic-server (data) → //rs/pocket_ic_server:pocket-ic-server → //rs/state_machine_tests. The PocketIC server binary reuses the state-machine internals, so any target that runs PocketIC reaches //rs/state_machine_tests through its data attribute — the plan's → empty criterion could never hold for a PocketIC-based suite. The criterion that actually matters is compile-time linkage, and it is clean: attr(deps, "state_machine_tests", //rs/ethereum/...) returns nothing, and rdeps(//rs/ethereum/..., //rs/state_machine_tests) except rdeps(//rs/ethereum/..., //:pocket-ic-server) leaves no rs/ethereum target at all. No Rust library or test in rs/ethereum compiles against ic-state-machine-tests any more. I consider the acceptance criterion met in substance; the plan's wording should be read as "no compile dependency", not "no node in the transitive graph".

Maintainability rundown

  • Duplication: none found — and the PR removes the ~1000-line dual-fixture duplication the plan itself listed as a risk for the stack's lifetime.
  • Unused derives: none — no types are introduced.
  • Primitive-obsession parameters: none — no signatures are introduced.
  • Divergent invariant handling: none — no invariant checks are introduced or moved.
  • Silent fallbacks: none — no failure paths are introduced.
  • Dead code (G9): the three pre-existing dead deps above; nothing newly orphaned by this deletion.
  • Component boundary: clean. The delta touches only rs/ethereum/ledger-suite-orchestrator/test_utils/** plus Cargo.lock.
  • Cargo/Bazel mirroring: exact. All four removals are mirrored 1:1 — assert_matches@crate_index//:assert_matches, ic-state-machine-tests//rs/state_machine_tests, ic-types//rs/types/types, ic-management-canister-types-private//rs/types/management_canister_types — and Cargo.lock drops exactly those four entries. ic-types-cycles is correctly retained: pocket_ic/universal_canister.rs:7,43,62 uses Cycles.
  • Docs: the PR description and commit message list three dropped deps but four were dropped — assert_matches is missing from both. Trivial; mention it if you push another commit.

Testing

Pure deletion of unreferenced code, so no behaviour changes and no new tests are warranted; the guarantee needed is that the surviving suites are unaffected, which they are.

What I ran

  • cargo check --all-targets --all-features -p ic-ledger-suite-orchestrator-test-utils -p ic-ledger-suite-orchestrator -p ic-cketh-test-utils -p ic-cketh-minter → clean.
  • bazel test //rs/ethereum/ledger-suite-orchestrator:integration_tests //rs/ethereum/cketh/minter:integration_tests → 3/3 PASSED (integration_tests 15.8s, cketh_test 75.9s, ckerc20_test 147.7s).
  • bazel build //rs/ethereum/... → 48 targets, success (nothing else in the component referenced the deleted fixture).
  • The four Bazel queries quoted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants