Skip to content

test: Chained-caller test prerequisites - #792

Open
romanzac wants to merge 51 commits into
devfrom
test/sequencer-registration-prerequisites
Open

romanzac wants to merge 51 commits into
devfrom
test/sequencer-registration-prerequisites

Conversation

@romanzac

@romanzac romanzac commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Purpose

Add the chained-caller test prerequisites to continue with cucumber sequencer integration tests: a stake_chain_caller test guest, runtime deployment of test programs through program_loader from the scenario wallet, and paid-by submission against a deployed program account.

The second-mover prerequisite (P-21) originally in this PR was dropped on the merge with dev: Stake now moves the funds natively and no longer chains into a caller-chosen mover, so there is no second mover to exercise. P-19 has no target either, as ConfirmStake is gone from the program.

⚙️ Tests added

stake_instruction_validation.feature — @stake_instruction_ci

  • P-17 — Stake invoked as a chained call is rejected

🧪 How to Test

cargo test -p integration_tests --features cucumber --test cucumber -- --tags '@P-17'

🔜 Future Work

To add remaining tests planned for sequencer registration these prerequisites need to be developed first:

  • Finish cucumber sequencer integration tests to cover spec completely.

Related tests will be added in upcoming PRs.

📋 PR Completion Checklist

Mark only completed items. A complete PR should have all boxes ticked.

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

@romanzac
romanzac marked this pull request as ready for review August 26, 2026 08:47
@romanzac
romanzac requested a review from davidrusu August 26, 2026 09:00

@hansieodendaal hansieodendaal 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.

Looking good.

Some comments to consider please.

@romanzac

romanzac commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Looking good.

Some comments to consider please.

Let me address your comments once #779 and #793 gets merged. I had to rebase #787 on new changes in Dev as well. It looks the review becomes new bottleneck (I have this problem also on another project). Perhaps, my PRs should get much smaller. WDYT ?

@hansieodendaal

hansieodendaal commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Let me address your comments once #779 and #793 gets merged. I had to rebase #787 on new changes in Dev as well. It looks the review becomes new bottleneck (I have this problem also on another project). Perhaps, my PRs should get much smaller. WDYT ?

Yes, we need the parent PRs to be merged first, then we can assess here. Although smaller PR's are easier to reason about, the size of your current PRs is not an issue atm. Where size do come in is that you should still categorize your scenarios into smaller feature and CI tag chunks.

That being said, you still need a LEZ domain expert to look at your scenarios; my biggest contribution is approach, organization and Cucumber-edness.

  - prove non-inclusion from the post-admission tip; guard P-24 against instruction-layout drift
  - pin the supply account by fixture id; honor caller sequencer configs instead of clobbering priority_fee
  - derive wait timeouts from block cadence; generic pre-state account counts in P-20
  - deduplicate wait loops, stake key derivation, and submit_stake steps; parallelize account reads
  Add a Background step "chain waits give up after N blocks" that replaces
  the hidden WAIT_TIMEOUT_BLOCKS constant, and make the unchanged-accounts
  assertion name the accounts it compares, e.g. "the config, funding and
  ownership accounts are unchanged", instead of the fixed snapshot set
  Use priority_fee_percent in the shared base config, read the minimum
  stake from the config's channel params, encode the raw Stake mirror
  with borsh and mover_account_id, and pass a program account id to the
  wallet's public send.
…iming

  Pass the stake funds account in every Stake pre-state list and assert the
  staked balance on it; claim the ownership account for P-13 through the
  token program, since a plain transfer no longer claims its recipient;
  donate from a genesis supply account in P-23, as plain transfers are
  fee-charged, and pin that the donation lands and stays outside the stake;
  shift the P-20 outline to 2 and 5 accounts around the new canonical four.
Split sequencer_registration.feature into three feature files, each a
coherent group with its own CI tag, and add one workflow step per group
to cucumber-integration-tests.yml following the run-cucumber-suite
pattern from #779 and #793:

- sequencer_registration.feature, @stake_registration_ci: the amount a
  first Stake moves (P-01, P-02, P-03, P-25, P-23)
- stake_account_validation.feature, @stake_accounts_ci: the pre-state
  account list, its signers, owners and count (P-04, P-13, P-14, P-20)
- stake_instruction_validation.feature, @stake_instruction_ci: the
  instruction bytes and call path (P-18, P-24)

Feature names drop the em-dash tagline so the artifact_subdir path the
suite action uploads on failure is plain ASCII. The non-inclusion
protocol rationale stays in sequencer_registration.feature; the other
two files point at it.
@romanzac
romanzac force-pushed the test/cucumber-sequencer-registration branch from e5ccfbe to ca3cd8f Compare September 11, 2026 06:07
-  right behind the transaction under test and judges non-inclusion against it.
- stake_chain_caller: a new guest that forwards an instruction into
  another program as a chained call. Validated by P-17 (a Stake chained
  through it is rejected by sequencer_stake's caller-is-none guard); also
  unblocks P-19, U-13, F-10. The top-level transaction is fee-charged,
  so the rejection shows as inclusion with reverted effects, paid by a
  genesis supply account.
- second native mover: the existing simple_balance_transfer. Validated by
  P-21 (Stake accepted through a non-authenticated_transfer mover). No
  claim on the funding account is needed: a debit is gated on the
  account's signature, which Stake passes through, not on its owner.
- both test programs are deployed at runtime through program_loader and
  addressed by the header account the deployment claims; the scenario
  wallet gains a deploy request and a payer-aware program transaction.
@romanzac
romanzac force-pushed the test/sequencer-registration-prerequisites branch from cb6154b to f7e1f09 Compare September 14, 2026 02:01
 Cucumber's run already parses --tags (with full tag expressions) and
  --name, which is what CI and local runs use. The env-var filter
  duplicated that with a weaker one and was ignored whenever --tags was
  passed.

@hansieodendaal hansieodendaal 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.

LGTM

@moudyellaz moudyellaz added the priority:medium Normal priority label Sep 17, 2026
Merge dev at 7e3f7f7 (CI: cache the resolved Bedrock node by its
pinned revision, and pass one env pair per line to the integration-test
prebuild step). The merge was conflict-free and touches only the CI
workflow and the new resolve-bedrock-node action; the branch's
sequencer registration prerequisites are kept as is.
RUSTSEC-2026-0385 (ctutils), -0386 (tokio AsyncFd I/O safety) and
-0387 (crypto-bigint constant-time branches) were published after the
last lockfile sync and fail `cargo deny check` on an unchanged lockfile.
Bump tokio to 1.54.1, crypto-bigint 0.7 to 0.7.9 and ctutils to 0.4.6,
which carry the fixes.

crypto-bigint 0.5.5, reached through elliptic-curve 0.13 under k256
0.13, which the workspace pins directly and libp2p-identity also uses,
has no patched 0.5 release; the fix only exists in the 0.7 line, which
requires migrating to elliptic-curve/k256 0.14. RUSTSEC-2026-0387 is
ignored in .deny.toml with that reason.
Merge dev at 0e5a0d9, which reports advisories instead of gating on
them, checks them nightly, bumps tokio to 1.53.3 and ignores the
ctutils and crypto-bigint 0.7.5 advisories rather than bumping them.

This branch already bumps tokio to 1.54.1, crypto-bigint 0.7 to 0.7.9
and ctutils to 0.4.6, so the lockfile keeps those versions and the
.deny.toml keeps only the RUSTSEC-2026-0387 ignore for the unpatched
crypto-bigint 0.5 line. dev's ignores for RUSTSEC-2026-0385 and the
yanked crypto-bigint@0.7.5 are dropped because neither crate version is
in this lockfile anymore. dev's switch of unused-ignored-advisory to
warn and its CI workflow changes are taken as is.
Merge dev at 8aea254, which archives the integration tests without
debug info in CI. The merge is conflict-free: dev only touched the
GitHub workflow files, and the branch's cucumber sequencer registration
tests and dependency bumps are untouched.
Merge dev at fe93529: a failed channel read is now an error item
rather than the channel's end in bedrock, the indexer and the zone
indexer; the indexer's status is dumped on a catch-up timeout; bedrock
logs the size of every published block; chain_state gains zone indexer
tests. The merge had no conflicts; the branch's dependency bumps in
Cargo.lock are preserved alongside dev's new chain_state async-trait
entry.
Merge dev at c830502, which moves the cucumber CI run onto a build job
plus a per-suite matrix. No conflicts: dev touched only the workflow and
composite action, and the matrix tags match the suites this branch
already splits the stake scenarios into.
Merge dev at e0da95a into the sequencer registration prerequisites
branch. The only conflict was the import block of the wallet test
app, where dev's sequencer-wallet FFI integration added the
SequencerClient import next to this branch's MAX_SEGMENT_DATA_LEN
import; both are kept.
Merge dev at 68ad874 into the sequencer registration prerequisites
branch. Dev brings atomic deposits in the sequencer, the channel_config
actor renamed to channel_signing, the core FFI HTTP client and the
wallet storage u128 nonce fix. No conflicts: dev did not touch the
cucumber stake scenarios, the wallet test app or the advisory pins this
branch carries, and the only shared file, Cargo.lock, merged cleanly
with the branch's tokio, crypto-bigint and ctutils bumps intact.
Merge dev at 1806e87 into the sequencer registration prerequisites
branch. The merge applied cleanly: dev's fee-aware genesis funding and
private transfer fee changes do not touch the stake Cucumber steps, the
wallet app's runtime program deployment, or the advisory ignores this
branch carries. Cargo.lock keeps the branch's tokio, crypto-bigint and
ctutils bumps alongside dev's new dependencies.
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Suggested reviewers

These code owners were requested because this pull request touches areas they know best (see CODEOWNERS). Each is asked to focus on the files listed under their name.

Reviewer Why Files
agureev Integration tests 10
Pravdyvy Integration tests 3
arjentix Integration tests 6
schouhy Integration tests 7

agureev

Integration tests (/integration_tests/, /integration_tests/src/cucumber/, /integration_tests/src/testing_framework/)

10 files

Pravdyvy

Integration tests (/integration_tests/)

arjentix

Integration tests (/integration_tests/src/cucumber/)

6 files

schouhy

Integration tests (/integration_tests/src/cucumber/, /integration_tests/src/testing_framework/)

7 files

The 2026-10-26 bump of crypto-bigint, ctutils and tokio moved the guest
image ids, so the committed artifacts no longer matched and the artifacts
check has failed on every run since. dev clears the same advisories with
ignore entries and keeps the old versions, so take dev's lockfile and
ignore list as they are.
Merge dev at 952bd6d into test/sequencer-registration-prerequisites.
Dev brings the CI changes that move integration shard retries inside
nextest and give each shard its own archive group. The merge touched
only the CI workflow and its discovery scripts; the branch's cucumber
stake and sequencer registration work is unchanged.
Merge dev at 5562eee (drop the sequencer_bootstrap and bridge nextest
serial groups, Bedrock confirmation depth 3 with the slow-finality
variant at depth 10). The merge applied cleanly with no conflicts; the
branch's cucumber stake scenarios and wallet helpers are unchanged.
Merge dev at e3edf47 (contains 3d3bac3). The only file touched on
both sides, the integration tests' wallet app, merged automatically:
dev's allow-revert switch on the deployed wallet sits alongside this
branch's runtime program deployment and paid-by transaction requests.
Merge dev at bafd07b (bump logos-blockchain to 0.3.5-rc.1) into
test/sequencer-registration-prerequisites. The merge was clean: dev's
changes land in the clock program, bedrock and channel-signing actors,
sequencer config and the bridge integration test, none of which overlap
the stake-scenario cucumber steps and wallet helpers this branch adds.
integration_tests type-checks with its tests on the merged tree.
Merge dev at 5cebe5a (size-metered privacy-preserving transaction
storage fees, pinned bridge_lock zones, cross-zone messages from any
program, actor metrics) into the sequencer registration cucumber
suite. The merge applied cleanly with no conflicts; the branch's own
changes are limited to the cucumber stake scenarios, their step
definitions and the wallet test app, and the integration_tests crate
still type-checks on top of dev.
@moudyellaz moudyellaz added the enhancement New feature or request label Nov 13, 2026
Merge dev at 14cb5d0, which moves the testing framework imports
under the logos-zone-sdk crate. The only conflict was the import
block of the integration-test wallet app: keep the branch's
program_loader_core import next to dev's zone-sdk re-exports.
Merge dev at dcbd318 (proven fee tips). The merge applied without
conflicts; the stake cucumber scenarios and wallet test helpers of this
branch are unchanged on top of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority:medium Normal priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants