Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 10.3 KB

File metadata and controls

73 lines (54 loc) · 10.3 KB

DLE client (daemon) programming rules

The client is the isomorphic daemon (core.ts, browser.ts): fetch to an archive, optional POST /ondemand/hook, local 7+2 recompute. It does not write disk WAL and does not produce blocks.

After any daemon / browser-client programming or probe-spec change, update this file in the same task.

Cluster count vs tip height (2026-08-15)

If the client surfaces a cluster / fission number:

  • Read liveGroupCount from trusted GET /health (or overview GET /api/v2/dle). Archive↔archive heartbeats use GET /liveness, not full /health.
  • No fission ⇒ 1; after lab M6 fission ⇒ 2 (two distinct canonical Group IDs)
  • Do not use dle_tip.height, eth_blockNumber, or AC height (NFT 42 stays 0x1 after AC)

probeArchive may pass through archive /health. When health includes liveGroupCount, keep it; on fetch failure do not overwrite a last trusted 2 (or 1) with 0 or shrink 2 to 1.

Standing invariants

  • Runtime: Node or browser (detectDaemonRuntime)
  • eth_chainId = CoNET-DLE Testnet EIP-155 0x44c45 — never CoNET L1 224422. This distinguishes the DLE plane; it is not Group ID.
  • Group ID (if shown) = L1 bootstrap register tx hash, not uint 1 and not dle.lab.group.v1
  • submitWaitHook / submitWaitHookToArchives send canonicalGroupId(groupId) so a legacy caller still posts the hash
  • P20: wait hooks are not intra-group gossip. submitWaitHook (one archive) sets fanoutComplete: false + singleArchiveAcceptNotGroupPool. submitWaitHookToArchives sets fanoutComplete only when every active archive queued. Lab HTTP is not production DePIN gossip
  • No tip VM: eth_call rejection is expected
  • On-demand wait session ≠ Clusters (see ../shared/ondemand/RULES.md)
  • No node: imports in core.ts / browser.ts
  • After P11: P12 seating EIP-712, P13 freeze-then-beacon, P14 (C_G) split, P15 challenge EIP-712, P16 BFT AC EIP-712, P17 on-demand attest EIP-712, P18 (Q_V) EIP-712, P19 on-demand freeze-then-bind, P20 wait-hook honesty, P21 lab BFT hashIndexRoot bind, and P22 official standby readiness EIP-712 landed (engine + tests). New-chain-user HTTP still only schema === 'DleLabValidatorQuorumV1'. Do not treat lab seating / challenge / BFT / on-demand / (Q_V) EIP-712, bftEip712, ondemandEip712, newchainValidatorQuorumEip712, labBeaconAfterFreeze, ondemandLabBeaconAfterFreeze, ondemandHookNotGossip, hashIndexCommittedInAc, standbyReadyEip712, officialStandbysReady, newchainOfficialStandbysReady, lab freezer 2249, or productionCgAvailable as production OperatorDomain / L1 wrapper / live CL RANDAO / 30-day qualification / production (C_G) / production DePIN gossip / production AC commitment / production secp256k1. P18 did not replace the on-demand lab beacon or gossip wait-hook. P19 cut over the on-demand lab beacon and did not replace gossip wait-hook. P20 cut over wait-hook honesty only. P21 binds hashIndexRoot into lab BFT and did not change daemon hook / new-chain-user HTTP. P22 gates lab-cli new-chain accept on two official standbys and did not change daemon hook / new-chain-user HTTP. P23 landed (live keep-deploy + evidence; honest 6/7 LIVE_OK; fd-01 409→accept; fd-06 HTTP unstable) and did not change daemon hook / new-chain-user HTTP. P24 landed (isolated node.ts uses the same officialStandbysReady callback; no sync.start() / no inventory freeze; runtime:test 154/154) and did not change daemon hook / new-chain-user HTTP. P25 landed (Explorer Certificates + Home non-green overlays; explorer:test 8/8; public SPA index-U1o9ul_I.js on dle.conet.network at 2026-08-18T00:18:49Z) and did not change daemon hook / new-chain-user HTTP. fd-06 remapped (2026-08-18, not P26): official standby seat now keep-data on 70.35.205.77 (~/dle-30d-lab); leftover 216.225.193.174 excluded. Did not change daemon hook / new-chain-user HTTP. Do not stop dle-newchain-user on .77. Scrape 2026-08-18T00:52Z: honest 7/7 GET :27101/liveness; officialStandbysReady still false (count=1, not sticky). Fan-out 2026-08-18T00:57Z: official standby envelopes POSTed to 7× /sync/standby-ready (200); six seats flickered ready=true then dropped as inventory grew. Peer-stale 2026-08-18T01:03Z: official peers still POSTed fd-06 to leftover .174. Peer-refresh 2026-08-18T01:10Z: lab:keep-refresh-fd06-peers ok; official configs now http://70.35.205.77:27101. Seven-seat ready=true flickered at 01:12:01Z then dropped as roots drifted. Split 2026-08-18T07:05Z / 07:08Z: honest 7/7 LIVE_OK; two official standbys on different four roots (fd-06 camp A vs fd-07 camp B). Envelope POST cannot make count=2. 08:01Z flicker 6/7 then drop in 21s. Operator authorized inventory freeze via lab:keep-freeze-inventory / POST /sync/inventory-freeze. Engine + tests: runtime:test 157/157; pilot 14/14; explorer:test 8/8. Live freeze 2026-08-18T08:35Z: official 7 + extra fd-08 inventoryFrozen=true reason=operator; honest 7/7 LIVE_OK; officialStandbysReady=true count=2; leaf 9750; pilotStartedAt=null. Evidence: pilot/evidence/conet-dle-p23-live-2026-08/operator-inventory-freeze.json. Standby gossip fan-out / peer refresh / split scrape / inventory freeze did not change daemon hook / new-chain-user HTTP. Operator authorized clock start via npm run lab:start-pilot-clock / POST /sync/pilot-clock. Live clock 2026-08-18T09:53:58.092Z (pilotQualified=false). Clock ≠ qualification. Did not change daemon hook / new-chain-user HTTP. Explorer clock overlay (2026-08-18, not P26): Home + Certificates show a non-green clock chip. Tests: explorer:test 10/10. Public SPA index-C8IdTq4H.js on dle.conet.network at 2026-08-18T10:15:00Z (replaced pre-clock index-U1o9ul_I.js). Painting the clock is not qualification and did not change daemon hook / new-chain-user HTTP. 7/7 liveness is not the 30-day gate.

Lab new-chain user (newchain-user-cli)

Separate from the isomorphic daemon. Deploy: npm run lab:deploy-newchain-user70.35.205.77:/home/peter/dle-newchain-user.

Step Behavior
Genesis smoke One POST /newchain/request each for asset / storage / trade; require 7/7 ok, identical requestId / chainNftId / valueHash, and validatorQuorum.schema === 'DleLabValidatorQuorumV1'
Random create After smoke, setTimeout 15–45s (no setInterval); pick a random class; persist data/status.json
Qualification Mode A replay + (Q_V=5/7) EIP-712 ArchiveValidatorQuorumAttest (P18); G1 then a per-chainNftId 4-of-5 AC (archiveCertificate present, chainNftId ≠ 42); dle_route → bootstrap Group ID hash; dle_getByHash(tipStateRoot)=hit; NFT 42 AC still live and eth_blockNumber unchanged by the new-chain AC. Smoke may return after 7/7 + matching hashes without waiting for AC. HTTP still only checks schema === 'DleLabValidatorQuorumV1'.

Not L1 NFT mint, Treasury burn, Settlement escrow, or 30-day archive qualification. Do not stop dle-ondemand-clients when restarting this user.

Mock-L1 auction CLI (mock-l1-auction-cli) + demo

Local Hardhat/Anvil MVP only. Not CoNET 224422 mainnet, not production DePIN, not lab notL1Nft newchain.

npm run mock-auction-cli -- --archive http://127.0.0.1:27101 <command> …
npm run mock-auction-demo   # in-process: attest → list/approve → lab settle (MOCK_L1_DEMO_MODE=settle|recovery)
npm run mock-auction-e2e    # MOCK_L1_E2E_MODE=settle|recovery on live local RPC (MOCK_L1_*)
npm run mock-auction-ci     # Round 11: unit tests + demo settle + demo recovery (no Hardhat)
# monorepo root: npm run dle:mock-auction-e2e  # hardhat node + deploy + recovery e2e then settle e2e
# monorepo root: npm run test:dle:ci           # Hardhat unit + full e2e (parent CI)
Command Role
register POST /mockl1/register with MockL1ChainRegistrationV1 (real local ERC-1155 tokenId, assignmentStatus=BOUND(2))
submit / cancel EIP-191 signed sell/buy orders → POST /trade/submit / /trade/cancel
scan / candidate Scanner proposes MockL1MatchCandidateV1 only — cannot settle
check / attest Archive legality + freeze-then-draw committee attest → TradeMatchCertificateV1. With Archive MOCK_L1_RPC_URL + MOCK_L1_SETTLEMENT, client custody flags are ignored
list / approve (rounds 5–7) CLI may POST Archive /trade/list / /trade/approve with session --pk. E2E settle mode POSTs both after attest. Demo POSTs them when configured
preflight (round 8) Read-only POST /trade/preflight — settle readiness + fee split; no phase change
unlist (round 9) Seller reclaim: POST /trade/unlist with --candidateHash + --pk. Clears listTxHash on success; phase unchanged. Use after list stuck or after settle … failed
settle (rounds 3 + 7–9) With MOCK_L1_SETTLE_ONCHAIN / authority key / --executeOnChain, Archive posts real settle tx. Round 7/8: Archive refuses without prior list+approve (unless --skipSettlePreflight); optional RPC eth_call preflight. Round 9: outcome: failed for lab recovery before unlist
Round 10 e2e/demo MOCK_L1_E2E_MODE=recovery = list → fail → unlist + ownerOf assert; settle = happy path. One-shot shell runs recovery then settle. Demo: MOCK_L1_DEMO_MODE=recovery (hook or RPC)
Round 11 CI Parent .github/workflows/dle-mock-auction-hardhat.ymltest:dle + dle:mock-auction-e2e. DLE mock-auction-ci / .github/workflows/mock-l1-auction-ci.yml for TypeScript gate. E2E settle path re-approves NFT (+ quote allowance if needed) before submit so custody still passes after recovery unlist
status GET /mockl1/chains + /trade/orders + /trade/matches

Forbidden: elevating DleLabNewChainRequestV1 / notL1Nft; using POST /ondemand/hook / WaitingPool as trade ingress; claiming lab beacon = live CL RANDAO; browser holding settlement authority private key.

Related

  • Archive fields: ../../RULES.md §Archive (Mock-L1 / Trade EventIngress)
  • Explorer UI: ../../../explorer/RULES.md (/mock-auction — Round 11 recovery English + Mark failed→Unlist; Round 9–10 recovery CTAs; no authority key in browser)