Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit af818b8

Browse files
dvushavalonche
authored andcommitted
Logs pt 3 (#38)
* log more info about bundles for all algos * remove redundant build block log * make fetch logs debug
1 parent 6bb10f5 commit af818b8

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

builder/relay.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ func (r *RemoteRelay) updateValidatorsMap(currentSlot uint64, retries int) error
103103
r.lastRequestedSlot = currentSlot
104104
r.validatorsLock.Unlock()
105105

106-
log.Info("Updated validators", "new", newMap, "for slot", currentSlot)
107-
106+
log.Info("Updated validators", "count", len(newMap), "slot", currentSlot)
108107
return nil
109108
}
110109

flashbotsextra/fetcher.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (b *bundleFetcher) fetchAndPush(ctx context.Context, pushMevBundles func(bu
8989
log.Error("failed to fetch high prio bundles", "err", err)
9090
continue
9191
}
92-
log.Info("Fetching High prio bundles", "size", len(bundles), "currentlyBuiltBlockNum", currentBlockNum+1)
92+
log.Debug("Fetching High prio bundles", "size", len(bundles), "currentlyBuiltBlockNum", currentBlockNum+1)
9393
if len(bundles) != 0 {
9494
pushMevBundles(bundles)
9595
}
@@ -105,7 +105,7 @@ func (b *bundleFetcher) fetchAndPush(ctx context.Context, pushMevBundles func(bu
105105
log.Error("failed to fetch low prio bundles", "err", err)
106106
continue
107107
}
108-
log.Info("Fetching low prio bundles", "len", len(bundles), "currentlyBuiltBlockNum", currentBlockNum+1)
108+
log.Debug("Fetching low prio bundles", "len", len(bundles), "currentlyBuiltBlockNum", currentBlockNum+1)
109109
if len(bundles) != 0 {
110110
pushMevBundles(bundles)
111111
}

miner/worker.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -1418,9 +1418,7 @@ func (w *worker) fillTransactionsAlgoWorker(interrupt *int32, env *environment,
14181418
return err, nil
14191419
}
14201420

1421-
start := time.Now()
14221421
simBundles, err := w.simulateBundles(env, bundles, nil) /* do not consider gas impact of mempool txs as bundles are treated as transactions wrt ordering */
1423-
log.Debug("Simulated bundles", "time", time.Since(start), "bundles", len(bundles))
14241422
if err != nil {
14251423
log.Error("Failed to simulate flashbots bundles", "err", err)
14261424
return err, nil
@@ -1429,10 +1427,8 @@ func (w *worker) fillTransactionsAlgoWorker(interrupt *int32, env *environment,
14291427
bundlesToConsider = simBundles
14301428
}
14311429

1432-
start := time.Now()
14331430
builder := newGreedyBuilder(w.chain, w.chainConfig, w.blockList, env, interrupt)
14341431
newEnv, blockBundles := builder.buildBlock(bundlesToConsider, pending)
1435-
log.Debug("Build block", "time", time.Since(start), "gasUsed", newEnv.header.GasUsed)
14361432
*env = *newEnv
14371433

14381434
if validatorCoinbase != nil && w.config.BuilderTxSigningKey != nil {
@@ -1484,7 +1480,6 @@ func (w *worker) generateWork(params *generateParams) (*types.Block, *big.Int, e
14841480
if errors.Is(err, errBlockInterruptedByTimeout) {
14851481
log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(w.newpayloadTimeout))
14861482
}
1487-
log.Debug("Filled block with transactions", "time", time.Since(start), "gas used", work.header.GasUsed, "txs", len(work.txs))
14881483
}
14891484
block, err := w.engine.FinalizeAndAssemble(w.chain, work.header, work.state, work.txs, work.unclelist(), work.receipts, params.withdrawals)
14901485
if err != nil {
@@ -1708,6 +1703,7 @@ func (w *worker) mergeBundles(env *environment, bundles []simulatedBundle, pendi
17081703
}
17091704

17101705
func (w *worker) simulateBundles(env *environment, bundles []types.MevBundle, pendingTxs map[common.Address]types.Transactions) ([]simulatedBundle, error) {
1706+
start := time.Now()
17111707
headerHash := env.header.Hash()
17121708
simCache := w.flashbots.bundleCache.GetBundleCache(headerHash)
17131709

@@ -1730,7 +1726,7 @@ func (w *worker) simulateBundles(env *environment, bundles []types.MevBundle, pe
17301726
simmed, err := w.computeBundleGas(env, bundle, state, gasPool, pendingTxs, 0)
17311727

17321728
if err != nil {
1733-
log.Debug("Error computing gas for a bundle", "error", err)
1729+
log.Trace("Error computing gas for a bundle", "error", err)
17341730
return
17351731
}
17361732
simResult[idx] = &simmed
@@ -1748,6 +1744,8 @@ func (w *worker) simulateBundles(env *environment, bundles []types.MevBundle, pe
17481744
}
17491745
}
17501746

1747+
okBundles := len(bundles) - len(simulatedBundles)
1748+
log.Debug("Simulated bundles", "block", env.header.Number, "allBundles", len(bundles), "okBundles", okBundles, "time", time.Since(start))
17511749
return simulatedBundles, nil
17521750
}
17531751

0 commit comments

Comments
 (0)