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] Supervisor #302

Merged
merged 39 commits into from
Jun 15, 2020
Merged

[light-client] Supervisor #302

merged 39 commits into from
Jun 15, 2020

Conversation

romac
Copy link
Member

@romac romac commented Jun 5, 2020

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGES.md

@romac romac added the light-client Issues/features which involve the light client label Jun 5, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2020

Codecov Report

Merging #302 into master will decrease coverage by 2.2%.
The diff coverage is 4.8%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #302     +/-   ##
========================================
- Coverage    30.5%   28.2%   -2.3%     
========================================
  Files         127     130      +3     
  Lines        4581    4880    +299     
  Branches     1416    1511     +95     
========================================
- Hits         1398    1378     -20     
- Misses       2216    2533    +317     
- Partials      967     969      +2     
Impacted Files Coverage Δ
light-client/src/callback.rs 0.0% <0.0%> (ø)
light-client/src/components/clock.rs 0.0% <0.0%> (ø)
light-client/src/components/io.rs 0.0% <0.0%> (-2.3%) ⬇️
light-client/src/components/scheduler.rs 44.0% <ø> (ø)
light-client/src/contracts.rs 63.6% <ø> (ø)
light-client/src/errors.rs 0.0% <0.0%> (ø)
light-client/src/fork_detector.rs 0.0% <0.0%> (ø)
light-client/src/operations/commit_validator.rs 23.0% <0.0%> (-17.0%) ⬇️
light-client/src/operations/header_hasher.rs 35.8% <ø> (-4.6%) ⬇️
light-client/src/operations/voting_power.rs 45.0% <0.0%> (-15.0%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 740cb66...b6b50a8. Read the comment docs.

@romac romac marked this pull request as ready for review June 9, 2020 08:38
@romac romac mentioned this pull request Jun 9, 2020
2 tasks
light-client/src/prelude.rs Outdated Show resolved Hide resolved
Base automatically changed from romain/light-client-followup to master June 9, 2020 10:29
brapse
brapse previously approved these changes Jun 9, 2020
Copy link
Contributor

@brapse brapse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some comments, can be done in follow up if need be, otherwise 👍

liamsi
liamsi previously approved these changes Jun 10, 2020
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍 Thanks for updating the example, too.

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work @romac 💯 left a few comments. don't know if they will be useful, but still

light-client/examples/light_client.rs Show resolved Hide resolved
light-client/src/fork_detector.rs Outdated Show resolved Hide resolved

state
.light_store
.update(trusted_state.clone(), VerifiedStatus::Verified);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we update the current state to verified here? not sure I understand

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The light client needs to have at least one trusted (Verified) block to perform verification.
We should perhaps provide a nicer API on State for interacting with the store, and make such things more explicit and higher-level.

trusted_state: &LightBlock,
) -> Result<Option<Vec<Fork>>, Error> {
if self.peers.secondaries().is_empty() {
return Ok(None);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems very insecure to me.. even though we rely on 1 correct node assumption, my personal opinion is that we need at least 1 witness. we can't assume primary will always be correct.

@brapse brapse changed the title Light Client Supervisor: MVP [light-client] Supervisor Jun 11, 2020
Copy link
Contributor

@brapse brapse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to go with any potential gaps covered by follow up issues 👍

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also love to see this merged in the context of the rpc light-node and the cli stuff 👍

@brapse brapse merged commit 0a50c12 into master Jun 15, 2020
@brapse brapse deleted the romain/supervisor branch June 15, 2020 13:42
@romac romac mentioned this pull request Jun 15, 2020
5 tasks
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 this pull request may close these issues.

5 participants