proto stuff

This commit is contained in:
David Terpay 2023-08-17 16:51:12 -04:00
parent b50fb816c8
commit ecdb7395e3
No known key found for this signature in database
GPG Key ID: 627EFB00DADF0CD1
10 changed files with 23 additions and 29 deletions

View File

@ -40,10 +40,9 @@ NOTE: This example walks through setting up the MEV and Default lanes.
```go
import (
...
"github.com/skip-mev/pob/block-sdk"
"github.com/skip-mev/pob/block-sdk/abci"
"github.com/skip-mev/pob/block-sdk/lanes/mev"
"github.com/skip-mev/pob/block-sdk/lanes/base"
"github.com/skip-mev/block-sdk/abci"
"github.com/skip-mev/block-sdk/lanes/mev"
"github.com/skip-mev/block-sdk/lanes/base"
buildermodule "github.com/skip-mev/block-sdk/x/builder"
builderkeeper "github.com/skip-mev/block-sdk/x/builder/keeper"
buildertypes "github.com/skip-mev/block-sdk/x/builder/types"

View File

@ -1,5 +1,5 @@
version: v1
name: buf.build/skip-mev/pob
name: buf.build/skip-mev/block-sdk
deps:
- buf.build/cosmos/cosmos-proto

View File

@ -1,6 +1,6 @@
syntax = "proto3";
package pob.builder.module.v1;
package sdk.builder.module.v1;
import "cosmos/app/v1alpha1/module.proto";
@ -12,5 +12,5 @@ message Module {
// Authority defines the custom module authority. If not set, defaults to the
// governance module.
string authority = 2;
string authority = 1;
}

View File

@ -1,5 +1,5 @@
syntax = "proto3";
package pob.builder.v1;
package sdk.builder.v1;
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
@ -13,7 +13,7 @@ message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; }
// Params defines the parameters of the x/builder module.
message Params {
option (amino.name) = "cosmos-sdk/x/builder/Params";
option (amino.name) = "block-sdk/x/builder/Params";
// max_bundle_size is the maximum number of transactions that can be bundled
// in a single bundle.
@ -39,9 +39,9 @@ message Params {
// proposer_fee defines the portion of the winning bid that goes to the block
// proposer that proposed the block.
string proposer_fee = 6 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}

View File

@ -1,10 +1,10 @@
syntax = "proto3";
package pob.builder.v1;
package sdk.builder.v1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/query/v1/query.proto";
import "pob/builder/v1/genesis.proto";
import "sdk/builder/v1/genesis.proto";
option go_package = "github.com/skip-mev/block-sdk/x/builder/types";
@ -13,7 +13,7 @@ service Query {
// Params queries the parameters of the x/builder module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/pob/builder/v1/params";
option (google.api.http).get = "/block-sdk/builder/v1/params";
}
}

View File

@ -1,10 +1,10 @@
syntax = "proto3";
package pob.builder.v1;
package sdk.builder.v1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
import "pob/builder/v1/genesis.proto";
import "sdk/builder/v1/genesis.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
@ -17,7 +17,7 @@ service Msg {
// AuctionBid defines a method for sending bids to the x/builder module.
rpc AuctionBid(MsgAuctionBid) returns (MsgAuctionBidResponse) {
option (google.api.http).post = "/pob/builder/v1/bid";
option (google.api.http).post = "/block-sdk/builder/v1/bid";
};
// UpdateParams defines a governance operation for updating the x/builder
@ -29,7 +29,7 @@ service Msg {
// module.
message MsgAuctionBid {
option (cosmos.msg.v1.signer) = "bidder";
option (amino.name) = "pob/x/builder/MsgAuctionBid";
option (amino.name) = "block-sdk/x/builder/MsgAuctionBid";
option (gogoproto.equal) = false;
@ -52,7 +52,7 @@ message MsgAuctionBidResponse {}
// parameters.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "pob/x/builder/MsgUpdateParams";
option (amino.name) = "block-sdk/x/builder/MsgUpdateParams";
option (gogoproto.equal) = false;

View File

@ -8,7 +8,7 @@ set -e
echo "Generating Protocol Buffer code..."
cd proto
proto_dirs=$(find ./pob -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
proto_dirs=$(find ./sdk -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
if grep go_package $file &> /dev/null ; then
@ -20,7 +20,7 @@ done
cd ..
# move proto files to the right places
cp -r github.com/skip-mev/pob/* ./
cp -r github.com/skip-mev/block-sdk/* ./
rm -rf github.com
# go mod tidy --compat=1.20

View File

@ -105,9 +105,6 @@ func (bd BuilderDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool,
// ValidateTimeout validates that the timeout is greater than or equal to the expected block height
// the bid transaction will be executed in.
//
// TODO: This will be deprecated in favor of the pre-commit hook once this available on the SDK
// https://github.com/skip-mev/pob/issues/147
func (bd BuilderDecorator) ValidateTimeout(ctx sdk.Context, timeout int64) error {
currentBlockHeight := ctx.BlockHeight()

View File

@ -218,8 +218,6 @@ func (suite *KeeperTestSuite) TestValidateBidInfo() {
}
func (suite *KeeperTestSuite) TestValidateBundle() {
// TODO: Update this to be multi-dimensional to test multi-sig
// https://github.com/skip-mev/pob/issues/14
var accounts []testutils.Account // tracks the order of signers in the bundle
rng := rand.New(rand.NewSource(time.Now().Unix()))

View File

@ -24,10 +24,10 @@ func init() {
// concrete types on the provided LegacyAmino codec. These types are used for
// Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
legacy.RegisterAminoMsg(cdc, &MsgAuctionBid{}, "pob/x/builder/MsgAuctionBid")
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "pob/x/builder/MsgUpdateParams")
legacy.RegisterAminoMsg(cdc, &MsgAuctionBid{}, "block-sdk/x/builder/MsgAuctionBid")
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "block-sdk/x/builder/MsgUpdateParams")
cdc.RegisterConcrete(Params{}, "pob/builder/Params", nil)
cdc.RegisterConcrete(Params{}, "block-sdk/x/builder/Params", nil)
}
// RegisterInterfaces registers the x/builder interfaces types with the