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] Testing Regimen meta-issue #320

Open
brapse opened this issue Jun 11, 2020 · 5 comments
Open

[light-client] Testing Regimen meta-issue #320

brapse opened this issue Jun 11, 2020 · 5 comments
Labels
help wanted Extra attention is needed light-client Issues/features which involve the light client tests

Comments

@brapse
Copy link
Contributor

brapse commented Jun 11, 2020

In anticipation of the release of Tendermint-rs Light Client we outline here want we want to be tested. This issue is meant to collect a bunch of sub issues and provide an overview of how correctness will be codified in unit and integration tests. If you are interested in contributing to the test, simply create a break out issue of one of the items and update this issue with a reference ☺️

NOTE: Everything should be tested against the branch in #302 which we expect to be merged shortly (11.6.2020)

Core Verification light-client/src/light_client.rs

  • Test that the light client bails out with an error in case target_height < last_trusted_state.height

Verification light-client/src/predicates.rs

Broken out into #330
The verifier is composed of multiple predicates, each of which should be tested for both the positive and negative case using concrete types. operations should be mocked out.

Fork Detection: light-client/src/fork_detector.rs

TODO
The Fork detector should be tested in isolation using concrete types to detect the following cases

  • Header matches
  • Headers differ but verification fails
  • Headers differ but verification succeeds

Bisection: light-client/tests/light_client.rs

Requires #290 but could use some help

  • All conformance Tests should pass including commit/one_third_vals_don’t_sign.json

Operations: light-client/src/operations/*

The operators provide an abstraction around crypto functions and allow traits to help mock them out during testing. Eventually these should be moved to the main crate but they should be moved there with accompanying tests. Each operator should be tested using concrete types.

Supervisor verify_to_target integration test: light-client/src/supervisor.rs

#331
The supervisor provides verification using multiple peers. It integrates the io, verification, bisection scheduling, fork detection and evidence reporting. All of which can be mocked out to exercise complex scenarios including

  • Perform Bisection into a fork with failed verification (true fork)
    • Should report evidence
  • Switching from primary to secondary
  • Exhausting peer list

Node Integration

Broken out into #373

  • Launch a node with the CLI and sync against the Tendermint proxy App

It’s possible and even likely that this doesn’t cover everything we want to test. Please feel free to discuss in the comments and edit this description as need be.

@brapse brapse added this to the Light Node milestone Jun 11, 2020
@brapse brapse added help wanted Extra attention is needed light-client Issues/features which involve the light client tests labels Jun 11, 2020
@brapse brapse self-assigned this Jun 11, 2020
@josef-widder
Copy link
Member

josef-widder commented Jun 12, 2020

It would be good to have tests when the primary (or secondaries) are not responding. In this case we should timeout and FetchLightBlock should report timeout errors. In case of verification we just terminate with failure then. In the detection we remove the secondary from the peer list. Right now the tests consider only correct/faulty data.

@romac
Copy link
Member

romac commented Jun 12, 2020

Just added support for timeouts to the Io component in the supervisor branch: 8fca5c1

@romac
Copy link
Member

romac commented Jun 12, 2020

Implemented removal of witness which timed out in 56bc022.

@brapse
Copy link
Contributor Author

brapse commented Jun 16, 2020

It would be good to have tests when the primary

Broken out into a separate issue: #331

@Shivani912 Shivani912 mentioned this issue Jun 23, 2020
5 tasks
@ebuchman
Copy link
Member

We should also run the light-node in CI against a real full node. Originally tracked in #120, made a follow up issue in #373

@romac romac pinned this issue Jun 26, 2020
@romac romac unpinned this issue Jun 26, 2020
@romac romac mentioned this issue Jun 27, 2020
19 tasks
@ebuchman ebuchman modified the milestones: v0.15.0, v0.16.0 Jul 8, 2020
@brapse brapse removed this from the v0.16.0 milestone Aug 5, 2020
@thanethomson thanethomson added this to the Q3 2021 milestone Jul 13, 2021
@thanethomson thanethomson removed this from the Q3 2021 milestone Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed light-client Issues/features which involve the light client tests
Projects
None yet
Development

No branches or pull requests

6 participants