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

lite: impl Requester, Store, and a basic syncing daemon #116

Merged
merged 44 commits into from
Jan 9, 2020

Conversation

ebuchman
Copy link
Member

@ebuchman ebuchman commented Dec 29, 2019

Started in a new crate as per #110 #110 (comment)

Includes a basic test for the Requester against a running tendermint node.

Not really sure how to use async stuff yet so I just copied the block_on thing from the integration tests for now ...

Also includes a basic daemon that uses bisection to sync against a local node from hard coded values - this is working against a my local node.

  • 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
Copy link
Contributor

xla commented Dec 30, 2019

@ebuchman As the Requesters async parts will be primarily around I/O async-std might be a better fit here.

This could be seen as a benefit for the codebase at large actually.

@tarcieri
Copy link
Contributor

At least for now, async-std is fairly new and immature/rough-around-the-edges, lacking an ecosystem of higher level libraries (e.g. tower, hyper), and at least anecdotally I’ve heard mixed reports about how well using async-std with a tokio reactor actually works in practice.

FWIW, I was interested in async-std for awhile (see e.g. #2 (comment) ) but much of what I liked about it ergonomically also landed in tokio 0.2.

@ebuchman
Copy link
Member Author

ebuchman commented Dec 31, 2019

Merged in #114 and #117.

Note that since #114 was squash merged to master, the original commits from that PR are showing up in this PR's commit history, even though the changes are already on master.

it's not actually a hash!
it's whatever is returned by the application,
which can be arbitrary bytes.
@ebuchman ebuchman changed the title impl Requester impl Requester, Store, and a basic syncing daemon Dec 31, 2019
@ebuchman ebuchman changed the title impl Requester, Store, and a basic syncing daemon lite: impl Requester, Store, and a basic syncing daemon Dec 31, 2019
@ebuchman ebuchman changed the base branch from bucky/lite-new-unit-tests to master December 31, 2019 22:24
@ebuchman ebuchman mentioned this pull request Dec 31, 2019
@ebuchman
Copy link
Member Author

ebuchman commented Jan 8, 2020

Merged in master and fixed conflicts. Also did some minor cleanup.

We can probably merge this more or less as is for now but we'll want to follow up with:

  • move subjective_init into the lite module, make it generic over the traits, and add the extra validation as noted
  • fix package structure (some impls for lite are in the new tendermint-lite crate while others are just in tendermint. Maybe they should all be in a module together in tendermint but lite itself should be factored out into its own crate and then we just need a crate for a tendermint-lite-node binary ?
  • refactor main.rs to be a CLI and take config & args

@ebuchman ebuchman marked this pull request as ready for review January 8, 2020 23:46

[dependencies]
tendermint = { path = "../tendermint" }
tokio = "0.2"
Copy link
Member

Choose a reason for hiding this comment

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

Cool that there is (again) a light client crate now. Is the plan to move everything from tendermint/src/lite into this crate too?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm starting to think the tendermint/src/lite should be its own crate and the non main stuff here should be in the tendermint crate

Copy link
Member

Choose a reason for hiding this comment

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

OK, I see. For binaries it is good practice to add the Cargo.lock to the repo, too.

assert_eq!(r1.hash(), r2.header().validators_hash());
}
}
*/
Copy link
Member

Choose a reason for hiding this comment

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

What's up with this? Why is it commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's an integration test requiring a full node and i wasn't sure how to indicate that ...

Copy link
Member

Choose a reason for hiding this comment

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

I think adding a #[ignore] to the test and adding one sentence about why this is disabled and what it needs to be able to run would be cool.

An example of this is:

https://github.com/interchainio/tendermint-rs/blob/1cc2071cead14533e71a69e8db4051eb0ea09c60/tendermint/tests/integration.rs#L3-L32

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tendermint = { path = "../tendermint" }
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be a proper dependency instead of a local path?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do both...

Suggested change
tendermint = { path = "../tendermint" }
tendermint = { version = "0.11", path = "../tendermint" }

Co-Authored-By: Ismail Khoffi <Ismail.Khoffi@gmail.com>
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.

Awesome work! We should merge this as is and address the following in follow-up work; e.g., in the PR that deals with making the consts config params (using abssicca):
- add a comment about why the integration test is commented out (and what is needed to run it)
- update Cargo.toml of the binary crate to point to specific tm version
- add Cargo.lock

@liamsi liamsi merged commit a6dcab4 into master Jan 9, 2020
@liamsi liamsi deleted the bucky/lite-reqester-store-impl branch January 9, 2020 17:36
@liamsi liamsi mentioned this pull request Mar 6, 2020
5 tasks
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.

None yet

4 participants