diff --git a/mt-batcher/config.go b/mt-batcher/config.go index 21400271f..ea7145fa6 100644 --- a/mt-batcher/config.go +++ b/mt-batcher/config.go @@ -1,10 +1,11 @@ package mt_batcher import ( + "time" + "github.com/Layr-Labs/datalayr/common/logging" "github.com/mantlenetworkio/mantle/mt-batcher/flags" "github.com/urfave/cli" - "time" ) type Config struct { @@ -35,7 +36,6 @@ type Config struct { FeeWorkerPollInterval time.Duration BlockOffset uint64 RollUpMinTxn uint64 - RollUpMinSize uint64 RollUpMaxSize uint64 EigenLayerNode int EigenLogConfig logging.Config @@ -96,7 +96,6 @@ func NewConfig(ctx *cli.Context) (Config, error) { PollingDuration: ctx.GlobalDuration(flags.PollingDurationFlag.Name), BlockOffset: ctx.GlobalUint64(flags.BlockOffsetFlag.Name), RollUpMinTxn: ctx.GlobalUint64(flags.RollUpMinTxnFlag.Name), - RollUpMinSize: ctx.GlobalUint64(flags.RollUpMinSizeFlag.Name), RollUpMaxSize: ctx.GlobalUint64(flags.RollUpMaxSizeFlag.Name), EigenLayerNode: ctx.GlobalInt(flags.EigenLayerNodeFlag.Name), EigenLogConfig: logging.ReadCLIConfig(ctx), diff --git a/mt-batcher/flags/flags.go b/mt-batcher/flags/flags.go index fae6af274..dbc7c49d1 100644 --- a/mt-batcher/flags/flags.go +++ b/mt-batcher/flags/flags.go @@ -1,8 +1,9 @@ package flags import ( - "github.com/urfave/cli" "time" + + "github.com/urfave/cli" ) const envVarPrefix = "MT_BATCHER" @@ -125,12 +126,6 @@ var ( Value: 500, EnvVar: prefixEnvVar(envVarPrefix, "ROLLUP_MIN_TXN"), } - RollUpMinSizeFlag = cli.Uint64Flag{ - Name: "rollup-min-size", - Usage: "Rollup transaction min size data for eigen da", - Value: 1000, - EnvVar: prefixEnvVar(envVarPrefix, "ROLLUP_MIN_SIZE"), - } FeeSizeSecFlag = cli.StringFlag{ Name: "fee-size-sec", Usage: "Rollup transaction fee size", @@ -363,7 +358,6 @@ var requiredFlags = []cli.Flag{ EigenFeeContractAddressFlag, BlockOffsetFlag, RollUpMinTxnFlag, - RollUpMinSizeFlag, RollUpMaxSizeFlag, FeeSizeSecFlag, FeePerBytePerTimeFlag, diff --git a/mt-batcher/mt_batcher.go b/mt-batcher/mt_batcher.go index b1474b514..e32620251 100644 --- a/mt-batcher/mt_batcher.go +++ b/mt-batcher/mt_batcher.go @@ -10,13 +10,14 @@ import ( ethc "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/mantlenetworkio/mantle/l2geth/common" + "github.com/urfave/cli" + "github.com/mantlenetworkio/mantle/mt-batcher/bindings" "github.com/mantlenetworkio/mantle/mt-batcher/l1l2client" "github.com/mantlenetworkio/mantle/mt-batcher/metrics" common2 "github.com/mantlenetworkio/mantle/mt-batcher/services/common" "github.com/mantlenetworkio/mantle/mt-batcher/services/restorer" "github.com/mantlenetworkio/mantle/mt-batcher/services/sequencer" - "github.com/urfave/cli" ) func Main(gitVersion string) func(ctx *cli.Context) error { @@ -108,11 +109,6 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) { log.Error("MtBatcher parse eigenda contract abi fail", "err", err) return nil, err } - eignenABI, err := bindings.BVMEigenDataLayrChainMetaData.GetAbi() - if err != nil { - log.Error("MtBatcher get eigenda contract abi fail", "err", err) - return nil, err - } rawEigenContract := bind.NewBoundContract( ethc.Address(common.HexToAddress(cfg.EigenContractAddress)), parsed, l1Client, l1Client, l1Client, @@ -135,11 +131,6 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) { log.Error("MtBatcher parse eigen fee contract abi fail", "err", err) return nil, err } - eigenFeeABI, err := bindings.BVMEigenDataLayrFeeMetaData.GetAbi() - if err != nil { - log.Error("MtBatcher get eigen fee contract abi fail", "err", err) - return nil, err - } rawEigenFeeContract := bind.NewBoundContract( ethc.Address(common.HexToAddress(cfg.EigenFeeContractAddress)), feeParsed, l1Client, l1Client, l1Client, @@ -152,10 +143,8 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) { DtlClientUrl: cfg.DtlClientUrl, EigenDaContract: eigenContract, RawEigenContract: rawEigenContract, - EigenABI: eignenABI, EigenFeeContract: eigenFeeContract, RawEigenFeeContract: rawEigenFeeContract, - EigenFeeABI: eigenFeeABI, FeeModelEnable: cfg.FeeModelEnable, FeeSizeSec: cfg.FeeSizeSec, FeePerBytePerTime: cfg.FeePerBytePerTime, @@ -164,7 +153,6 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) { FeePrivKey: mtFeePrivateKey, BlockOffset: cfg.BlockOffset, RollUpMinTxn: cfg.RollUpMinTxn, - RollUpMinSize: cfg.RollUpMinSize, RollUpMaxSize: cfg.RollUpMaxSize, EigenLayerNode: cfg.EigenLayerNode, DataStoreDuration: uint64(cfg.DataStoreDuration), @@ -199,13 +187,10 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) { } daServiceConfig := &restorer.DaServiceConfig{ EigenContract: eigenContract, - EigenABI: eignenABI, RetrieverSocket: cfg.RetrieverSocket, GraphProvider: cfg.GraphProvider, - Timeout: cfg.RetrieverTimeout, DaServicePort: cfg.EigenDaHttpPort, EigenLayerNode: cfg.EigenLayerNode, - Debug: cfg.EchoDebug, } daService, err := restorer.NewDaService(ctx, daServiceConfig) if err != nil { diff --git a/mt-batcher/services/restorer/service.go b/mt-batcher/services/restorer/service.go index 570d11984..8e6c718cc 100644 --- a/mt-batcher/services/restorer/service.go +++ b/mt-batcher/services/restorer/service.go @@ -2,28 +2,25 @@ package restorer import ( "context" + "strconv" + "sync" + "github.com/Layr-Labs/datalayr/common/graphView" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/log" gecho "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" + "github.com/shurcooL/graphql" + "github.com/mantlenetworkio/mantle/mt-batcher/bindings" "github.com/mantlenetworkio/mantle/mt-batcher/services/common" - "github.com/shurcooL/graphql" - "strconv" - "sync" - "time" ) type DaServiceConfig struct { EigenContract *bindings.BVMEigenDataLayrChain - EigenABI *abi.ABI RetrieverSocket string GraphProvider string - Timeout time.Duration DaServicePort int EigenLayerNode int - Debug bool } type DaService struct { diff --git a/mt-batcher/services/sequencer/driver.go b/mt-batcher/services/sequencer/driver.go index 9d0d4e110..306a0ef5b 100644 --- a/mt-batcher/services/sequencer/driver.go +++ b/mt-batcher/services/sequencer/driver.go @@ -14,7 +14,6 @@ import ( "github.com/Layr-Labs/datalayr/common/graphView" pb "github.com/Layr-Labs/datalayr/common/interfaces/interfaceDL" "github.com/Layr-Labs/datalayr/common/logging" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -25,6 +24,10 @@ import ( l2ethclient "github.com/mantlenetworkio/mantle/l2geth/ethclient" l2rlp "github.com/mantlenetworkio/mantle/l2geth/rlp" common3 "github.com/mantlenetworkio/mantle/l2geth/rollup/eigenda" + "github.com/pkg/errors" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "github.com/mantlenetworkio/mantle/mt-batcher/bindings" rc "github.com/mantlenetworkio/mantle/mt-batcher/bindings" common2 "github.com/mantlenetworkio/mantle/mt-batcher/common" @@ -33,9 +36,6 @@ import ( common4 "github.com/mantlenetworkio/mantle/mt-batcher/services/common" "github.com/mantlenetworkio/mantle/mt-batcher/services/sequencer/db" "github.com/mantlenetworkio/mantle/mt-batcher/txmgr" - "github.com/pkg/errors" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" ) type SignerFn func(context.Context, common.Address, *types.Transaction) (*types.Transaction, error) @@ -47,16 +47,13 @@ type DriverConfig struct { DtlClientUrl string EigenDaContract *bindings.BVMEigenDataLayrChain RawEigenContract *bind.BoundContract - EigenABI *abi.ABI EigenFeeContract *bindings.BVMEigenDataLayrFee RawEigenFeeContract *bind.BoundContract - EigenFeeABI *abi.ABI Logger *logging.Logger PrivKey *ecdsa.PrivateKey FeePrivKey *ecdsa.PrivateKey BlockOffset uint64 RollUpMinTxn uint64 - RollUpMinSize uint64 RollUpMaxSize uint64 EigenLayerNode int DataStoreDuration uint64