-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
abci++: only include meaningful header fields in data passed-through to application #8216
Conversation
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.
Thanks for this! Looking great!
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 one piece of information that I think is missing that applications may want is to know who the proposer for the block was
@cmwaters are you thinking of its possible use by slashing and/or distribution modules? |
Yes in the past, the SDK have allowed the proposer to receive an additional reward. I think generally it makes sense because there's nothing else that could inform the application of the proposer elected without the application having to run the algorithm themselves |
proto/tendermint/abci/types.proto
Outdated
int64 height = 2; | ||
google.protobuf.Timestamp time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; | ||
repeated bytes txs = 4; | ||
CommitInfo decided_last_commit = 5 [(gogoproto.nullable) = false]; |
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.
should this flip with the previous line?
I'm aware of that. That's what I'm concerned with, although I don't have hard proof today. We're having preliminary discussions in the Protocol Desgin team within Informal, but no results yet. So, as there isn't any hard proof at the moment (about asymmetric rewards encouraging byzantine behavior), I'm OK with including this field. We can always deprecate it and/or discourage its use in the future. |
Happy to add it as part of this pull request. I did a pass through the SDK and this appears to the main field missed. I also see the SDK make many references to the ChainID. @cmwaters do you know if the SDK stores the chain ID anywhere and doesn't rely strictly on getting it from the block header? cc: @marbar3778 as well. |
Id prefer to keep the entire header being passed to the application in at least one phase since we don't know all the use cases an application may have for this. Is there any benefit to not passing it, it doesn't seem like there is an added overhead to the message, In 99.9% cases the application and tendermint will run on the same machine so the over head is very very minimal. The sdk doesn't have complex use cases for most things, all the modules are simple implementations, there are chains looking at doing more complex things that may need this data, but passing it each time may not be needed. |
I'm not convinced that exposing the whole header to the App (with all the hashes, etc) is the cleanest API. Since this API is defined using protobufs, we can easily add any field that might be missing, without breaking backwards compatibility. |
Adding to this: The concern about existing use is a very reasonable one. Because ABCI++ will require all applications to make changes, however, this is one of the rare cases where we can get meaningful feedback about what applications are actually doing. If an app needs header data that we aren't exposing in ABCI++, I'd like them to come talk to us about it. Minimizing the header to start will allow us to have that conversation (and we could add more fields in a point release, it wouldn't require a major update). |
Either way works with me, I don't have the full scope of what people are doing, and the cosmos-sdk repo is not a good representation. The ibc team may have better insight here |
Thanks for the info marko we pinged the IBC-rs team to see if they have more info. |
3a43a6b
to
4be3ef8
Compare
@@ -355,7 +367,7 @@ message ResponseFinalizeBlock { | |||
repeated Event events = 1 | |||
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; | |||
repeated ExecTxResult tx_results = 2; | |||
repeated ValidatorUpdate validator_updates = 3; | |||
repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; |
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 now matches the .intermediate
file. It appears that at some point these files skewed.
int64 height = 1; | ||
uint32 index = 2; | ||
bytes tx = 3; | ||
ExecTxResult result = 4 [(gogoproto.nullable) = false]; |
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.
Updated to match the .intermediate
file.
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.
LGTM thanks!
…passed-through to application (#8216)
…to App (#9219) * [cherrypicked] abci++: only include meaningful header fields in data passed-through to application (#8216) * make proto-gen * Fix kvstore tests * Small changes to abci protobufs taken from v0.36.x * make proto-gen (again) * [Partial cherrypick] Restore `Commit` to the ABCI++ spec, and other late modifications (backport #8796) (#8936) * Restore `Commit` to the ABCI++ spec, and other late modifications (#8796) * Added VoteExtensionsEnableHeight * Fix reference to `modified` * Removed old pseudo-code, now included in spec * Removed markdown warnings in abci++_basic_concepts_002_draft.md * Restored `Commit` in the Methods section * Addressed remaining markdown warnings * Revisited intro and basic concepts section * Extra pass at all spec sections to recover Commit, and other ABCI++ spec modifications * Fixed links * make proto-gen * Remove _primes_ from spec notation * Update proto/tendermint/abci/types.proto Co-authored-by: Callum Waters <cmwaters19@gmail.com> * Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md Co-authored-by: Callum Waters <cmwaters19@gmail.com> * Addressed @cmwaters' comments * Addressed @angbrav's and @mpoke's comments on spec * make proto-gen * Fix MD anchor reference * Clarify throughout the spec when `ProcessProposal` and `VerifyVoteExtension` are called * Update spec/abci++/abci++_app_requirements_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_app_requirements_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_app_requirements_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Update spec/abci++/abci++_basic_concepts_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Update spec/abci++/abci++_basic_concepts_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_basic_concepts_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Update spec/abci++/abci++_methods_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Addresed comments * Renamed 'draft' files * Adatped links to new filenames * Fixed links and minor cosmetic changes * Renamed 'byzantine_validators' to 'misbehavior' in ABCI++ spec and protobufs * make proto-gen * Renamed 'byzantine_validators' to 'misbehavior' in the code * Fixed link * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Addressed @cason's comments * Clarified conditions for `ProcessProposal` call at proposer Co-authored-by: Callum Waters <cmwaters19@gmail.com> Co-authored-by: M. J. Fromberger <fromberger@interchain.io> Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> Co-authored-by: Daniel <daniel.cason@usi.ch> (cherry picked from commit 331860c) * Fixed merge conflicts Co-authored-by: Sergio Mena <sergio@informal.systems> * make proto-gen (and again) * make build * fix UTs Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…to App (#9219) * [cherrypicked] abci++: only include meaningful header fields in data passed-through to application (#8216) * make proto-gen * Fix kvstore tests * Small changes to abci protobufs taken from v0.36.x * make proto-gen (again) * [Partial cherrypick] Restore `Commit` to the ABCI++ spec, and other late modifications (backport #8796) (#8936) * Restore `Commit` to the ABCI++ spec, and other late modifications (#8796) * Added VoteExtensionsEnableHeight * Fix reference to `modified` * Removed old pseudo-code, now included in spec * Removed markdown warnings in abci++_basic_concepts_002_draft.md * Restored `Commit` in the Methods section * Addressed remaining markdown warnings * Revisited intro and basic concepts section * Extra pass at all spec sections to recover Commit, and other ABCI++ spec modifications * Fixed links * make proto-gen * Remove _primes_ from spec notation * Update proto/tendermint/abci/types.proto Co-authored-by: Callum Waters <cmwaters19@gmail.com> * Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md Co-authored-by: Callum Waters <cmwaters19@gmail.com> * Addressed @cmwaters' comments * Addressed @angbrav's and @mpoke's comments on spec * make proto-gen * Fix MD anchor reference * Clarify throughout the spec when `ProcessProposal` and `VerifyVoteExtension` are called * Update spec/abci++/abci++_app_requirements_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_app_requirements_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_app_requirements_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Update spec/abci++/abci++_basic_concepts_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Update spec/abci++/abci++_basic_concepts_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_basic_concepts_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Update spec/abci++/abci++_methods_002_draft.md Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Addresed comments * Renamed 'draft' files * Adatped links to new filenames * Fixed links and minor cosmetic changes * Renamed 'byzantine_validators' to 'misbehavior' in ABCI++ spec and protobufs * make proto-gen * Renamed 'byzantine_validators' to 'misbehavior' in the code * Fixed link * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_basic_concepts.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Update spec/abci++/abci++_methods.md Co-authored-by: Daniel <daniel.cason@usi.ch> * Addressed @cason's comments * Clarified conditions for `ProcessProposal` call at proposer Co-authored-by: Callum Waters <cmwaters19@gmail.com> Co-authored-by: M. J. Fromberger <fromberger@interchain.io> Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> Co-authored-by: Daniel <daniel.cason@usi.ch> (cherry picked from commit 331860c) * Fixed merge conflicts Co-authored-by: Sergio Mena <sergio@informal.systems> * make proto-gen (and again) * make build * fix UTs Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
… passed-through to application (tendermint#8216) (#98) closes: tendermint#7950 Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
… passed-through to application (tendermint#8216) (#98) (tendermint#453) closes: tendermint#7950 Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
closes: #7950