Skip to content

Add QBFT validator set contract package#168

Merged
YoshihitoAso merged 4 commits into
dev-2.8from
validator-set-contract
Jul 7, 2026
Merged

Add QBFT validator set contract package#168
YoshihitoAso merged 4 commits into
dev-2.8from
validator-set-contract

Conversation

@YoshihitoAso

Copy link
Copy Markdown
Member

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:

  • Implements ValidatorSet in validator_set.sol, providing on-chain governance for adding/removing validators, maintenance mode, and compatibility with QBFT's getValidators() interface. Includes events, proposal voting, and strict rules for validator maintenance and removal.

Go Integration:

  • Adds validator.go, a Go wrapper for interacting with the deployed validator set contract, including contract binding and helper methods.

Documentation and Developer Workflow:

Documentation:

  • Adds a comprehensive README.md describing the contract's files, update flow (including compilation and Go binding regeneration), and compatibility rules for contract upgrades and QBFT integration.

@github-actions github-actions Bot requested a review from purplesmoke05 July 7, 2026 11:17
@YoshihitoAso YoshihitoAso marked this pull request as ready for review July 7, 2026 11:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ValidatorSet contract implementing quorum-based add/remove governance and maintenance-mode exclusion from getValidators().
  • 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");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit c81e588.

@YoshihitoAso YoshihitoAso merged commit b2019eb into dev-2.8 Jul 7, 2026
5 checks passed
@YoshihitoAso YoshihitoAso deleted the validator-set-contract branch July 7, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Contract for Managing the Validator List

3 participants