You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The light client core verification spec Specifies the logic in which a header and validator set is verified by a trusted state. The current implementation depends on various types (Commit, ValidatorSet, Header, etc) that are abstracted over using traits for testing. Mock implementation of those traits are used avoid complex cryptographic functions that obscure the core predicates being tested.
The the current formulation has two problems:
It requires trait bounds be used everywhere
It requires the construction of mock types to trigger predicates instead of just mocking out specific predicates for testing.
The goal then is to simplify the types used for core verification in two ways:
It would make sense to change the interface of the core verification to be specified as predicates instead of types. Predicates could then be mocked out with fixed point true or fixed point false to test complex verification sequences.
Cryptographic functions should be taken out of core types put into separate Calculator objects which expose interfaces which can be mocked. The core verification can then use dependency injection of Calculator objects to keep cryptographic primitives out of the light client package.
The combination of these two changes will allow depending on simple types instead of abstract trait implementation and significantly reduce the amount type specification.
The light client core verification spec Specifies the logic in which a header and validator set is verified by a trusted state. The current implementation depends on various types (Commit, ValidatorSet, Header, etc) that are abstracted over using traits for testing. Mock implementation of those traits are used avoid complex cryptographic functions that obscure the core predicates being tested.
The the current formulation has two problems:
The goal then is to simplify the types used for core verification in two ways:
It would make sense to change the interface of the core verification to be specified as predicates instead of types. Predicates could then be mocked out with fixed point true or fixed point false to test complex verification sequences.
Cryptographic functions should be taken out of core types put into separate
Calculator
objects which expose interfaces which can be mocked. The core verification can then use dependency injection ofCalculator
objects to keep cryptographic primitives out of the light client package.The combination of these two changes will allow depending on simple types instead of abstract trait implementation and significantly reduce the amount type specification.
Current implementation underway: #225.
The text was updated successfully, but these errors were encountered: