Skip to content

feat(inprocess): shared-network model + migrate distribution & staking#3706

Draft
bdchatham wants to merge 3 commits into
mainfrom
feat/inprocess-migrations
Draft

feat(inprocess): shared-network model + migrate distribution & staking#3706
bdchatham wants to merge 3 commits into
mainfrom
feat/inprocess-migrations

Conversation

@bdchatham

@bdchatham bdchatham commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

In-process migration: shared-network model + first YAML-suite wave

Second wave of the in-process integration migration (builds on the merged harness, #3642).

What's here

  • Keystone — node_admin operator key. Each validator's operator key is stored in its node keyring as node_admin, mirroring the docker localnode — so suites resolve the operator by name (valoper via --bech val, reward/commission queries, delegation targets) and run unchanged. provisionExtraKeys rejects an ExtraKey reusing the name (would silently overwrite the operator), with a regression test.
  • Shared-network test model. The runner's in-process arm starts one inprocess.Network in TestMain and reuses it across suites — required (one network per process — process-global EVM singletons) and efficient (amortizes bring-up + the one seid build). Mirrors the docker job model: one cluster, suites sequential.
  • Migrated: Bank, Distribution, Staking. Distribution's rewards and Staking's cross-node redelegate (node-0 → node-1) both exercise the operator-key seeding across distinct validators.

Measured (in-process, shared network)

Suite Docker In-process
Distribution 2.9 min ~30s
Staking (in the 4.3-min Mint&Staking&Bank job) ~16s
Bank (send_funds) folded into the shared run

All three + N=4 harness + guards green in one process (~87s package total incl. seid build).

Deferred (documented skips, each surfaced in go test)

  • Authz — staking/generic YAMLs re-keys add grantee and rely on a passphrase-prompting keyring backend; the harness test backend takes none. Needs keyring-backend parity or per-suite key isolation.
  • Mint — asserts the docker localnode's fixed genesis: both the mint-release schedule and the total supply (which folds in the full genesis allocation, not just minted tokens). Needs the localnode genesis (schedule + allocation) replicated, not the schedule alone.

Review

Independent, blinded, domain-led /xreview (per operator instruction: peer review independent of the systems engineer). Round 6 (keystone + shared-net + distribution) and Round 7 (staking + skips) — both RESOLVED. Highlights:

  • sei-network-specialist (dissenter) closed a silent operator-overwrite footgun (guard + test), confirmed the cross-node staking is semantically faithful (distinct valopers, non-vacuous assertions), and caught that the mint blocker is the full genesis, not just the schedule.
  • A rename-orphaned tx signer (an untouched caller) was caught by the full-package run, not the diff review.
  • Ledger: bdchatham-designs test-harness arc, Rounds 6–7.

Follow-ups

  • Keyring-backend parity / per-suite key isolation — unblocks the keys add-override suite class (authz).
  • Localnode genesis replication — unblocks mint + likely other genesis-specific suites.
  • Test residue — in-process runs write --generate-only tx files to the repo root (runner CWD = repoRoot for relative source); gitignore or write to a temp dir.
  • distribution/rewards timing — reward-accrual-between-queries is tight; passed 3/4 local. Harness-side block-pacing if it flakes in CI.

🤖 Generated with Claude Code

Keystone: name each validator's operator key `node_admin` (was the moniker),
mirroring the docker localnode — so suites resolve the operator's valoper,
rewards, and delegation-target by that name and run unchanged. Guard
provisionExtraKeys against an ExtraKey reusing the name (would silently
overwrite the operator with a plain account) + a regression test.

Runner in-process arm moves to one shared network started in TestMain and
reused by every suite (required by the one-network-per-process guard;
amortizes bring-up + the seid build). Migrate the distribution suite
(community_pool + rewards — rewards exercises the operator-key seeding).
Authz is skipped for now: its YAMLs re-`keys add` an existing key and rely on
a passphrase-prompting backend the `test` keyring isn't.

Fix the cross-node-tx signer in harness_test.go to the operator key's new name.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.36%. Comparing base (8ea349f) to head (eab7a8f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3706      +/-   ##
==========================================
- Coverage   59.31%   58.36%   -0.95%     
==========================================
  Files        2273     2186      -87     
  Lines      188364   178547    -9817     
==========================================
- Hits       111720   104203    -7517     
+ Misses      66583    65086    -1497     
+ Partials    10061     9258     -803     
Flag Coverage Δ
sei-chain-pr 0.00% <ø> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 87 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 6, 2026, 6:31 PM

bdchatham and others added 2 commits July 6, 2026 11:23
Staking migrates cleanly on the keystone: admin delegates/redelegates/unbonds
across validators, resolving each node's operator valoper by node_admin
(--bech val). The cross-node redelegate (node-0 -> node-1) exercises two
distinct operators.

Mint is skipped: mint_test.yaml asserts the docker localnode's exact
mint-schedule genesis (total 999999999999usei, fixed supply), but the harness
boots ModuleBasics.DefaultGenesis. Needs the localnode mint genesis replicated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mint skip: broaden the remediation — the total-supply assertion folds in the
localnode's full genesis allocation, not just the mint schedule, so replicating
the schedule alone wouldn't unblock it (sei-network catch). Drop the drift-prone
inline numbers; point to mint_test.yaml. Staking: fix the ambiguous "which"
antecedent + doubled valoper-resolution phrasing (idiom + prose).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bdchatham bdchatham changed the title feat(inprocess): migrate distribution suite + shared-network test model feat(inprocess): shared-network model + migrate distribution & staking Jul 6, 2026
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