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

Replace RPC ABCI types with ABCI domain types #1204

Merged
merged 29 commits into from
Nov 5, 2022

Conversation

mzabaluev
Copy link
Contributor

@mzabaluev mzabaluev commented Sep 29, 2022

Closes #1090 and #947

Picked up from #1092 by rebasing the branch onto main.

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Added entry in .changelog/

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Signed-off-by: Thane Thomson <connect@thanethomson.com>
Signed-off-by: Thane Thomson <connect@thanethomson.com>
…ermint::Hash

Signed-off-by: Thane Thomson <connect@thanethomson.com>
@mzabaluev mzabaluev added rpc breaking domain-types Anything relating to the creation, modification or removal of domain types labels Sep 29, 2022
Does not seem to be used for anything.
First attempt, with a serialization snag in tendermint-proto.
Instead of deriving serde on raw proto types to de/serialize
abci::response::DeliverTx, abci::Event, and abci::EventAttribute,
derive on the domain types directly.
This disentangles the serialization, now primarily used by JSON-RPC,
from protobuf struct definitions which are subject to change for
Tendermint Core 0.37 (in case of EventAttribute).
In tendermint-rpc, the only place where Gas newtype is still used
is in the response to /broadcast_tx_commit, which is a development-only
endpoint. Leave the response struct defined through tx_commit::TxResult
for the time being.
Define serialization of abci::response::CheckTx (currently not used)
to match that of DeliverTx.
Also in tendermint, remove validator::Update which duplicates
abci::types::ValidatorUpdate.
With it goes mod abci::responses.
@mzabaluev mzabaluev force-pushed the thane+mikhail/rpc-abci-domain-types branch from b602e09 to 5725d4f Compare October 7, 2022 12:11
@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2022

Codecov Report

Merging #1204 (5a6c555) into main (035acab) will increase coverage by 0.3%.
The diff coverage is 70.5%.

❗ Current head 5a6c555 differs from pull request most recent head dc1f3fb. Consider uploading reports for the commit dc1f3fb to get more accurate results

@@           Coverage Diff           @@
##            main   #1204     +/-   ##
=======================================
+ Coverage   64.0%   64.3%   +0.3%     
=======================================
  Files        253     244      -9     
  Lines      21636   21345    -291     
=======================================
- Hits       13851   13736    -115     
+ Misses      7785    7609    -176     
Impacted Files Coverage Δ
light-client/src/evidence.rs 9.0% <ø> (ø)
rpc/src/client/bin/main.rs 0.3% <0.0%> (+<0.1%) ⬆️
rpc/src/endpoint/abci_info.rs 100.0% <ø> (+39.1%) ⬆️
rpc/src/endpoint/abci_query.rs 17.6% <0.0%> (ø)
rpc/src/endpoint/block_results.rs 20.0% <ø> (ø)
rpc/src/endpoint/broadcast/tx_async.rs 25.0% <0.0%> (ø)
rpc/src/endpoint/broadcast/tx_commit.rs 25.0% <0.0%> (-8.4%) ⬇️
rpc/src/endpoint/broadcast/tx_sync.rs 25.0% <0.0%> (ø)
rpc/src/endpoint/evidence.rs 0.0% <ø> (ø)
rpc/src/endpoint/tx.rs 25.0% <0.0%> (ø)
... and 31 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Promote this to a proper domain type.
This was the last of the ABCI helper types defined in tendermint-rpc,
and with it goes the abci module.
@mzabaluev mzabaluev marked this pull request as ready for review October 10, 2022 17:44
Copy link
Contributor

@thanethomson thanethomson 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 disentangling all this @mzabaluev!

///
/// Used to inform Tendermint of changes to the validator set.
///
/// [ABCI documentation](https://docs.tendermint.com/master/spec/abci/abci.html#validatorupdate)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// [ABCI documentation](https://docs.tendermint.com/master/spec/abci/abci.html#validatorupdate)
/// [ABCI documentation](https://github.com/tendermint/tendermint/blob/v0.34.x/spec/abci/abci.md#validatorupdate)

We currently do not make the spec available via the docs site, and the one from master is no longer relevant. We also keep the specification relevant to the specific Tendermint release series on each release branch, so it's easier to see diffs in the specs between major releases of Tendermint.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can probably keep this as-is for this PR, but in a follow-up PR we should update all the spec references to rather point to the v0.34.x branch of the Tendermint repo. I've created #1224 to track this.

@thanethomson thanethomson merged commit 2ce1789 into main Nov 5, 2022
@thanethomson thanethomson deleted the thane+mikhail/rpc-abci-domain-types branch November 5, 2022 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking domain-types Anything relating to the creation, modification or removal of domain types rpc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpc: Remove ABCI-related types
3 participants