feat: added validator whitelisting module #16
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.
Description
This PR implements a comprehensive validator whitelist system for the Shardeum EVM chain, providing governance-controlled validator consensus participation management. The implementation includes a full Cosmos SDK module with on-chain state management, governance proposals, and fail-fast transaction processing.
Key Features
x/validatorwhitelistmodule with keeper, message server, query server, and genesis supportMsgUpdateWhitelist: Enable/disable whitelist and update allowlistMsgAddValidator: Add validators to the allowlistMsgRemoveValidator: Remove validators from the allowlistCritical Files to Review
Core Module Implementation
x/validatorwhitelist/keeper/keeper.go- Core keeper with state managementx/validatorwhitelist/keeper/msg_server.go- Governance message handlersx/validatorwhitelist/keeper/query_server.go- Query interface implementationx/validatorwhitelist/types/params.go- Parameter validation and business logicIntegration & Ante Handler
ante/cosmos/validator_whitelist.go- Transaction decorator for fail-fast processingante/interfaces/validator_whitelist_keeper.go- Interface implementations for modularityshardeumd/app.go- Module wiring and keeper initializationProtobuf Definitions
proto/shardeum/validatorwhitelist/v1/tx.proto- Message definitionsproto/shardeum/validatorwhitelist/v1/query.proto- Query definitionsproto/shardeum/validatorwhitelist/v1/genesis.proto- Genesis stateTesting & Documentation
x/validatorwhitelist/types/*_test.go- Parameter and genesis validation testsx/validatorwhitelist/keeper/*_test.go- Keeper functionality testsante/interfaces/validator_whitelist_keeper_test.go- Interface compliance testsdocs/validator_whitelist.md- Technical documentationdocs/validator_whitelist_runbook.md- End-to-end testing guideBehavior Changes
Testing
The implementation includes comprehensive test coverage:
Run tests with:
Documentation
Complete documentation is provided:
docs/validator_whitelist.mddocs/validator_whitelist_runbook.mdAuthor Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
mainbranchReview Instructions
docs/validator_whitelist.md) to understand the system designx/validatorwhitelist/keeper/) for business logic implementationante/cosmos/validator_whitelist.go) for transaction processing logicante/interfaces/) for modularity and testabilitydocs/validator_whitelist_runbook.md) for end-to-end validationKey Design Decisions