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

Tendermint/v0.33 #196

Merged
merged 39 commits into from
Apr 21, 2020
Merged

Tendermint/v0.33 #196

merged 39 commits into from
Apr 21, 2020

Conversation

greg-szabo
Copy link
Member

@greg-szabo greg-szabo commented Mar 29, 2020

This is a minimum viable product for Tendermint v0.33 compatibility. Lots of improvements can be made (more tests, further optimizations) but most probably those should be added as new issues and PRs.

I'm writing an ADR that should address the decisions made in updating/implementing the RPC structs.

  • 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

Shivani912 and others added 28 commits March 17, 2020 17:52
* initial new commit struct

* update functions

* fixed deserialization for new commit struct

* updated links to generator + val_set_test file

* Update tendermint/src/account.rs

Co-Authored-By: Ismail Khoffi <Ismail.Khoffi@gmail.com>

* fmt

* clippy

* rpc tests: grab latest example fro commit:
 - use https://docs.tendermint.com/master/rpc/#/Info/commit
 - update chain_id: cosmoshub-1 to cosmoshub-2 everywhere else
 - manually kept `id` a string in JSONrpc responses

* Actually let's go cosmoshub-3:

 - grabbed from: https://rpc.cosmos.network/commit?height=2

* Fix commit test

- regenerated commit.json via
`curl -X GET "http://localhost:26657/commit?height=10" -H "accept: application/json"`

* Fix block test

- "regenerated" block.json via
`curl -X GET "http://localhost:26657/block?height=10" -H "accept: application/json"`

* Fix first_block test

- "regenerated" block.json via
`curl -X GET "http://localhost:26657/block?height=1" -H "accept: application/json" `

Co-authored-by: Shivani Joshi <joshi.shivani912@gmail.com>
Co-authored-by: Shivani Joshi <46731446+Shivani912@users.noreply.github.com>
fix /abci_info & /genesis:
 - add app_version & use #[serde(default)] to deal with omitted fields in JSON
 - make app_state in /genesis reply optional
 - fix string in abci_info test (kvstore wont reply with "GaiaApp")

 verify tests pass via running `tendermint node --proxy_app=kvstore` and
 `cargo test -- --nocapture --ignored
@codecov-io
Copy link

codecov-io commented Mar 29, 2020

Codecov Report

Merging #196 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #196   +/-   ##
======================================
  Coverage    39.1%   39.1%           
======================================
  Files          99      99           
  Lines        3610    3610           
  Branches      580     580           
======================================
  Hits         1413    1413           
  Misses       1800    1800           
  Partials      397     397           

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 2993d23...2993d23. Read the comment docs.

@greg-szabo greg-szabo requested a review from liamsi March 29, 2020 08:40
@liamsi liamsi mentioned this pull request Apr 8, 2020
5 tasks
@liamsi
Copy link
Member

liamsi commented Apr 8, 2020

Could #198 be fixed part of this?

#206

* manually update Proof and introduce ProofOp to match the actual JSON encoding

* 0.33 branch seems out of date with master, committing to switch back

* Fix test

* Fix rpc endpoint test (how wasn't this detected before by the integration tests)?
@greg-szabo greg-szabo changed the title WIP: Tendermint/v0.33 Tendermint/v0.33 Apr 9, 2020
@greg-szabo
Copy link
Member Author

Removed WIP, let's see if everything is in place for merge. I'd consider @liamsi or @ebuchman as the best people to approve this.

@liamsi
Copy link
Member

liamsi commented Apr 9, 2020

I'll go through the changes again and collect everything in a followup issue. I think we can merge this later today.

@romac
Copy link
Member

romac commented Apr 10, 2020

FYI there are missing serializers for TrustThresholdFraction. I just opened a PR to fix those at #210.

Also, I just ran the relayer (which depends on this branch) against a Tendermint 0.33.3 node and got an RPC error saying missing field 'height' at line 59 column 7. I suspect it comes from either tendermint::rpc::Client::latest_commit or tendermint::rpc::Client::commit.

@ancazamfir
Copy link
Contributor

I tried with gaia nodes running IBC and get Some("missing field num_txs at line 30 column 7"), this is with tendermint v0.33.2

* rename iter -> signed_votes and add validation checks

 - add basic validation to validate method (depending on `BlockIDFlag`)
 - move check for unknown validator to validate method (for CommitSig)
@liamsi liamsi mentioned this pull request Apr 10, 2020
9 tasks
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.

This PR is becoming way too large... I put some of the outstanding issues in #211 and would recommend merging this instead of adding more to it. I'd also recommend another pair of eyes here though as I authored parts of this PR 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.

tendermint/src/block/commit_sig.rs Show resolved Hide resolved
tendermint/src/block/commit_sig.rs Show resolved Hide resolved
@@ -52,42 +45,109 @@ impl lite::Commit for block::signed_header::SignedHeader {
}

fn validate(&self, vals: &Self::ValidatorSet) -> Result<(), Error> {
if self.commit.precommits.len() != vals.validators().len() {
// TODO: self.commit.block_id cannot be zero in the same way as in go
Copy link
Contributor

Choose a reason for hiding this comment

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

only the very first block (height: 1) is allowed (actually required) to have 0 signatures

tendermint/src/lite_impl/signed_header.rs Show resolved Hide resolved
self
);
}
// TODO: this last check is only necessary if we do full verification (2/3) but the
Copy link
Contributor

Choose a reason for hiding this comment

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

seems to me this should not be the concern of Commit to validate if it's a part of some validator set, but it should be rather the job of external object, who's probably holding a validator set to make sure commit signatures match validator set. that's how it's done in Go. It's interesting that you've decided to revert this relationship.

@tarcieri
Copy link
Contributor

tarcieri commented Apr 16, 2020

Probably good to create a 0.32 based release from master first!

@liamsi I think it'd be good to cut a final tendermint-rs v0.12 release (the current release is v0.12.0-rc0) then merge this.

Happy to help with that.

@liamsi liamsi mentioned this pull request Apr 17, 2020
5 tasks
@liamsi
Copy link
Member

liamsi commented Apr 21, 2020

Merging this now. Whenever we want, we can now release this as 0.14.0 (a 0.12.0 and a 0.13.0 were released in the meantime). Will add the adding changelog entries to #211.

@liamsi liamsi merged commit 3003fef into master Apr 21, 2020
This was referenced Apr 21, 2020
@liamsi liamsi mentioned this pull request May 4, 2020
5 tasks
@liamsi liamsi mentioned this pull request Jun 3, 2020
5 tasks
@liamsi liamsi deleted the tendermint/v0.33 branch June 3, 2020 09:51
liamsi added a commit that referenced this pull request Jun 3, 2020
* Drop redundant prefixes in BlockIDFlag enum variants

- #196 (comment)

* improve error message
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.

9 participants