Skip to content

feat: create batch-operator/underwriter accounts via the node owner (roa::newuser)#37

Open
heifner wants to merge 5 commits into
masterfrom
feat/node-owner-operator-accounts
Open

feat: create batch-operator/underwriter accounts via the node owner (roa::newuser)#37
heifner wants to merge 5 commits into
masterfrom
feat/node-owner-operator-accounts

Conversation

@heifner

@heifner heifner commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Batch-operator and underwriter accounts are now created by the node owner instead of directly by sysio, mirroring the production sponsorship path: provisioning calls sysio.roa::newuser as wireno with the operator's deterministic label (batchop.a, uwrit.a, a flow's depositor) as the sponsor nonce, and adopts the chain-generated wireno.<suffix> account name from the sponsors table. Producers are unchanged (their accounts stay defproducer*, keyed by their node's K1).

Design

  • Label vs account. OperatorAccount gains label — the deterministic handle the harness keys everything by (ClusterKeyStore is label-keyed; node↔operator association, daemon node names/dirs, flow constants are all labels). account is the chain-generated name, written back by the sponsored-creation step and resolved from the key store at RUN time everywhere it matters (regoperator data, authex links, daemon --batch-operator-account/--underwriter-account args, opreg-row and batch_op_groups comparisons, dispute candidates, crank auth actors).
  • New steps in WireOperatorProvisioningTool: planSponsoredAccountCreation (one newuser write as [wireno@active]; re-entrant — adopts an existing sponsor row; tolerates the never-written-KV-table read on a fresh chain) and planRegistration (regoperator with the run-time-resolved account, replacing the plan-time OperatorSteps.planRegister usage).
  • Full rename sweep (no half-renames): Constants.batchOperatorLabel/underwriterLabel, NodeConfig.batchOperatorLabel/underwriterLabel, ClusterState + PidSources, operatorLabel params on the ETH/SOL collateral + funding tools, WireUnderwriterTool.underwriterLabels, OperatorDaemonTool (which also had a latent label/account divergence between its idempotency check and the daemon's NodeConfig name — fixed).
  • config.ini no longer renders the operator-account lines — the generated account rides the daemon CLI args resolved from the key store at start.
  • docs/production-bootstrap.md Stage 12 documents the new path (stacked on docs: sync production-bootstrap.md with the current master bootstrap #35).

Verification

  • Live flow: flow-operator-collateral-deposit end-to-end green — operators provisioned as wireno.aasrg/wireno.dyukh/wireno.jjmui (batch) + wireno.v1ilz (underwriter) + wireno.zngjk (flow depositor); authex links, regoperator, daemon relay, epochs advancing 4/4 OPP directions, ETH bond → depot credit → SOL bond → ACTIVE → withdraw → flushwtdwWITHDRAW_REMIT → outpost escrow decrement, all steps SUCCESS.
  • Unit tests: new runner coverage (fresh-create, adopt-existing, rejected first read, no-row failure, resolved-account registration) + label-keying/sort determinism on ClusterKeyStore; all touched suites green, all other package suites green (the pre-existing host-baseline jest failures were confirmed identical on a stashed clean checkout).
  • Lint: 0 errors.

Notes

heifner added 2 commits July 21, 2026 15:00
Re-verified every value and action against ClusterBuildDefaults + Constants
(and wire-sysio master for contract-side claims); the doc had drifted:

- epoch_duration_sec 360 -> 90; epoch_retention_envelope_log_count 128 -> 10
- uwrit setconfig rewritten to the current 4-field ABI (fee_bps 30,
  min_fromwire_amount, fromwire_revert_fee_bps; fee_split_* fields removed)
- stablecoin token rows register precision 6; reserves carry
  source_token_precision with the /1000 stablecoin chain seed
- dropped actions that no longer exist: sysio::init, the authex/sysio-active
  authority rewrites, and the cross-contract @sysio.code active delegations
  (the nine OPP owner grants are the only authority rewrites)
- producers are keyed by their node's generated K1, operators by their own
  generated K1 (DEV_K1 remains genesis + sysio active + wireno only); no
  addpolicy during bootstrap
- stages renumbered to follow ClusterBuildDefaults.compose execution order
  (config before node owner; outposts -> registry -> uwrit; links before
  regoperator); PREACTIVATE explained via the genesis intrinsic whitelist
- port scheme rewritten (10500-11999 band, bios 10788/10776, dynamic pairs
  for producer/operator nodes); underwriter daemons load 5 plugins; 100-SOL
  batch-operator airdrop; giftram rejects (not skips) non-finite targets
- flagged target design at Stage 12: operator accounts to be created by a
  node owner (pending harness/flow update)

Change-Id: If2482c66e5d2f3720a6da523ed5cc25a1309b5af
…roa::newuser)

Operator accounts are now node-owner-created, mirroring the production
sponsorship path: provisioning invokes sysio.roa::newuser as the bootstrap
node owner (wireno) with the operator's deterministic LABEL as the sponsor
nonce, and adopts the chain-generated wireno.<suffix> account name from the
sponsors table (re-entrant; tolerates the never-written-KV-table read on a
fresh chain).

- OperatorAccount gains `label` (the deterministic handle = newuser nonce;
  producers keep label == account); ClusterKeyStore keys operators by label
  and sorts operatorsByType for parallel-provisioning determinism
- WireOperatorProvisioningTool: planSponsoredAccountCreation replaces the
  sysio-newaccount step for OPP operators; regoperator moves to a run-time
  planRegistration (the generated account is unknown at plan time); authex
  links carry the resolved chain account
- Full label rename sweep (no half-renames): Constants.batchOperatorLabel/
  underwriterLabel, NodeConfig.batchOperatorLabel/underwriterLabel,
  ClusterState + PidSources, operatorLabel params on the ETH/SOL collateral
  + funding tools, WireUnderwriterTool.underwriterLabels, OperatorDaemonTool
  (also fixes a label/account divergence between its idempotency check and
  the daemon NodeConfig name)
- config.ini no longer renders batch-operator-account/underwriter-account:
  the generated account rides the daemon CLI args resolved from the key
  store at start
- All 8 operator-referencing flows resolve chain accounts from the key
  store at run time (opreg rows, epochstate group membership, dispute
  candidates, crank auth actors)
- docs/production-bootstrap.md Stage 12 updated to the newuser path

Verified: flow-operator-collateral-deposit end-to-end (operators
provisioned as wireno.aasrg/dyukh/jjmui/v1ilz + depositor wireno.zngjk;
bonds, ACTIVE flip, withdraw, WITHDRAW_REMIT all green), cluster-tool unit
suites + all other package suites green, lint clean.

Change-Id: I91af84f790d2786853cc600197d43784f750a49d

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

This is a massive change affecting enumerable flows and requires real discussion before hand

…-sysio #529 pins batch_op_groups)

wire-sysio #529 (SEC-28) makes sysio.epoch::setconfig reject any
batch_op_groups change once the rotation schedule is materialized. The
flow's one-group-of-three reshape (bootstrap 3 groups -> 1) now trips the
guard — first hit on the gate's first post-merge master run. Bootstrap with
BootstrapBatchOperatorCount = 1 so the derived epoch config materializes
exactly the DisputeBatchOperatorGroupCount (= 1) group from the start; the
reshape then only raises operators_per_epoch / the active minimum, which
the guard (an equality check on the group count) permits.

Verified: flow-batch-operator-slashing green end-to-end locally against
wire-sysio master contracts (dispute opened, canonical vote, non-canonical
deliverers slashed, 146 report steps ok).

Change-Id: I4787e3cd5861c1d37e3f21981ec91629045db6c5
@heifner

heifner commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Gate run 29871325332 (BRANCH_WIRE_TOOLS_TS=feat/node-owner-operator-accounts, everything else on defaults): 12/13 flows green, including operator-collateral-deposit and all six swap flows on the node-owner-created accounts.

The one failure — flow-batch-operator-slashing — was a pre-existing incompatibility with today's wire-sysio master, not this PR's change: wire-sysio #529 (merged 14:15 CDT) added "batch_op_groups cannot change once the rotation schedule is materialized" to sysio.epoch::setconfig, and the flow's long-standing one-group-of-three reshape (bootstrap 3 groups → 1) now trips it. This dispatch was the first gate run against post-#529 master (the earlier success today ran a BRANCH_WIRE_SYSIO override). Even in the failing run, the dispute operators provisioned cleanly as wireno.* accounts.

Fixed in 8f00ead: the flow bootstraps with BootstrapBatchOperatorCount = 1, so the schedule materializes exactly the one group it needs and the reshape only raises operators_per_epoch (the guard is an equality check on the count). Verified green end-to-end locally against master contracts (dispute → canonical vote → slash, 146/146 steps). Re-dispatching the gate.

Side observation while diagnosing (pre-existing, not addressed here): ClusterBuildOptions' terminateMaxConsecutiveMisses / terminateMaxPercentMisses24h / terminateWindowMs are accepted by the options + CLI surface but never resolved into ClusterConfigoperatorRegistryConfig hardcodes the dev values, so the slashing scenario's miss-ladder overrides are silently dropped.

@heifner

heifner commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Gate re-run 29876862714 with 8f00ead: all 13 flows green ✅ — including batch-operator-slashing (340s) against post-#529 wire-sysio master. Ready for review.

heifner added 2 commits July 22, 2026 08:27
Per review on #35: the literal dev key strings (K1 public/WIF, BLS
public/PoP) are replaced with the deterministic derivation —
K1.regenerate(SHA256("nathan")) / BLS.regenerate(SHA256("wire")) — so no
key material is spelled out in the doc.

Change-Id: I14f5b861e951a3113bfed1e3730f3a07e804e2dd
…o-code

Change-Id: I20b0db12531e84549115fba4fef4628409b287e1
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.

2 participants