Skip to content

Commit b308ed2

Browse files
committed
Add CometBFT protobufs
1 parent f2e3426 commit b308ed2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+38026
-0
lines changed

proto/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.h
2+
*.cc

proto/BDK_README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
This is a deep copy of the latest proto files from the CometBFT repository.
2+
3+
If they change in the original repository, then we need to update our copy here.
4+
5+
The proto files here should always be updated to the latest available set
6+
offered by the CometBFT project, and we should always be using the latest
7+
CometBFT version.
8+
9+
CometBFT maintains multiple versions of the proto files; we should always be
10+
using only the latest set. We should not have a copy of any older version here.
11+
12+
If there are file names/directories added or removed to the proto file set,
13+
the CMake scripts will need to be updated.
14+

proto/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[NB]: # (
2+
Ensure that all hyperlinks in this doc are absolute URLs, not relative ones,
3+
as this doc gets published to the Buf registry and relative URLs will fail
4+
to resolve.
5+
)
6+
7+
# CometBFT Protocol Buffers Definitions
8+
9+
This is the set of [Protobuf][protobuf] definitions of types used by various
10+
parts of [CometBFT]:
11+
12+
- The [Application Blockchain Interface][abci] (ABCI), especially in the context
13+
of _remote_ applications.
14+
- The P2P layer, in how CometBFT nodes interact with each other over the
15+
network.
16+
- In interaction with remote signers ("privval").
17+
- The RPC, in that the native JSON serialization of certain Protobuf types is
18+
used when accepting and responding to RPC requests.
19+
- The storage layer, in how data is serialized to and deserialized from on-disk
20+
storage.
21+
22+
The canonical Protobuf definitions live in the `proto` folder of the relevant
23+
release branch of CometBFT. These definitions are published to the [Buf
24+
registry][buf] for integrators' convenience. For detailed instructions on how to publish
25+
the files to the Buf registry, please refer to the [RELEASES.md](../RELEASES.md) document.
26+
27+
The Protobuf files are organized under two domains: `cometbft` and `tendermint`.
28+
The `cometbft.*` packages use version suffixes to let application developers
29+
target versions of the protocols as they have evolved between CometBFT releases.
30+
31+
## Which CometBFT release does each package belong to?
32+
33+
By the 1.0.0 release, the entire set of Protobuf definitions used by CometBFT
34+
is published in packages suffixed with `.v1`. Earlier revisions of the
35+
definitions, where they differed, are provided alongside in `.v1beta`_N_
36+
packages. The correspondence between package suffixes and releases is as follows:
37+
38+
| Domain | 0.34 | 0.37 | 0.38 | 1.0 |
39+
|-----------------|-----------|-----------|-----------|------|
40+
| `abci` | `v1beta1` | `v1beta2` | `v1beta3` | `v1` |
41+
| `blocksync` | | `v1beta1` | `v1` | `v1` |
42+
| `consensus` | `v1beta1` | `v1beta1` | `v1beta1` | `v1` |
43+
| `crypto` | `v1` | `v1` | `v1` | `v1` |
44+
| `libs/bits` | `v1` | `v1` | `v1` | `v1` |
45+
| `mempool` | `v1` | `v1` | `v1` | `v1` |
46+
| `p2p` | `v1` | `v1` | `v1` | `v1` |
47+
| `privval` | `v1beta1` | `v1beta1` | `v1beta2` | `v1` |
48+
| `rpc/grpc`[^1] | `v1beta1` | `v1beta2` | `v1beta3` | |
49+
| `state` | `v1beta1` | `v1beta2` | `v1beta3` | `v1` |
50+
| `statesync` | `v1` | `v1` | `v1` | `v1` |
51+
| `types` | `v1beta1` | `v1beta2` | `v1` | `v1` |
52+
| `version` | `v1` | `v1` | `v1` | `v1` |
53+
54+
[^1]: Retired in 1.0
55+
56+
## Why does CometBFT provide `tendermint` Protobuf definitions?
57+
58+
This is as a result of CometBFT being a fork of [Tendermint Core][tmcore] and
59+
wanting to provide integrators with as painless a way as possible of
60+
transitioning from Tendermint Core to CometBFT.
61+
62+
As of CometBFT v1, however, the project will transition to using and providing a
63+
`cometbft` package of Protobuf definitions (see [\#1330]).
64+
65+
Protobuf definitions for each respective release are also, for convenience,
66+
published to a corresponding branch in the `tendermint/tendermint` Buf repository.
67+
68+
| CometBFT version | Canonical Protobufs | Buf registry |
69+
|------------------|---------------------------------------------|-------------------------------------------|
70+
| v0.38.x | [v0.38.x Protobuf definitions][v038-protos] | [Buf repository v0.38.x branch][v038-buf] |
71+
| v0.37.x | [v0.37.x Protobuf definitions][v037-protos] | [Buf repository v0.37.x branch][v037-buf] |
72+
| v0.34.x | [v0.34.x Protobuf definitions][v034-protos] | [Buf repository v0.34.x branch][v034-buf] |
73+
74+
[protobuf]: https://protobuf.dev/
75+
[CometBFT]: https://github.com/cometbft/cometbft
76+
[abci]: https://github.com/cometbft/cometbft/tree/main/spec/abci
77+
[buf]: https://buf.build/tendermint/tendermint
78+
[tmcore]: https://github.com/tendermint/tendermint
79+
[\#1330]: https://github.com/cometbft/cometbft/issues/1330
80+
[v034-protos]: https://github.com/cometbft/cometbft/tree/v0.34.x/proto
81+
[v034-buf]: https://buf.build/tendermint/tendermint/docs/v0.34.x
82+
[v037-protos]: https://github.com/cometbft/cometbft/tree/v0.37.x/proto
83+
[v037-buf]: https://buf.build/tendermint/tendermint/docs/v0.37.x
84+
[v038-protos]: https://github.com/cometbft/cometbft/tree/v0.38.x/proto
85+
[v038-buf]: https://buf.build/tendermint/tendermint/docs/v0.38.x

proto/buf.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated by buf. DO NOT EDIT.
2+
version: v1
3+
deps:
4+
- remote: buf.build
5+
owner: cosmos
6+
repository: gogo-proto
7+
commit: 88ef6483f90f478fb938c37dde52ece3
8+
digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba

proto/buf.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: v1
2+
name: buf.build/cometbft/cometbft
3+
deps:
4+
- buf.build/cosmos/gogo-proto
5+
breaking:
6+
use:
7+
- FILE
8+
build:
9+
excludes:
10+
- tendermint
11+
lint:
12+
use:
13+
- DEFAULT
14+
- COMMENTS
15+
- FILE_LOWER_SNAKE_CASE
16+
except:
17+
- COMMENT_FIELD
18+
ignore_only:
19+
ENUM_VALUE_PREFIX:
20+
- cometbft/abci/v1beta1
21+
- cometbft/abci/v1beta2
22+
- cometbft/abci/v1beta3
23+
ENUM_ZERO_VALUE_SUFFIX:
24+
- cometbft/abci/v1beta1
25+
- cometbft/abci/v1beta2
26+
- cometbft/abci/v1beta3
27+
PACKAGE_VERSION_SUFFIX:
28+
- cometbft/abci/v1beta1
29+
- cometbft/abci/v1beta2
30+
- cometbft/abci/v1beta3
31+
RPC_REQUEST_RESPONSE_UNIQUE:
32+
- cometbft/abci/v1beta1
33+
- cometbft/abci/v1beta2
34+
- cometbft/abci/v1beta3
35+
- cometbft/rpc/grpc
36+
RPC_REQUEST_STANDARD_NAME:
37+
- cometbft/abci/v1beta1
38+
- cometbft/abci/v1beta2
39+
- cometbft/abci/v1beta3
40+
- cometbft/rpc/grpc
41+
RPC_RESPONSE_STANDARD_NAME:
42+
- cometbft/abci/v1beta1
43+
- cometbft/abci/v1beta2
44+
- cometbft/abci/v1beta3
45+
- cometbft/rpc/grpc
46+
SERVICE_SUFFIX:
47+
- cometbft/abci/v1beta1
48+
- cometbft/abci/v1beta2
49+
- cometbft/abci/v1beta3
50+
- cometbft/rpc/grpc
51+
enum_zero_value_suffix: _UNKNOWN

0 commit comments

Comments
 (0)