Skip to content

feat(local-env): catalog seeds full lifecycle for all 12 blueprints#3183

Merged
drewstone merged 33 commits intodevelopfrom
feat/catalog-staking-prereg
May 7, 2026
Merged

feat(local-env): catalog seeds full lifecycle for all 12 blueprints#3183
drewstone merged 33 commits intodevelopfrom
feat/catalog-staking-prereg

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Fixes the catalog seed so a fresh ./scripts/local-env/start-local-env.sh + yarn local:blueprint-ui-catalog produces 12 blueprints with active operators and approved service requests, end-to-end clean.

What was broken

  • registerOperator(blueprintId,...) reverted with OperatorNotActive for every blueprint past the LocalTestnet bootstrap fixture, because the deploy script only stakes operators on its single bootstrap blueprint.
  • approveService(uint64, uint8) reverted with UnknownSelector because PR Listen. to accounts change on MetaMask and UI fixes #119 unified approveService into approveService(ApprovalParams). Catalog ABI was stale.
  • BLUEPRINTS array hardcoded /home/drew/code/... paths.

What it does now

  • New ensureOperatorActiveInStaking() helper called before each registerOperator(blueprintId,…). Idempotent — returns early if the operator is already isOperatorActive. Otherwise approves OPERATOR_BOND (100 TNT) on the staking proxy and calls registerOperatorWithAsset(tnt, bond).
  • approveService ABI + call updated to the PR-119 ApprovalParams tuple shape, with empty arrays opting out of per-asset commitments / BLS / TEE.
  • BLUEPRINT_ROOT env var (default $HOME/code) replaces hardcoded paths.
  • Staking proxy + TNT token addresses constants match script/LocalTestnet.s.sol deploy order.

Verified

Blueprint exists: 12
Approving service request: 11
! skipped: 0

dutterbutter and others added 30 commits April 27, 2023 15:51
Co-authored-by: Pavan Soratur <pavanvsoratur@gmail.com>
Co-authored-by: vutuanlinh2k2 <69841784+vutuanlinh2k2@users.noreply.github.com>
Co-authored-by: Dustin Brickwood <dustinbrickwood204@gmail.com>
Co-authored-by: drewstone <drewstone329@gmail.com>
Co-authored-by: shekohex <dev+github@shadykhalifa.me>
Co-authored-by: vutuanlinh2k2 <69841784+vutuanlinh2k2@users.noreply.github.com>
Co-authored-by: vutuanlinh2k2 <vutuanlinh2002@gmail.com>
…26-03-20

[RELEASE] Merge develop into master
release: promote develop → staging (iframe feature)
release: promote staging → master (iframe feature + tnt-core v0.11.3)
drewstone added 3 commits May 7, 2026 12:24
Brings the local catalog seed to a clean end-to-end state — every
blueprint registers, every operator activates in staking, every
service request gets approved. No more 'OperatorNotActive' or
'UnknownSelector' reverts in the seed log.

Three coordinated changes:

- Operator staking pre-registration (the actual fix). Adds
  ensureOperatorActiveInStaking() that:
  1. Reads isOperatorActive(operator) on MultiAssetDelegation,
     returns immediately if true
  2. Otherwise approves the staking proxy on TNT for the 100 TNT
     bond and calls registerOperatorWithAsset(tnt, bond)
  3. Wraps in try/catch so duplicate-registration / insufficient-
     balance failures log cleanly without aborting the seed
  Called inside the seed loop right before each operator's
  registerOperator(blueprintId,...). LocalTestnet.s.sol only stakes
  operators for its bootstrap blueprint; this lets the other 12
  catalog blueprints succeed too.

- approveService ABI updated to PR-119's unified ApprovalParams
  shape (uint64 requestId, AssetSecurityCommitment[],
  uint256[4] blsPubkey, uint256[2] blsPopSignature,
  TeeAttestationCommitment[]). Previously the catalog was calling
  the deleted approveService(uint64, uint8) signature and getting
  UnknownSelector reverts on every blueprint.

- BLUEPRINT_ROOT env var (default $HOME/code) replaces the hardcoded
  /home/drew/code paths so the seed works for any operator without
  editing the script.

Local-env addresses for staking proxy + TNT token + 100 TNT bond
inlined as constants matching script/LocalTestnet.s.sol's deploy
order; override via env vars if you re-shuffle that script.

Verified end-to-end against a live anvil + tnt-core deploy:
  Blueprint exists: 12
  Approving service request: 11 (1 was pre-approved from prior run)
  ! skipped: 0
  + staking: registered for op1 + op2
@drewstone drewstone requested a review from AtelyPham as a code owner May 7, 2026 14:34
@drewstone drewstone merged commit adbbf05 into develop May 7, 2026
@drewstone drewstone deleted the feat/catalog-staking-prereg branch May 7, 2026 14:34
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-dapp ready!

Name Link
🔨 Latest commit d43f687
🔍 Latest deploy log https://app.netlify.com/projects/tangle-dapp/deploys/69fca2edd027470007c943cd
😎 Deploy Preview https://deploy-preview-3183--tangle-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-cloud ready!

Name Link
🔨 Latest commit d43f687
🔍 Latest deploy log https://app.netlify.com/projects/tangle-cloud/deploys/69fca2ed5f5f3600083678f3
😎 Deploy Preview https://deploy-preview-3183--tangle-cloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for tangle-leaderboard ready!

Name Link
🔨 Latest commit d43f687
🔍 Latest deploy log https://app.netlify.com/projects/tangle-leaderboard/deploys/69fca2edf8f04b00077b1493
😎 Deploy Preview https://deploy-preview-3183--tangle-leaderboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

4 participants