Migration, protocol compatibility and independent security review of token fleet #7
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/cw20-mintable#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Inventory deployed cw20-mintable instances from reliable chain/code records: admin, code ID, decimals, issuer/minter, protocol custody, balance and integration surfaces. Identify contracts that cannot be migrated. Plan controller deployment and registry binding, migration gates, DEX code-id pin/whitelist coordination, pools/router/LP/bridge/wrapper/treasury compatibility, backups and forward-fix rollback. A migration must not silently discard balances, allowances, minters, pending timers or reservations. Keep minter vs governance authority separate and preserve old CW20 JSON aliases. Explicitly document admin migration power as possible policy bypass requiring multisig custody.
Independent reviewer examines actual final commits and meaningful adversarial focused tests: all movement paths, query failure, timer shortening, stale pending requests, default limit drain, governance compromise blast radius, recovery disputes and upgrade bypasses. Fix findings before release. Deploy only exact reviewed artifacts through available authorized credentials; actual on-chain custody unavailable is recorded, not invented. Bounded testnet/local proof precedes mainnet. Public coverage and contract/controller identities required before claiming fleet-wide pause.
Dependency: controller/wallet/recovery implementation; review can begin on completed shards.
Working rules
User authorizes implementation and worker coordination. Trusted CL8Y governance is an explicit trust assumption; separate containment, unpause, recovery authorization, execution and key rotation. No social account alone establishes asset ownership. Never publish PII, secrets or private incident operations. Work in small reviewable increments, with bounded focused security tests; no broad soak runs or very long scripts. Publish commits/PRs and factual evidence. Keep acceptance open until actually met; source success does not establish live deployment. No automatic closing keywords in PR descriptions before full acceptance.
Implementation assigned to BB worker
thr_n4vtxxfcb7, coordinated bythr_4rw76j9kerin security epic.Dependency/order: Controller, wallet and recovery implementation, followed by independent review of pinned artifacts; deploy reviewed controller before migrating verified token inventory.
Worker is active in an isolated worktree. It owns implementation and truthful acceptance evidence, with independent review before production completion. Initial orchestration does not establish code/deployment acceptance.
Independent coordinator source review completed for controller + shared interface at
3333807148f096cc5894c2b74442655bc5f4ad93; reviewer did not author the controller. This reviews controller source/interface/documentation only, not token correctness or live deployment.Result: no blocking controller finding in reviewed scope. Inspected initial
2239cd2implementation, then exact final delta: three timer events gain storedinitiatorandproposed_at; shared interface changes are formatting only. Guard remains constant-work, maximum three validated addresses with input-order blacklist vector, explicit enrollment/version and authoritative epochs. Distinct role addresses, pause-only responder, governance-only unpause/enrollment/delayed clearing, immediate responder revoke/reblock, candidate acceptance, global nonces and checked counters are enforced. Governance-tenure epoch prevents blacklist-clear replay even after an address returns to governance. Existing proposal deadlines intentionally retain old-delay snapshots; new delay affects future proposals. Fractional block timestamps round deadlines up. Queries and local tests cover shared pause across two enrolled token identities, independent of fleet fanout.Independent bounded validation:
cargo test -p cw20-security-controller --libin integration worktree at the exact pin: 14 passed, 0 failed, test runtime 0.01s (build 0.93s). Reviewed meaningful authorization, role overlap, replacement/cancellation, old-delay shortening, fractional timestamp, stale-governance replay, overflow/funds and query-boundary tests. No broad script or extra full-workspace test run.Deployment acceptance remains open: verify actual multisig threshold and constituent-key independence, chain-level admin custody/upgrade policy, exact code/artifact checksums, intended chain/controller enrollment and every token's live fail-closed pointer/guards. Distinct addresses alone cannot prove independent people/keys or a multisig. Shared controller availability and trusted governance/admin remain documented assumptions. Wasm/optimizer/chain compatibility and migration custody are separate release evidence. Any subsequent controller semantic change requires a new pinned review; token review remains assigned to its independent reviewer.
Independent TOKEN source review receipt — pinned
2d70d43c65Result: no remaining blocking token finding identified in the reviewed scope. This concludes source review of integration
3333807148, corrective deltaa13c8f5fb6, and final source/schema delta2d70d43c65. Subsequent commits are outside this exact-pin conclusion.Independence: this reviewer authored the controller shard, not the token implementation. This receipt independently reviews TOKEN code only. Running controller tests as part of workspace validation is not independent controller approval. The coordinator's separate controller receipt is #4 (comment).
Scope inspected: src/security.rs, src/recovery.rs, guarded contract dispatcher, messages, allowances, migration and inherited minter-fix prerequisite against Forgejo main
2f8438b; token schemas; docs/token-security-v1.md; and tests/security_program.rs. Review used separate detached checkouts, with no implementation changes.Adversarial checks covered all six ordinary debit paths attributed to the balance owner, mint and allowance guards, owner/actor/recipient blacklists, bounded single-query fail-closed behavior, versions/vector lengths/unenrollment, callback rollback, lazy protection basis, conservative hourly rolling accounting, split/boundary/top-up drains, old-delay policy changes, replacement/cancellation/replay/relock, exact reservations and nondecreasing recovery replacement, source objections versus independent triage/veto, current-epoch governance-plus-dispute cancellation, destination acceptance/revocation/blacklist, fractional timestamps and the full 30-day minimum, role changes, immutable controller pointer, storage preservation, legacy JSON aliases, and admin upgrade trust.
Resolved edge: the implementation lead identified that a zero-value delegated debit could initialize another wallet's lazy basis before meaningful funding. Independently reviewed
a13c8f5: zero debits return before accounting/state initialization, after reservation and lock checks; dispatcher containment and allowance authorization remain enforced. The added zero-allowance/dust/funding regression passes. Final additive WalletResponse.initialized uses persisted WALLETS.has and matches generated schemas; it does not change execution semantics.Reproduced at final exact pin:
Limits: bounded source/native-test review and structural Wasm validation, not formal verification, a target-chain VM acceptance check, or live deployment evidence. An arbitrary governance/admin address does not establish multisig custody or independent constituent keys. Chain admins can replace code and bypass application policy; deployable code/checksum, custody, inventory, integration exemptions, and migration receipts still require separate verification. Individual legacy Rust execute_* helpers remain unguarded implementation helpers; downstream library users must enter through contract::execute. Default wallet throughput needs reviewed protocol assignments; no fleet-wide pause or compatibility claim follows from these tests. Issue #7 acceptance remains open for deployment/migration and coverage evidence. No live deployment performed.
Serial implementation/integration complete;91tests pass (56legacy+21cross-contract+14controller), strict workspace clippy, deterministic schemas, two repeat-identical Rust1.81/pinned optimizer builds and matching cosmwasm-check1.5.11 PASS for both exact optimized artifacts. Independent controller review3333807 and independent token/schema review2d70d43 published separately. CI bootstrapPR15 merged only after actual required check success; PR14 latest-head CI remains separately tracked. Current primary LCD evidence inventories35code10184 contracts, all cw2=0.1.0, plus95selected admin/minter/pool/router balance queries. Registered historical governance is confirmed on-chain2-of-3, but custody is not inferred: encrypted file-keyring access fails without unavailable passphrase/unlocked authorized quorum; test keyring empty and no signing broker credential discovered. Several primary-minter/governance overlaps and LP-admin execution routes require real verification/separation. No controller deployed,0/35migrated/enrolled, no chain broadcasts. Immutable/BSC/native/other-code/third-party assets not covered. Exact migration/DEX whitelist/pin/protocol assignment/backup/forward-fix sequence documented without fabricated payloads or bypassed timers.
Implementation PR: #14 . Reviewed exact-byte local candidate (draft, not deployed): https://git.cl8y.com/code/cw20-mintable/releases/tag/security-v1-review-2d70d43 . Rollout receipts: docs/rollout/{README.md,artifact-provenance.json,columbus-5-inventory.json,selected-integration-balances.json}. Contract lead thr_n4vtxxfcb7 retains issue/rollout ownership; parent coordinator thr_4rw76j9ker. No closing keywords or live coverage claim; this issue remains open for unverified production acceptance.
Compiled optimized-Wasm VM smoke receipt — PASS (local only)
Executed the exact optimized release artifacts associated with reviewed source
2d70d43c65. Compared src/, packages/, and contracts/security-controller/ against final integration8dc22d9885: no differences. This supplements the independent TOKEN source receipt #7 (comment); controller execution evidence does not constitute independent review by its author.Artifact identity was checked before loading using SHA-256:
The isolated harness links cosmwasm-vm =1.5.11 and cosmwasm-std =1.5.11, with the checker's locked dependency versions, and uses Rust 1.81.0. It links no native token/controller implementation. It loads both Wasm files into actual VM instances and dispatches actual Wasm instantiate/execute/query entry points. The testing smart-query host forwards the token's raw smart-query payloads to the compiled controller VM, rather than fabricating config/guard responses.
Successful assertions:
Initial offline two-job harness build completed in 55.09s, within the 180-second build budget. Final harness execution exited successfully within a 30-second timeout. No dependency installation, contract source edits, new repository commit, CI restart, chain RPC, signing, or deployment was performed for this proof.
Portable harness files and transcript are available to the coordinating agents for draft-release/rollout attachment. The harness uses mocked host storage, address API and consensus Env; direct VM mocks are not a transactional chain layer, and these negative probes fail before writes. This short runtime smoke does not cover full Wasm recovery/migration/rotation scenarios, the target chain's configuration/gas schedule, signer custody, deployment identity, inventory or live coverage. Native 91-case evidence, independent source reviews, and deployment gates remain separate. No target-chain or fleet-wide live claim follows from this PASS.