Skip to content

fix(bridge): reject adversarialResilience >= validatorCount - #241

Open
crazywriter1 wants to merge 1 commit into
podnetwork:mainfrom
crazywriter1:fix/bridge-require-strict-adversarial-resilience
Open

fix(bridge): reject adversarialResilience >= validatorCount#241
crazywriter1 wants to merge 1 commit into
podnetwork:mainfrom
crazywriter1:fix/bridge-require-strict-adversarial-resilience

Conversation

@crazywriter1

Copy link
Copy Markdown

Summary

  • Enforce adversarialResilience < validatorCount when updating the validator set, so certificate claims always require weight ≥ 1
  • Reject certificate proofs when requiredWeight == 0 (defense-in-depth for misconfigured state)
  • Update validator-set unit and fuzz tests for the strict f < n invariant

Previously f == n (or n == 0) was accepted by config validation. That made validatorCount - adversarialResilience == 0, so an empty aggregate signature (weight = 0) satisfied the claim check. This is an admin misconfiguration footgun, not a default-deployment drain path — shipped configs use f < n — but the contract allowed the bad state and should not.

Test plan

  • forge test --match-contract BridgeUpdateValidatorSetTest -vv
  • forge test --match-path test/Bridge.t.sol

f == n (or n == 0) made certificate claims succeed with empty
signatures. Require f < n and reject zero required weight at claim time.
@crazywriter1

Copy link
Copy Markdown
Author

Hi @abresas @poszu friendly ping for a review when you have a moment.

This PR enforces adversarialResilience < validatorCount and rejects certificate proofs when requiredWeight == 0, closing the f == n misconfiguration footgun where an empty aggregate signature could pass.

I verified locally with:

  • forge test --match-contract BridgeUpdateValidatorSetTest -vv
  • forge test --match-path test/Bridge.t.sol

Happy to adjust anything if you’d prefer a different validation approach. Thanks!

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.

1 participant