Skip to content

Commit

Permalink
feat(proto)!: update celestia-app and node proto definitios (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin authored Nov 13, 2024
1 parent b036b04 commit debcadf
Show file tree
Hide file tree
Showing 23 changed files with 307 additions and 38 deletions.
8 changes: 4 additions & 4 deletions proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NULL_DEFAULT: &str = r#"#[serde(with = "crate::serializers::null_default")

#[rustfmt::skip]
static CUSTOM_TYPE_ATTRIBUTES: &[(&str, &str)] = &[
(".celestia.da.DataAvailabilityHeader", SERIALIZED_DEFAULT),
(".celestia.core.v1.da.DataAvailabilityHeader", SERIALIZED_DEFAULT),
(".celestia.blob.v1.MsgPayForBlobs", SERIALIZED_DEFAULT),
(".cosmos.base.abci.v1beta1.ABCIMessageLog", SERIALIZED_DEFAULT),
(".cosmos.base.abci.v1beta1.Attribute", SERIALIZED_DEFAULT),
Expand Down Expand Up @@ -48,8 +48,8 @@ static CUSTOM_TYPE_ATTRIBUTES: &[(&str, &str)] = &[

#[rustfmt::skip]
static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[
(".celestia.da.DataAvailabilityHeader.row_roots", VEC_BASE64STRING),
(".celestia.da.DataAvailabilityHeader.column_roots", VEC_BASE64STRING),
(".celestia.core.v1.da.DataAvailabilityHeader.row_roots", VEC_BASE64STRING),
(".celestia.core.v1.da.DataAvailabilityHeader.column_roots", VEC_BASE64STRING),
(".cosmos.base.abci.v1beta1.TxResponse.tx", OPTION_ANY),
(".cosmos.base.abci.v1beta1.TxResponse.logs", NULL_DEFAULT),
(".cosmos.base.abci.v1beta1.TxResponse.events", NULL_DEFAULT),
Expand All @@ -66,7 +66,7 @@ static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[
fn main() {
let fds = protox::compile(
[
"vendor/celestia/da/data_availability_header.proto",
"vendor/celestia/core/v1/da/data_availability_header.proto",
"vendor/celestia/blob/v1/tx.proto",
"vendor/header/pb/extended_header.proto",
"vendor/share/eds/byzantine/pb/share.proto",
Expand Down
1 change: 0 additions & 1 deletion proto/vendor/celestia/blob/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package celestia.blob.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "celestia/blob/v1/params.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/blob/types";
Expand Down
5 changes: 4 additions & 1 deletion proto/vendor/celestia/blob/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ option go_package = "github.com/celestiaorg/celestia-app/x/blob/types";
service Msg {
// PayForBlobs allows the user to pay for the inclusion of one or more blobs
rpc PayForBlobs(MsgPayForBlobs) returns (MsgPayForBlobsResponse) {
option (google.api.http).get = "/blob/v1/payforblobs";
option (google.api.http) = { post: "/blob/v1/payforblobs", body: "*" };
}
}

// MsgPayForBlobs pays for the inclusion of a blob in the block.
message MsgPayForBlobs {
// signer is the bech32 encoded signer address. See
// https://en.bitcoin.it/wiki/Bech32.
string signer = 1;
// namespaces is a list of namespaces that the blobs are associated with. A
// namespace is a byte slice of length 29 where the first byte is the
// namespaceVersion and the subsequent 28 bytes are the namespaceId.
repeated bytes namespaces = 2;
// blob_sizes is a list of blob sizes (one per blob). Each size is in bytes.
repeated uint32 blob_sizes = 3;
// share_commitments is a list of share commitments (one per blob).
repeated bytes share_commitments = 4;
Expand Down
24 changes: 24 additions & 0 deletions proto/vendor/celestia/core/v1/blob/blob.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";
package celestia.core.v1.blob;

option go_package = "github.com/celestiaorg/go-square/blob";

// 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;
}

// 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;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";
package celestia.da;
package celestia.core.v1.da;

option go_package = "github.com/celestiaorg/celestia-app/proto/celestia/da";
option go_package = "github.com/celestiaorg/celestia-app/proto/celestia/core/v1/da";

// DataAvailabilityHeader contains the row and column roots of the erasure
// coded version of the data in Block.Data.
// Therefor the original Block.Data is arranged in a
// Therefore the original Block.Data is arranged in a
// k × k matrix, which is then "extended" to a
// 2k × 2k matrix applying multiple times Reed-Solomon encoding.
// For details see Section 5.2: https://arxiv.org/abs/1809.09044
Expand Down
54 changes: 54 additions & 0 deletions proto/vendor/celestia/core/v1/proof/proof.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
syntax = "proto3";
package celestia.core.v1.proof;

option go_package = "github.com/celestiaorg/celestia-app/pkg/proof";

// 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 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;
}

// Proof is taken from the merkle package
message Proof {
int64 total = 1;
int64 index = 2;
bytes leaf_hash = 3;
repeated bytes aunts = 4;
}
40 changes: 40 additions & 0 deletions proto/vendor/celestia/core/v1/tx/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";
package celestia.core.v1.tx;

import "google/api/annotations.proto";

option go_package = "github.com/celestiaorg/celestia-app/app/grpc/tx";

// Service defines a gRPC service for interacting with transactions.
service Tx {
// TxStatus returns the status of a transaction. There are four possible states:
// - Committed
// - Pending
// - Evicted
// - Unknown
rpc TxStatus(TxStatusRequest) returns (TxStatusResponse) {
option (google.api.http) = {
get: "/celestia/core/v1/tx/{tx_id}"
};
}
}

// TxStatusRequest is the request type for the TxStatus gRPC method.
message TxStatusRequest {
// this is the hex encoded transaction hash (should be 64 bytes long)
string tx_id = 1;
}

// TxStatusResponse is the response type for the TxStatus gRPC method.
message TxStatusResponse {
int64 height = 1;
uint32 index = 2;
// execution_code is returned when the transaction has been committed
// and returns whether it was successful or errored. A non zero
// execution code indicated an error.
uint32 execution_code = 3;
// error log for failed transactions.
string error = 4;
// status is the status of the transaction.
string status = 5;
}
16 changes: 16 additions & 0 deletions proto/vendor/celestia/minfee/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";
package celestia.minfee.v1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/minfee";

// GenesisState defines the minfee module's genesis state.
message GenesisState {
string network_min_gas_price = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
28 changes: 28 additions & 0 deletions proto/vendor/celestia/minfee/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";
package celestia.minfee.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/minfee";

// Query defines the gRPC querier service.
service Query {
// NetworkMinGasPrice queries the network wide minimum gas price.
rpc NetworkMinGasPrice(QueryNetworkMinGasPrice) returns (QueryNetworkMinGasPriceResponse) {
option (google.api.http).get = "/celestia/minfee/v1/min_gas_price";
}
}

// QueryNetworkMinGasPrice is the request type for the Query/NetworkMinGasPrice RPC method.
message QueryNetworkMinGasPrice {}

// QueryNetworkMinGasPriceResponse is the response type for Query/NetworkMinGasPrice RPC method.
message QueryNetworkMinGasPriceResponse {
string network_min_gas_price = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
6 changes: 3 additions & 3 deletions proto/vendor/celestia/qgb/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ package celestia.qgb.v1;
import "gogoproto/gogo.proto";
import "celestia/qgb/v1/types.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/qgb/types";
option go_package = "github.com/celestiaorg/celestia-app/x/blobstream/types";

// Params represent the Quantum Gravity Bridge genesis and store parameters.
// Params represent Blobstream genesis and store parameters.
message Params {
option (gogoproto.stringer) = false;

uint64 data_commitment_window = 1;
}

// GenesisState struct, containing all persistent data required by the QGB
// GenesisState struct, containing all persistent data required by Blobstream
// module
message GenesisState { Params params = 1; }
5 changes: 2 additions & 3 deletions proto/vendor/celestia/qgb/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ package celestia.qgb.v1;
import "celestia/qgb/v1/genesis.proto";
import "celestia/qgb/v1/types.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/qgb/types";
option go_package = "github.com/celestiaorg/celestia-app/x/blobstream/types";

// Query defines the gRPC querier service.
service Query {
// Params queries the current parameters for the qgb module
// Params queries the current parameters for the blobstream module
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/qgb/v1/params";
}
Expand Down
4 changes: 2 additions & 2 deletions proto/vendor/celestia/qgb/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "google/api/annotations.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/qgb/types";
option go_package = "github.com/celestiaorg/celestia-app/x/blobstream/types";

// Msg is the message server for receiving qgb transactions
// Msg is the message server for receiving Blobstream transactions
service Msg {
// RegisterEVMAddress records an evm address for the validator which is used
// by the relayer to aggregate signatures. A validator can only register a
Expand Down
4 changes: 2 additions & 2 deletions proto/vendor/celestia/qgb/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/qgb/types";
option go_package = "github.com/celestiaorg/celestia-app/x/blobstream/types";

// BridgeValidator represents a validator's ETH address and its power
message BridgeValidator {
Expand All @@ -15,7 +15,7 @@ message BridgeValidator {
string evm_address = 2;
}

// Valset is the EVM Bridge Multsig Set, each qgb validator also
// Valset is the EVM Bridge Multsig Set, each Blobstream validator also
// maintains an ETH key to sign messages, these are used to check signatures on
// ETH because of the significant gas savings
message Valset {
Expand Down
42 changes: 42 additions & 0 deletions proto/vendor/celestia/signal/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
syntax = "proto3";
package celestia.signal.v1;

import "google/api/annotations.proto";
import "celestia/signal/v1/upgrade.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/signal/types";

// Query defines the signal Query service.
service Query {
// VersionTally enables a client to query for the tally of voting power that
// has signalled for a particular version.
rpc VersionTally(QueryVersionTallyRequest)
returns (QueryVersionTallyResponse) {
option (google.api.http).get = "/signal/v1/tally/{version}";
}

// GetUpgrade enables a client to query for upgrade information if an upgrade is pending.
// The response will be empty if no upgrade is pending.
rpc GetUpgrade(QueryGetUpgradeRequest)
returns (QueryGetUpgradeResponse) {
option (google.api.http).get = "/signal/v1/upgrade";
}
}

// QueryVersionTallyRequest is the request type for the VersionTally query.
message QueryVersionTallyRequest { uint64 version = 1; }

// QueryVersionTallyResponse is the response type for the VersionTally query.
message QueryVersionTallyResponse {
uint64 voting_power = 1;
uint64 threshold_power = 2;
uint64 total_voting_power = 3;
}

// QueryGetUpgradeRequest is the request type for the GetUpgrade query.
message QueryGetUpgradeRequest {}

// QueryGetUpgradeResponse is the response type for the GetUpgrade query.
message QueryGetUpgradeResponse {
Upgrade upgrade = 1;
}
35 changes: 35 additions & 0 deletions proto/vendor/celestia/signal/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
syntax = "proto3";
package celestia.signal.v1;

import "google/api/annotations.proto";

option go_package = "github.com/celestiaorg/celestia-app/x/signal/types";

// Msg defines the signal Msg service.
service Msg {
// SignalVersion allows a validator to signal for a version.
rpc SignalVersion(MsgSignalVersion) returns (MsgSignalVersionResponse) {
option (google.api.http).post = "/signal/v1/signal";
}

// TryUpgrade tallies all the votes for all the versions to determine if a
// quorum has been reached for a version.
rpc TryUpgrade(MsgTryUpgrade) returns (MsgTryUpgradeResponse) {
option (google.api.http).post = "/signal/v1/upgrade";
}
}

// MsgSignalVersion signals for an upgrade.
message MsgSignalVersion {
string validator_address = 1;
uint64 version = 2;
}

// MsgSignalVersionResponse is the response type for the SignalVersion method.
message MsgSignalVersionResponse {}

// MsgTryUpgrade tries to upgrade the chain.
message MsgTryUpgrade { string signer = 1; }

// MsgTryUpgradeResponse is the response type for the TryUpgrade method.
message MsgTryUpgradeResponse {}
Loading

0 comments on commit debcadf

Please sign in to comment.