rename tob lane to mev lane

This commit is contained in:
David Terpay
2023-08-15 09:44:11 -04:00
parent e9dd8259eb
commit b2daf5acbb
20 changed files with 188 additions and 186 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import (
type POBHandlerOptions struct {
BaseOptions ante.HandlerOptions
Mempool blockbuster.Mempool
TOBLane builderante.TOBLane
MEVLane builderante.MEVLane
TxDecoder sdk.TxDecoder
TxEncoder sdk.TxEncoder
BuilderKeeper builderkeeper.Keeper
@@ -54,7 +54,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.TOBLane, options.Mempool),
builderante.NewBuilderDecorator(options.BuilderKeeper, options.TxEncoder, options.MEVLane, options.Mempool),
}
return sdk.ChainAnteDecorators(anteDecorators...)
+11 -11
View File
@@ -63,9 +63,9 @@ import (
"github.com/skip-mev/pob/blockbuster"
"github.com/skip-mev/pob/blockbuster/abci"
"github.com/skip-mev/pob/blockbuster/lanes/auction"
"github.com/skip-mev/pob/blockbuster/lanes/base"
"github.com/skip-mev/pob/blockbuster/lanes/free"
"github.com/skip-mev/pob/blockbuster/lanes/mev"
buildermodule "github.com/skip-mev/pob/x/builder"
builderkeeper "github.com/skip-mev/pob/x/builder/keeper"
)
@@ -139,7 +139,7 @@ type TestApp struct {
FeeGrantKeeper feegrantkeeper.Keeper
// custom checkTx handler
checkTxHandler auction.CheckTx
checkTxHandler mev.CheckTx
}
func init() {
@@ -262,16 +262,16 @@ func New(
// NOTE: The lanes are ordered by priority. The first lane is the highest priority
// lane and the last lane is the lowest priority lane.
// Top of block lane allows transactions to bid for inclusion at the top of the next block.
tobConfig := blockbuster.LaneConfig{
mevConfig := blockbuster.LaneConfig{
Logger: app.Logger(),
TxEncoder: app.txConfig.TxEncoder(),
TxDecoder: app.txConfig.TxDecoder(),
MaxBlockSpace: math.LegacyZeroDec(), // This means the lane has no limit on block space.
MaxTxs: 0, // This means the lane has no limit on the number of transactions it can store.
}
tobLane := auction.NewTOBLane(
tobConfig,
auction.NewDefaultAuctionFactory(app.txConfig.TxDecoder()),
mevLane := mev.NewMEVLane(
mevConfig,
mev.NewDefaultAuctionFactory(app.txConfig.TxDecoder()),
)
// Free lane allows transactions to be included in the next block for free.
@@ -300,7 +300,7 @@ func New(
// Set the lanes into the mempool.
lanes := []blockbuster.Lane{
tobLane,
mevLane,
freeLane,
defaultLane,
}
@@ -322,7 +322,7 @@ func New(
TxDecoder: app.txConfig.TxDecoder(),
TxEncoder: app.txConfig.TxEncoder(),
FreeLane: freeLane,
TOBLane: tobLane,
MEVLane: mevLane,
Mempool: mempool,
}
anteHandler := NewPOBAnteHandler(options)
@@ -343,10 +343,10 @@ func New(
app.App.SetProcessProposal(proposalHandler.ProcessProposalHandler())
// Set the custom CheckTx handler on BaseApp.
checkTxHandler := auction.NewCheckTxHandler(
checkTxHandler := mev.NewCheckTxHandler(
app.App,
app.txConfig.TxDecoder(),
tobLane,
mevLane,
anteHandler,
)
app.SetCheckTx(checkTxHandler.CheckTx())
@@ -392,7 +392,7 @@ func (app *TestApp) CheckTx(req *cometabci.RequestCheckTx) (*cometabci.ResponseC
}
// SetCheckTx sets the checkTxHandler for the app.
func (app *TestApp) SetCheckTx(handler auction.CheckTx) {
func (app *TestApp) SetCheckTx(handler mev.CheckTx) {
app.checkTxHandler = handler
}
+4 -4
View File
@@ -1003,7 +1003,7 @@ func (s *POBIntegrationTestSuite) TestLanes() {
params := QueryBuilderParams(s.T(), s.chain)
s.Run("block with tob, free, and normal tx", func() {
s.Run("block with mev, free, and normal tx", func() {
user2BalanceBefore := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user2.FormattedAddress(), s.denom)
// create free-tx, bid-tx, and normal-tx\
@@ -1071,7 +1071,7 @@ func (s *POBIntegrationTestSuite) TestLanes() {
require.Equal(s.T(), user2BalanceBefore, user2BalanceAfter+delegation.Amount.Int64())
})
s.Run("failing top of block transaction, free, and normal tx", func() {
s.Run("failing MEV transaction, free, and normal tx", func() {
user2BalanceBefore := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user2.FormattedAddress(), s.denom)
user1Balance := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user1.FormattedAddress(), s.denom)
// create free-tx, bid-tx, and normal-tx\
@@ -1151,7 +1151,7 @@ func (s *POBIntegrationTestSuite) TestLanes() {
require.Equal(s.T(), user2BalanceBefore, user2BalanceAfter+delegation.Amount.Int64())
})
s.Run("top of block transaction that includes transactions from the free lane", func() {
s.Run("MEV transaction that includes transactions from the free lane", func() {
user2BalanceBefore := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user2.FormattedAddress(), s.denom)
delegateTx := Tx{
@@ -1212,7 +1212,7 @@ func (s *POBIntegrationTestSuite) TestLanes() {
VerifyBlock(s.T(), block, 0, TxHash(txs[0]), bundledTx)
})
s.Run("top of block transaction that includes transaction from free lane + other free lane txs + normal txs", func() {
s.Run("MEV transaction that includes transaction from free lane + other free lane txs + normal txs", func() {
user2BalanceBefore := QueryAccountBalance(s.T(), s.chain.(*cosmos.CosmosChain), s.user2.FormattedAddress(), s.denom)
// create free-txs signed by user2 / 3