Repository navigation
test: assert vesting-account creation is rejected via group proposal - #4635
Conversation
Add a unit test for AuthzLimiterDecorator and an e2e test proving that MsgCreateVestingAccount cannot be smuggled onto the chain by wrapping it in a group proposal. The ante decorator inspects group.MsgSubmitProposal inner messages, so the tx is rejected before the group module runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9YpkFxXRRB1DES7ecggND
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9YpkFxXRRB1DES7ecggND
skosito
left a comment
There was a problem hiding this comment.
Approving — confirms group/authz-wrapped vesting creation is blocked at ante, including nested, with a negative case and a real e2e broadcast. Two non-blocking notes inline (gov path is out of scope; test hardcodes the disabled list rather than asserting app.go's wiring).
… + gov - Export app.DisabledAuthzMsgs() as the single source of truth for the ante HandlerOptions; the unit test now asserts against it so dropping a vesting entry from app.go fails the test (no more hardcoded mirror). - Add the MsgCreatePeriodicVestingAccount group-proposal case. - Document the gov gap with a case asserting gov.MsgSubmitProposal is not covered by AuthzLimiterDecorator (privileged, out of scope). - Add an in-process integration test running the real production ante handler end to end, proving the group-wrapped MsgCreateVestingAccount is rejected without needing localnet/Docker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9YpkFxXRRB1DES7ecggND
morde08
left a comment
There was a problem hiding this comment.
Reviewed at dd63870, after the review-address commit. I checked the branch out, ran the suite, and mutation-tested each new test against the production code.
Verified working: TestAuthzLimiter_AnteHandle genuinely binds — I removed the recursion from the *group.MsgSubmitProposal case in app/ante/authz.go and 4 subtests went red. This is the first coverage AuthzLimiterDecorator has had since #794 (2023). The e2e mechanics also check out: AuthzLimiterDecorator is ante decorator #2, ahead of ValidateBasicDecorator, so the tx really does fail on found disabled msg type and not on the arbitrary group-policy address; BroadcastSync surfaces RawLog and errRetryable delegates Error(), so ErrorContains will match. The gov out-of-scope case and the periodic-vesting case both landed well.
Six things below. The first is the one I'd block on — everything else is hardening.
…roadcast - extract AnteHandlerOptions so New and the integration test share one construction; dropping DisabledAuthzMsgs now fails the test - //go:build test on authz_integration_test.go so a bare `go test ./app/ante/...` no longer panics - add authz.MsgGrant coverage to the AuthzLimiter table - BroadcastTxWithoutRetry for deterministic-failure e2e paths; use it in the disallow-vesting-via-group-proposal test to skip the 25s retry loop Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9YpkFxXRRB1DES7ecggND
Summary
We block vesting-account creation on ZetaChain, but the ante-level block (
VestingAccountDecorator) only catches top-level txs. Governance-style wrappers (authz.MsgExec,group.MsgSubmitProposal) execute their inner messages through the msg router, which bypasses that decorator.These tests pin the behavior that actually closes the
grouproute: zeta's customAuthzLimiterDecoratorrecurses intogroup.MsgSubmitProposal(andauthz.MsgExec) inner messages and rejects any disabled type — includingMsgCreateVestingAccount— at ante time, before the group module runs.What we check:
app/ante/authz_test.go):AuthzLimiterDecoratorblocksMsgCreateVestingAccount/MsgCreatePermanentLockedAccountwhen wrapped in a group proposal, an authz exec, and a nested authz→group combination; a non-disabled message (bank send) in the same group proposal passes; a top-level vesting msg is not blocked here (that'sVestingAccountDecorator's job).disallow_vesting_via_group_proposal, admin test group): broadcasting agroup.MsgSubmitProposalthat wrapsMsgCreateVestingAccountfails withfound disabled msg type. No real group needs to exist — the ante rejects the tx first.🤖 Generated with Claude Code
Note
Low Risk
Test-only changes; no modifications to ante handlers or production behavior.
Overview
Adds regression coverage for the existing
AuthzLimiterDecoratorpath that rejects disabled vesting-account creation messages when they are wrapped ingroup.MsgSubmitProposalorauthz.MsgExec(including nested authz → group), without changing chain logic.Unit tests in
app/ante/authz_test.gotable-drive ante handling: blocked cases expectfound disabled msg type; allowed cases include a group proposal with a bank send and a top-level vesting msg (explicitly not this decorator’s responsibility).E2E adds
disallow_vesting_via_group_proposal: broadcasts a group proposal wrappingMsgCreateVestingAccountand asserts broadcast fails with the same error. The test is registered in the admin suite and local--test-adminrun list.Reviewed by Cursor Bugbot for commit 375afcc. Configure here.
Greptile Summary
The PR adds unit and end-to-end coverage confirming that disabled vesting-account creation messages are rejected when wrapped in group proposals or authz execution.
Confidence Score: 4/5
The PR appears safe to merge, with only a non-blocking gap in coverage for the periodic vesting-account message.
The added unit and E2E paths correctly target recursive group and authz inspection, but the unit table does not exercise one of the three disabled vesting message types declared by its fixture.
Files Needing Attention: app/ante/authz_test.go
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Signed transaction] --> B[AuthzLimiterDecorator] B --> C{Wrapper type} C -->|group proposal| D[Inspect proposal messages] C -->|authz exec| E[Inspect executed messages] D --> F{Disabled vesting type?} E --> F F -->|Yes| G[Reject during ante handling] F -->|No| H[Continue ante chain]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "test: assert vesting-account creation is..." | Re-trigger Greptile
Context used (3)