Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e6ce3f4
test: sequencer registration
romanzac Aug 24, 2026
51c1c53
fix: formatting
romanzac Aug 25, 2026
c9ae91f
fix: remove references to test plan
romanzac Aug 25, 2026
215d255
fix: correctness and robustness
romanzac Aug 25, 2026
e381ba6
fix: fold sequencer config into deploy_lez_stack
romanzac Sep 7, 2026
eadb41e
refactor: name the non-inclusion block window in the scenario
romanzac Sep 7, 2026
d1032c1
refactor: declare wait timeout and snapshot scope in the scenario
romanzac Sep 7, 2026
33790d0
fix: adapt cucumber stake scenarios to the dev API
romanzac Sep 7, 2026
bc8eaac
fix: remove unused async
romanzac Sep 7, 2026
3a1b8e5
fix: address unused dependencies
romanzac Sep 7, 2026
8d1d13f
fix: address cargo deny check and formatting
romanzac Sep 7, 2026
fd39afc
fix: remove confusing ported comment
romanzac Sep 7, 2026
69de217
fix: adapt cucumber stake scenarios to the funds PDA and implicit cla…
romanzac Sep 7, 2026
ca3cd8f
test: split the stake scenarios into three CI suites
romanzac Sep 11, 2026
cc3a1c3
fix: the non-inclusion step now submits a canary transaction
romanzac Sep 11, 2026
e088401
Merge branch 'dev' into test/cucumber-sequencer-registration
romanzac Sep 12, 2026
f7e1f09
refactor: chained-caller and second-mover test prerequisites
romanzac Aug 26, 2026
77e3ad4
fix: drop the custom CUCUMBER_TAGS filter
romanzac Sep 14, 2026
7ddb2e4
fix: add a step to match P-01's full assertion set
romanzac Sep 14, 2026
b59d26c
Merge branch 'dev' into test/sequencer-registration-prerequisites
romanzac Oct 12, 2026
2696563
refactor: name the unclaimed ownership account step without an owner
romanzac Oct 12, 2026
040b46b
Merge remote-tracking branch 'origin/dev' into test/sequencer-registr…
romanzac Oct 15, 2026
0f998fd
Merge branch 'dev' into test/sequencer-registration-prerequisites
romanzac Oct 18, 2026
e478383
chore(merge): sync with dev
romanzac Oct 21, 2026
80e477a
fix(deps): patch rustls webpki crates for new RustSec advisories
romanzac Oct 21, 2026
f422b85
chore(merge): sync with dev
romanzac Oct 21, 2026
2e81806
ci(deny): drop the stale RUSTSEC-2026-0383 ignore
romanzac Oct 22, 2026
3e1cddb
chore(merge): sync with dev
romanzac Oct 24, 2026
fba9e88
fix(deps): bump tokio, crypto-bigint, ctutils for new RustSec advisories
romanzac Oct 26, 2026
41e3ceb
chore(merge): sync with dev
romanzac Oct 26, 2026
a17656d
chore(merge): sync with dev
romanzac Oct 26, 2026
83027ed
chore(merge): sync with dev
romanzac Oct 26, 2026
d62a347
chore(merge): sync with dev
romanzac Oct 27, 2026
d22ca26
chore(merge): sync with dev
romanzac Oct 29, 2026
bd05f77
chore(merge): sync with dev
romanzac Oct 29, 2026
6594eb7
chore(merge): sync with dev
romanzac Oct 29, 2026
0e0754f
chore(merge): sync with dev
romanzac Oct 29, 2026
139ba52
chore(merge): sync with dev
romanzac Oct 29, 2026
dbdeee9
chore(merge): sync with dev
romanzac Oct 30, 2026
da2553f
fix(deps): return Cargo.lock and .deny.toml to dev's
romanzac Oct 31, 2026
c855f1f
chore(merge): sync with dev
romanzac Nov 2, 2026
b509802
chore(merge): sync with dev
romanzac Nov 3, 2026
7ada36b
chore(merge): sync with dev
romanzac Nov 4, 2026
002d9ba
chore(merge): sync with dev
romanzac Nov 5, 2026
258bf49
chore(merge): sync with dev
romanzac Nov 10, 2026
ef0e16c
chore(merge): sync with dev
romanzac Nov 11, 2026
bb386a6
chore(merge): sync with dev
romanzac Nov 12, 2026
2e47536
chore(merge): sync with dev
romanzac Nov 13, 2026
68e8b70
chore(merge): sync with dev
romanzac Nov 15, 2026
e8412a2
chore(merge): sync with dev
romanzac Nov 17, 2026
e7d0ef4
chore(merge): sync with dev
romanzac Nov 18, 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
39 changes: 39 additions & 0 deletions .github/workflows/cucumber-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,45 @@ jobs:
image: ${{ inputs.image }}
node_binary: ${{ github.workspace }}/bedrock/.resolved/logos-blockchain-node

# Feature: Sequencer registration (@stake_registration_ci)
- name: Run cucumber suite - stake registration
if: ${{ !cancelled() && steps.build_cucumber.outcome == 'success' }}
timeout-minutes: 60
uses: ./.github/actions/run-cucumber-suite
with:
suite_tag: "@stake_registration_ci"
suite_name: stake-registration
artifact_subdir: "Sequencer registration"
max_concurrent_scenarios: "1"
image: ${{ inputs.image }}
node_binary: ${{ github.workspace }}/bedrock/.resolved/logos-blockchain-node

# Feature: Stake account validation (@stake_accounts_ci)
- name: Run cucumber suite - stake accounts
if: ${{ !cancelled() && steps.build_cucumber.outcome == 'success' }}
timeout-minutes: 60
uses: ./.github/actions/run-cucumber-suite
with:
suite_tag: "@stake_accounts_ci"
suite_name: stake-accounts
artifact_subdir: "Stake account validation"
max_concurrent_scenarios: "1"
image: ${{ inputs.image }}
node_binary: ${{ github.workspace }}/bedrock/.resolved/logos-blockchain-node

# Feature: Stake instruction validation (@stake_instruction_ci)
- name: Run cucumber suite - stake instruction
if: ${{ !cancelled() && steps.build_cucumber.outcome == 'success' }}
timeout-minutes: 60
uses: ./.github/actions/run-cucumber-suite
with:
suite_tag: "@stake_instruction_ci"
suite_name: stake-instruction
artifact_subdir: "Stake instruction validation"
max_concurrent_scenarios: "1"
image: ${{ inputs.image }}
node_binary: ${{ github.workspace }}/bedrock/.resolved/logos-blockchain-node

- name: Upload cucumber JUnit results
if: ${{ !cancelled() && steps.build_cucumber.outcome == 'success' }}
continue-on-error: true
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cross_zone_inbox_core.workspace = true
cross_zone_marker_core.workspace = true
bridge_lock_core.workspace = true
wrapped_token_core.workspace = true
token_core.workspace = true
indexer_service_rpc = { workspace = true, features = ["client"] }
indexer_service.workspace = true
sequencer_service_rpc = { workspace = true, features = ["client"] }
Expand Down Expand Up @@ -55,6 +56,7 @@ cucumber = { features = [
"macros",
"output-junit",
], workspace = true, optional = true }
futures.workspace = true
hex.workspace = true
log.workspace = true
num-bigint.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Feature: Sequencer registration

# Node-level (L3) coverage of the amount a first Stake moves: the happy
# path, the minimum-stake boundary from both sides, a funding account that
# cannot cover the amount, and a donation that reaches the ownership
# account before the first Stake. Every scenario runs against a deployed
# LEZ stack: transactions are signed and submitted through the scenario
# wallet, executed by the real sequencer, and every assertion reads state
# back through the sequencer's RPC API. The @P-NN tags are stable case ids.
#
# The account list a Stake names is covered by stake_account_validation.feature
# and the instruction bytes and call path by stake_instruction_validation.feature.
#
# Rejection semantics at node level: an invalid transaction is admitted to
# the mempool and only fails during block building, where the builder drops
# it from the block without surfacing the in-program rejection reason
# through any API. Rejection scenarios therefore assert non-inclusion plus
# unchanged accounts; the expected in-program reason is kept as a comment
# on each scenario and stays pinned by sequencer_core's unit tests.
#
# Non-inclusion alone is not evidence of a rejection: a transaction the
# builder accepted into a candidate block whose publish then failed is also
# in no block for ever, since a failed turn does not requeue what it popped,
# and later turns move the chain on regardless. The non-inclusion step
# therefore submits a canary, a plain transfer signed by the second genesis
# supply account, right behind the transaction under test, and asserts the
# canary landed in a block within the named window. That rests on two node
# properties that no API documents or pins:
# - mempool admission is synchronous with the send RPC reply, so a tip read
# after submission is at or past the admission point, and the canary is
# admitted behind the transaction under test
# - the block builder pulls the whole mempool on every turn, in admission
# order, so the turn that pulled the canary had pulled the transaction
# under test; the canary landing proves that turn published, and two
# blocks past the tip bound where it lands, the "within the next 2 blocks"
# window each rejection step names
# A canary that lands later, or never, fails the step instead of letting a
# failed turn pass as a rejection. One gap stays open: a turn that starts
# between the two admissions, pulls only the transaction under test and
# then fails to publish. With a two-second block cadence that needs the turn
# to begin inside the milliseconds between the two sends, and the RPC API
# exposes nothing that would close it. Should the node ever gain a
# transaction status API (pending, included, or dropped with a reason),
# replace the canary with it.
#
# Registration cases not yet covered here:
# - G-01..G-03 exercise genesis builders private to sequencer_core, where
# G-01 and G-02 are already covered

Background:
Given a LEZ stack with fast blocks and configured public accounts
And the sequencer_stake config account is at the default minimum stake
And a sequencer key with no config entry
And a default-owned, unclaimed ownership account for the sequencer key
And a funding account holding "ten times the minimum stake"
And chain waits give up after 60 blocks

@stake_registration_ci @P-01 @P0 @L3
# Mirrors the registration leg of tests/sequencer_stake_demo.rs,
# additionally asserting the config entry and both balance deltas.
Scenario: Happy-path registration through authenticated_transfer
When a Stake of "twice the minimum stake" is submitted
Then the stake transaction is accepted
And the config entry tracks the staked amount with no pending unstake
And the config entry points at the ownership account
And the ownership account is claimed by sequencer_stake backing the sequencer key with no pending unstake
And the funds account balance increased by the staked amount
And the funding account balance decreased by the staked amount

@stake_registration_ci @P-02 @P0 @L3
# In-program reason: "an initial stake must already meet the minimum".
Scenario: Registration one below the minimum is rejected
When a Stake of "one below the minimum stake" is submitted
Then the stake transaction is not included within the next 2 blocks
And the ownership account is not claimed
And the config has no entry for the sequencer key
And the config, funding and ownership accounts are unchanged

@stake_registration_ci @P-03 @P0 @L3
# The boundary is β‰₯ and genesis relies on it.
Scenario: Registration at exactly the minimum is accepted
When a Stake of "the minimum stake" is submitted
Then the stake transaction is accepted
And the config entry tracks the staked amount with no pending unstake

@stake_registration_ci @P-25 @P0 @L3
# In-program reason: "Sender has insufficient balance" β€” the mover call
# itself fails, so the whole transaction is rejected atomically. The most
# common real-world rejection on the stake-in walk.
Scenario: Funding account holds less than the amount
Given a funding account holding "one below the minimum stake"
When a Stake of "the minimum stake" is submitted
Then the stake transaction is not included within the next 2 blocks
And the ownership account is not claimed
And the config has no entry for the sequencer key
And the config, funding and ownership accounts are unchanged

@stake_registration_ci @P-23 @P1 @L3
# The plan expects a donation made before the first Stake to be absorbed
# into the stake (expected_balance_after = donation + amount). Two dev
# changes move the goalposts: a credit leaves a default-owned account
# unowned (claiming is implicit on data writes only), so the donation lands
# and the first Stake still claims the account; and the stake is custodied
# in the funds PDA, so the donation stays on the ownership account and the
# entry tracks only the staked amount. Revisit with the plan's Β§15.8
# decision.
Scenario: A donation to the unclaimed ownership account stays outside the first Stake
When a donation of 25 to the unclaimed ownership account is submitted
Then the donation transaction is accepted
And the ownership account is not claimed
And the ownership account balance increased by the donated amount
And the config and funding accounts are unchanged
When a Stake of "twice the minimum stake" is submitted
Then the stake transaction is accepted
And the config entry tracks the staked amount with no pending unstake
And the ownership account is claimed by sequencer_stake backing the sequencer key with no pending unstake
And the funds account balance increased by the staked amount
And the ownership account balance is unchanged
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Feature: Stake account validation

# Node-level (L3) coverage of the pre-state account list a Stake names:
# [funding, ownership, funds, config]. The program checks who signed, who
# owns the ownership account, that the config slot holds the real config
# account, and that the list has exactly four entries. Every scenario runs
# against a deployed LEZ stack through the scenario wallet and the
# sequencer's RPC API. The @P-NN tags are stable case ids.
#
# Rejection scenarios assert non-inclusion plus unchanged accounts; the
# non-inclusion protocol and its two-block window are described in
# sequencer_registration.feature.
#
# P-21 deploys a test program at runtime through program_loader, since test
# guests are not in the node's compiled-in program set. A deployed program is
# addressed by the header account its deployment claims, not by its image id.

Background:
Given a LEZ stack with fast blocks and configured public accounts
And the sequencer_stake config account is at the default minimum stake
And a sequencer key with no config entry
And a default-owned, unclaimed ownership account for the sequencer key
And a funding account holding "ten times the minimum stake"
And chain waits give up after 60 blocks

@stake_accounts_ci @P-04 @P0 @L3
# In-program reason: "must sign for the ownership account".
Scenario: Registration without the ownership account's signature is rejected
When a Stake of "twice the minimum stake" is submitted without the ownership account's signature
Then the stake transaction is not included within the next 2 blocks
And the config, funding and ownership accounts are unchanged

@stake_accounts_ci @P-13 @P1 @L3
# In-program reason: "not a sequencer_stake ownership account". Claiming is
# implicit on data writes, so a plain transfer leaves its recipient
# unowned; the token program claims the ownership account by writing a
# token holding into it, which is the foreign owner the plan names.
Scenario: Ownership account owned by another program is rejected
Given the ownership account is already claimed by the token program
When a Stake of "twice the minimum stake" is submitted
Then the stake transaction is not included within the next 2 blocks
And the config has no entry for the sequencer key
And the config, funding and ownership accounts are unchanged

@stake_accounts_ci @P-14 @P0 @L3
# In-program reason: "not the sequencer_stake config account". Mirrors
# lez/sequencer/core/src/tests.rs::an_ownership_account_cannot_stand_in_for_the_config_account
# for the Stake path: the stand-in is owned by sequencer_stake too, so only
# the id check can reject it.
Scenario: An ownership account cannot stand in for the config account
Given a second sequencer key staked through its own ownership account
When a Stake of "twice the minimum stake" is submitted with the second ownership account standing in for the config account
Then the stake transaction is not included within the next 2 blocks
And the ownership account is not claimed
And the config, funding, ownership and second ownership accounts are unchanged

@stake_accounts_ci @P-20 @P2 @L3
# In-program reason: "Stake requires a funding account, an ownership
# account, the stake funds account, and the config account". The canonical
# count is 4, so the examples sit one short of and one past it; a
# 4-account list with a wrong funds slot is P-27, not this case.
Scenario Outline: Wrong pre-state account count is rejected
When a Stake of "the minimum stake" is submitted with <count> pre-state accounts
Then the stake transaction is not included within the next 2 blocks
And the config, funding and ownership accounts are unchanged

Examples:
| count |
| 2 |
| 5 |

@stake_accounts_ci @P-21 @P2 @L3
# Stake is generic over its mover: it chains into whichever program the
# instruction names, handing it the funding and funds accounts. The
# simple_balance_transfer test program is a native two-account transfer
# distinct from authenticated_transfer. It needs no claim on the funding
# account: a balance decrease is gated on the account's signature, which
# Stake passes through to the mover, not on the account's owner.
Scenario: Registration through a second mover program is accepted
Given the simple_balance_transfer test program is deployed
When a Stake of "twice the minimum stake" is submitted with simple_balance_transfer as the mover
Then the stake transaction is accepted
And the config entry tracks the staked amount with no pending unstake
And the config entry points at the ownership account
And the ownership account is claimed by sequencer_stake backing the sequencer key with no pending unstake
And the funds account balance increased by the staked amount
And the funding account balance decreased by the staked amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Feature: Stake instruction validation

# Node-level (L3) coverage of the instruction itself rather than the amount
# or the accounts: the bytes a Stake carries and the call path an
# instruction may arrive on. Every scenario runs against a deployed LEZ
# stack through the scenario wallet and the sequencer's RPC API. The @P-NN
# tags are stable case ids.
#
# Rejection scenarios assert non-inclusion plus unchanged accounts; the
# non-inclusion protocol and its two-block window are described in
# sequencer_registration.feature.
#
# Instruction cases not yet covered here:
# - P-15, P-16 need no new test program: the mover instruction data is
# caller-controlled and opaque to sequencer_stake, so authenticated_transfer
# can be told to move a different amount than the Stake declares
# - P-19 needs a ConfirmStake chained from another program, rejected by the
# self-caller guard; the stake_chain_caller program supports it
#
# P-17 deploys a test program at runtime through program_loader, since test
# guests are not in the node's compiled-in program set. A deployed program is
# addressed by the header account its deployment claims, not by its image id.

Background:
Given a LEZ stack with fast blocks and configured public accounts
And the sequencer_stake config account is at the default minimum stake
And a sequencer key with no config entry
And a default-owned, unclaimed ownership account for the sequencer key
And a funding account holding "ten times the minimum stake"
And chain waits give up after 60 blocks

@stake_instruction_ci @P-18 @P0 @L3
# In-program reason: "ConfirmStake can only be invoked as a self-chained
# call". The expected balance matches the stake funds account, the account
# ConfirmStake reads, and the caller check is the handler's first assert,
# so it is the one that rejects. The ownership account signs because a
# top-level transaction needs a signer and the funds PDA has no key.
Scenario: ConfirmStake submitted top-level is rejected
When a ConfirmStake matching the current funds balance is submitted as a top-level transaction
Then the stake transaction is not included within the next 2 blocks
And the config, funding and ownership accounts are unchanged

@stake_instruction_ci @P-17 @P1 @L3
# In-program reason: "Stake is only invoked as a top-level user
# transaction". The stake_chain_caller test program forwards an otherwise
# well-formed Stake into sequencer_stake as a chained call, so the
# caller-is-none guard is the only assert that can reject it.
#
# Unlike the other rejection scenarios, the top-level transaction targets the
# test program, not sequencer_stake, so it is fee-charged rather than exempt.
# A charged transaction whose execution fails is not dropped: it is included
# with its fee kept and its effects reverted, advancing only the signers'
# nonces. The rejection therefore shows as inclusion with no state change
# apart from those nonces. A genesis supply account pays the fee, so the
# funding account's balance stays put; the funds and config accounts do not
# sign, so they are unchanged outright.
Scenario: Stake invoked as a chained call is rejected
Given the stake_chain_caller test program is deployed
When a Stake of "twice the minimum stake" is submitted as a chained call through the stake_chain_caller program
Then the stake transaction is included in a block
And the ownership account is not claimed
And the config has no entry for the sequencer key
And the config and funds accounts are unchanged
And the funding account balance is unchanged
And the ownership account balance is unchanged

@stake_instruction_ci @P-24 @P1 @L3
# The borsh half mirrors sequencer_stake core's
# a_non_curve_point_is_not_a_sequencer_key; the instruction half is
# the πŸ†• path of the plan: an off-curve Stake never reaches the handler
# (the instruction decode panics inside the zkVM guest and surfaces as a
# program-execution failure).
Scenario: SequencerKey accepts only Ed25519 curve points
Given 32 bytes that are not an Ed25519 curve point
Then the bytes are not decodable as a SequencerKey
And a StakeRecord carrying the bytes fails to decode
And an Instruction carrying the bytes fails to deserialize
When a Stake carrying the off-curve key bytes is submitted
Then the stake transaction is not included within the next 2 blocks
And the config, funding and ownership accounts are unchanged
Loading
Loading