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

New commit struct! #181

Closed
wants to merge 9 commits into from
Closed

New commit struct! #181

wants to merge 9 commits into from

Conversation

Shivani912
Copy link
Contributor

closes #145

NOTE: I've updated the commit struct here but as a result we'll have to give up compatibility with current Gaia (assuming they're still using the older commit struct)

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

@liamsi There are rpc JSON tests here that are failing because of the new commit struct. I don't have pointers to the code that generated those files. Do you want to take it from here?

Also, would appreciate your early review!

@Shivani912 Shivani912 requested a review from liamsi March 12, 2020 20:49
@liamsi
Copy link
Member

liamsi commented Mar 12, 2020

Thanks @Shivani912! I'll review and look into the failing tests tomorrow! I'm also not sure from what they where generated; the problem is that a bunch of these aren't up to date with the latest tendermint even without the commit changes.
Note to myself:
failures:

  • endpoints::block
  • endpoints::commit
  • endpoints::first_block

@Shivani912
Copy link
Contributor Author

@liamsi Ahan! Time for more tests then, haha 🙃

tendermint/src/account.rs Outdated Show resolved Hide resolved
@Shivani912
Copy link
Contributor Author

Note: All the JSON files have been re-generated so they are compatible with the latest changes. Link to generator updated in code!

@liamsi
Copy link
Member

liamsi commented Mar 13, 2020

It looks like the RPC tests where either copy & pasted from the documentation, or, dumped via a modified fork. I can't find any code that generated the RPC JSON tests either. @tarcieri can you confirm that these files weren't generated with some tool in tendermint/gaiad?

@tarcieri
Copy link
Contributor

@liamsi the JSON used in the original RPC unit tests was taken from a cosmoshub-2 full node

@liamsi liamsi mentioned this pull request Mar 15, 2020
.is_none());
}
// NOTE: Since the commit struct changed, the votes i.e. CommitSig no longer contains BlockID
// TODO: Do we still need this test?
Copy link
Member

Choose a reason for hiding this comment

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

No, we don't need that exact test anymore. But it would we good to translate it into the new semantic. It tested that the blockId is none. Which looks suspiciously to saying BlockIDFlagAbsent now. But I'll double check.

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.

The main changes in this PR look great and to the point. #182 will fix the failing tests and resolve a few open todos.

@liamsi liamsi mentioned this pull request Mar 16, 2020
liamsi and others added 2 commits March 17, 2020 18:18
* 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>
@codecov-io
Copy link

codecov-io commented Mar 17, 2020

Codecov Report

Merging #181 into master will decrease coverage by 4.0%.
The diff coverage is 44.9%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #181     +/-   ##
========================================
- Coverage    42.0%   38.0%   -4.1%     
========================================
  Files          88      98     +10     
  Lines        3051    3546    +495     
  Branches      470     563     +93     
========================================
+ Hits         1283    1348     +65     
- Misses       1431    1850    +419     
- Partials      337     348     +11     
Impacted Files Coverage Δ
tendermint/src/account.rs 46.0% <ø> (-8.7%) ⬇️
tendermint/src/block.rs 0.0% <ø> (ø)
tendermint/src/block/header.rs 5.5% <ø> (-4.5%) ⬇️
tendermint/src/genesis.rs 0.0% <0.0%> (ø)
tendermint/src/lite/types.rs 45.1% <ø> (ø)
tendermint/src/lite_impl/header.rs 89.3% <ø> (-0.5%) ⬇️
tendermint/src/rpc/endpoint/abci_query.rs 0.0% <ø> (ø)
tendermint/src/rpc/endpoint/block.rs 0.0% <0.0%> (ø)
tendermint/src/serializers.rs 0.0% <0.0%> (ø)
tendermint/src/block/commit_sig.rs 28.5% <28.5%> (ø)
... and 30 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 50cd585...ae3ee39. Read the comment docs.

@liamsi
Copy link
Member

liamsi commented Mar 18, 2020

Nice, the tests @greg-szabo added fired 👍 (integration tests against a tendermint node that is)

@greg-szabo
Copy link
Member

I looked through the failing integration tests and found the following work to do so far:

  1. abci_info: app_version was missing, I've just added that (it's quite verbose, we might want to talk about it)
  2. abci_info: still fails with unknown parsing error, needs more checks
  3. block_results: missing fields: TxsResults, BeginBlockEvents, EndBlockEvents, ValidatorUpdates, ConsensusParamUpdates. The old "results" field need to be removed.
  4. genesis, evidence Params: missing fields: max_age_num_blocks, max_age_duration. The old field "max_age" has to be removed.

@Shivani912
Copy link
Contributor Author

Shivani912 commented Mar 19, 2020

After a discussion with @greg-szabo, I'm closing this pull request. Since Gaia is using Tendermint v0.32 and we don't want to give up compatibility with it, the master branch will stay as is i.e. compatible with Tendermint v0.32. So, all the v0.33 related upgrades will stay in a separate branch. That means, this branch will be compatible with Tendermint v0.33.

@Shivani912 Shivani912 closed this Mar 19, 2020
@Shivani912 Shivani912 deleted the new-commit-struct branch March 19, 2020 18:51
@ebuchman
Copy link
Member

@Shivani912 we reverted this decision right? We're going to update master to tendermint v0.33 and drop compatibility with current gaia?

@Shivani912
Copy link
Contributor Author

@Shivani912 we reverted this decision right? We're going to update master to tendermint v0.33 and drop compatibility with current gaia?

Yes, that's right @ebuchman. For a record, the progress is being posted in issue #184

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.

SignedHeader impl needs to be updated
6 participants