Add QBFT validator set contract package#168
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new contracts/validatorcontract package providing a reference QBFT validator-set contract implementation, along with Go bindings/wrapper, tests, and documentation to support contract-based validator selection.
Changes:
- Introduces a Solidity
ValidatorSetcontract implementing quorum-based add/remove governance and maintenance-mode exclusion fromgetValidators(). - Adds generated Go bindings plus a small wrapper for interacting with the deployed contract.
- Adds simulated-backend Go tests and a README documenting update/regen flow and compatibility rules.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| contracts/validatorcontract/validator.go | Go wrapper around the generated ValidatorSet binding. |
| contracts/validatorcontract/validator_test.go | Simulated-backend tests covering deployment validation, governance voting, and maintenance mode behavior. |
| contracts/validatorcontract/README.md | Documentation for files, update flow, and QBFT compatibility/upgrade rules. |
| contracts/validatorcontract/contract/validator_set.sol | New Solidity validator set contract implementing governance + maintenance + QBFT getValidators() compatibility. |
| contracts/validatorcontract/contract/validator_set.go | Generated Go binding for the Solidity contract (ABI/bytecode + call/transact/event helpers). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+239
to
+243
| bytes32 id = proposalId(operation, candidate); | ||
| Proposal storage proposal = proposals[id]; | ||
| require(!proposal.executed, "ValidatorSet: proposal executed"); | ||
| require(!proposal.voted[msg.sender], "ValidatorSet: already voted"); | ||
|
|
purplesmoke05
approved these changes
Jul 7, 2026
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 #167
This pull request introduces a new reference implementation of a validator set contract for use with QBFT contract-based validator selection. It includes a complete Solidity contract with governance, maintenance, and compatibility features, a Go wrapper for the contract, and documentation describing the architecture, update flow, and compatibility rules.
New Validator Set Contract Implementation:
Solidity Contract:
ValidatorSetinvalidator_set.sol, providing on-chain governance for adding/removing validators, maintenance mode, and compatibility with QBFT'sgetValidators()interface. Includes events, proposal voting, and strict rules for validator maintenance and removal.Go Integration:
validator.go, a Go wrapper for interacting with the deployed validator set contract, including contract binding and helper methods.Documentation and Developer Workflow:
Documentation:
README.mddescribing the contract's files, update flow (including compilation and Go binding regeneration), and compatibility rules for contract upgrades and QBFT integration.