diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 000000000..2c82ff47b --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,33 @@ +name: Protobuf +# Runs buf (https://buf.build/) checks and pushes to BSR +# PR: runs lint, format, and breaking change detection +# Push to main/tags: pushes to BSR +# Delete branch/tag: archives corresponding BSR labels + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + paths: + - "proto/**" + - ".github/workflows/proto.yml" + delete: + +permissions: + contents: read + pull-requests: write + +jobs: + buf-build: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v6 + - uses: bufbuild/buf-action@v1 + with: + input: proto + token: ${{ secrets.BUF_TOKEN }} + # breaking defaults to PR-only; not set explicitly to avoid running on push events diff --git a/proto/buf.yaml b/proto/buf.yaml index 9f632374e..0405cff6b 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -13,7 +13,7 @@ breaking: - FILE lint: use: - - DEFAULT + - STANDARD - COMMENTS - FILE_LOWER_SNAKE_CASE except: @@ -24,3 +24,7 @@ lint: - RPC_REQUEST_STANDARD_NAME - ENUM_VALUE_PREFIX - ENUM_ZERO_VALUE_SUFFIX + # excluded to avoid breaking changes on existing fields and RPCs + - FIELD_LOWER_SNAKE_CASE + - RPC_REQUEST_RESPONSE_UNIQUE + - RPC_RESPONSE_STANDARD_NAME diff --git a/proto/ibc/applications/nft_transfer/v1/packet.proto b/proto/ibc/applications/nft_transfer/v1/packet.proto index 9db31fa88..f1c0731e2 100644 --- a/proto/ibc/applications/nft_transfer/v1/packet.proto +++ b/proto/ibc/applications/nft_transfer/v1/packet.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package ibc.applications.nft_transfer.v1; -import "gogoproto/gogo.proto"; - option go_package = "github.com/initia-labs/initia/x/ibc/nft-transfer/types"; // NonFungibleTokenPacketData defines a struct for the packet payload diff --git a/proto/initia/abcipp/mempool/v1/query.proto b/proto/initia/abcipp/mempool/v1/query.proto index 97210d1fd..2b3478ef8 100644 --- a/proto/initia/abcipp/mempool/v1/query.proto +++ b/proto/initia/abcipp/mempool/v1/query.proto @@ -1,26 +1,21 @@ syntax = "proto3"; package initia.abcipp.mempool.v1; -option go_package = "github.com/initia-labs/initia/abcipp/types"; - import "google/api/annotations.proto"; +option go_package = "github.com/initia-labs/initia/abcipp/types"; // Query provides defines the gRPC querier service service Query { - // QueryTxDistribution returns the distribution of transactions in the mempool. - rpc QueryTxDistribution(QueryTxDistributionRequest) returns (QueryTxDistributionResponse) { - option (google.api.http) = { - get: "/initia/abcipp/mempool/v1/distribution" - }; - } - - // QueryTxHash checks if a transaction is in the mempool. - rpc QueryTxHash(QueryTxHashRequest) returns (QueryTxHashResponse) { - option (google.api.http) = { - get: "/initia/abcipp/mempool/v1/{sender}/{sequence}" - }; - } + // QueryTxDistribution returns the distribution of transactions in the mempool. + rpc QueryTxDistribution(QueryTxDistributionRequest) returns (QueryTxDistributionResponse) { + option (google.api.http) = {get: "/initia/abcipp/mempool/v1/distribution"}; + } + + // QueryTxHash checks if a transaction is in the mempool. + rpc QueryTxHash(QueryTxHashRequest) returns (QueryTxHashResponse) { + option (google.api.http) = {get: "/initia/abcipp/mempool/v1/{sender}/{sequence}"}; + } } // QueryTxDistributionRequest is the request type for the Query.QueryTxDistribution @@ -30,19 +25,19 @@ message QueryTxDistributionRequest {} // QueryTxDistributionResponse is the response type for the Query.QueryTxDistribution // RPC method. message QueryTxDistributionResponse { - // Distribution is a map of lane to the number of transactions in the mempool for that lane. - map distribution = 1; + // Distribution is a map of lane to the number of transactions in the mempool for that lane. + map distribution = 1; } // QueryTxHashRequest is the request type for the Query.QueryTxHash // RPC method. message QueryTxHashRequest { - string sender = 1; - string sequence = 2; + string sender = 1; + string sequence = 2; } // QueryTxHashResponse is the response type for the Query.QueryTxHash // RPC method. message QueryTxHashResponse { - string txHash = 1; + string txHash = 1; } diff --git a/proto/initia/dynamicfee/v1/query.proto b/proto/initia/dynamicfee/v1/query.proto index 35833e64e..2b59dca34 100644 --- a/proto/initia/dynamicfee/v1/query.proto +++ b/proto/initia/dynamicfee/v1/query.proto @@ -1,8 +1,6 @@ syntax = "proto3"; package initia.dynamicfee.v1; -import "amino/amino.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "initia/dynamicfee/v1/types.proto"; diff --git a/proto/initia/dynamicfee/v1/types.proto b/proto/initia/dynamicfee/v1/types.proto index 40387017f..147ce32a9 100644 --- a/proto/initia/dynamicfee/v1/types.proto +++ b/proto/initia/dynamicfee/v1/types.proto @@ -9,6 +9,7 @@ option go_package = "github.com/initia-labs/initia/x/dynamic-fee/types"; option (gogoproto.equal_all) = true; option (gogoproto.goproto_getters_all) = false; +// Params defines the parameters for the dynamicfee module. message Params { string base_gas_price = 1 [ (gogoproto.moretags) = "yaml:\"base_gas_price\"", diff --git a/proto/initia/reward/v1/tx.proto b/proto/initia/reward/v1/tx.proto index a824c5a84..4fa06d371 100644 --- a/proto/initia/reward/v1/tx.proto +++ b/proto/initia/reward/v1/tx.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package initia.reward.v1; import "amino/amino.proto"; -import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "initia/reward/v1/types.proto";