Skip to content

Sample: Align isOperator and CanOperatorPass checks - #8159

Merged
Amaury Chamayou (achamayou) merged 2 commits into
microsoft:mainfrom
cjen1-msft:sample-fix
Aug 14, 2026
Merged

Sample: Align isOperator and CanOperatorPass checks#8159
Amaury Chamayou (achamayou) merged 2 commits into
microsoft:mainfrom
cjen1-msft:sample-fix

Conversation

@cjen1-msft

Copy link
Copy Markdown
Contributor

In the sample constitution it was possible for an operator to add a new operator with a recovery key.

Specifically isOperator == !has_recovery_key && data.is_operator while canOperatorPass == data.is_operator.

Thus an operator could add an operator who has a recovery key, which is fine for canOperatorPass, but is not an operator for membership counting reasons.
So an operator could use this to add N+1 'operator recovery members' and hence pass their own ballots.

This PR aligns these two constraints.

To clarify this just fixes up a sample, not anything which is released.

Copilot AI lite review requested due to automatic review settings August 14, 2026 13:29
@cjen1-msft
cjen1-msft requested a review from a team as a code owner August 14, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes an authorization/counting mismatch in the sample operator constitution by ensuring that “operator-only” proposals cannot add a member flagged as an operator while also assigning them a recovery (encryption) public key, which would otherwise exclude them from operator counting and allow vote-inflation.

Changes:

  • Tighten canOperatorPass() for set_member so it only treats adding/setting an operator as “operator-passable” when encryption_pub_key is not provided (== null).
  • Aligns the canOperatorPass eligibility criteria with isOperator()’s “operators cannot be recovery members” rule.

Custom instructions used:

  • .github/copilot-instructions.md
  • .github/instructions/reviewing.instructions.md

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@achamayou
Amaury Chamayou (achamayou) merged commit c4eeccb into microsoft:main Aug 14, 2026
19 checks passed
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.

4 participants