feat: harden evidence submissions and remove per-consumer infraction params#16
Draft
feat: harden evidence submissions and remove per-consumer infraction params#16
Conversation
…idation # Conflicts: # x/vaas/provider/types/keys.go # x/vaas/provider/types/keys_test.go
… already tombstoned - Enforce infraction header height == evidence height and header chain-id matches the consumer chain-id.
There was a problem hiding this comment.
Pull request overview
This PR removes per-consumer infraction parameters from the VAAS provider module and hardens evidence submission handling against malformed inputs. The changes implement validation improvements for double-voting evidence submissions and make misbehaviour handling non-punitive (validate and log only).
Changes:
- Removed
infraction_parametersfield fromMsgCreateConsumer,MsgUpdateConsumer,Chain, andQueryConsumerChainResponsewith proper protobuf field reservation - Added nil input validation for evidence submission messages to prevent panics
- Added chain_id and height matching validation for double-voting evidence submissions
- Made repeated double-vote evidence submissions idempotent when validator is already tombstoned
- Changed misbehaviour handling to validate and log only (removed slashing/jailing/tombstoning)
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/vaas/provider/v1/tx.proto | Reserved field 5 and 7 for removed infraction_parameters in MsgCreateConsumer and MsgUpdateConsumer |
| proto/vaas/provider/v1/query.proto | Reserved field 6 and 7 for removed infraction_parameters in Chain and QueryConsumerChainResponse |
| x/vaas/provider/types/tx.pb.go | Generated code for removed infraction_parameters fields |
| x/vaas/provider/types/query.pb.go | Generated code for removed infraction_parameters fields |
| x/vaas/provider/types/msg.go | Added submitter validation, nil misbehaviour check, and height matching validation in ValidateBasic; removed ValidateInfractionParameters function |
| x/vaas/provider/types/msg_test.go | Updated tests to remove infraction_parameters usage |
| x/vaas/provider/types/submit_msgs_test.go | Added new tests for nil misbehaviour validation and height mismatch |
| x/vaas/provider/keeper/msg_server.go | Added extensive nil checks, chain_id validation, and height validation for evidence submissions |
| x/vaas/provider/keeper/msg_server_test.go | Added tests for nil message and header validation |
| x/vaas/provider/keeper/consumer_equivocation.go | Made double-voting idempotent for tombstoned validators; changed misbehaviour to log-only |
| x/vaas/provider/keeper/grpc_query.go | Removed infraction_parameters from query responses |
| x/vaas/provider/types/keys.go | Removed infraction-related key constants; renamed PrioritylistPrefix to PriorityListPrefix |
| x/vaas/provider/types/errors.go | Removed ErrInvalidConsumerInfractionParameters error |
| x/vaas/provider/client/cli/tx.go | Updated CLI examples to remove infraction_parameters |
| go.mod, go.sum | Updated bytedance/sonic dependency from v1.12.7 to v1.15.0 |
| REWRITE_SUMMARY.md, README.md, PLAN.md | Updated documentation to reflect removal of per-consumer infraction parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #5
Description
infraction_parametersfrom provider tx/query protos (tags reserved) and CLI JSON examples.SubmitConsumerMisbehaviour/SubmitConsumerDoubleVotingagainst nil inputs and invalid submitters (avoid panics).chain_idmatches the stored consumer chain-id, and the header height matches the evidence height.Breaking changes
infraction_parametersremoved fromMsgCreateConsumer,MsgUpdateConsumer,Chain, andQueryConsumerChainResponse.