Skip to content

Commit

Permalink
remove unused ingestion and metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Oct 1, 2024
1 parent 7d782c8 commit 51b9301
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 1,902 deletions.
2 changes: 1 addition & 1 deletion cmd/bootstrap/utils/md5.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package utils

// The google storage API only provides md5 and crc32 hence overriding the linter flag for md5
// #nosec
import (
// #nosec
"crypto/md5"
"io"
"os"
Expand Down
52 changes: 7 additions & 45 deletions cmd/execution_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import (
txmetrics "github.com/onflow/flow-go/engine/execution/computation/metrics"
"github.com/onflow/flow-go/engine/execution/ingestion"
"github.com/onflow/flow-go/engine/execution/ingestion/fetcher"
"github.com/onflow/flow-go/engine/execution/ingestion/loader"
"github.com/onflow/flow-go/engine/execution/ingestion/stop"
"github.com/onflow/flow-go/engine/execution/ingestion/uploader"
exeprovider "github.com/onflow/flow-go/engine/execution/provider"
Expand Down Expand Up @@ -1081,61 +1080,24 @@ func (exeNode *ExecutionNode) LoadIngestionEngine(
exeNode.collectionRequester = reqEng
}

if exeNode.exeConf.enableNewIngestionEngine {
_, core, err := ingestion.NewMachine(
node.Logger,
node.ProtocolEvents,
exeNode.collectionRequester,
colFetcher,
node.Storage.Headers,
node.Storage.Blocks,
node.Storage.Collections,
exeNode.executionState,
node.State,
exeNode.collector,
exeNode.computationManager,
exeNode.providerEngine,
exeNode.blockDataUploader,
exeNode.stopControl,
)

return core, err
}

var blockLoader ingestion.BlockLoader
if exeNode.exeConf.enableStorehouse {
blockLoader = loader.NewUnfinalizedLoader(node.Logger, node.State, node.Storage.Headers, exeNode.executionState)
} else {
blockLoader = loader.NewUnexecutedLoader(node.Logger, node.State, node.Storage.Headers, exeNode.executionState)
}

ingestionEng, err := ingestion.New(
exeNode.ingestionUnit,
_, core, err := ingestion.NewMachine(
node.Logger,
node.EngineRegistry,
node.ProtocolEvents,
exeNode.collectionRequester,
colFetcher,
node.Storage.Headers,
node.Storage.Blocks,
node.Storage.Collections,
exeNode.computationManager,
exeNode.providerEngine,
exeNode.executionState,
node.State,
exeNode.collector,
node.Tracer,
exeNode.exeConf.extensiveLog,
exeNode.executionDataPruner,
exeNode.computationManager,
exeNode.providerEngine,
exeNode.blockDataUploader,
exeNode.stopControl,
blockLoader,
)

// TODO: we should solve these mutual dependencies better
// => https://github.com/dapperlabs/flow-go/issues/4360
exeNode.collectionRequester.WithHandle(ingestionEng.OnCollection)

node.ProtocolEvents.AddConsumer(ingestionEng)

return ingestionEng, err
return core, err
}

// create scripts engine for handling script execution
Expand Down
13 changes: 7 additions & 6 deletions cmd/execution_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ type ExecutionConfig struct {
// It works around an issue where some collection nodes are not configured with enough
// this works around an issue where some collection nodes are not configured with enough
// file descriptors causing connection failures.
onflowOnlyLNs bool
enableStorehouse bool
enableChecker bool
enableNewIngestionEngine bool
publicAccessID string
onflowOnlyLNs bool
enableStorehouse bool
enableChecker bool
publicAccessID string
}

func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) {
Expand Down Expand Up @@ -132,7 +131,9 @@ func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) {
flags.BoolVar(&exeConf.onflowOnlyLNs, "temp-onflow-only-lns", false, "do not use unless required. forces node to only request collections from onflow collection nodes")
flags.BoolVar(&exeConf.enableStorehouse, "enable-storehouse", false, "enable storehouse to store registers on disk, default is false")
flags.BoolVar(&exeConf.enableChecker, "enable-checker", true, "enable checker to check the correctness of the execution result, default is true")
flags.BoolVar(&exeConf.enableNewIngestionEngine, "enable-new-ingestion-engine", true, "enable new ingestion engine, default is true")
// deprecated. Retain it to prevent nodes that previously had this configuration from crashing.
var deprecatedEnableNewIngestionEngine bool
flags.BoolVar(&deprecatedEnableNewIngestionEngine, "enable-new-ingestion-engine", true, "enable new ingestion engine, default is true")
flags.StringVar(&exeConf.publicAccessID, "public-access-id", "", "public access ID for the node")

}
Expand Down
8 changes: 8 additions & 0 deletions engine/execution/ingestion/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,14 @@ func (e *Core) onBlockExecuted(
return nil
}

func nonSystemTransactionCount(result flow.ExecutionResult) uint64 {
count := uint64(0)
for _, chunk := range result.Chunks {
count += chunk.NumberOfTransactions
}
return count
}

func (e *Core) onCollection(col *flow.Collection) error {
colID := col.ID()
e.log.Info().
Expand Down
Loading

0 comments on commit 51b9301

Please sign in to comment.