-
Notifications
You must be signed in to change notification settings - Fork 226
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
Side-by-side support for Tendermint 0.34 and 0.37 #1193
Merged
Merged
Changes from 87 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
d37f063
proto-compiler: Improve error reporting
mzabaluev ce68dbd
Generate proto from tendermint 0.37.0-alpha.1
mzabaluev 95b962a
proto: sort includes in generated tendermint.rs
mzabaluev c6807d2
proto: generate structs for 0.34 and 0.37
mzabaluev df05a47
tendermint: Remove Evidence::ConflictingHeaders
mzabaluev eb160fb
Add serializers::allow_null
mzabaluev 8e04a06
Adapt domain types to v0.37 and add multi-version conversions.
mzabaluev d33945a
Multi-version protobuf support for request types
mzabaluev 7414aa9
Add ABCI response types for PrepareProposal, ProcessProposal
mzabaluev 30408ed
Multi-version protobuf conversions for response types
mzabaluev df28559
Fix conversion from account::Id to Bytes
mzabaluev ca50ce4
Fix compiler warnings
mzabaluev 3277ac3
light-client: Restore Supervisor::report_evidence
mzabaluev 47e285b
Restore serialization of Block and Evidence
mzabaluev 53a546c
Fix clippy lints
mzabaluev 9b7089c
proto-compiler: Improve copying of generated files
mzabaluev f40b6f4
proto: Regenerate v0_34 with v0.34.22
mzabaluev 276bc6d
Add domain type for RemoteSignerError
mzabaluev 18f51e4
Define more multi-protocol conversions
mzabaluev b18264e
p2p: version-qualify dependencies on protobuf
mzabaluev d1a76a9
Make clippy happy
mzabaluev d397090
Derive Eq where clippy suggests
mzabaluev 4796bc4
tendermint: version-specific Request and Response
mzabaluev 9730636
Remove last version aliases of Request, Response
mzabaluev 1aa5fee
Merge branch 'main' into mikhail/multi-tc-version-support
mzabaluev d7ee353
Re-generate protos with prost-build 0.11.4
mzabaluev 0bea5cf
rpc: add endpoints header and header_by_hash
mzabaluev d7e7100
rpc: Separate Client traits for v0.34 and v0.37
mzabaluev 6a24461
rpc: feature-gate the Client traits
mzabaluev a00a69d
xla/multi-tc-versionsupport/fix (#1254)
xla 14b3080
Merge branch 'main' into mikhail/multi-tc-version-support
mzabaluev 08702c5
tendermint: post-merge fix
mzabaluev 011dc7b
Add missing ConsensusRequest and ConsensusResponse mappings.
aakoshh e6fdbcd
Merge branch 'mikhail/multi-tc-version-support' of github.com:aakoshh…
mzabaluev 1f782ea
rpc: clean up change noise
mzabaluev c2f06e3
Changelog entries for #1193
mzabaluev c2fa95a
Revert "rpc: clean up change noise"
mzabaluev 620aa99
abci: change serialization to unsigned varint
mzabaluev 483be77
abci: changelog notice about varint encoding
mzabaluev 0af8aba
rpc: multi-version support through generics
mzabaluev 0695093
Merge branch 'main' into mikhail/multi-tc-version-support
mzabaluev 91b984d
rpc: remove generic default from request::Wrapper
mzabaluev 6054e3e
Implement both Client dialect traits for websocket
mzabaluev ab16785
Rework Event serialization with helper types
mzabaluev 03eda10
rpc: Refactor subscriptions to support dialects
mzabaluev 6beba5f
rpc: fix the fixture tests
mzabaluev d708fd0
rpc: fix websocket tests
mzabaluev 251ff89
Merge branch 'main' into mikhail/multi-tc-version-support
mzabaluev 580b367
tendermint: Fix test_sign_bytes_compatibility
mzabaluev 0305ba8
Versioned type aliases for WebSocketClient
mzabaluev 75c212f
Fix tools build
mzabaluev 546170e
Remove dialect parameter for SubscriptionClient
mzabaluev 52197f0
Derive PartialEq, Eq on ProdCommitValidator
mzabaluev 1610120
tendermint: restore Serialize impl on Event
mzabaluev 2d864bb
rpc: de-genericized result types
mzabaluev 504bbe7
rpc: make the client module public
mzabaluev e81f7bf
Remove WebSocketClient::*_with_dialect
mzabaluev 064534b
rpc: rename DefaultDialect to LatestDialect
mzabaluev fca0f1a
rpc: dynamic compat mode for HttpClient
mzabaluev 31cf889
rpc: eliminate dialect Client traits
mzabaluev 1c1432e
rpc: Add client::compat::discover
mzabaluev b587e6e
rpc: unit test for CompatMode version parsing
mzabaluev 7691ba0
rpc: make WebSocketConfig struct more usable
mzabaluev 3866d0e
rpc: expose CompatMode::from_version
mzabaluev 62f6e5d
rpc: make mod client::compat private
mzabaluev 4c55808
rpc: account for "v" prefixing Tendermint version
mzabaluev b526b2a
rpc: fix websocket tests
mzabaluev c6c5aa6
rpc: debug received events in WebSocketTransport
mzabaluev f0d9e6a
Quick fix for running `rpc-probe` against a Comet 0.37 node
romac 4f8f122
Fix doc for overriding env variable in rpc-probe README
romac 4deecf4
Merge branch 'main' into mikhail/multi-tc-version-support
mzabaluev ab8b54e
rpc: added kvstore test fixtures for 0.37
mzabaluev bacb64b
rpc: adjust some v0_37 tests to match fixtures
mzabaluev 6946849
rpc: fudge data in subscribe_newblock_1
mzabaluev 295ef2a
rpc: adjust kvstore_fixtures tests for v0_37
mzabaluev 7fedc09
rpc: fixed and expanded unit tests using fixtures
mzabaluev 7e79039
abci: more sensible default impl of ABCI++ methods
mzabaluev 0fe73a1
abci: overflow-proof impl of prepare_proposal
mzabaluev 9e25f3f
Update #1193 changelog for tendermint-rpc changes
mzabaluev 74b8793
Fill out .changelog entry for #1193
mzabaluev f3e161e
rpc: improve CompatMode enum
mzabaluev 84d9cad
rpc: builder API for clients
mzabaluev 7d9572c
Update #1193 changelog about RPC client builders
mzabaluev 679eba1
Change CompatMode::LATEST to a const fn
romac 11c2c82
Add missing serde bounds on WebSocketClientUrl
romac e68643b
Add missing Display impl to WebSocketClientUrl
romac fe4c0ab
Change to self-consuming builder API
romac 2d4a333
rpc: do version discovery in CLI
mzabaluev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
.changelog/unreleased/breaking-changes/1193-multi-version-tendermint.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,16 @@ | ||
- [`tendermint`] Version-specific definitions for ABCI `Request` and `Response` | ||
enums under `v0_34::abci` and `v0_37::abci`, containing only the method variants | ||
present in each of the respective protocol versions. | ||
`Request` and `Response` defined under `v0_37` are re-exported under | ||
the non-versioned `abci` module name, but the `SetOption` variant is not present | ||
in these latest versions of the enums. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)) | ||
- [`tendermint-abci`] Change the frame length encoding in the ABCI wire protocol | ||
to unsigned varint, to correspond to the changes in Tendermint Core 0.37. | ||
No compatibility with 0.34 is provided at the moment. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)) | ||
- [`tendermint-rpc`] Changed the signature of `WebSocketClient::new_with_config` | ||
to accept a `WebSocketConfig` struct value rather than an `Option`. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)) | ||
- [`tendermint-proto`] The `serializers::evidence` module has been made private. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)) |
21 changes: 21 additions & 0 deletions
21
.changelog/unreleased/enhancements/1193-multi-version-tendermint.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,21 @@ | ||
- [`tendermint-proto`] Generate prost bindings for Tendermint 0.34 and 0.37 side by side. | ||
The version-specific structs are placed under the `tendermint::v0_34` and | ||
`tendermint::v0_37` module namespaces, respectively. The names under | ||
`tendermint::v0_37` are also re-exported under `tendermint`. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)) | ||
- [`tendermint`] New and updated ABCI domain types for Tendermint Core v0.37 | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)). | ||
- [`tendermint`] Protobuf conversions provided for both `v0_34` and `v0_37` | ||
versions of the generated [`tendermint-proto`] structs, where applicable. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)). | ||
- [`tendermint-rpc`] Introduce `client::CompatMode`, enumerating protocol | ||
compatibility modes specifying the RPC data encoding used by the client. | ||
An `HttpClient` can be created with a selected mode specified in the new | ||
`builder` API, or have the mode changed afterwards (usually after | ||
version discovery) by the added `set_compat_mode` method. | ||
For `WebSocketClient`, the mode can only be specified at creation via the new | ||
`builder` API. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)) | ||
- [`tendermint-abci`] Port ABCI application support to 0.37 Tendermint Core API. | ||
No legacy support for 0.34 is provided at the moment. | ||
([#1193](https://github.com/informalsystems/tendermint-rs/pull/1193)). |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
//! Supervisor and Handle implementation. | ||
use crossbeam_channel as channel; | ||
use tendermint::evidence::{ConflictingHeadersEvidence, Evidence}; | ||
use tendermint::evidence::Evidence; | ||
|
||
use crate::{ | ||
errors::Error, | ||
|
@@ -284,19 +284,15 @@ impl Supervisor { | |
} | ||
|
||
/// Report the given evidence of a fork. | ||
// TODO: rework to supply LightClientAttackEvidence data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In progress in my branch |
||
fn report_evidence( | ||
&mut self, | ||
provider: PeerId, | ||
primary: &LightBlock, | ||
witness: &LightBlock, | ||
_primary: &LightBlock, | ||
_witness: &LightBlock, | ||
) -> Result<(), Error> { | ||
let evidence = ConflictingHeadersEvidence::new( | ||
primary.signed_header.clone(), | ||
witness.signed_header.clone(), | ||
); | ||
|
||
self.evidence_reporter | ||
.report(Evidence::ConflictingHeaders(Box::new(evidence)), provider) | ||
.report(Evidence::LightClientAttackEvidence, provider) | ||
.map_err(Error::io)?; | ||
|
||
Ok(()) | ||
|
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.
Has this landed in 0.34?
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.
No, it's a breaking change from 0.34. It was originally supposed to be included in 0.35. I don't know if it's slated for inclusion in 0.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.
The encoding has changed in 0.37, and in this PR,
tendermint-abci
is converted completely to 0.37 with no compatibility support. We can revert all of this and declaretendermint-abci
at end of life if that's better.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.
We could also choose to commit to multi-version support here as well, but this will require more work.