Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[light-client] Core verification as predicates #229

Closed
brapse opened this issue Apr 21, 2020 · 0 comments · Fixed by #237
Closed

[light-client] Core verification as predicates #229

brapse opened this issue Apr 21, 2020 · 0 comments · Fixed by #237
Labels
light-client Issues/features which involve the light client

Comments

@brapse
Copy link
Contributor

brapse commented Apr 21, 2020

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:

  1. It requires trait bounds be used everywhere
  2. 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.

Current implementation underway: #225.

@romac romac mentioned this issue May 25, 2020
5 tasks
@romac romac added the light-client Issues/features which involve the light client label May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
light-client Issues/features which involve the light client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants