Completes the tokenfactory tx-submittability work. The generated proto descriptor + handler-registration fixes landed in ad6a7ec0 (layers 1-2); this finishes the remaining layers and validates the whole path on a live node. - Client-side decode (layer 4): `clawchaind query tx`, block explorers, and tx history failed with "unable to resolve type URL /osmosis.tokenfactory.v1beta1.Msg*". The module is wired manually (app/tokenfactory.go), so app.RegisterModules registers its interfaces on the server registry, but the depinject-built client registry in root.go never saw them. Now ProvideClientContext calls tokenfactorytypes.RegisterInterfaces. - Block inclusion (layer 3) confirmed resolved: the earlier "txs pass CheckTx but are excluded from proposals" symptom was the first (hand-built) descriptor omitting the cosmos.msg.v1.signer option, so the proposal-path ante handler could not resolve the signer. The properly generated descriptor in descriptor.go carries the signer option; a stale untracked tx_descriptor.go that shadowed it was removed. - Regression test: x/tokenfactory/types/descriptor_test.go reproduces the original "does not have a Descriptor() method" failure and asserts RejectUnknownFields accepts a valid MsgMint (Coin submessage included). Proven end-to-end on the live local node as real signed CLI txs: create-denom (code 0) -> mint 1000000 (balance 1000000) -> burn 400000 (balance 600000); query tx now decodes the messages. The hand-written Marshal/Unmarshal and ProtoCoin in msgs.go are unchanged, preserving the validated Astroport-DEX Stargate wire path and all existing tests.
12 KiB
ClawChain Readiness: Status & Remediation Plan
Last updated: 2026-05-31 • Branch: fix/security-blockers-and-landing-3d
Bottom line
The question was: "do we have a full working real blockchain?" The honest answer was no — it could not even start. After fixing four startup bugs it now boots, produces blocks, reaches consensus, and processes real transactions through the core SDK and the custom modules. This document records what was wrong, what is now proven, and a concrete plan to close the remaining gaps.
What was actually wrong
The binary panicked on startup with four separate bugs, all in the oracle module. None were caught by the ~2,450 unit/integration tests, because:
- Unit tests construct keepers directly, bypassing depinject wiring, store mounting, and full app construction.
app/test_helpers.go::newTestAppwrapsapp.Newinrecover()and callst.Skip("app.New panicked during depinject wiring (pre-existing module config issue)"). So every app-construction test silently skipped itself while the suite reported green.
"Tests pass" never meant "the chain works." Fixed in commit dedef5b2:
| # | Bug | File | Panic |
|---|---|---|---|
| 1 | Module proto descriptor missing cosmos.app.v1alpha1.module option |
x/oracle/types/module.pb.go |
depinject rejected the module |
| 2 | Params subspace never registered | x/oracle/module/module.go |
ProvideModule panic |
| 3 | Module account missing from auth permissions | app/app_config.go |
NewKeeper panic |
| 4 | Requested both KVStoreService + KVStoreKey → two "oracle" stores |
x/oracle/module/module.go |
duplicate store key |
What is now proven (live, chain-id clawchain-local)
| Layer | Evidence |
|---|---|
| Block production | height 4 → 252+, finalized/committed, app_hash advancing |
| Bank | sent 12,345 uclaw dev→bob (tx 9729CECF), balance moved |
| Staking | delegated 5M, delegation 100M → 105M (tx EF91B11F) |
| Distribution | withdrew validator commission (tx 14424B45) |
| Governance | proposal created + voted; dev's vote weighted 105M (its stake) |
| Fail-closed voting | bob (no stake) rejected, code 1413 "only stakers may vote" |
| Marketplace | listed a skill (list_skill event); self-purchase rejected, code 1205 |
| Messaging | reused nonce rejected, code 1105 "duplicate nonce" (replay protection) |
Every rejection is correct business logic. Full reproduction steps are in blockchain-liveness-evidence.md.
Remaining gaps & remediation plan
Four known gaps remain. None break block production; the chain runs without them. Ordered by leverage.
Gap A — Privacy ZK verifying keys not available in local dev
- Problem: the node logs
privacy module: verifying keys not loadedbecause.local-node/keys/transfer_vk.bin/unshield_vk.binare missing. Shield / unshield / private-transfer cannot be exercised until the keys exist. - Root cause:
x/privacy/keeper/keeper.go::LoadVerifyingKeysreads the VKs from a keys dir, but nothing generates them for a dev node. Generation logic exists inx/privacy/circuit/setup.go(SetupTransfer,SetupUnshield) andx/privacy/circuit/mpc_setup.go(the production MPC ceremony). - Plan:
- Add a
clawchaind privacy gen-dev-keys <dir>CLI subcommand (or ascripts/gen-privacy-keys.sh) that callsSetupTransfer/SetupUnshield, serializes the verifying keys, and writestransfer_vk.bin/unshield_vk.bin. - Have
scripts/local-dev.shcall it during init so dev nodes load VKs. - Document clearly that dev keys are NOT secure — mainnet must use the MPC
ceremony output (
artifacts/ceremony-transcript.json, currentlypending).
- Add a
- Acceptance:
clawd privacy shieldsucceeds on the local node; the shield→private-transfer→unshield round-trip works end-to-end. - Effort: ~half a day. Risk: low (dev-only); keep prod ceremony separate.
Gap B — Oracle Msg service missing cosmos.msg.v1.service annotation
- Problem: startup warning
service terra.oracle.v1beta1.Msg does not have cosmos.msg.v1.service proto annotation; oracle msg routing/signing validation is not enforced. - Root cause:
proto/clawchain/oracle/v1beta1/tx.protodeclaresservice Msg { ... }(line 11) with per-methodcosmos.msg.v1.signeroptions but is missing the service-leveloption (cosmos.msg.v1.service) = true;. Sibling modules (privacy,clawchain,modelregistry) all have it. - Plan:
- Add
option (cosmos.msg.v1.service) = true;inside the oracleMsgservice. - Regenerate the oracle tx descriptor (the repo uses buf via
make proto-gen; buf is not installed locally — install it, or hand-patch the generatedtx.pb.godescriptor the same way the boot fix patchedmodule.pb.go). - Re-run the node; confirm the warning is gone and oracle vote txs validate.
- Add
- Acceptance: no annotation warning at startup; an oracle exchange-rate vote from the feeder account is accepted.
- Effort: ~half a day (mostly proto toolchain). Risk: low.
Gap C — Tokenfactory has no CLI tx commands
- Problem: there is no
clawchaind tx tokenfactory ...— create-denom / mint / burn / change-admin are unreachable from the CLI even though the keeper works and is unit-tested. - Root cause:
x/tokenfactory/module/autocli.goexplicitly does not implementAutoCLIOptions, and there is no manualGetTxCmd, so no tx surface is wired. - Plan:
- Implement
AutoCLIOptionsfor the tokenfactoryMsgservice (map create-denom / mint / burn / set-denom-metadata / change-admin), or add a manualGetTxCmd()returning cobra commands for those msgs. - Add the corresponding query commands if also missing.
- Implement
- Acceptance:
clawchaind tx tokenfactory create-denom <sub>mints a newfactory/<addr>/<sub>denom, thenmint/burnadjust supply on the live node. - Effort: ~half to one day. Risk: low.
- UPDATE (2026-05-31): partially done + deeper finding. A manual
x/tokenfactory/client/cli/tx.go(GetTxCmdwith create-denom/mint/burn) is now wired into the roottxcommand, so the subcommands appear. But submitting them fails at decode time:*types.MsgCreateDenom does not have a Descriptor() method. The hand-crafted Osmosis-compatible msg types (x/tokenfactory/types/ msgs.go) implement Marshal/Unmarshal but have no protoDescriptor()and no file descriptor, so they are not tx-submittable by the standard proto codec at all — the module is unit-tested but its messages cannot be sent on-chain.- Real remaining work: generate proper proto descriptors for the
osmosis.tokenfactory.v1beta1Msg types (regeneratetx.pb.gowith buf, or embed a file descriptor and addDescriptor()methods like the oracle module fix). This is the actual blocker; the CLI is ready once it lands. - Reclassified effort: ~one day (proto descriptor generation for ~8 msgs).
- Real remaining work: generate proper proto descriptors for the
- UPDATE 2 (2026-05-31): two more layers fixed; a third, deeper one remains.
The hand-crafted types are broken at multiple layers, peeled back in order:
- Decode (fixed): added a real proto file descriptor +
Descriptor()methods (x/tokenfactory/types/descriptor.go, generated from a newproto/osmosis/tokenfactory/v1beta1/tx.proto, withcosmos.msg.v1.signerandcosmos.msg.v1.serviceoptions). Txs now decode. - Handler registration (fixed):
AppModule.RegisterServicestype-asserted the registrar tomodule.Configurator, which is NOT what the depinject runtime passes, so the assertion silently failed and no msg handlers were registered ("no message handler found"). Now registers directly on thegrpc.ServiceRegistrar. CheckTx now passes (code 0). - Block inclusion (fixed): create-denom/mint passed CheckTx but were
silently excluded from block proposals (PrepareProposal) and never committed.
Root cause: the first descriptor attempt (
tx_descriptor.go, hand-built) omitted thecosmos.msg.v1.signeroption, so the proposal-path ante handler could not resolve the signer and dropped the tx. Replacing it with a properly generated descriptor (descriptor.go, fromproto/osmosis/tokenfactory/v1beta1/tx.protoviaprotoc-gen-gocosmos, carrying the signer option + theMsgservice) makes the signer resolvable. - Client-side decode (fixed):
clawchaind query tx(and block explorers / tx history) failed with "unable to resolve type URL /osmosis.tokenfactory.v1beta1.Msg*". The module is wired into the app manually (app/tokenfactory.go), soapp.RegisterModulesregisters its interfaces on the server registry, but the depinject-built client registry incmd/clawchaind/cmd/root.gonever saw them. Fixed by callingtokenfactorytypes.RegisterInterfacesinProvideClientContext.
- Decode (fixed): added a real proto file descriptor +
- STATUS: DONE (2026-05-31). All four layers fixed with a surgical change
(the hand-written Marshal/Unmarshal and
ProtoCoininmsgs.goare unchanged, so the validated Astroport-DEX Stargate wire path and all existing tests are preserved). Proven end-to-end on the live local node as real signed CLI txs:create-denom(code 0) →mint 1000000(balance = 1000000) →burn 400000(balance = 600000), andquery txnow decodes the messages. Regression test:x/tokenfactory/types/descriptor_test.go(reproduces the original "does not have a Descriptor() method" failure and asserts it stays fixed).
Gap D — Un-masked app tests reveal test-helper genesis gaps
- Problem: with
app.Newfixed, the previously-skipped app tests now run and fail in a cascade:TestExportAppStatefirst hit agent params, now mint (collections: not found: ... cosmos.mint.v1beta1.Minter). These are test-helper genesis issues — the live chain has correct state (verified: agent params and mint inflation are present on the running node). - Root cause:
app/test_helpers.go::Setupbuilds a synthetic genesis (DefaultGenesis()+ hand-overridden staking/bank) that does not fully initialize every module the wayclawchaind initdoes, so export round-trips fail for modules whose state was never set. - Plan:
- Decide the test-genesis strategy: prefer building the test genesis from the same default-genesis path the binary uses (so all modules initialize), rather than hand-overriding individual module sections.
- Remove the
recover()/t.Skip()masking innewTestAppso construction failures fail loudly (the chain boots now; masking should not hide future regressions). Gate it behind an explicit opt-in if still needed. - Fix each remaining export/init gap until
go test ./app/ -count=1is genuinely green (no skips).
- Acceptance:
go test ./app/...passes with zero skipped app-construction tests; a CI check asserts the suite does not skip on construction panic. - Effort: ~one to two days (cascade depth unknown). Risk: medium — each fixed module may reveal the next; bounded by the module count.
Recommended sequence
- Gap D first (test honesty): remove the masking and get the app suite truly green, so the test suite stops lying and future regressions are caught.
- Gap B (oracle annotation) and Gap C (tokenfactory CLI): small, isolated, unlock oracle and tokenfactory exercise.
- Gap A (privacy dev keys): unlocks the privacy round-trip demo; keep the prod MPC ceremony as a separate launch-gate item.
These are all additive; none reopen the boot fixes. After they land, the chain has no known functional gaps in local operation, leaving the external security audit and the multi-validator genesis ceremony as the remaining mainnet launch gates (tracked in mainnet/README.md).