CodeChain-io / CodeChain-io/foundry

Organize validator set

Aperta
#560 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
36
Fork
11
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Types

Eventually, we will have only 3 types for validators.

1. `ctypes::Validator` - It has two fields: `public_key` and `weight`.
2. `ctypes::ValidatorSet` - It is a newtype of `Vec`, but it save it sorted, and provides methods to save to/load from state. Also, its hash will be directly written in block header.
3. `foundry_graphql_engine::Validator` GraphQL resolver for validator.

All other types will be completely removed. (`NextValidatorSet`, `CurrentValidatorSet`, `SimpleValidator`, `WeightOrderedValidators`, ...)

## Naming

Validators -> Validator set
delegation/deposit/ ... -> weight

## Next / Current
Both will be saved, but share same type `ValidatorSet`.

## Coordinator-Module interface
Will be asked to return only `Vec` as the validator set.

## Test
We have to add various e2e tests that involve multiple nodes + varying validator set.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.