fix(schema): accept proto-JSON Any in tx body extension_options#113
Conversation
extension_options and non_critical_extension_options were validated
with the protobuf runtime Any shape ({ typeUrl, value }), but REST and
indexer APIs return the proto-JSON encoding ({ "@type", ...fields }).
The wrong element schema was never exercised because these arrays were
always empty, until queued txs carrying
/initia.tx.v1.ExtensionOptionQueuedTx appeared on initiation-2 and
decodeCosmosTransaction started rejecting them.
Validate both fields with zMessage (the proto-JSON Any schema already
used for messages), drop the now-unused zAny, and add a regression test
with the real failing tx payload.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI uses pnpm/action-setup with version: latest, which now resolves to pnpm 11. pnpm 11 replaced onlyBuiltDependencies with an allowBuilds map and hard-fails install when dependency build scripts are unapproved (ERR_PNPM_IGNORED_BUILDS), breaking the install step before tests run. Declare explicit allowBuilds decisions, pin the package manager via the packageManager field, and let pnpm/action-setup@v4 pick up the pinned version so CI no longer drifts with pnpm releases. Same setup as the initia multisig repo. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WalkthroughThe PR updates transaction extension options validation from generic ChangesExtension Options Schema & Test Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci-tests.yml:
- Line 22: Replace the floating tag usage of the GitHub Action used in the
workflow (the step referencing "uses: pnpm/action-setup@v4") with a pinned
commit SHA; locate the step that currently uses pnpm/action-setup@v4 and change
it to pnpm/action-setup@<full-commit-hash> (use the full 40-char commit from the
pnpm/action-setup repo release you want) so the workflow is pinned to a specific
commit for supply-chain security.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4e06979f-aa71-4644-a2e3-f3048b6acae8
📒 Files selected for processing (7)
.github/workflows/ci-tests.ymlpackage.jsonpnpm-workspace.yamlsrc/schema/common.tssrc/schema/cosmos/transaction.tssrc/tests/common/extension-options.fixture.tssrc/tests/common/extension-options.test.ts
💤 Files with no reviewable changes (1)
- src/schema/common.ts
What
Fixes
decodeCosmosTransactionrejecting any transaction whose body carries a non-emptyextension_optionsarray, e.g. queued txs with{"@type": "/initia.tx.v1.ExtensionOptionQueuedTx"}on initiation-2.Why
zTxBodyvalidatedextension_optionsandnon_critical_extension_optionswithzAny, the protobuf runtime shape ({ typeUrl: string, value: number[] }). But REST/indexer APIs return the proto-JSON encoding ofgoogle.protobuf.Any({ "@type": string, ...fields }). The wrong element schema was never exercised because these arrays were always empty — until queued txs appeared:Repro: tx
5126CB517545FE819676F16656D5944C2F53ABDD180A1EE4A326EC5EC7F0CBE4on initiation-2.Changes
z.array(zMessage)— the proto-JSON Any schema ({ "@type": z.string() }.passthrough()) already used formessages.zAnyfromsrc/schema/common.ts: those two fields were its only usages (verified by grep), and it is not part of the package's public API.tx_responsepayload of the failing tx; it asserts the tx parses and theMsgSenddecodes end-to-end. Verified the test fails with the exact reported error before the fix.Notes for reviewers
tsc --noEmit, eslint, and prettier are clean.src/lib/services/types/tx.ts); after this is released, celatone-frontend needs a version bump of@initia/tx-decoderto pick up the fix.🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Tests