mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-21 08:10:31 +00:00
[cherry-picked] Vote extensions: new design (#8031)
* Changed the spec text to agreed VoteExtension solution
* Revert "Removed protobufs related to vote extensions"
This reverts commit 4566f1e302.
* Changes to ABCI protocol buffers
* Update spec/core/data_structures.md
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
* Update spec/core/data_structures.md
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
* Fix dangling link in ABCI++ readme
* Addressed comments
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
@@ -125,16 +125,6 @@ message RequestApplySnapshotChunk {
|
||||
string sender = 3;
|
||||
}
|
||||
|
||||
// Extends a vote with application-side injection
|
||||
message RequestExtendVote {
|
||||
types.Vote vote = 1;
|
||||
}
|
||||
|
||||
// Verify the vote extension
|
||||
message RequestVerifyVoteExtension {
|
||||
types.Vote vote = 1;
|
||||
}
|
||||
|
||||
message RequestPrepareProposal {
|
||||
// the modified transactions cannot exceed this size.
|
||||
int64 max_tx_bytes = 1;
|
||||
@@ -163,6 +153,20 @@ message RequestProcessProposal {
|
||||
bytes proposer_address = 8;
|
||||
}
|
||||
|
||||
// Extends a vote with application-side injection
|
||||
message RequestExtendVote {
|
||||
bytes hash = 1;
|
||||
int64 height = 2;
|
||||
}
|
||||
|
||||
// Verify the vote extension
|
||||
message RequestVerifyVoteExtension {
|
||||
bytes hash = 1;
|
||||
bytes validator_address = 2;
|
||||
int64 height = 3;
|
||||
bytes vote_extension = 4;
|
||||
}
|
||||
|
||||
message RequestFinalizeBlock {
|
||||
repeated bytes txs = 1;
|
||||
CommitInfo decided_last_commit = 2 [(gogoproto.nullable) = false];
|
||||
@@ -301,21 +305,6 @@ message ResponseApplySnapshotChunk {
|
||||
}
|
||||
}
|
||||
|
||||
message ResponseExtendVote {
|
||||
tendermint.types.VoteExtension vote_extension = 1;
|
||||
}
|
||||
|
||||
message ResponseVerifyVoteExtension {
|
||||
Result result = 1;
|
||||
|
||||
enum Result {
|
||||
UNKNOWN = 0; // Unknown result, treat as ACCEPT by default
|
||||
ACCEPT = 1; // Vote extension verified, include the vote
|
||||
SLASH = 2; // Vote extension verification aborted, continue but slash validator
|
||||
REJECT = 3; // Vote extension invalidated
|
||||
}
|
||||
}
|
||||
|
||||
message ResponsePrepareProposal {
|
||||
repeated bytes txs = 1;
|
||||
}
|
||||
@@ -330,6 +319,14 @@ message ResponseProcessProposal {
|
||||
}
|
||||
}
|
||||
|
||||
message ResponseExtendVote {
|
||||
bytes vote_extension = 1;
|
||||
}
|
||||
|
||||
message ResponseVerifyVoteExtension {
|
||||
bool accept = 1;
|
||||
}
|
||||
|
||||
message ResponseFinalizeBlock {
|
||||
// set of block events emmitted as part of executing the block
|
||||
repeated Event events = 1
|
||||
@@ -408,29 +405,35 @@ message TxResult {
|
||||
//----------------------------------------
|
||||
// Blockchain Types
|
||||
|
||||
// Validator
|
||||
message Validator {
|
||||
bytes address = 1; // The first 20 bytes of SHA256(public key)
|
||||
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
|
||||
int64 power = 3; // The voting power
|
||||
}
|
||||
|
||||
// ValidatorUpdate
|
||||
message ValidatorUpdate {
|
||||
tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
|
||||
int64 power = 2;
|
||||
}
|
||||
|
||||
// VoteInfo
|
||||
message VoteInfo {
|
||||
Validator validator = 1 [(gogoproto.nullable) = false];
|
||||
bool signed_last_block = 2;
|
||||
}
|
||||
|
||||
// TODO: move this to core Tendermint data structures
|
||||
message CanonicalVoteExtension {
|
||||
bytes extension = 1;
|
||||
int64 height = 2;
|
||||
int32 round = 3;
|
||||
string chain_id = 4;
|
||||
bytes address = 5;
|
||||
}
|
||||
|
||||
message ExtendedVoteInfo {
|
||||
Validator validator = 1 [(gogoproto.nullable) = false];
|
||||
bool signed_last_block = 2;
|
||||
bytes vote_extension = 3; // Reserved for future use
|
||||
bytes vote_extension = 3;
|
||||
}
|
||||
|
||||
enum MisbehaviorType {
|
||||
|
||||
Reference in New Issue
Block a user