-
Notifications
You must be signed in to change notification settings - Fork 216
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
Rebase ABCI domain types onto main #1203
Changes from 26 commits
3021889
38a5de3
b7f3125
8bc6a97
3096775
e403925
5de9425
b9b6596
c02739a
2e429e7
064fb82
39f7210
60dafb4
61e6bf5
08a6a1e
ce30fe6
35b75fc
9667148
8f45e28
3aba2d2
6c38131
0ca7299
3a92d77
8d31c4e
f9ae6a4
308d060
35e3fe5
2a89abe
b21d86b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- `[tendermint-proto]` Use `Bytes` for byte array fields of ABCI protobuf types. | ||
([#1203](https://github.com/informalsystems/tendermint-rs/pull/1203)) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- `[tendermint]` Added domain types for ABCI | ||
([#862](https://github.com/informalsystems/tendermint-rs/issues/862)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,10 @@ use tendermint_proto::abci::{ | |
request, response, Request, RequestApplySnapshotChunk, RequestBeginBlock, RequestCheckTx, | ||
RequestCommit, RequestDeliverTx, RequestEcho, RequestEndBlock, RequestFlush, RequestInfo, | ||
RequestInitChain, RequestListSnapshots, RequestLoadSnapshotChunk, RequestOfferSnapshot, | ||
RequestQuery, RequestSetOption, ResponseApplySnapshotChunk, ResponseBeginBlock, | ||
ResponseCheckTx, ResponseCommit, ResponseDeliverTx, ResponseEcho, ResponseEndBlock, | ||
ResponseFlush, ResponseInfo, ResponseInitChain, ResponseListSnapshots, | ||
ResponseLoadSnapshotChunk, ResponseOfferSnapshot, ResponseQuery, ResponseSetOption, | ||
RequestQuery, ResponseApplySnapshotChunk, ResponseBeginBlock, ResponseCheckTx, ResponseCommit, | ||
ResponseDeliverTx, ResponseEcho, ResponseEndBlock, ResponseFlush, ResponseInfo, | ||
ResponseInitChain, ResponseListSnapshots, ResponseLoadSnapshotChunk, ResponseOfferSnapshot, | ||
ResponseQuery, | ||
}; | ||
|
||
use crate::{codec::ClientCodec, Error}; | ||
|
@@ -113,11 +113,6 @@ impl Client { | |
perform!(self, Commit, RequestCommit {}) | ||
} | ||
|
||
/// Request that the application set an option to a particular value. | ||
pub fn set_option(&mut self, req: RequestSetOption) -> Result<ResponseSetOption, Error> { | ||
perform!(self, SetOption, req) | ||
} | ||
|
||
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. Not a big deal, since I don't think anyone really uses this crate, but why was 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. I think this slipped through backporting. We could add it back in, or leave it out. There's no documentation on what it's actually supposed to do, so I'm not sure how anyone would use it. 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. I have restored the method, but added a |
||
/// Used during state sync to discover available snapshots on peers. | ||
pub fn list_snapshots(&mut self) -> Result<ResponseListSnapshots, Error> { | ||
perform!(self, ListSnapshots, RequestListSnapshots {}) | ||
|
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.
@thanethomson I've added a notice about this change, but as stated already, I'm not sure we need to go ahead with it for 0.26. This is certainly unrelated to domain types, it's applied piecemeal to a single proto module not as a consistent change throughout tendermint-proto, and has the overall smell of a premature optimization.
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 is related to the domain types, because the ABCI domain types use
Bytes
internally, so unwinding this part of the ABCI domain types will break existing users of the ABCI domain types. This is not meaningfully a breaking change for anyone else, because there weren't users of the ABCI proto types other than the stub ABCI demo application. It's also not a breaking change relative tomaster
, because this code has been merged on that branch (albeit unreleased) for about a year.If this change is unwound out, you'll have to edit all of the ABCI domain types, and then all the users will have to edit all their uses of those domain types. I don't think it would be good to put this on the critical path for doing a semver release of the
tendermint
crates that contains ABCI domain types.If the decision, later, is that the domain types should not use the
Bytes
type, it would be much better to do that as a later change that can be modeled with semver. (For the record, I don't think this is a good decision, but in any case I think it should be separate from getting this code backported as-is).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.
Thank you @hdevalence for the detailed exposition.
As a late-to-the-scene comment, if I were into micro-optimizing domain type conversions to protobuf, I'd start with the
Protobuf
trait forcing a clone of the entire structure, because the domain-to-raw conversion is implemented viaFrom<Self>
, but theencode*
methods take&self
. But this is a subject for a larger rework.