Closed merklefruit closed 3 months ago
The update introduces a new ValidatorIndexes
type that replaces the use of Vec<u64>
for managing validator indexes. This change promotes better encapsulation and functionality directly relevant to validator indexes, simplifying management and validation. Areas affected include configuration loading, the ConsensusState
instantiation, and related method implementations, enhancing consistency and future maintenance.
File | Change Summary |
---|---|
bolt-sidecar/bin/sidecar.rs |
Modified parameter passing to ConsensusState::new from a reference to a cloned value of config.validator_indexes . |
bolt-sidecar/src/config/mod.rs |
Added validator_indexes module and ValidatorIndexes struct, updated Opts struct to use ValidatorIndexes . |
bolt-sidecar/src/config/validator_indexes.rs |
Introduced ValidatorIndexes struct, methods for checking index containment, parsing from string representations, and test functions. |
bolt-sidecar/src/state/consensus.rs |
Updated ConsensusState to use ValidatorIndexes for validator indexes, including the constructor and related logic adjustments. |
The changes collectively transition the handling of validator indexes from a simple vector to a more structured and functional type, ValidatorIndexes
, fostering a more robust and maintainable codebase.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This PR adds the ability to parse validator index ranges from an array of comma-separated ranges. ValidatorIndex also becomes a separate struct to allow for future parsing methods too, including from a keystore directory which would be handy for validators
example of valid values: