Skip to content
Open
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
11 changes: 2 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ jobs:
- uses: actions/checkout@v5
- name: Install Buf
uses: bufbuild/buf-setup-action@v1.47.2
- name: Format Proto
run: make proto-fmt
- name: Lint Proto
run: make proto-lint
- name: clang-format Check
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: 17
check: true
diff: true
extensions: .proto
path: proto
style: file
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ proto-gen:

proto-fmt:
@echo "Formatting Protobuf files"
@find ./ -name "*.proto" -exec clang-format -i {} \;
@buf format -w ./proto

proto-lint:
@echo "Linting Protobuf files"
Expand Down
11 changes: 4 additions & 7 deletions proto/sedachain/app/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
syntax = "proto3";
package sedachain.app.v1;

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

option go_package = "github.com/sedaprotocol/seda-chain/app";

// Query defines the gRPC querier service.
service Query {
// SEDASignerStatus returns the status of the node's SEDA signer.
rpc SEDASignerStatus(QuerySEDASignerStatusRequest)
returns (QuerySEDASignerStatusResponse) {
rpc SEDASignerStatus(QuerySEDASignerStatusRequest) returns (QuerySEDASignerStatusResponse) {
option (google.api.http).get = "/seda-chain/pubkey/seda_signer";
}
}
Expand All @@ -23,8 +22,7 @@ message QuerySEDASignerStatusRequest {}
// RPC method.
message QuerySEDASignerStatusResponse {
// ValidatorAddress is the address of the validator loaded in the signer.
string validator_address = 1
[ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ];
string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"];
// SignerKeys is the list of keys loaded in the SEDA signer.
repeated SignerKey signer_keys = 2;
}
Expand All @@ -39,8 +37,7 @@ message SignerKey {
bool is_proving_scheme_active = 3;
// PublicKey is the hex-encoded public key of the key loaded in
// the SEDA signer.
string public_key = 4
[ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ];
string public_key = 4 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
// IsSynced indicates whether the keys loaded in the SEDA signer match
// the keys registered in the pubkey module.
bool is_synced = 5;
Expand Down
34 changes: 16 additions & 18 deletions proto/sedachain/batching/v1/batching.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,59 +31,57 @@ message Batch {

// DataResultTreeEntries is a list of data result tree entries for a
// given batch.
message DataResultTreeEntries { repeated bytes entries = 1; }
message DataResultTreeEntries {
repeated bytes entries = 1;
}

// ValidatorTreeEntry is an entry in the validator tree.
message ValidatorTreeEntry {
bytes validator_address = 1
[ (gogoproto.casttype) =
"github.com/cosmos/cosmos-sdk/types.ValAddress" ];
bytes validator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
uint32 voting_power_percent = 2;
bytes eth_address = 3;
}

// BatchSignatures contains basic validator data and its batch signatures
// under various cryptographic schemes.
message BatchSignatures {
bytes validator_address = 1
[ (gogoproto.casttype) =
"github.com/cosmos/cosmos-sdk/types.ValAddress" ];
bytes validator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
bytes secp256k1_signature = 2;
}

// DataResult represents the result of a resolved data request.
message DataResult {
// id is the Keccack-256 hash of the data result.
string id = 1 [ (gogoproto.jsontag) = "id" ];
string id = 1 [(gogoproto.jsontag) = "id"];
// dr_id is the data request identifier.
string dr_id = 2 [ (gogoproto.jsontag) = "dr_id" ];
string dr_id = 2 [(gogoproto.jsontag) = "dr_id"];
// dr_block_height is the height at which the data request was submitted.
uint64 dr_block_height = 3 [ (gogoproto.jsontag) = "dr_block_height" ];
uint64 dr_block_height = 3 [(gogoproto.jsontag) = "dr_block_height"];
// version is a semantic version string.
string version = 4 [ (gogoproto.jsontag) = "version" ];
string version = 4 [(gogoproto.jsontag) = "version"];
// block_height is the height at which the data request was tallied.
uint64 block_height = 5 [ (gogoproto.jsontag) = "block_height" ];
uint64 block_height = 5 [(gogoproto.jsontag) = "block_height"];
// block_timestamp is the unix timestamp in seconds of when the data request
// was tallied.
uint64 block_timestamp = 6 [ (gogoproto.jsontag) = "block_timestamp" ];
uint64 block_timestamp = 6 [(gogoproto.jsontag) = "block_timestamp"];
// exit_code is the exit code of the tally wasm binary execution.
uint32 exit_code = 7 [ (gogoproto.jsontag) = "exit_code" ];
uint32 exit_code = 7 [(gogoproto.jsontag) = "exit_code"];
// gas_used is the gas used by the data request execution.
string gas_used = 8 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.jsontag) = "gas_used"
];
// result is the result of the tally wasm binary execution.
bytes result = 9 [ (gogoproto.jsontag) = "result" ];
bytes result = 9 [(gogoproto.jsontag) = "result"];
// payback_address is the payback address set by the relayer.
string payback_address = 10 [ (gogoproto.jsontag) = "payback_address" ];
string payback_address = 10 [(gogoproto.jsontag) = "payback_address"];
// seda_payload is the payload set by SEDA Protocol (e.g. OEV-enabled
// data requests)
string seda_payload = 11 [ (gogoproto.jsontag) = "seda_payload" ];
string seda_payload = 11 [(gogoproto.jsontag) = "seda_payload"];
// consensus indicates whether consensus was reached in the tally
// process.
bool consensus = 12 [ (gogoproto.jsontag) = "consensus" ];
bool consensus = 12 [(gogoproto.jsontag) = "consensus"];
}

// Params defines the parameters for the batching module.
Expand Down
3 changes: 1 addition & 2 deletions proto/sedachain/batching/v1/evidence.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ message BatchDoubleSign {

// operator_address is the operator address of the validator committing the
// double signing.
string operator_address = 3
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string operator_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// validator_root is the hex-encoded root of the validator merkle tree.
string validator_root = 4;
Expand Down
22 changes: 9 additions & 13 deletions proto/sedachain/batching/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ message GenesisState {
// current_batch_number is the batch number of the most recently-
// created batch.
uint64 current_batch_number = 1;
repeated Batch batches = 2 [ (gogoproto.nullable) = false ];
repeated BatchData batch_data = 3 [ (gogoproto.nullable) = false ];
repeated GenesisDataResult data_results = 4 [ (gogoproto.nullable) = false ];
repeated BatchAssignment batch_assignments = 5
[ (gogoproto.nullable) = false ];
Params params = 6 [ (gogoproto.nullable) = false ];
repeated Batch batches = 2 [(gogoproto.nullable) = false];
repeated BatchData batch_data = 3 [(gogoproto.nullable) = false];
repeated GenesisDataResult data_results = 4 [(gogoproto.nullable) = false];
repeated BatchAssignment batch_assignments = 5 [(gogoproto.nullable) = false];
Params params = 6 [(gogoproto.nullable) = false];
uint64 first_batch_number = 7;
}

Expand All @@ -31,16 +30,13 @@ message BatchAssignment {
// BatchData represents a given batch's full data.
message BatchData {
uint64 batch_number = 1;
DataResultTreeEntries data_result_entries = 2
[ (gogoproto.nullable) = false ];
repeated ValidatorTreeEntry validator_entries = 3
[ (gogoproto.nullable) = false ];
repeated BatchSignatures batch_signatures = 4
[ (gogoproto.nullable) = false ];
DataResultTreeEntries data_result_entries = 2 [(gogoproto.nullable) = false];
repeated ValidatorTreeEntry validator_entries = 3 [(gogoproto.nullable) = false];
repeated BatchSignatures batch_signatures = 4 [(gogoproto.nullable) = false];
}

// GenesisDataResult includes a data result and its batching status.
message GenesisDataResult {
bool batched = 1;
DataResult data_result = 2 [ (gogoproto.nullable) = false ];
DataResult data_result = 2 [(gogoproto.nullable) = false];
}
34 changes: 15 additions & 19 deletions proto/sedachain/batching/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package sedachain.batching.v1;

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "sedachain/batching/v1/batching.proto";
import "sedachain/batching/v1/genesis.proto";

Expand All @@ -17,10 +17,8 @@ service Query {
}

// BatchForHeight returns a batch created at a given block height.
rpc BatchForHeight(QueryBatchForHeightRequest)
returns (QueryBatchForHeightResponse) {
option (google.api.http).get =
"/seda-chain/batching/batch_for_height/{block_height}";
rpc BatchForHeight(QueryBatchForHeightRequest) returns (QueryBatchForHeightResponse) {
option (google.api.http).get = "/seda-chain/batching/batch_for_height/{block_height}";
}

// Batch returns all batches in the store.
Expand All @@ -31,8 +29,7 @@ service Query {
// DataResult returns a data result given its associated data request's
// ID.
rpc DataResult(QueryDataResultRequest) returns (QueryDataResultResponse) {
option (google.api.http).get =
"/seda-chain/batching/data_result/{data_request_id}";
option (google.api.http).get = "/seda-chain/batching/data_result/{data_request_id}";
}

// Params returns the total set of batching parameters.
Expand All @@ -52,21 +49,20 @@ message QueryBatchRequest {

// The response message for QueryBatch RPC.
message QueryBatchResponse {
Batch batch = 1 [ (gogoproto.nullable) = false ];
DataResultTreeEntries data_result_entries = 2
[ (gogoproto.nullable) = false ];
repeated ValidatorTreeEntry validator_entries = 3
[ (gogoproto.nullable) = false ];
repeated BatchSignatures batch_signatures = 4
[ (gogoproto.nullable) = false ];
Batch batch = 1 [(gogoproto.nullable) = false];
DataResultTreeEntries data_result_entries = 2 [(gogoproto.nullable) = false];
repeated ValidatorTreeEntry validator_entries = 3 [(gogoproto.nullable) = false];
repeated BatchSignatures batch_signatures = 4 [(gogoproto.nullable) = false];
}

// The request message for BatchForHeight RPC.
message QueryBatchForHeightRequest { int64 block_height = 1; }
message QueryBatchForHeightRequest {
int64 block_height = 1;
}

// The response message for BatchForHeight RPC.
message QueryBatchForHeightResponse {
Batch batch = 1 [ (gogoproto.nullable) = false ];
Batch batch = 1 [(gogoproto.nullable) = false];
}

// The request message for QueryBatches RPC.
Expand All @@ -80,7 +76,7 @@ message QueryBatchesRequest {

// The response message for QueryBatches RPC.
message QueryBatchesResponse {
repeated Batch batches = 1 [ (gogoproto.nullable) = false ];
repeated Batch batches = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

Expand All @@ -92,7 +88,7 @@ message QueryDataResultRequest {

// The response message for QueryDataResult RPC.
message QueryDataResultResponse {
DataResult data_result = 1 [ (gogoproto.nullable) = true ];
DataResult data_result = 1 [(gogoproto.nullable) = true];
BatchAssignment batch_assignment = 2;
}

Expand All @@ -102,5 +98,5 @@ message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];
Params params = 1 [(gogoproto.nullable) = false];
}
6 changes: 3 additions & 3 deletions proto/sedachain/data_proxy/v1/data_proxy.proto
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package sedachain.data_proxy.v1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types";

Expand All @@ -27,7 +27,7 @@ message Params {
message ProxyConfig {
// payout_address defines the address to which the data proxy fees should be
// transferred.
string payout_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string payout_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// fee defines the amount in aseda this data-proxy charges when utilised.
cosmos.base.v1beta1.Coin fee = 2;
Expand Down
10 changes: 4 additions & 6 deletions proto/sedachain/data_proxy/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types";

// GenesisState defines data_proxy module's genesis state.
message GenesisState {
Params params = 1 [ (gogoproto.nullable) = false ];
Params params = 1 [(gogoproto.nullable) = false];

repeated DataProxyConfig data_proxy_configs = 2
[ (gogoproto.nullable) = false ];
repeated DataProxyConfig data_proxy_configs = 2 [(gogoproto.nullable) = false];

repeated FeeUpdateQueueRecord fee_update_queue = 3
[ (gogoproto.nullable) = false ];
repeated FeeUpdateQueueRecord fee_update_queue = 3 [(gogoproto.nullable) = false];
}

// DataProxyConfigs define the data proxy entries in the registry.
Expand All @@ -29,4 +27,4 @@ message FeeUpdateQueueRecord {
bytes data_proxy_pubkey = 1;

int64 update_height = 2;
}
}
14 changes: 7 additions & 7 deletions proto/sedachain/data_proxy/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";
package sedachain.data_proxy.v1;

import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "sedachain/data_proxy/v1/data_proxy.proto";

option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types";
Expand All @@ -11,10 +11,8 @@ option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types";
service Query {
// DataProxyConfig returns a data proxy config when given its public key as a
// hex encoded string.
rpc DataProxyConfig(QueryDataProxyConfigRequest)
returns (QueryDataProxyConfigResponse) {
option (google.api.http).get =
"/seda-chain/data-proxy/data_proxy_config/{pub_key}";
rpc DataProxyConfig(QueryDataProxyConfigRequest) returns (QueryDataProxyConfigResponse) {
option (google.api.http).get = "/seda-chain/data-proxy/data_proxy_config/{pub_key}";
}

// Params returns the total set of data proxy parameters.
Expand All @@ -30,13 +28,15 @@ message QueryDataProxyConfigRequest {
}

// The response message for QueryDataProxyConfig RPC method.
message QueryDataProxyConfigResponse { ProxyConfig config = 1; }
message QueryDataProxyConfigResponse {
ProxyConfig config = 1;
}

// QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];
Params params = 1 [(gogoproto.nullable) = false];
}
Loading
Loading