Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
463 changes: 249 additions & 214 deletions api/cometbft/abci/v2/types.pb.go

Large diffs are not rendered by default.

297 changes: 276 additions & 21 deletions api/cometbft/mempool/v2/types.pb.go

Large diffs are not rendered by default.

4,176 changes: 3,980 additions & 196 deletions api/cometbft/rpc/grpc/v1beta3/types.pb.go

Large diffs are not rendered by default.

413 changes: 348 additions & 65 deletions api/cometbft/state/v2/types.pb.go

Large diffs are not rendered by default.

5,322 changes: 3,708 additions & 1,614 deletions api/cometbft/types/v2/types.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions proto/cometbft/abci/v2/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ message ListSnapshotsRequest {}
message OfferSnapshotRequest {
Snapshot snapshot = 1; // snapshot offered by peers
bytes app_hash = 2; // light client-verified app hash for snapshot height
uint64 app_version = 3; // The application version at which the snapshot was taken
}

// Request to load a snapshot chunk.
Expand Down
6 changes: 6 additions & 0 deletions proto/cometbft/mempool/v2/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ message HaveTx {
bytes tx_key = 1;
}

// WantTx is sent by the CAT protocol to signal a peer that the sender wants a transaction.
message WantTx {
bytes tx_key = 1;
}

// ResetRoute is sent by the DOG protocol to signal a peer to reset a (random)
// route to the sender.
message ResetRoute {
Expand All @@ -26,5 +31,6 @@ message Message {
Txs txs = 1;
HaveTx have_tx = 2;
ResetRoute reset_route = 3;
WantTx want_tx = 4;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this is breaking, users using the cat mempool when upgrading will experience an issue.

}
}
139 changes: 138 additions & 1 deletion proto/cometbft/rpc/grpc/v1beta3/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ package cometbft.rpc.grpc.v1beta3;
option go_package = "github.com/cometbft/cometbft/api/cometbft/rpc/grpc/v1beta3";

import "cometbft/rpc/grpc/v1beta1/types.proto";

import "cometbft/abci/v1beta3/types.proto";

import "cometbft/types/v2/types.proto";
import "cometbft/p2p/v1/types.proto";
import "cometbft/crypto/v1/keys.proto";
import "cometbft/types/v2/validator.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";

// ResponseBroadcastTx is a response of broadcasting the transaction.
message ResponseBroadcastTx {
cometbft.abci.v1beta3.ResponseCheckTx check_tx = 1;
Expand All @@ -22,3 +28,134 @@ service BroadcastAPI {
// BroadcastTx broadcasts a transaction.
rpc BroadcastTx(v1beta1.RequestBroadcastTx) returns (v1beta3.ResponseBroadcastTx);
}

// BlockAPI is an API for querying blocks.
service BlockAPI {
// BlockByHash returns a block by its hash.
rpc BlockByHash(BlockByHashRequest) returns (stream StreamedBlockByHashResponse);
// BlockByHeight returns a block by its height.
rpc BlockByHeight(BlockByHeightRequest) returns (stream StreamedBlockByHeightResponse);
// Commit returns the commit of a block.
rpc Commit(CommitRequest) returns (CommitResponse);
// ValidatorSet returns the validator set of a block.
rpc ValidatorSet(ValidatorSetRequest) returns (ValidatorSetResponse);
// SubscribeNewHeights subscribes to new heights.
rpc SubscribeNewHeights(SubscribeNewHeightsRequest) returns (stream NewHeightEvent);
// Status returns the status of the node.
rpc Status(StatusRequest) returns (StatusResponse);
}


// BlockByHashRequest is a request to get a block by its hash.
message BlockByHashRequest {
bytes hash = 1;
bool prove = 2;
}

// BlockByHeightRequest is a request to get a block by its height.
message BlockByHeightRequest {
// Height the requested block height.
// If height is equal to 0, the latest height stored in the block store
// will be used.
int64 height = 1;
// Prove set to true to return the parts proofs.
bool prove = 2;
}

// CommitRequest is a request to get the commit of a block.
message CommitRequest {
// Height the requested block commit height.
// If height is equal to 0, the latest height stored in the block store
// will be used.
int64 height = 1;
}

// ValidatorSetRequest is a request to get the validator set of a block.
message ValidatorSetRequest {
// Height the requested validator set height.
// If height is equal to 0, the latest height stored in the block store
// will be used.
int64 height = 1;
}

// SubscribeNewHeightsRequest is a request to subscribe to new heights.
message SubscribeNewHeightsRequest {}

// StatusRequest is a request to get the status of the node.
message StatusRequest {}


// StreamedBlockByHashResponse is a response to a BlockByHashRequest.
message StreamedBlockByHashResponse {
cometbft.types.v2.Part block_part = 1;
// Commit is only set in the first part, and
// it stays nil in the remaining ones.
cometbft.types.v2.Commit commit = 2;
// ValidatorSet is only set in the first part, and
// it stays nil in the remaining ones.
cometbft.types.v2.ValidatorSet validator_set = 3;
bool is_last = 4;
}

// StreamedBlockByHeightResponse is a response to a BlockByHeightRequest.
message StreamedBlockByHeightResponse {
cometbft.types.v2.Part block_part = 1;
// Commit is only set in the first part, and
// it stays nil in the remaining ones.
cometbft.types.v2.Commit commit = 2;
// ValidatorSet is only set in the first part, and
// it stays nil in the remaining ones.
cometbft.types.v2.ValidatorSet validator_set = 3;
bool is_last = 4;
}

// CommitResponse is a response to a CommitRequest.
message CommitResponse {
cometbft.types.v2.Commit commit = 1;
}

// ValidatorSetResponse is a response to a ValidatorSetRequest.
message ValidatorSetResponse {
// ValidatorSet the requested validator set.
cometbft.types.v2.ValidatorSet validator_set = 1;
// Height the height corresponding to the returned
// validator set.
int64 height = 2;
}

// NewHeightEvent is an event that indicates a new height.
message NewHeightEvent {
int64 height = 1;
bytes hash = 2;
}

// StatusResponse is a response to a StatusRequest.
message StatusResponse {
cometbft.p2p.v1.DefaultNodeInfo node_info = 1;
SyncInfo sync_info = 2;
ValidatorInfo validator_info = 3;
}

// SyncInfo is information about the node's sync status.
message SyncInfo {
bytes latest_block_hash = 1;
bytes latest_app_hash = 2;
int64 latest_block_height = 3;
google.protobuf.Timestamp latest_block_time = 4
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];

bytes earliest_block_hash = 5;
bytes earliest_app_hash = 6;
int64 earliest_block_height = 7;
google.protobuf.Timestamp earliest_block_time = 8
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];

bool catching_up = 9;
}

// ValidatorInfo is information about a validator.
message ValidatorInfo {
bytes address = 1;
cometbft.crypto.v1.PublicKey pub_key = 2;
int64 voting_power = 3;
}
12 changes: 12 additions & 0 deletions proto/cometbft/state/v2/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,15 @@ message State {
(gogoproto.stdduration) = true
];
}

// TxInfo describes the location of a tx inside a committed block
// as well as the result of executing the transaction and the error log output.
message TxInfo {
int64 height = 1;
uint32 index = 2;
// The response code of executing the tx. 0 means
// successfully executed, all others are error codes.
uint32 code = 3;
// The error log output generated if the transaction execution fails.
string error = 4;
}
89 changes: 88 additions & 1 deletion proto/cometbft/types/v2/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,31 @@ message Data {
// NOTE: not all txs here are valid. We're just agreeing on the order first.
// This means that block.AppHash does not include these txs.
repeated bytes txs = 1;
}

reserved 2, 3, 4;
// field number 2 is reserved for intermediate state roots
// field number 3 is reserved for evidence
// field number 4 is reserved for blobs

// SquareSize is the number of rows or columns in the original data square.
uint64 square_size = 5;

// Hash is the root of a binary Merkle tree where the leaves of the tree are
// the row and column roots of an extended data square. Hash is often referred
// to as the "data root".
bytes hash = 6;
}

// Blob (named after binary large object) is a chunk of data submitted by a user
// to be published to the Celestia blockchain. The data of a Blob is published
// to a namespace and is encoded into shares based on the format specified by
// share_version.
message Blob {
bytes namespace_id = 1;
bytes data = 2;
uint32 share_version = 3;
uint32 namespace_version = 4;
}

// Vote represents a prevote or precommit vote from validators for
// consensus.
Expand Down Expand Up @@ -198,3 +222,66 @@ message TxProof {
bytes data = 2;
cometbft.crypto.v1.Proof proof = 3;
}




// IndexWrapper adds index metadata to a transaction. This is used to track
// transactions that pay for blobs, and where the blobs start in the square.
message IndexWrapper {
bytes tx = 1;
repeated uint32 share_indexes = 2;
string type_id = 3;
}

// BlobTx wraps an encoded sdk.Tx with a second field to contain blobs of data.
// The raw bytes of the blobs are not signed over, instead we verify each blob
// using the relevant MsgPayForBlobs that is signed over in the encoded sdk.Tx.
message BlobTx {
bytes tx = 1;
repeated Blob blobs = 2;
string type_id = 3;
}

// ShareProof is an NMT proof that a set of shares exist in a set of rows and a
// Merkle proof that those rows exist in a Merkle tree with a given data root.
message ShareProof {
repeated bytes data = 1;
repeated NMTProof share_proofs = 2;
bytes namespace_id = 3;
RowProof row_proof = 4;
uint32 namespace_version = 5;
}

// RowProof is a Merkle proof that a set of rows exist in a Merkle tree with a
// given data root.
message RowProof {
repeated bytes row_roots = 1;
repeated cometbft.crypto.v1.Proof proofs = 2;
bytes root = 3;
uint32 start_row = 4;
uint32 end_row = 5;
}

// NMTProof is a proof of a namespace.ID in an NMT.
// In case this proof proves the absence of a namespace.ID
// in a tree it also contains the leaf hashes of the range
// where that namespace would be.
message NMTProof {
// Start index of this proof.
int32 start = 1;
// End index of this proof.
int32 end = 2;
// Nodes that together with the corresponding leaf values can be used to
// recompute the root and verify this proof. Nodes should consist of the max
// and min namespaces along with the actual hash, resulting in each being 48
// bytes each
repeated bytes nodes = 3;
// leafHash are nil if the namespace is present in the NMT. In case the
// namespace to be proved is in the min/max range of the tree but absent, this
// will contain the leaf hash necessary to verify the proof of absence. Leaf
// hashes should consist of the namespace along with the actual hash,
// resulting 40 bytes total.
bytes leaf_hash = 4;
}

Loading