Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R4R]-{mt-batcher}: log optimization for mt-batcher and da-retriever #1329

Merged
merged 2 commits into from
Aug 8, 2023
Merged
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
2 changes: 1 addition & 1 deletion datalayr
2 changes: 1 addition & 1 deletion mt-batcher/l1l2client/l1client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func L1EthClientWithTimeout(ctx context.Context, url string, disableHTTP2 bool)
if strings.HasPrefix(url, "http") {
httpClient := new(http.Client)
if disableHTTP2 {
log.Info("Disabled HTTP/2 support in L1 eth client")
log.Debug("Disabled HTTP/2 support in L1 eth client")
httpClient.Transport = &http.Transport{
TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
}
Expand Down
2 changes: 1 addition & 1 deletion mt-batcher/l1l2client/l2client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func DialL2EthClientWithTimeout(ctx context.Context, url string, disableHTTP2 bo
if strings.HasPrefix(url, "http") {
httpClient := new(http.Client)
if disableHTTP2 {
log.Info("Disabled HTTP/2 support in L2 eth client")
log.Debug("Disabled HTTP/2 support in L2 eth client")
httpClient.Transport = &http.Transport{
TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
}
Expand Down
10 changes: 3 additions & 7 deletions mt-batcher/mt_batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ func Main(gitVersion string) func(ctx *cli.Context) error {
return err
}

log.Info("Init Mantle Batcher success", "CurrentVersion", gitVersion)

mantleBatch, err := NewMantleBatch(cfg)
if err != nil {
return err
Expand All @@ -40,7 +38,7 @@ func Main(gitVersion string) func(ctx *cli.Context) error {
}
defer mantleBatch.Stop()

log.Info("mantle batcher started")
log.Debug("mantle batcher started")

<-(chan struct{})(nil)

Expand Down Expand Up @@ -84,13 +82,11 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) {
if err != nil {
return nil, err
}
log.Info("l1Client init success", "chainID", chainID)

l2Client, err := l1l2client.DialL2EthClientWithTimeout(ctx, cfg.L2MtlRpc, cfg.DisableHTTP2)
if err != nil {
return nil, err
}
log.Info("l2Client init success")

eigenContract, err := bindings.NewBVMEigenDataLayrChain(
ethc.Address(common.HexToAddress(cfg.EigenContractAddress)), l1Client,
Expand All @@ -115,7 +111,7 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) {
ethc.Address(common.HexToAddress(cfg.EigenContractAddress)), parsed, l1Client, l1Client,
l1Client,
)
log.Info("contract init success", "EigenContractAddress", cfg.EigenContractAddress)
log.Debug("contract init success", "EigenContractAddress", cfg.EigenContractAddress)

eigenFeeContract, err := bindings.NewBVMEigenDataLayrFee(
ethc.Address(common.HexToAddress(cfg.EigenFeeContractAddress)),
Expand Down Expand Up @@ -185,7 +181,7 @@ func NewMantleBatch(cfg Config) (*MantleBatch, error) {
log.Error("new driver fail", "err", "config value error : MinTimeoutRollupTxn should less than RollUpMinTxn MinTimeoutRollupTxn(%v)>RollUpMinTxn(%v)", cfg.MinTimeoutRollupTxn, cfg.RollUpMinTxn)
return nil, errors.New("config value error : MinTimeoutRollupTxn should less than RollUpMinTxn")
}
log.Info("hsm",
log.Debug("hsm",
"enablehsm", driverConfig.EnableHsm, "hsmaddress", driverConfig.HsmAddress,
"hsmapiname", driverConfig.HsmAPIName, "HsmFeeAPIName", driverConfig.HsmFeeAPIName, "HsmFeeAddress", driverConfig.HsmFeeAddress)
driver, err := sequencer.NewDriver(ctx, driverConfig)
Expand Down
1 change: 0 additions & 1 deletion mt-batcher/services/restorer/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (s *DaService) GetDtlBatchTransactionByDataStoreId(c gecho.Context) error {
log.Error("invalid request params", "err", err)
return c.JSON(http.StatusBadRequest, errors.New("invalid request params"))
}
log.Info("GetBatchTransactionByDataStoreId Request para", "StoreNumber", txReq.StoreNumber)
conn, err := grpc.Dial(s.Cfg.RetrieverSocket, grpc.WithInsecure())
if err != nil {
log.Error("disperser Cannot connect to", "err", err)
Expand Down
2 changes: 1 addition & 1 deletion mt-batcher/services/sequencer/db/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Store struct {
func NewStore(path string) (*Store, error) {
db, err := NewLevelDBStore(path)
if err != nil {
log.Info("Could not create leveldb database.")
log.Error("Could not create leveldb database.")
return nil, err
}
return &Store{
Expand Down
6 changes: 3 additions & 3 deletions mt-batcher/services/sequencer/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (d *Driver) UpdateGasPrice(ctx context.Context, tx *types.Transaction, feeM
func (d *Driver) GetBatchBlockRange(ctx context.Context) (*big.Int, *big.Int, error) {
blockOffset := new(big.Int).SetUint64(d.Cfg.BlockOffset)
var end *big.Int
log.Info("MtBatcher GetBatchBlockRange", "blockOffset", blockOffset)
log.Debug("MtBatcher GetBatchBlockRange", "blockOffset", blockOffset)
start, err := d.Cfg.EigenDaContract.GetL2ConfirmedBlockNumber(&bind.CallOpts{
Context: context.Background(),
})
Expand Down Expand Up @@ -907,7 +907,7 @@ func (d *Driver) CheckConfirmedWorker() {
continue
}

log.Info("Checker db batch index and contract batch idnex", "DbBatchIndex", batchIndex, "ContractBatchIndex", latestReRollupBatchIndex.Uint64())
log.Debug("Checker db batch index and contract batch idnex", "DbBatchIndex", batchIndex, "ContractBatchIndex", latestReRollupBatchIndex.Uint64())
for i := batchIndex; i < latestReRollupBatchIndex.Uint64(); i++ {
log.Info("Checker batch confirm data index", "batchIndex", i)
reConfirmedBatchIndex, err := d.Cfg.EigenDaContract.ReRollupBatchIndex(&bind.CallOpts{}, big.NewInt(int64(i)))
Expand All @@ -927,7 +927,7 @@ func (d *Driver) CheckConfirmedWorker() {
log.Info("Checker get l2 rollup block fail", "err", err)
continue
}
log.Info("Checker DataStoreIdToL2RollUpBlock", "rollupBlock.StartL2BlockNumber", rollupBlock.StartL2BlockNumber, "rollupBlock.EndBL2BlockNumber", rollupBlock.EndBL2BlockNumber)
log.Debug("Checker DataStoreIdToL2RollUpBlock", "rollupBlock.StartL2BlockNumber", rollupBlock.StartL2BlockNumber, "rollupBlock.EndBL2BlockNumber", rollupBlock.EndBL2BlockNumber)

aggregateTxData, startL2BlockNumber, endL2BlockNumber := d.TxAggregator(
d.Ctx, rollupBlock.StartL2BlockNumber, rollupBlock.EndBL2BlockNumber,
Expand Down
6 changes: 3 additions & 3 deletions mt-batcher/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (m *SimpleTxManager) Send(ctx context.Context, updateGasPrice UpdateGasPric
nonce := tx.Nonce()
gasTipCap := tx.GasTipCap()
gasFeeCap := tx.GasFeeCap()
log.Info("MtBatcher publishing transaction", "txHash", txHash, "nonce", nonce, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap)
log.Debug("MtBatcher publishing transaction", "txHash", txHash, "nonce", nonce, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap)

err = sendTx(ctxc, tx)
sendState.ProcessSendError(err)
Expand All @@ -89,7 +89,7 @@ func (m *SimpleTxManager) Send(ctx context.Context, updateGasPrice UpdateGasPric
return
}

log.Info("MtBatcher transaction published successfully", "hash", txHash, "nonce", nonce, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap)
log.Debug("MtBatcher transaction published successfully", "hash", txHash, "nonce", nonce, "gasTipCap", gasTipCap, "gasFeeCap", gasFeeCap)

receipt, err := waitMined(
ctxc, m.backend, tx, m.cfg.ReceiptQueryInterval,
Expand Down Expand Up @@ -178,7 +178,7 @@ func waitMined(
"numConfirmations", numConfirmations)

if txHeight+numConfirmations <= tipHeight+1 {
log.Info("MtBatcher Transaction confirmed", "txHash", txHash)
log.Debug("MtBatcher Transaction confirmed", "txHash", txHash)
return receipt, nil
}

Expand Down
Loading