Skip to content

Commit

Permalink
Merge pull request #5463 from onflow/leo/disable-execution-data-pruner
Browse files Browse the repository at this point in the history
Disable execution data pruner
  • Loading branch information
zhangchiqing authored Feb 28, 2024
2 parents 915d8e1 + 122f249 commit 1726b7b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/execution_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ func (builder *ExecutionNodeBuilder) LoadComponentsAndModules() {
Component("execution state", exeNode.LoadExecutionState).
Component("stop control", exeNode.LoadStopControl).
Component("execution state ledger WAL compactor", exeNode.LoadExecutionStateLedgerWALCompactor).
Component("execution data pruner", exeNode.LoadExecutionDataPruner).
// disable execution data pruner for now, since storehouse is going to need the execution data
// for recovery,
// TODO: will re-visit this once storehouse has implemented new WAL for checkpoint file of
// payloadless trie.
// Component("execution data pruner", exeNode.LoadExecutionDataPruner).
Component("blob service", exeNode.LoadBlobService).
Component("block data upload manager", exeNode.LoadBlockUploaderManager).
Component("GCP block data uploader", exeNode.LoadGCPBlockDataUploader).
Expand Down
4 changes: 4 additions & 0 deletions module/executiondatasync/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func NewProvider(
storage tracker.Storage,
opts ...ProviderOption,
) *ExecutionDataProvider {
if storage == nil {
storage = &tracker.NoopStorage{}
}

p := &ExecutionDataProvider{
logger: logger.With().Str("component", "execution_data_provider").Logger(),
metrics: metrics,
Expand Down
29 changes: 29 additions & 0 deletions module/executiondatasync/tracker/noop.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package tracker

import "github.com/ipfs/go-cid"

type NoopStorage struct{}

var _ Storage = (*NoopStorage)(nil)

func (s *NoopStorage) Update(update UpdateFn) error {
return update(func(blockHeight uint64, cids ...cid.Cid) error {
return nil
})
}

func (s *NoopStorage) GetFulfilledHeight() (uint64, error) {
return 0, nil
}

func (s *NoopStorage) SetFulfilledHeight(uint64) error {
return nil
}

func (s *NoopStorage) GetPrunedHeight() (uint64, error) {
return 0, nil
}

func (s *NoopStorage) PruneUpToHeight(height uint64) error {
return nil
}

0 comments on commit 1726b7b

Please sign in to comment.