You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. # ADR 004: Historical Validators
  2. ## Context
  3. Right now, we can query the present validator set, but there is no history.
  4. If you were offline for a long time, there is no way to reconstruct past validators. This is needed for the light client and we agreed needs enhancement of the API.
  5. ## Decision
  6. For every block, store a new structure that contains either the latest validator set,
  7. or the height of the last block for which the validator set changed. Note this is not
  8. the height of the block which returned the validator set change itself, but the next block,
  9. ie. the first block it comes into effect for.
  10. Storing the validators will be handled by the `state` package.
  11. At some point in the future, we may consider more efficient storage in the case where the validators
  12. are updated frequently - for instance by only saving the diffs, rather than the whole set.
  13. An alternative approach suggested keeping the validator set, or diffs of it, in a merkle IAVL tree.
  14. While it might afford cheaper proofs that a validator set has not changed, it would be more complex,
  15. and likely less efficient.
  16. ## Status
  17. Implemented
  18. ## Consequences
  19. ### Positive
  20. - Can query old validator sets, with proof.
  21. ### Negative
  22. - Writes an extra structure to disk with every block.
  23. ### Neutral