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
22 changes: 0 additions & 22 deletions .github/workflows/buf_breaking.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/buf_push.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ test-cover: tidy
### Protobuf ###
###############################################################################

protoVer=0.15.1
protoVer=0.16.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

Expand Down
9 changes: 7 additions & 2 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This module represents buf.build/initia-labs/connect
version: v1
name: buf.build/skip-mev/connect
name: buf.build/initia-labs/connect

deps:
- buf.build/cosmos/cosmos-proto
Expand All @@ -11,12 +12,16 @@ breaking:
- FILE
lint:
use:
- DEFAULT
- STANDARD
- COMMENTS
- FILE_LOWER_SNAKE_CASE
except:
- SERVICE_SUFFIX
- RPC_REQUEST_STANDARD_NAME
- RPC_RESPONSE_STANDARD_NAME
- COMMENT_FIELD
- FIELD_LOWER_SNAKE_CASE
- PACKAGE_DIRECTORY_MATCH
# excluded to avoid breaking changes on existing enum values
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
6 changes: 2 additions & 4 deletions proto/connect/marketmap/module/v2/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import "cosmos/app/v1alpha1/module.proto";

// Module is the config object of the builder module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import : "github.com/skip-mev/connect/v2/x/marketmap"
};
option (cosmos.app.v1alpha1.module) = {go_import: "github.com/skip-mev/connect/v2/x/marketmap"};

// Authority defines the custom module authority. If not set, defaults to the
// governance module.
Expand All @@ -18,4 +16,4 @@ message Module {
// of module names which provide a marketmap hooks instance. If no order is
// provided, then hooks will be applied in alphabetical order of module names.
repeated string hooks_order = 2;
}
}
6 changes: 3 additions & 3 deletions proto/connect/marketmap/v2/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
syntax = "proto3";
package connect.marketmap.v2;

import "gogoproto/gogo.proto";
import "connect/marketmap/v2/market.proto";
import "connect/marketmap/v2/params.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types";

// GenesisState defines the x/marketmap module's genesis state.
message GenesisState {
// MarketMap defines the global set of market configurations for all providers
// and markets.
MarketMap market_map = 1 [ (gogoproto.nullable) = false ];
MarketMap market_map = 1 [(gogoproto.nullable) = false];

// LastUpdated is the last block height that the market map was updated.
// This field can be used as an optimization for clients checking if there
// is a new update to the map.
uint64 last_updated = 2;

// Params are the parameters for the x/marketmap module.
Params params = 3 [ (gogoproto.nullable) = false ];
Params params = 3 [(gogoproto.nullable) = false];
}
16 changes: 8 additions & 8 deletions proto/connect/marketmap/v2/market.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package connect.marketmap.v2;

option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types";

import "gogoproto/gogo.proto";
import "connect/types/v2/currency_pair.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types";

// Market encapsulates a Ticker and its provider-specific configuration.
message Market {
Expand All @@ -14,10 +14,10 @@ message Market {
// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The
// price feed is scaled to a number of decimal places and has a minimum number
// of providers required to consider the ticker valid.
Ticker ticker = 1 [ (gogoproto.nullable) = false ];
Ticker ticker = 1 [(gogoproto.nullable) = false];

// ProviderConfigs is the list of provider-specific configs for this Market.
repeated ProviderConfig provider_configs = 2 [ (gogoproto.nullable) = false ];
repeated ProviderConfig provider_configs = 2 [(gogoproto.nullable) = false];
}

// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price
Expand All @@ -28,8 +28,7 @@ message Ticker {
option (gogoproto.stringer) = false;

// CurrencyPair is the currency pair for this ticker.
connect.types.v2.CurrencyPair currency_pair = 1
[ (gogoproto.nullable) = false ];
connect.types.v2.CurrencyPair currency_pair = 1 [(gogoproto.nullable) = false];

// Decimals is the number of decimal places for the ticker. The number of
// decimal places is used to convert the price to a human-readable format.
Expand All @@ -48,6 +47,7 @@ message Ticker {
string metadata_JSON = 15;
}

// ProviderConfig defines the configuration for a given provider.
message ProviderConfig {
// Name corresponds to the name of the provider for which the configuration is
// being set.
Expand Down Expand Up @@ -80,5 +80,5 @@ message MarketMap {

// Markets is the full list of tickers and their associated configurations
// to be stored on-chain.
map<string, Market> markets = 1 [ (gogoproto.nullable) = false ];
map<string, Market> markets = 1 [(gogoproto.nullable) = false];
}
45 changes: 19 additions & 26 deletions proto/connect/marketmap/v2/query.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";
package connect.marketmap.v2;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "connect/types/v2/currency_pair.proto";
import "connect/marketmap/v2/market.proto";
import "connect/marketmap/v2/params.proto";
import "connect/types/v2/currency_pair.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/skip-mev/connect/v2/x/marketmap/types";

Expand All @@ -15,39 +15,29 @@ service Query {
// module. NOTE: the value returned by this query is not safe for on-chain
// code.
rpc MarketMap(MarketMapRequest) returns (MarketMapResponse) {
option (google.api.http) = {
get : "/connect/marketmap/v2/marketmap"
};
option (google.api.http) = {get: "/connect/marketmap/v2/marketmap"};
}

// Market returns all stored in the x/marketmap
// Markets returns all markets stored in the x/marketmap
// module as a sorted list.
rpc Markets(MarketsRequest) returns (MarketsResponse) {
option (google.api.http) = {
get : "/connect/marketmap/v2/markets"
};
option (google.api.http) = {get: "/connect/marketmap/v2/markets"};
}

// Market returns a market stored in the x/marketmap
// module.
rpc Market(MarketRequest) returns (MarketResponse) {
option (google.api.http) = {
get : "/connect/marketmap/v2/market"
};
option (google.api.http) = {get: "/connect/marketmap/v2/market"};
}

// LastUpdated returns the last height the market map was updated at.
rpc LastUpdated(LastUpdatedRequest) returns (LastUpdatedResponse) {
option (google.api.http) = {
get : "/connect/marketmap/v2/last_updated"
};
option (google.api.http) = {get: "/connect/marketmap/v2/last_updated"};
}

// Params returns the current x/marketmap module parameters.
rpc Params(ParamsRequest) returns (ParamsResponse) {
option (google.api.http) = {
get : "/connect/marketmap/v2/params"
};
option (google.api.http) = {get: "/connect/marketmap/v2/params"};
}
}

Expand All @@ -59,7 +49,7 @@ message MarketMapRequest {}
message MarketMapResponse {
// MarketMap defines the global set of market configurations for all providers
// and markets.
MarketMap market_map = 1 [ (gogoproto.nullable) = false ];
MarketMap market_map = 1 [(gogoproto.nullable) = false];

// LastUpdated is the last block height that the market map was updated.
// This field can be used as an optimization for clients checking if there
Expand All @@ -76,34 +66,37 @@ message MarketsRequest {}
// MarketsResponse is the query response for the Markets query.
message MarketsResponse {
// Markets is a sorted list of all markets in the module.
repeated Market markets = 1 [ (gogoproto.nullable) = false ];
repeated Market markets = 1 [(gogoproto.nullable) = false];
}

// MarketRequest is the query request for the Market query.
// It takes the currency pair of the market as an argument.
message MarketRequest {
// CurrencyPair is the currency pair associated with the market being
// requested.
connect.types.v2.CurrencyPair currency_pair = 1
[ (gogoproto.nullable) = false ];
connect.types.v2.CurrencyPair currency_pair = 1 [(gogoproto.nullable) = false];
}

// MarketResponse is the query response for the Market query.
message MarketResponse {
// Market is the configuration of a single market to be price-fetched for.
Market market = 1 [ (gogoproto.nullable) = false ];
Market market = 1 [(gogoproto.nullable) = false];
}

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

// ParamsResponse is the response type for the Query/Params RPC method.
message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; }
message ParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}

// LastUpdatedRequest is the request type for the Query/LastUpdated RPC
// method.
message LastUpdatedRequest {}

// LastUpdatedResponse is the response type for the Query/LastUpdated RPC
// method.
message LastUpdatedResponse { uint64 last_updated = 1; }
message LastUpdatedResponse {
uint64 last_updated = 1;
}
Loading
Loading