This contract provides an onchain registry for Chronicle Protocol validators via 1-byte validators ids.
A validators id is computed as the highest-order byte of the validators address, ie uint8 validatorId = uint8(uint(uint160(validator)) >> 152);
Due to validator ids being 1 byte, the maximum number of feeds supported is 256.
Note that a set of lifted validators can be encoded in a single uint. The code refers to it as uint bloom
.
Install module via Foundry:
$ forge install chronicleprotocol/validator-registry
The project uses the Foundry toolchain. You can find installation instructions here.
Setup:
$ git clone https://github.com/chronicleprotocol/validator-registry
$ cd validator-registry/
$ forge install
Run tests:
$ forge test
$ forge test -vvvv # Run with full stack traces
$ FOUNDRY_PROFILE=intense forge test # Run in intense mode
Lint:
$ forge fmt [--check]
Update gas snapshots:
$ forge snapshot --nmt "Fuzz" [--check]