feat(docs): rename x/builder -> x/auction (#55)

* rename x/builder -> x/auction

* update proto / etc.

* integratino fix

---------

Co-authored-by: David Terpay <david.terpay@gmail.com>
This commit is contained in:
Nikhil Vasan
2023-09-12 14:37:25 -04:00
committed by GitHub
co-authored by David Terpay
parent 21b9b6f882
commit 3c6f319ff1
57 changed files with 845 additions and 846 deletions
+5 -5
View File
@@ -6,17 +6,17 @@ import (
"github.com/skip-mev/block-sdk/block"
"github.com/skip-mev/block-sdk/block/utils"
builderante "github.com/skip-mev/block-sdk/x/builder/ante"
builderkeeper "github.com/skip-mev/block-sdk/x/builder/keeper"
auctionante "github.com/skip-mev/block-sdk/x/auction/ante"
auctionkeeper "github.com/skip-mev/block-sdk/x/auction/keeper"
)
type POBHandlerOptions struct {
BaseOptions ante.HandlerOptions
Mempool block.Mempool
MEVLane builderante.MEVLane
MEVLane auctionante.MEVLane
TxDecoder sdk.TxDecoder
TxEncoder sdk.TxEncoder
BuilderKeeper builderkeeper.Keeper
auctionkeeper auctionkeeper.Keeper
FreeLane block.Lane
}
@@ -55,7 +55,7 @@ func NewPOBAnteHandler(options POBHandlerOptions) sdk.AnteHandler {
ante.NewSigGasConsumeDecorator(options.BaseOptions.AccountKeeper, options.BaseOptions.SigGasConsumer),
ante.NewSigVerificationDecorator(options.BaseOptions.AccountKeeper, options.BaseOptions.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.BaseOptions.AccountKeeper),
builderante.NewBuilderDecorator(options.BuilderKeeper, options.TxEncoder, options.MEVLane, options.Mempool),
auctionante.NewAuctionDecorator(options.auctionkeeper, options.TxEncoder, options.MEVLane, options.Mempool),
}
return sdk.ChainAnteDecorators(anteDecorators...)
+6 -6
View File
@@ -67,8 +67,8 @@ import (
defaultlane "github.com/skip-mev/block-sdk/lanes/base"
"github.com/skip-mev/block-sdk/lanes/free"
"github.com/skip-mev/block-sdk/lanes/mev"
buildermodule "github.com/skip-mev/block-sdk/x/builder"
builderkeeper "github.com/skip-mev/block-sdk/x/builder/keeper"
auctionmodule "github.com/skip-mev/block-sdk/x/auction"
auctionkeeper "github.com/skip-mev/block-sdk/x/auction/keeper"
)
const (
@@ -104,7 +104,7 @@ var (
groupmodule.AppModuleBasic{},
vesting.AppModuleBasic{},
consensus.AppModuleBasic{},
buildermodule.AppModuleBasic{},
auctionmodule.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
)
)
@@ -136,7 +136,7 @@ type TestApp struct {
GroupKeeper groupkeeper.Keeper
ConsensusParamsKeeper consensuskeeper.Keeper
CircuitBreakerKeeper circuitkeeper.Keeper
BuilderKeeper builderkeeper.Keeper
auctionkeeper auctionkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
// custom checkTx handler
@@ -217,7 +217,7 @@ func New(
&app.ParamsKeeper,
&app.AuthzKeeper,
&app.GroupKeeper,
&app.BuilderKeeper,
&app.auctionkeeper,
&app.ConsensusParamsKeeper,
&app.FeeGrantKeeper,
&app.CircuitBreakerKeeper,
@@ -319,7 +319,7 @@ func New(
}
options := POBHandlerOptions{
BaseOptions: handlerOptions,
BuilderKeeper: app.BuilderKeeper,
auctionkeeper: app.auctionkeeper,
TxDecoder: app.txConfig.TxDecoder(),
TxEncoder: app.txConfig.TxEncoder(),
FreeLane: freeLane,
+9 -9
View File
@@ -65,9 +65,9 @@ import (
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
buildermodulev1 "github.com/skip-mev/block-sdk/api/sdk/builder/module/v1"
_ "github.com/skip-mev/block-sdk/x/builder" // import for side-effects
buildertypes "github.com/skip-mev/block-sdk/x/builder/types"
auctionmodulev1 "github.com/skip-mev/block-sdk/api/sdk/auction/module/v1"
_ "github.com/skip-mev/block-sdk/x/auction" // import for side-effects
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"
)
var (
@@ -79,7 +79,7 @@ var (
{Account: stakingtypes.BondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}},
{Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}},
{Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}},
{Account: buildertypes.ModuleName, Permissions: []string{}},
{Account: auctiontypes.ModuleName, Permissions: []string{}},
}
// blocked account addresses
@@ -112,7 +112,7 @@ var (
stakingtypes.ModuleName,
genutiltypes.ModuleName,
authz.ModuleName,
buildertypes.ModuleName,
auctiontypes.ModuleName,
feegrant.ModuleName,
},
EndBlockers: []string{
@@ -121,7 +121,7 @@ var (
stakingtypes.ModuleName,
genutiltypes.ModuleName,
group.ModuleName,
buildertypes.ModuleName,
auctiontypes.ModuleName,
feegrant.ModuleName,
},
OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{
@@ -150,7 +150,7 @@ var (
vestingtypes.ModuleName,
consensustypes.ModuleName,
circuittypes.ModuleName,
buildertypes.ModuleName,
auctiontypes.ModuleName,
feegrant.ModuleName,
},
// When ExportGenesis is not specified, the export genesis module order
@@ -244,8 +244,8 @@ var (
Config: appconfig.WrapAny(&circuitmodulev1.Module{}),
},
{
Name: buildertypes.ModuleName,
Config: appconfig.WrapAny(&buildermodulev1.Module{}),
Name: auctiontypes.ModuleName,
Config: appconfig.WrapAny(&auctionmodulev1.Module{}),
},
},
}),
+7 -7
View File
@@ -26,7 +26,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
buildertypes "github.com/skip-mev/block-sdk/x/builder/types"
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"
)
// ChainBuilderFromChainSpec creates an interchaintest chain builder factory given a ChainSpec
@@ -149,7 +149,7 @@ type Tx struct {
}
// CreateAuctionBidMsg creates a new AuctionBid tx signed by the given user, the order of txs in the MsgAuctionBid will be determined by the contents + order of the MessageForUsers
func CreateAuctionBidMsg(t *testing.T, ctx context.Context, searcher cosmos.User, chain *cosmos.CosmosChain, bid sdk.Coin, txsPerUser []Tx) (*buildertypes.MsgAuctionBid, [][]byte) {
func CreateAuctionBidMsg(t *testing.T, ctx context.Context, searcher cosmos.User, chain *cosmos.CosmosChain, bid sdk.Coin, txsPerUser []Tx) (*auctiontypes.MsgAuctionBid, [][]byte) {
// for each MessagesForUser get the signed bytes
txs := make([][]byte, len(txsPerUser))
for i, tx := range txsPerUser {
@@ -161,7 +161,7 @@ func CreateAuctionBidMsg(t *testing.T, ctx context.Context, searcher cosmos.User
require.NoError(t, err)
// create a message auction bid
return buildertypes.NewMsgAuctionBid(
return auctiontypes.NewMsgAuctionBid(
accAddr,
bid,
txs,
@@ -221,8 +221,8 @@ func BroadcastTxs(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain,
return txs
}
// QueryBuilderParams queries the x/builder module's params
func QueryBuilderParams(t *testing.T, chain ibc.Chain) buildertypes.Params {
// QueryAuctionParams queries the x/auction module's params
func QueryAuctionParams(t *testing.T, chain ibc.Chain) auctiontypes.Params {
// cast chain to cosmos-chain
cosmosChain, ok := chain.(*cosmos.CosmosChain)
require.True(t, ok)
@@ -230,11 +230,11 @@ func QueryBuilderParams(t *testing.T, chain ibc.Chain) buildertypes.Params {
nodes := cosmosChain.Nodes()
require.True(t, len(nodes) > 0)
// make params query to first node
resp, _, err := nodes[0].ExecQuery(context.Background(), "builder", "params")
resp, _, err := nodes[0].ExecQuery(context.Background(), "auction", "params")
require.NoError(t, err)
// unmarshal params
var params buildertypes.Params
var params auctiontypes.Params
err = json.Unmarshal(resp, &params)
require.NoError(t, err)
return params
+4 -4
View File
@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/skip-mev/block-sdk/tests/integration"
buildertypes "github.com/skip-mev/block-sdk/x/builder/types"
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"
)
var (
@@ -31,7 +31,7 @@ var (
genesisKV = []cosmos.GenesisKV{
{
Key: "app_state.builder.params.max_bundle_size",
Key: "app_state.auction.params.max_bundle_size",
Value: 3,
},
}
@@ -70,8 +70,8 @@ var (
func MakeEncodingConfig() *testutil.TestEncodingConfig {
cfg := cosmos.DefaultEncoding()
// register builder types
buildertypes.RegisterInterfaces(cfg.InterfaceRegistry)
// register auction types
auctiontypes.RegisterInterfaces(cfg.InterfaceRegistry)
return &cfg
}
+5 -5
View File
@@ -76,7 +76,7 @@ func (s *IntegrationTestSuite) SetupSubTest() {
func (s *IntegrationTestSuite) TestQueryParams() {
// query params
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
// expect validate to pass
require.NoError(s.T(), params.Validate())
@@ -90,7 +90,7 @@ func (s *IntegrationTestSuite) TestQueryParams() {
// 3. The balance of the escrow account should be updated correctly.
// 4. Top of block bids will be included in block proposals before other transactions
func (s *IntegrationTestSuite) TestValidBids() {
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String()
s.Run("Valid Auction Bid", func() {
@@ -322,7 +322,7 @@ func (s *IntegrationTestSuite) TestValidBids() {
// 5. If there is a block that has multiple valid bids with timeouts that are sufficiently far apart,
// the bids should be executed respecting the highest bids until the timeout is reached.
func (s *IntegrationTestSuite) TestMultipleBids() {
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String()
s.Run("broadcasting bids to two different validators (both should execute over several blocks) with same bid", func() {
@@ -664,7 +664,7 @@ func (s *IntegrationTestSuite) TestMultipleBids() {
}
func (s *IntegrationTestSuite) TestInvalidBids() {
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
escrowAddr := sdk.AccAddress(params.EscrowAccountAddress).String()
s.Run("searcher is attempting to submit a bundle that includes another bid tx", func() {
@@ -1001,7 +1001,7 @@ func (s *IntegrationTestSuite) TestLanes() {
delegation := sdk.NewCoin(s.denom, sdk.NewInt(100))
params := QueryBuilderParams(s.T(), s.chain)
params := QueryAuctionParams(s.T(), s.chain)
s.Run("block with mev, free, and normal tx", func() {
user2BalanceBefore := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user2.FormattedAddress(), s.denom)