Skip to content

Fix sequencer QA findings: foreclosure, exits, replay and integrity - #56

Open
stephenctw wants to merge 8 commits into
mainfrom
fix/sequencer-qa-findings
Open

stephenctw wants to merge 8 commits into
mainfrom
fix/sequencer-qa-findings

Conversation

@stephenctw

Copy link
Copy Markdown
Member

This fixes the sequencer QA findings around canonical fee rejection, foreclosure, emergency withdrawals, signature replay, artifact integrity, and RPC credential logging. Each finding has a separate commit; a final lint fix corrects the watchdog test's shadowed variable.

Findings and changes

Finding Result
SEQ-4 Reject a whole batch containing an out-of-range frame fee before frame execution, without consuming its nonce; preserve overdue-direct execution.
SEQ-2 Verify cached/downloaded kernels against an independently pinned SHA-512 and verify watchdog snapshot hash trees before bootstrap/replay.
NODE-15 (sequencer portion) Omit startup RPC URLs and strip credential-bearing URLs from transport diagnostics.
SEQ-3 Require signed valid_until_block, enforce it at the shared execution boundary, persist it without truncation, and expose the frame clock through /fee.
SEAM-3 Publish reference-wallet exit entitlements covering credited balances and finalized scheduler-pending deposits, with a full-uint256 withdrawal builder and proof exporter.
SEQ-1 Refuse startup repair for foreclosed applications and stop the running sequencer when foreclosure is observed, including during idle submitter polls.

Compatibility and limits

  • Requires signing domain version 2, a fresh baseline database/setup, rebuilt canonical images, and matching exit deployment configuration. Existing signatures and pending batches are incompatible.
  • Expiry is inclusive and uses frame safe_block. Recovery does not immediately revoke signatures; replay within the signed deadline remains valid. Price/slippage constraints remain application-owned.
  • The exit integration is for the bounded reference wallet. Production engines need independent custody conformance. The on-chain test uses a finalization fixture and does not validate Dave's dispute/epoch finalization pipeline.
  • Foreclosure detection follows RPC completion and polling cadence; it is not atomic with the L1 transition.

Validation

  • 761 Rust tests passed across affected crates, plus 11 real canonical guest tests.
  • On-chain emergency withdrawal tests cover credited and queued balances, full-width amounts, invalid proofs, finalized-deposit refund rejection, and duplicate withdrawals.
  • Recovery/foreclosure E2Es cover expired-signature resubmission, repeated foreclosure restart refusal, and unavailable application-status RPC.
  • 51 watchdog unit tests and the real-machine stale-sidecar tamper regression passed.
  • Kernel download integrity controls, OpenAPI lint, strict Clippy, formatting, and cargo check passed locally.
  • Reproduced and fixed the CI Lua lint failure; the exact lint command now reports zero warnings.

QA finding SEQ-4: a batch with fee_price >= 17102 could permanently
halt the canonical guest.

Validate every frame fee before any frame drain or user-op execution.
Reject the whole batch without consuming its nonce while preserving the
independent overdue-direct backstop. Pin the fee boundary, invalid tail
frames, nonce reuse, and the documented off-chain structural omission.

Compatibility: canonical behavior changes require a rebuilt guest image.
Validation: scheduler unit tests; the subsequent signed-expiry commit adds
a combined real-machine fee/expiry regression.
QA finding SEQ-2: a release-hosted checksum did not independently pin the
kernel, and stale snapshot hash sidecars could hide modified state.

Pin the kernel SHA-512 in toolchain-pins.env and verify cached and newly
downloaded bytes against it. Include the pin in release manifests. Verify
the complete stored machine hash tree before watchdog bootstrap/replay.

Validation: genuine/poisoned kernel download controls, toolchain pin checks,
51 watchdog unit tests, and a real-machine stale-sidecar corruption test.
The sequencer portion of QA finding NODE-15 exposed credential-bearing RPC
URLs through startup and transport diagnostics.

Omit the startup URL, report only the origin in plaintext opt-in warnings,
and strip reqwest's attached URL before retry wrappers format failures.
Preserve typed transport errors and their causes. Document the remaining
server-response and dependency trace logging boundary.

Validation: credential-bearing URL diagnostics regression and sequencer
tests; strict Clippy passes.
…EQ-3)

QA finding SEQ-3: anyone holding a recovered-away operation could submit it
again when its nonce became current.

Add required EIP-712/SSZ valid_until_block and reject expired operations at
the shared execution boundary without consuming nonce or fee. Expose the
frame clock in GET /fee, persist the full u64 deadline, update clients and
fixtures, and account for the additional DA bytes in fee estimates.

The deadline is inclusive and uses frame safe_block, not wall time or L1
inclusion time. Recovery does not immediately revoke a signature: replay
before its deadline remains valid. Price/slippage limits remain app-owned.

Compatibility: signing domain version 2, changed batch format and baseline
schema; fresh setup and rebuilt canonical images are required.
Validation: shared execution/storage tests, 11 real-machine tests including
fee rejection and expiry boundaries, and revoked-signature recovery E2E.
…(SEAM-3)

QA finding SEAM-3: foreclosure stranded credited balances and finalized
deposits still pending in the scheduler, outside contract refund coverage.

Publish sorted full-uint256 wallet entitlements in a canonical accounts
drive, including authenticated supported-token pending deposits. Add a
matching withdrawal builder, verified snapshot proof exporter, deployment
geometry, and guardian-enabled on-chain test infrastructure.

Validation: real canonical replay and on-chain Application withdrawal of
credited and queued balances, including amounts above 128 bits; reject
invalid proofs, finalized-deposit refunds and duplicate withdrawals.

Compatibility: new canonical images and matching deployment configuration
are required. This is the bounded reference-wallet integration. Production
engines need their own custody conformance; the test finalization fixture
does not validate Dave's dispute/epoch finalization pipeline.
QA finding SEQ-1: foreclosure left the sequencer issuing confirmations and
reporting healthy before entering repeated recovery/no-op flush loops.

Require fresh pinned-chain/open-application status before startup repair,
and repeat the check on submitter polls, including idle polls. Treat the
pinned application's foreclosure revert as terminal. Unavailable startup
status retries without repair even when the persisted input view is fresh.

Validation: status classification, repeated startup refusal without sends,
real guardian foreclosure stopping admission/health, and warm restart
refusal while the status RPC is unavailable.

Detection follows RPC completion and poll cadence; it is not atomic with
the L1 transition. A Latest reorg may conservatively stop the process.
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