Skip to content
Unverified Commit 1adc5e07 authored by David Dunn's avatar David Dunn Committed by GitHub
Browse files

Dynamic signature sampling (#956)



* Switch to dynamic signature sampling

* Require 2/3+1 signatures when validator count is low

* Replace mapping with packed counters

* Update bitfield and proof for beefy test data

* Gas optimization

* Hex encode payload data

* Log CreateInitialBitfield params

* Use value from calldata instead of from storage

* Fix initialize count in DeployScript

* More tests

* fixed round up logic

* use storage modifier to save gas

* Revert "use storage modifier to save gas"

This reverts commit 744556c03e8ffda5e84b1ba7dca94e58a64624e6.

* ws

* added counter tests

* fmt

* fixed overwriting issue

* removed redundant comment

* better messages and names for tests

* even better messages and names for tests

* minor PR feedback

* added python code for sampling

* make minimum signatures immutable

* refactor counters to separate variables

* rename variables

* test overwrite with length change

* added more tests

* use a random signature on submitInitial

* new signature logic

* regenerated data and fixed tests

* use slash rate of 100%

* more tests

* comments

* fix code coverage

* added comments to counters

* more comments

* fix spelling

* handover tests for copied counters

* more asserts on tests

* even more asserts

* added pre and post asserts

* use math util and min

* refactored ceiling and log functions

* use intialiser syntax

* comments

* comment fixes

* remove assert messages

* refactor tests

* use log2 from openzepplin

* add tests for log

* rename shell variable

* minor renames

* use saturating add

* remove case

* bound to 2/3 majority

* make computeNumRequiredSignatures pure

* more test cases

* refactors and tests

* refactor rename

* refactor out computeQuorum function

* changed tests to test computeQuorum

* use fuzz testing for computeQuorum

* use fuzz testing

* refactor ticket to remove account and use uint32 for numRequiredSignatures

* use 16 as minimum in verification tests

* fix comment

* added comments

---------

Co-authored-by: default avatarron <[email protected]>
Co-authored-by: default avatarAlistair Singh <[email protected]>
parent 5fabd10f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment