-
Notifications
You must be signed in to change notification settings - Fork 225
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
RPC support for CometBFT 0.38 #1317
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9962a4f
rpc: 0.38 support for /block_results endpoint
mzabaluev 8328820
rpc: add app_hash field to /block_results response
mzabaluev 320decd
tendermint: restore Deserialize on some types
mzabaluev ad73c4b
tendermint: serde impls for ExecTxResult
mzabaluev 4c0cb74
rpc: support more changes in CometBFT 0.38
mzabaluev 14cda47
rpc: recognize 0.38 in CompatMode::from_version
mzabaluev ba70456
Fix CompatMode parsing test
mzabaluev c8d8497
Fix deserialization of RPC results
mzabaluev 009e696
rpc: 0.37 compat on /block_results response
mzabaluev 7ba4b1c
Add kvstore fixtures for 0.38
mzabaluev 057f169
Derive serde impls for abci responses
mzabaluev ce199fa
rpc: adapt serialization of Event for 0.38
mzabaluev 07de311
base64 for app_hash in JSON of FinalizeBlock
mzabaluev c37c6c3
rpc: adjusted tests for kvstore_fixtures/v0_38
mzabaluev 2cf5d78
clippy fix
mzabaluev 3c12478
Fix up kvstore-test
mzabaluev e85d346
rpc: CometBFT 0.38 compat notes on new fields
mzabaluev a2015fb
rpc: version-alias latest event serde helpers
mzabaluev fa7d4b1
Changelog for #1317
mzabaluev 2406f5a
rpc: swap around dialect parsing in websocket
mzabaluev 77b5b63
rpc: swap around dialects in websocket test
mzabaluev c00766a
rpc: websocket_client_happy_path test for 0.38
mzabaluev a4e3804
rpc: split ser/de helpers for Event
mzabaluev 569db8c
rpc: 0.37 serialization for /broadcast_tx_commit
mzabaluev 8d58a1d
rpc: Fix 0.38 websocket test by proper emulation
mzabaluev 3d3dac8
Merge branch 'main' into mikhail/cometbft-rpc-0.38
mzabaluev 51e47d0
Remove a FIXME comment
mzabaluev 3d05019
Merge branch 'main' into mikhail/cometbft-rpc-0.38
mzabaluev 18ccbcc
rpc: add new fields to 0.38 fixture test
mzabaluev e5f141b
Update changelog for #1317
mzabaluev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
.changelog/unreleased/breaking-changes/1317-cometbft-rpc-0.38.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- `[tendermint-rpc]` Changes to support the RPC protocol in CometBFT 0.38 | ||
([\#1317](https://github.com/informalsystems/tendermint-rs/pull/1317)): | ||
* Add `finalize_block_results` and `app_hash` fields to | ||
`endpoint::block_results::Response`. | ||
* The `deliver_tx` field is renamed to `tx_result` in | ||
`endpoint::broadcast::tx_commit::Response`. | ||
* The `tx_result` field type changed to `ExecTxResult` in | ||
`endpoint::tx::Response`. | ||
* The `event::EventData::NewBlock` variant is renamed to `LegacyNewBlock`. | ||
The new `NewBlock` variant only carries fields relevant since CometBFT 0.38. | ||
* Removed `event::DialectEvent`, replaced with non-generic serialization | ||
helpers in `event::{v0_34, v0_37, v0_38}`. The `Deserialize` helpers in | ||
the latter two modules are aliased from common types that can support both | ||
fields added in CometBFT 0.38, `block_id` and `result_finalize_block`, | ||
as well as the fields present 0.37. Likewise for `DialectEventData` | ||
and other event data structure types. | ||
* Changed some of the serialization dialect helpers to only be | ||
used by the 0.34 dialect and remove generics. The current dialect's | ||
seralization is switched to the serde impls on the domain types in | ||
`tendermint`. | ||
- `[tendermint]` Changes to support the RPC protocol in CometBFT 0.38 | ||
([\#1317](https://github.com/informalsystems/tendermint-rs/pull/1317)): | ||
* Due to some attribute changes, the format emitted by `Serialize` is | ||
changed for `abci::response` types `CheckTx` and `FinalizeBlock`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- `[tendermint-rpc]` Support for CometBFT 0.38 | ||
([\#1317](https://github.com/informalsystems/tendermint-rs/pull/1317)): | ||
* `Deserialize` implementations on `abci::Event`, `abci::EventAttribute` | ||
that correspond to the current RPC serialization. | ||
* Domain types under `abci::response` also get `Deserialize` implementations | ||
corresponding to the current RPC serialization. | ||
* `Serialize`, `Deserialize` implementations on `abci::types::ExecTxResult` | ||
corresponding to the current RPC serialization. | ||
* Added the `apphash_base64` serializer module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit counterintuitive, though I guess if the RPC client does not differentiate between 0.37 and 0.38 it makes sense.
I wonder though if we could rather add a
CompatMode
variant for 0.38 and then change the logic at use site to check whether the compat mode is set to 0.3X or higher on case-per-case basis, eg. withcompat_mode >= CompatMode::v0_37
for when we want to check if the version is higher or equal to v0.37.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, the RPC "dialect" does not change enough between 0.37 and 0.38 that we have to specially switch anything in order to talk to any node built on either of these versions. Naming could be improved; I tried to play with the
Latest
compact mode name in the past, perhaps anticipating this ambiguity.