Skip to content

docs: ADR 019 — node onboarding and bootstrapping flow - #191

Merged
thiras merged 2 commits into
mainfrom
adr/019-node-onboarding
Apr 8, 2026
Merged

thiras merged 2 commits into
mainfrom
adr/019-node-onboarding

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

Adds ADR 019, formalizing the complete ordered procedure from bare server to actively accepting paid delivery.

Background

Issue #190 identified that no single document describes the end-to-end node onboarding flow. Missing or mis-ordered steps produce silent protocol failures (e.g., gossip rejected because clock isn't synced, connections refused because blacklist wasn't fetched).

What's in this ADR

Five sequential phases, each with explicit MUST-level gates before advancing:

Phase Name Key steps
1 Pre-flight Clock sync, iroh key gen, Ethereum key funding, region selection
2 On-chain setup TOKEN approve, stake, registerNode (ed25519 + EIP-712 signatures)
3 Node startup Rate bounds fetch, blacklist sync, registry peer table bootstrap
4 Gossip Subscribe to cdn/global/v1 + regional topic, publish first NodeAnnounce
5 Accepting paid delivery Six-point acceptance criteria table

Also covers:

  • NAT/multiaddr handling — iroh hole-punching behaviour and when to call updateMultiaddrs
  • Re-onboarding after voluntary deregistration or auto-ejection (nonce increment, preserved firstRegisteredAt)
  • PoC vs. production differences table

Cross-ADR references

Synthesizes scattered requirements from ADRs 001, 003, 004, 008, 011, 016 into one sequential flow. No existing ADR content is changed.

Closes

Addresses item 1 (Node onboarding & bootstrapping flow) from issue #190.

@alpergundogdu
alpergundogdu requested a review from thiras April 8, 2026 10:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces ADR 019, which formalizes a five-phase node onboarding and bootstrapping flow, and updates the architecture overview. The review feedback highlights a missing multiaddr consistency check in the final acceptance criteria, a logical circularity regarding NAT discovery between the setup and startup phases, and terminology inconsistencies in signature payload descriptions.

Comment thread adr/019-node-onboarding.md Resolved
Comment thread adr/019-node-onboarding.md Resolved
Comment thread adr/019-node-onboarding.md Outdated
- Verifies the EIP-712 `bindingSignature` over `BindNodeId(nodeId, bindingNonce[msg.sender])`,
establishing the `nodeId → ethAddress` mapping for slash evidence and payment attribution.
- Verifies the `ed25519Signature` over
`keccak256(abi.encodePacked(nodeId, msg.sender, block.chainid, registrationNonce[nodeId]))`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description of the ed25519Signature payload here uses Solidity-specific terms (msg.sender, block.chainid), while the corresponding pseudo-code at Line 132 uses operator-context variables (ethAddress, chainId). While they refer to the same values, using consistent terminology (matching the canonical ADR 001) would reduce the risk of implementation errors in operator tooling.

References
  1. Maintaining consistent terminology across all Architecture Decision Records (ADRs) is prioritized over strict technical accuracy of a term, especially if the term is already established in other ADRs.

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.

Fixed — replaced msg.sender/block.chainid with ethAddress/chainId in the on-chain verification description (lines 111–114) to match the signing pseudo-code. Added a parenthetical note clarifying these are msg.sender and block.chainid in the on-chain context, for readers cross-referencing the Solidity in ADR 001.

alpergundogdu and others added 2 commits April 9, 2026 02:10
Formalizes the complete ordered procedure from bare server to accepting
paid delivery. Covers five sequential phases:

  1. Pre-flight: clock sync, iroh key gen, Ethereum key funding, region
  2. On-chain setup: TOKEN approve, stake, registerNode (ed25519 + EIP-712)
  3. Node startup: rate bounds fetch, blacklist sync, registry peer bootstrap
  4. Gossip: subscribe to cdn/global/v1 + regional topic, publish NodeAnnounce
  5. Accepting paid delivery: six-point acceptance criteria table

Also documents NAT/multiaddr handling (iroh hole-punching, when to call
updateMultiaddrs), re-onboarding after deregistration/auto-ejection (nonce
increment, preserved firstRegisteredAt), and PoC vs. production differences.

Updates architecture.md with ADR 019 summary entry.

Closes the bootstrapping gap identified in issue #190 (item 1).

Co-authored-by: Copilot <[email protected]>
- Use canonical decdn_gossip_messages_rejected_total{reason=clock_skew} (ADR 020 §2.6)
- Replace Solidity-isms (msg.sender, block.chainid) with operator-context vars (ethAddress, chainId) to match pseudo-code
- Clarify Phase 2/3 NAT circularity: NAT nodes register with relay placeholder; updateMultiaddrs called after Phase 3
- Add acceptance criterion #7: multiaddrs synchronized (on-chain matches Endpoint::direct_addresses())
- Update 'six criteria' references to 'seven'

Co-authored-by: Copilot <[email protected]>
@thiras
thiras force-pushed the adr/019-node-onboarding branch from c3f8909 to ef36b5e Compare April 8, 2026 23:10
@thiras
thiras merged commit 41b769c into main Apr 8, 2026
@thiras
thiras deleted the adr/019-node-onboarding branch April 8, 2026 23:11
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