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

first take at hooking up a node #117

Merged
merged 5 commits into from
Dec 31, 2019

Conversation

ebuchman
Copy link
Member

First take at hooking it all up into a running light node!

It currently fails I think because we're computing header hashes incorrectly ...

  • 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

@xla xla requested review from liamsi and tarcieri December 30, 2019 20:09
@@ -0,0 +1,134 @@
use tendermint::hash::Algorithm;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it would be less ambiguous to import tendermint::hash and reference Algorithm as hash::Algorithm?

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed in 712e673

@tarcieri Is it necessary to expose this param at all at this point if the enum has only one variant?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say it's both more explicit and good futureproofing in the event you do ever want to support additional hash algorithms. I'll cite git as a project which didn't do this which also still hasn't managed to migrate to a new hash algorithm.

That said I doubt SHA-256 will ever be catastrophically broken.

Comment on lines 15 to 19
let mut height_opt = Some(height);
if height.value() == 0 {
height_opt = None
}
Self { height: height_opt }
Copy link
Contributor

@tarcieri tarcieri Dec 30, 2019

Choose a reason for hiding this comment

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

I'd probably write this like:

Self {
    height: match height.value() {
        0 => None,
        _ => Some(height)
    }
}

Alternatively perhaps define a method on Height for this? It seems useful.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was a shortcut to get the integration to work. There ought to be a more explicit way to request the latest height that depending on the implicit menaing of 0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed in 7477c9d

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened an issue for this #118

@ebuchman ebuchman merged commit 7477c9d into bucky/lite-reqester-store-impl Dec 31, 2019
@xla xla deleted the bucky/lite-node-impl branch January 18, 2020 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants