Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Feb 8, 2025
1 parent f9e0a63 commit 4c91379
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions engine/execution/pruner/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
const NextHeightForUnprunedExecutionDataPackKey = "NextHeightForUnprunedExecutionDataPackKey"

func LoopPruneExecutionDataFromRootToLatestSealed(
ctx context.Context,
log zerolog.Logger,
metrics module.ExecutionMetrics,
ctx context.Context,
state protocol.State,
badgerDB *badger.DB,
headers storage.Headers,
Expand All @@ -49,7 +49,7 @@ func LoopPruneExecutionDataFromRootToLatestSealed(
ctx, // for cancelling the iteration when the context is done
config,
chunksDB,
NewChunKDataPackPruner(chunkDataPacks, results),
NewChunkDataPackPruner(chunkDataPacks, results),
)

for {
Expand Down
2 changes: 1 addition & 1 deletion engine/execution/pruner/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestLoopPruneExecutionDataFromRootToLatestSealed(t *testing.T) {
})(cancel)

require.NoError(t, LoopPruneExecutionDataFromRootToLatestSealed(
unittest.Logger(), metrics, ctx, ps, bdb, headers, chunkDataPacks, results, pdb, cfg,
ctx, unittest.Logger(), metrics, ps, bdb, headers, chunkDataPacks, results, pdb, cfg,
))

// verify the chunk data packs beyond the threshold are pruned
Expand Down
4 changes: 2 additions & 2 deletions engine/execution/pruner/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func NewChunkDataPackPruningEngine(
ready()

err := LoopPruneExecutionDataFromRootToLatestSealed(
log.With().Str("component", "CDP-pruner").Logger(), metrics,
ctx, state, badgerDB, headers, chunkDataPacks, results, chunkDataPacksDB, config)
ctx, log.With().Str("component", "CDP-pruner").Logger(), metrics,
state, badgerDB, headers, chunkDataPacks, results, chunkDataPacksDB, config)
if err != nil {
ctx.Throw(err)
}
Expand Down
2 changes: 1 addition & 1 deletion engine/execution/pruner/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ChunkDataPackPruner struct {

var _ executor.IterationExecutor = (*ChunkDataPackPruner)(nil)

func NewChunKDataPackPruner(chunkDataPacks storage.ChunkDataPacks, results storage.ExecutionResults) *ChunkDataPackPruner {
func NewChunkDataPackPruner(chunkDataPacks storage.ChunkDataPacks, results storage.ExecutionResults) *ChunkDataPackPruner {
return &ChunkDataPackPruner{
ChunkDataPackPruner: pruners.NewChunkDataPackPruner(chunkDataPacks, results),
}
Expand Down
8 changes: 4 additions & 4 deletions module/block_iterator/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func IterateExecuteAndCommitInBatch(
total := 0
defer func() {
log.Info().Str("duration", time.Since(startTime).String()).
Int("total_block_pruned", total).
Msg("pruning completed")
Int("total_block_executed", total).
Msg("block iteration and execution completed")
}()

for {
Expand Down Expand Up @@ -94,10 +94,10 @@ func IterateExecuteAndCommitInBatch(
break
}

// prune all the data indexed by the block
// execute all the data indexed by the block
err = executor.ExecuteByBlockID(blockID, batch)
if err != nil {
return fmt.Errorf("failed to prune by block ID %v: %w", blockID, err)
return fmt.Errorf("failed to execute by block ID %v: %w", blockID, err)
}
iteratedCountInCurrentBatch++
total++
Expand Down

0 comments on commit 4c91379

Please sign in to comment.