Skip to content

Commit de6e4f3

Browse files
committed
ABCI++
1 parent 3f270a9 commit de6e4f3

File tree

10 files changed

+160
-157
lines changed

10 files changed

+160
-157
lines changed

p2p/src/secret_connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ impl Handshake<AwaitingAuthSig> {
165165
ed25519::PublicKey::from_bytes(bytes).ok()
166166
}
167167
proto::crypto::public_key::Sum::Secp256k1(_) => None,
168+
proto::crypto::public_key::Sum::Sr25519(_) => None,
168169
})
169170
.ok_or(Error::CryptoError)?;
170171

proto/src/prost/tendermint.abci.rs

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ pub struct RequestQuery {
100100
#[derive(Clone, PartialEq, ::prost::Message)]
101101
pub struct RequestFinalizeBlock {
102102
}
103-
104103
#[derive(Clone, PartialEq, ::prost::Message)]
105104
pub struct RequestCheckTx {
106105
#[prost(bytes="bytes", tag="1")]
107106
pub tx: ::prost::bytes::Bytes,
108107
#[prost(enumeration="CheckTxType", tag="2")]
109108
pub r#type: i32,
110109
}
111-
112110
#[derive(Clone, PartialEq, ::prost::Message)]
113111
pub struct RequestCommit {
114112
}
@@ -146,55 +144,41 @@ pub struct RequestApplySnapshotChunk {
146144
#[prost(string, tag="3")]
147145
pub sender: ::prost::alloc::string::String,
148146
}
149-
150147
/// Prepare proposal
151148
#[derive(Clone, PartialEq, ::prost::Message)]
152149
pub struct RequestPrepareProposal {
153-
//FIXME(Ash): add block field, unbatched header field
154150
}
155-
156151
/// Verify header
157152
#[derive(Clone, PartialEq, ::prost::Message)]
158153
pub struct RequestVerifyHeader {
159-
//FIXME(Ash): add header field
160-
161154
#[prost(bool, tag="1")]
162155
pub is_validator: bool,
163156
}
164-
165157
/// Process proposal
166158
#[derive(Clone, PartialEq, ::prost::Message)]
167159
pub struct RequestProcessProposal {
168-
//FIXME(Ash): add block field
169160
}
170-
171-
/// Revert proposal
172161
#[derive(Clone, PartialEq, ::prost::Message)]
173162
pub struct RequestRevertProposal {
174163
#[prost(uint64, tag="1")]
175164
pub height: u64,
176165
#[prost(uint64, tag="2")]
177166
pub round: u64,
178167
}
179-
180-
/// Extend vote
181168
#[derive(Clone, PartialEq, ::prost::Message)]
182169
pub struct RequestExtendVote {
183170
#[prost(uint64, tag="1")]
184171
pub height: u64,
185172
#[prost(uint64, tag="2")]
186173
pub round: u64,
187174
}
188-
189-
/// Verify vote extension
190175
#[derive(Clone, PartialEq, ::prost::Message)]
191176
pub struct RequestVerifyVoteExtension {
192-
#[prost(bytes, tag="1")]
193-
pub signed_app_vote_data: Vec<u8>,
194-
#[prost(bytes, tag="2")]
195-
pub self_authenticating_app_vote_data: Vec<u8>,
177+
#[prost(bytes="bytes", tag="1")]
178+
pub signed_app_vote_data: ::prost::bytes::Bytes,
179+
#[prost(bytes="bytes", tag="2")]
180+
pub self_authenticating_app_vote_data: ::prost::bytes::Bytes,
196181
}
197-
198182
//----------------------------------------
199183
// Response types
200184

@@ -314,6 +298,13 @@ pub struct ResponseQuery {
314298
pub codespace: ::prost::alloc::string::String,
315299
}
316300
#[derive(Clone, PartialEq, ::prost::Message)]
301+
pub struct ResponseFinalizeBlock {
302+
#[prost(message, optional, tag="1")]
303+
pub updates: ::core::option::Option<ConsensusUpdates>,
304+
#[prost(message, repeated, tag="2")]
305+
pub tx_results: ::prost::alloc::vec::Vec<ResponseTx>,
306+
}
307+
#[derive(Clone, PartialEq, ::prost::Message)]
317308
pub struct ResponseCheckTx {
318309
#[prost(uint32, tag="1")]
319310
pub code: u32,
@@ -335,14 +326,6 @@ pub struct ResponseCheckTx {
335326
pub codespace: ::prost::alloc::string::String,
336327
}
337328
#[derive(Clone, PartialEq, ::prost::Message)]
338-
pub struct ResponseFinalizeBlock {
339-
//FIXME(ash): this should not be optional
340-
#[prost(message, optional, tag="1")]
341-
pub updates: ::std::option::Option<ConsensusUpdates>,
342-
#[prost(message, repeated, tag="2")]
343-
pub tx_results: ::std::vec::Vec<ResponseTx>,
344-
}
345-
#[derive(Clone, PartialEq, ::prost::Message)]
346329
pub struct ResponseTx {
347330
#[prost(uint32, tag="1")]
348331
pub code: u32,
@@ -447,30 +430,29 @@ pub mod response_apply_snapshot_chunk {
447430
}
448431
#[derive(Clone, PartialEq, ::prost::Message)]
449432
pub struct ResponsePrepareProposal {
450-
//FIXME(Ash): add BlockData field, header field
451433
}
452434
#[derive(Clone, PartialEq, ::prost::Message)]
453435
pub struct ResponseVerifyHeader {
454436
#[prost(bool, tag="1")]
455437
pub accept_header: bool,
456438
#[prost(message, repeated, tag="2")]
457-
pub evidence: ::std::vec::Vec<Evidence>,
439+
pub evidence: ::prost::alloc::vec::Vec<Evidence>,
458440
}
459441
#[derive(Clone, PartialEq, ::prost::Message)]
460442
pub struct ResponseProcessProposal {
461443
#[prost(bool, tag="1")]
462444
pub accept_block: bool,
463445
#[prost(message, repeated, tag="2")]
464-
pub evidence: ::std::vec::Vec<Evidence>,
446+
pub evidence: ::prost::alloc::vec::Vec<Evidence>,
465447
}
466448
#[derive(Clone, PartialEq, ::prost::Message)]
467449
pub struct ResponseRevertProposal {
468450
}
469451
#[derive(Clone, PartialEq, ::prost::Message)]
470452
pub struct ResponseExtendVote {
471-
#[prost(bytes, tag="1")]
453+
#[prost(bytes="bytes", tag="1")]
472454
pub unsigned_app_vote_data: ::prost::bytes::Bytes,
473-
#[prost(bytes, tag="2")]
455+
#[prost(bytes="bytes", tag="2")]
474456
pub self_authenticating_app_data: ::prost::bytes::Bytes,
475457
}
476458
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -489,7 +471,7 @@ pub struct LastCommitInfo {
489471
pub votes: ::prost::alloc::vec::Vec<VoteInfo>,
490472
}
491473
/// Event allows application developers to attach additional information to
492-
/// ResponseFinalizeBlock and ResponseCheckTx.
474+
/// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
493475
/// Later, transactions may be queried using these events.
494476
#[derive(Clone, PartialEq, ::prost::Message)]
495477
pub struct Event {
@@ -501,10 +483,10 @@ pub struct Event {
501483
/// EventAttribute is a single key-value pair, associated with an event.
502484
#[derive(Clone, PartialEq, ::prost::Message)]
503485
pub struct EventAttribute {
504-
#[prost(bytes="bytes", tag="1")]
505-
pub key: ::prost::bytes::Bytes,
506-
#[prost(bytes="bytes", tag="2")]
507-
pub value: ::prost::bytes::Bytes,
486+
#[prost(string, tag="1")]
487+
pub key: ::prost::alloc::string::String,
488+
#[prost(string, tag="2")]
489+
pub value: ::prost::alloc::string::String,
508490
/// nondeterministic
509491
#[prost(bool, tag="3")]
510492
pub index: bool,

proto/src/prost/tendermint.crypto.rs

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/// PublicKey defines the keys available for use with Tendermint Validators
2+
#[derive(::serde::Deserialize, ::serde::Serialize)]
3+
#[derive(Clone, PartialEq, ::prost::Message)]
4+
pub struct PublicKey {
5+
#[prost(oneof="public_key::Sum", tags="1, 2, 3")]
6+
pub sum: ::core::option::Option<public_key::Sum>,
7+
}
8+
/// Nested message and enum types in `PublicKey`.
9+
pub mod public_key {
10+
#[derive(::serde::Deserialize, ::serde::Serialize)]
11+
#[serde(tag = "type", content = "value")]
12+
#[derive(Clone, PartialEq, ::prost::Oneof)]
13+
pub enum Sum {
14+
#[prost(bytes, tag="1")]
15+
#[serde(rename = "tendermint/PubKeyEd25519", with = "crate::serializers::bytes::base64string")]
16+
Ed25519(::prost::alloc::vec::Vec<u8>),
17+
#[prost(bytes, tag="2")]
18+
#[serde(rename = "tendermint/PubKeySecp256k1", with = "crate::serializers::bytes::base64string")]
19+
Secp256k1(::prost::alloc::vec::Vec<u8>),
20+
#[prost(bytes, tag="3")]
21+
Sr25519(::prost::alloc::vec::Vec<u8>),
22+
}
23+
}
124
#[derive(::serde::Deserialize, ::serde::Serialize)]
225
#[derive(Clone, PartialEq, ::prost::Message)]
326
pub struct Proof {
@@ -50,24 +73,3 @@ pub struct ProofOps {
5073
#[prost(message, repeated, tag="1")]
5174
pub ops: ::prost::alloc::vec::Vec<ProofOp>,
5275
}
53-
/// PublicKey defines the keys available for use with Tendermint Validators
54-
#[derive(::serde::Deserialize, ::serde::Serialize)]
55-
#[derive(Clone, PartialEq, ::prost::Message)]
56-
pub struct PublicKey {
57-
#[prost(oneof="public_key::Sum", tags="1, 2")]
58-
pub sum: ::core::option::Option<public_key::Sum>,
59-
}
60-
/// Nested message and enum types in `PublicKey`.
61-
pub mod public_key {
62-
#[derive(::serde::Deserialize, ::serde::Serialize)]
63-
#[serde(tag = "type", content = "value")]
64-
#[derive(Clone, PartialEq, ::prost::Oneof)]
65-
pub enum Sum {
66-
#[prost(bytes, tag="1")]
67-
#[serde(rename = "tendermint/PubKeyEd25519", with = "crate::serializers::bytes::base64string")]
68-
Ed25519(::prost::alloc::vec::Vec<u8>),
69-
#[prost(bytes, tag="2")]
70-
#[serde(rename = "tendermint/PubKeySecp256k1", with = "crate::serializers::bytes::base64string")]
71-
Secp256k1(::prost::alloc::vec::Vec<u8>),
72-
}
73-
}

proto/src/prost/tendermint.p2p.rs

Lines changed: 57 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
11
#[derive(Clone, PartialEq, ::prost::Message)]
2+
pub struct PacketPing {
3+
}
4+
#[derive(Clone, PartialEq, ::prost::Message)]
5+
pub struct PacketPong {
6+
}
7+
#[derive(Clone, PartialEq, ::prost::Message)]
8+
pub struct PacketMsg {
9+
#[prost(int32, tag="1")]
10+
pub channel_id: i32,
11+
#[prost(bool, tag="2")]
12+
pub eof: bool,
13+
#[prost(bytes="vec", tag="3")]
14+
pub data: ::prost::alloc::vec::Vec<u8>,
15+
}
16+
#[derive(Clone, PartialEq, ::prost::Message)]
17+
pub struct Packet {
18+
#[prost(oneof="packet::Sum", tags="1, 2, 3")]
19+
pub sum: ::core::option::Option<packet::Sum>,
20+
}
21+
/// Nested message and enum types in `Packet`.
22+
pub mod packet {
23+
#[derive(Clone, PartialEq, ::prost::Oneof)]
24+
pub enum Sum {
25+
#[prost(message, tag="1")]
26+
PacketPing(super::PacketPing),
27+
#[prost(message, tag="2")]
28+
PacketPong(super::PacketPong),
29+
#[prost(message, tag="3")]
30+
PacketMsg(super::PacketMsg),
31+
}
32+
}
33+
#[derive(Clone, PartialEq, ::prost::Message)]
34+
pub struct AuthSigMessage {
35+
#[prost(message, optional, tag="1")]
36+
pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
37+
#[prost(bytes="vec", tag="2")]
38+
pub sig: ::prost::alloc::vec::Vec<u8>,
39+
}
40+
#[derive(Clone, PartialEq, ::prost::Message)]
241
pub struct ProtocolVersion {
342
#[prost(uint64, tag="1")]
443
pub p2p: u64,
@@ -54,45 +93,6 @@ pub struct PeerAddressInfo {
5493
pub dial_failures: u32,
5594
}
5695
#[derive(Clone, PartialEq, ::prost::Message)]
57-
pub struct PacketPing {
58-
}
59-
#[derive(Clone, PartialEq, ::prost::Message)]
60-
pub struct PacketPong {
61-
}
62-
#[derive(Clone, PartialEq, ::prost::Message)]
63-
pub struct PacketMsg {
64-
#[prost(int32, tag="1")]
65-
pub channel_id: i32,
66-
#[prost(bool, tag="2")]
67-
pub eof: bool,
68-
#[prost(bytes="vec", tag="3")]
69-
pub data: ::prost::alloc::vec::Vec<u8>,
70-
}
71-
#[derive(Clone, PartialEq, ::prost::Message)]
72-
pub struct Packet {
73-
#[prost(oneof="packet::Sum", tags="1, 2, 3")]
74-
pub sum: ::core::option::Option<packet::Sum>,
75-
}
76-
/// Nested message and enum types in `Packet`.
77-
pub mod packet {
78-
#[derive(Clone, PartialEq, ::prost::Oneof)]
79-
pub enum Sum {
80-
#[prost(message, tag="1")]
81-
PacketPing(super::PacketPing),
82-
#[prost(message, tag="2")]
83-
PacketPong(super::PacketPong),
84-
#[prost(message, tag="3")]
85-
PacketMsg(super::PacketMsg),
86-
}
87-
}
88-
#[derive(Clone, PartialEq, ::prost::Message)]
89-
pub struct AuthSigMessage {
90-
#[prost(message, optional, tag="1")]
91-
pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
92-
#[prost(bytes="vec", tag="2")]
93-
pub sig: ::prost::alloc::vec::Vec<u8>,
94-
}
95-
#[derive(Clone, PartialEq, ::prost::Message)]
9696
pub struct PexAddress {
9797
#[prost(string, tag="1")]
9898
pub id: ::prost::alloc::string::String,
@@ -110,8 +110,21 @@ pub struct PexResponse {
110110
pub addresses: ::prost::alloc::vec::Vec<PexAddress>,
111111
}
112112
#[derive(Clone, PartialEq, ::prost::Message)]
113+
pub struct PexAddressV2 {
114+
#[prost(string, tag="1")]
115+
pub url: ::prost::alloc::string::String,
116+
}
117+
#[derive(Clone, PartialEq, ::prost::Message)]
118+
pub struct PexRequestV2 {
119+
}
120+
#[derive(Clone, PartialEq, ::prost::Message)]
121+
pub struct PexResponseV2 {
122+
#[prost(message, repeated, tag="1")]
123+
pub addresses: ::prost::alloc::vec::Vec<PexAddressV2>,
124+
}
125+
#[derive(Clone, PartialEq, ::prost::Message)]
113126
pub struct PexMessage {
114-
#[prost(oneof="pex_message::Sum", tags="1, 2")]
127+
#[prost(oneof="pex_message::Sum", tags="1, 2, 3, 4")]
115128
pub sum: ::core::option::Option<pex_message::Sum>,
116129
}
117130
/// Nested message and enum types in `PexMessage`.
@@ -122,5 +135,9 @@ pub mod pex_message {
122135
PexRequest(super::PexRequest),
123136
#[prost(message, tag="2")]
124137
PexResponse(super::PexResponse),
138+
#[prost(message, tag="3")]
139+
PexRequestV2(super::PexRequestV2),
140+
#[prost(message, tag="4")]
141+
PexResponseV2(super::PexResponseV2),
125142
}
126143
}

proto/src/prost/tendermint.state.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#[derive(Clone, PartialEq, ::prost::Message)]
55
pub struct AbciResponses {
66
#[prost(message, repeated, tag="1")]
7-
pub finalize_block: ::std::vec::Vec<super::abci::ResponseFinalizeBlock>,
7+
pub deliver_txs: ::prost::alloc::vec::Vec<super::abci::ResponseTx>,
8+
#[prost(message, optional, tag="2")]
9+
pub finalize_block: ::core::option::Option<super::abci::ResponseFinalizeBlock>,
810
}
911
/// ValidatorsInfo represents the latest validator set, or the last height it changed
1012
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -60,7 +62,7 @@ pub struct State {
6062
#[prost(int64, tag="9")]
6163
pub last_height_validators_changed: i64,
6264
/// Consensus parameters used for validating blocks.
63-
/// Changes returned by FinalizeBlock and updated after Commit.
65+
/// Changes returned by EndBlock and updated after Commit.
6466
#[prost(message, optional, tag="10")]
6567
pub consensus_params: ::core::option::Option<super::types::ConsensusParams>,
6668
#[prost(int64, tag="11")]

0 commit comments

Comments
 (0)