You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#500 archived V8/V9 contracts at the Solidity, deploy script, and test layers. But V9-shaped TypeScript scaffolding remains in packages/chain, packages/agent, and packages/cli: null stubs, V9 method signatures in the public adapter interface, contract-resolution attempts that always fail, V9 response serializers, V9 ABI bundles, and a /api/pca/* route family that returns 503 because its underlying impl is wired to a contract that no longer exists.
Excising this scaffolding is a precondition for a clean V10 SDK surface (see #519 — V10 PCA NFT wiring) and removes maintenance burden on dead code paths.
Inventory
packages/agent/src/dkg-agent.ts
Five PCA stubs at L3978-4013 that return null and accept V9-shaped args:
createPublishingConvictionAccount(_amount: bigint, _lockEpochs: number) — _lockEpochs is V9-only; V10 NFT lock is global.
try{this.contracts.publishingConvictionAccount=awaitthis.resolveContract('PublishingConvictionAccount');}catch{// PublishingConvictionAccount not deployed}
Action: delete; V9 contract will never be deployed again.
V9-touching production methods still live and called from the publisher path. Each needs audit:
~5K LOC reference snapshot preserved as part of #500. Not imported anywhere. Action: keep as historical reference for the duration of V10.1; remove in V10.2 once V9 lessons-learned are codified in docs/migration/v9-to-v10-pca.md.
Phasing
This is naturally two phases. Phase A is mechanical removal of dead scaffolding; Phase B is structural refactoring of methods that still read archived storage.
Phase A — Remove dead code
Delete the five dkg-agent.ts PCA null stubs.
Delete V9 method signatures from chain-adapter.ts interface.
Delete V9 stubs from mock-adapter.ts and no-chain-adapter.ts.
Delete publishingConvictionAccount contract resolution in evm-adapter.ts:705-709.
Drop archived-contract ABIs from packages/chain/abi/.
Summary
#500 archived V8/V9 contracts at the Solidity, deploy script, and test layers. But V9-shaped TypeScript scaffolding remains in
packages/chain,packages/agent, andpackages/cli: null stubs, V9 method signatures in the public adapter interface, contract-resolution attempts that always fail, V9 response serializers, V9 ABI bundles, and a/api/pca/*route family that returns 503 because its underlying impl is wired to a contract that no longer exists.Excising this scaffolding is a precondition for a clean V10 SDK surface (see #519 — V10 PCA NFT wiring) and removes maintenance burden on dead code paths.
Inventory
packages/agent/src/dkg-agent.tsFive PCA stubs at L3978-4013 that
return nulland accept V9-shaped args:createPublishingConvictionAccount(_amount: bigint, _lockEpochs: number)—_lockEpochsis V9-only; V10 NFT lock is global.addPublishingConvictionAccountFunds(_accountId, _amount).addPCAAuthorizedKey(_accountId, _key)— V9 "key" terminology; V10 uses "agent".isPCAAuthorizedKey(_accountId, _key).getPublishingConvictionAccountInfo(_accountId)returning V9 shape{accountId, admin, balance, initialDeposit, lockEpochs, conviction, discountBps}.Action: delete all five stubs after the V10 NFT wiring lands. Replace with V10-shaped methods.
packages/chain/src/evm-adapter.tsL705-709: V9
publishingConvictionAccountslot init (resolves Hub key"PublishingConvictionAccount"):Action: delete; V9 contract will never be deployed again.
V9-touching production methods still live and called from the publisher path. Each needs audit:
reserveUALRange— reads V9knowledgeCollectionstorageverifyKAUpdate— reads V9 KA fieldsgetRequiredPublishTokenAmount— V9 pricing pathverifyPublisherOwnsRange— V9 KA owner checkpublishToContextGraph— V9 entrypointresolvePublishByTxHash— parses V9KnowledgeCollectionCreatedeventcreateKnowledgeAssetsV10— V10 method but contains V9 fallback / lookup branchupdateKnowledgeCollectionV10— sameAction: for each, either drop the V9 branch (if a V10 equivalent exists, e.g. KAv10
publish()), or archive the whole method.packages/chain/src/chain-adapter.ts(interface)V9 method signatures still declared even though impls return null:
Action: remove. Replace with V10 surface during PCA NFT wiring.
packages/chain/src/mock-adapter.ts,packages/chain/src/no-chain-adapter.tsV9 PCA method stubs for adapter-interface parity. Action: remove alongside the interface.
packages/chain/abi/Bundled JSON ABIs for archived contracts. Action: drop ABIs for:
PublishingConvictionAccountKnowledgeAssets(V8 KA)KnowledgeCollection(V8 KC)Staking(V8)PaymasterPaymasterManagerDelegatorsInfoKnowledgeAssetsStorageContextGraphNameRegistryIPaymasterpackages/cli/src/daemon/routes/pca.tsPublishingConvictionAccountcontract by name.serializeAccountInforeturns V9 fields.null).Action: rewrite handlers against V10 NFT API once the SDK wiring (issue #519) lands. Until then, the 503 responses are correct.
packages/chain/src/archive/evm-adapter-v8-v9-methods.ts~5K LOC reference snapshot preserved as part of #500. Not imported anywhere. Action: keep as historical reference for the duration of V10.1; remove in V10.2 once V9 lessons-learned are codified in
docs/migration/v9-to-v10-pca.md.Phasing
This is naturally two phases. Phase A is mechanical removal of dead scaffolding; Phase B is structural refactoring of methods that still read archived storage.
Phase A — Remove dead code
dkg-agent.tsPCA null stubs.chain-adapter.tsinterface.mock-adapter.tsandno-chain-adapter.ts.publishingConvictionAccountcontract resolution inevm-adapter.ts:705-709.packages/chain/abi/./api/pca/*routes: short-circuit to 410 GONE with link to migration doc, instead of 503. (Or remove the routes entirely until the V10 wiring lands in SDK + daemon PCA write surface is wired to archived V9 contract; V10 PCA NFT has no SDK path #519.)Phase B — V9 method excision in
evm-adapter.tsreserveUALRange,verifyKAUpdate,getRequiredPublishTokenAmount,verifyPublisherOwnsRange,publishToContextGraph,resolvePublishByTxHash,createKnowledgeAssetsV10V9 fallback,updateKnowledgeCollectionV10V9 fallback).evm-adapter.tsreferences no archived Hub contract key.Acceptance
Phase A
return nullPCA stubs indkg-agent.ts.chain-adapter.tsinterface.mock-adapter.ts/no-chain-adapter.ts.publishingConvictionAccountreferences inevm-adapter.tsoutside the archive subdir.packages/chain/abi/contains only V10-active contract ABIs./api/pca/*returns 410 Gone (or routes removed), not 503.pnpm -r buildgreen.pnpm --filter @origintrail-official/dkg-chain testgreen.Phase B
evm-adapter.tshas nothis.contracts.knowledgeAssets,this.contracts.knowledgeCollection,this.contracts.staking(V8),this.contracts.paymaster*,this.contracts.delegatorsInfo,this.contracts.knowledgeAssetsStorage,this.contracts.contextGraphNameRegistry,this.contracts.publishingConvictionAccountreferences.KnowledgeAssetsV10, V10 storages).DKG_HOME=.devnet/node1 NODE2_DKG_HOME=.devnet/node2 node run.mjs --no-pause) exits 0.Out of scope
DKGStakingConvictionNFTSDK surface — separate feature.References