Skip to content

Commit 2b44fd9

Browse files
committed
remove execution data mode
1 parent 53d2093 commit 2b44fd9

File tree

7 files changed

+27
-67
lines changed

7 files changed

+27
-67
lines changed

cmd/access/node_builder/access_node_builder.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ type AccessNodeConfig struct {
161161
rpcMetricsEnabled bool
162162
executionDataSyncEnabled bool
163163
publicNetworkExecutionDataEnabled bool
164-
executionDataDBMode string
165164
executionDataPrunerHeightRangeTarget uint64
166165
executionDataPrunerThreshold uint64
167166
executionDataPruningInterval time.Duration
@@ -277,7 +276,6 @@ func DefaultAccessNodeConfig() *AccessNodeConfig {
277276
MaxRetryDelay: edrequester.DefaultMaxRetryDelay,
278277
},
279278
executionDataIndexingEnabled: false,
280-
executionDataDBMode: execution_data.ExecutionDataDBModePebble.String(),
281279
executionDataPrunerHeightRangeTarget: 0,
282280
executionDataPrunerThreshold: pruner.DefaultThreshold,
283281
executionDataPruningInterval: pruner.DefaultPruningInterval,
@@ -591,7 +589,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
591589
Module("execution data datastore and blobstore", func(node *cmd.NodeConfig) error {
592590
var err error
593591
builder.ExecutionDatastoreManager, err = edstorage.CreateDatastoreManager(
594-
node.Logger, builder.executionDataDir, builder.executionDataDBMode)
592+
node.Logger, builder.executionDataDir)
595593
if err != nil {
596594
return fmt.Errorf("could not create execution data datastore manager: %w", err)
597595
}
@@ -1362,10 +1360,13 @@ func (builder *FlowAccessNodeBuilder) extraFlags() {
13621360
"execution-data-max-retry-delay",
13631361
defaultConfig.executionDataConfig.MaxRetryDelay,
13641362
"maximum delay for exponential backoff when fetching execution data fails e.g. 5m")
1365-
flags.StringVar(&builder.executionDataDBMode,
1363+
1364+
var builderexecutionDataDBMode string
1365+
flags.StringVar(&builderexecutionDataDBMode,
13661366
"execution-data-db",
1367-
defaultConfig.executionDataDBMode,
1368-
"[experimental] the DB type for execution datastore. One of [badger, pebble]")
1367+
"pebble",
1368+
"[deprecated] the DB type for execution datastore")
1369+
13691370
flags.Uint64Var(&builder.executionDataPrunerHeightRangeTarget,
13701371
"execution-data-height-range-target",
13711372
defaultConfig.executionDataPrunerHeightRangeTarget,

cmd/execution_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ func (exeNode *ExecutionNode) LoadExecutionDataDatastore(
716716
node *NodeConfig,
717717
) (err error) {
718718
exeNode.executionDataDatastore, err = edstorage.CreateDatastoreManager(
719-
node.Logger, exeNode.exeConf.executionDataDir, exeNode.exeConf.executionDataDBMode)
719+
node.Logger, exeNode.exeConf.executionDataDir)
720720
if err != nil {
721721
return fmt.Errorf("could not create execution data datastore manager: %w", err)
722722
}

cmd/execution_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ type ExecutionConfig struct {
5959
importCheckpointWorkerCount int
6060
transactionExecutionMetricsEnabled bool
6161
transactionExecutionMetricsBufferSize uint
62-
executionDataDBMode string
6362
scheduleCallbacksEnabled bool
6463

6564
computationConfig computation.ComputationConfig
@@ -136,10 +135,12 @@ func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) {
136135
flags.IntVar(&exeConf.importCheckpointWorkerCount, "import-checkpoint-worker-count", 10, "number of workers to import checkpoint file during bootstrap")
137136
flags.BoolVar(&exeConf.transactionExecutionMetricsEnabled, "tx-execution-metrics", true, "enable collection of transaction execution metrics")
138137
flags.UintVar(&exeConf.transactionExecutionMetricsBufferSize, "tx-execution-metrics-buffer-size", 200, "buffer size for transaction execution metrics. The buffer size is the number of blocks that are kept in memory by the metrics provider engine")
139-
flags.StringVar(&exeConf.executionDataDBMode,
138+
139+
var exeConfExecutionDataDBMode string
140+
flags.StringVar(&exeConfExecutionDataDBMode,
140141
"execution-data-db",
141142
execution_data.ExecutionDataDBModePebble.String(),
142-
"[experimental] the DB type for execution datastore. One of [badger, pebble]")
143+
"[deprecated] the DB type for execution datastore. it's been deprecated")
143144

144145
flags.BoolVar(&exeConf.onflowOnlyLNs, "temp-onflow-only-lns", false, "do not use unless required. forces node to only request collections from onflow collection nodes")
145146
flags.BoolVar(&exeConf.enableStorehouse, "enable-storehouse", false, "enable storehouse to store registers on disk, default is false")

cmd/observer/node_builder/observer_builder.go

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ type ObserverServiceConfig struct {
154154
logTxTimeToSealed bool
155155
executionDataSyncEnabled bool
156156
executionDataIndexingEnabled bool
157-
executionDataDBMode string
158157
executionDataPrunerHeightRangeTarget uint64
159158
executionDataPrunerThreshold uint64
160159
executionDataPruningInterval time.Duration
@@ -234,7 +233,6 @@ func DefaultObserverServiceConfig() *ObserverServiceConfig {
234233
logTxTimeToSealed: false,
235234
executionDataSyncEnabled: false,
236235
executionDataIndexingEnabled: false,
237-
executionDataDBMode: execution_data.ExecutionDataDBModePebble.String(),
238236
executionDataPrunerHeightRangeTarget: 0,
239237
executionDataPrunerThreshold: pruner.DefaultThreshold,
240238
executionDataPruningInterval: pruner.DefaultPruningInterval,
@@ -712,10 +710,9 @@ func (builder *ObserverServiceBuilder) extraFlags() {
712710
flags.BoolVar(&builder.localServiceAPIEnabled, "local-service-api-enabled", defaultConfig.localServiceAPIEnabled, "whether to use local indexed data for api queries")
713711
flags.StringVar(&builder.registersDBPath, "execution-state-dir", defaultConfig.registersDBPath, "directory to use for execution-state database")
714712
flags.StringVar(&builder.checkpointFile, "execution-state-checkpoint", defaultConfig.checkpointFile, "execution-state checkpoint file")
715-
flags.StringVar(&builder.executionDataDBMode,
716-
"execution-data-db",
717-
defaultConfig.executionDataDBMode,
718-
"[experimental] the DB type for execution datastore. One of [badger, pebble]")
713+
714+
var builderExecutionDataDBMode string
715+
flags.StringVar(&builderExecutionDataDBMode, "execution-data-db", "pebble", "[deprecated] the DB type for execution datastore.")
719716

720717
// Execution data pruner
721718
flags.Uint64Var(&builder.executionDataPrunerHeightRangeTarget,
@@ -1110,7 +1107,6 @@ func (builder *ObserverServiceBuilder) BuildExecutionSyncComponents() *ObserverS
11101107
var execDataDistributor *edrequester.ExecutionDataDistributor
11111108
var execDataCacheBackend *herocache.BlockExecutionData
11121109
var executionDataStoreCache *execdatacache.ExecutionDataCache
1113-
var executionDataDBMode execution_data.ExecutionDataDBMode
11141110

11151111
// setup dependency chain to ensure indexer starts after the requester
11161112
requesterDependable := module.NewProxiedReadyDoneAware()
@@ -1129,20 +1125,11 @@ func (builder *ObserverServiceBuilder) BuildExecutionSyncComponents() *ObserverS
11291125
return err
11301126
}
11311127

1132-
executionDataDBMode, err = execution_data.ParseExecutionDataDBMode(builder.executionDataDBMode)
1128+
builder.ExecutionDatastoreManager, err = edstorage.NewPebbleDatastoreManager(
1129+
node.Logger.With().Str("pebbledb", "endata").Logger(),
1130+
datastoreDir, nil)
11331131
if err != nil {
1134-
return fmt.Errorf("could not parse execution data DB mode: %w", err)
1135-
}
1136-
1137-
if executionDataDBMode == execution_data.ExecutionDataDBModePebble {
1138-
builder.ExecutionDatastoreManager, err = edstorage.NewPebbleDatastoreManager(
1139-
node.Logger.With().Str("pebbledb", "endata").Logger(),
1140-
datastoreDir, nil)
1141-
if err != nil {
1142-
return fmt.Errorf("could not create PebbleDatastoreManager for execution data: %w", err)
1143-
}
1144-
} else {
1145-
return fmt.Errorf("datastore with badger has been deprecated, please use pebble instead")
1132+
return fmt.Errorf("could not create PebbleDatastoreManager for execution data: %w", err)
11461133
}
11471134
ds = builder.ExecutionDatastoreManager.Datastore()
11481135

integration/tests/access/cohort3/execution_state_sync_test.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,14 @@ type ExecutionStateSyncSuite struct {
4848
ctx context.Context
4949
cancel context.CancelFunc
5050

51-
net *testnet.FlowNetwork
52-
executionDataDBMode execution_data.ExecutionDataDBMode
51+
net *testnet.FlowNetwork
5352
}
5453

5554
func (s *ExecutionStateSyncSuite) SetupTest() {
56-
s.setup(execution_data.ExecutionDataDBModePebble)
57-
}
58-
59-
func (s *ExecutionStateSyncSuite) setup(executionDataDBMode execution_data.ExecutionDataDBMode) {
6055
s.log = unittest.LoggerForTest(s.Suite.T(), zerolog.InfoLevel)
6156
s.log.Info().Msg("================> SetupTest")
6257
s.ctx, s.cancel = context.WithCancel(context.Background())
6358

64-
s.executionDataDBMode = executionDataDBMode
6559
s.buildNetworkConfig()
6660

6761
// start the network
@@ -95,7 +89,6 @@ func (s *ExecutionStateSyncSuite) buildNetworkConfig() {
9589
testnet.WithAdditionalFlag(fmt.Sprintf("--execution-data-dir=%s", testnet.DefaultExecutionDataServiceDir)),
9690
testnet.WithAdditionalFlag("--execution-data-retry-delay=1s"),
9791
testnet.WithAdditionalFlagf("--public-network-execution-data-sync-enabled=true"),
98-
testnet.WithAdditionalFlag(fmt.Sprintf("--execution-data-db=%s", s.executionDataDBMode.String())),
9992
)
10093

10194
// add the ghost (access) node config
@@ -135,7 +128,6 @@ func (s *ExecutionStateSyncSuite) buildNetworkConfig() {
135128
fmt.Sprintf("--execution-data-dir=%s", testnet.DefaultExecutionDataServiceDir),
136129
"--execution-data-sync-enabled=true",
137130
"--event-query-mode=execution-nodes-only",
138-
fmt.Sprintf("--execution-data-db=%s", s.executionDataDBMode.String()),
139131
},
140132
}}
141133

@@ -239,9 +231,7 @@ func (s *ExecutionStateSyncSuite) nodeExecutionDataStore(node *testnet.Container
239231
var err error
240232
dsPath := filepath.Join(node.ExecutionDataDBPath(), "blobstore")
241233

242-
if s.executionDataDBMode == execution_data.ExecutionDataDBModePebble {
243-
ds, err = pebbleds.NewDatastore(dsPath, nil)
244-
}
234+
ds, err = pebbleds.NewDatastore(dsPath, nil)
245235
require.NoError(s.T(), err, "could not get execution datastore")
246236

247237
return execution_data.NewExecutionDataStore(blobs.NewBlobstore(ds), execution_data.DefaultSerializer)

integration/tests/access/cohort3/pebble_execution_state_sync_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"testing"
55

66
"github.com/stretchr/testify/suite"
7-
8-
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
97
)
108

119
func TestPebbleExecutionStateSync(t *testing.T) {
@@ -16,10 +14,6 @@ type PebbleExecutionStateSync struct {
1614
ExecutionStateSyncSuite
1715
}
1816

19-
func (s *PebbleExecutionStateSync) SetupTest() {
20-
s.setup(execution_data.ExecutionDataDBModePebble)
21-
}
22-
2317
// TestPebbleDBHappyPath+ tests that Execution Nodes generate execution data, and Access Nodes are able to
2418
// successfully sync the data to pebble DB
2519
func (s *PebbleExecutionStateSync) TestPebbleDBHappyPath() {

module/executiondatasync/storage/datastore_factory.go

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import (
66
"path/filepath"
77

88
"github.com/rs/zerolog"
9-
10-
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
119
)
1210

1311
// CreateDatastoreManager creates a new datastore manager of the specified type.
1412
// It supports both Badger and Pebble datastores.
1513
func CreateDatastoreManager(
1614
logger zerolog.Logger,
1715
executionDataDir string,
18-
executionDataDBModeStr string,
1916
) (DatastoreManager, error) {
2017

2118
// create the datastore directory if it does not exist
@@ -25,24 +22,14 @@ func CreateDatastoreManager(
2522
return nil, err
2623
}
2724

28-
// parse the execution data DB mode
29-
executionDataDBMode, err := execution_data.ParseExecutionDataDBMode(executionDataDBModeStr)
30-
if err != nil {
31-
return nil, fmt.Errorf("could not parse execution data DB mode: %w", err)
32-
}
33-
3425
// create the appropriate datastore manager based on the DB mode
3526
var executionDatastoreManager DatastoreManager
36-
if executionDataDBMode == execution_data.ExecutionDataDBModePebble {
37-
logger.Info().Msgf("Using Pebble datastore for execution data at %s", datastoreDir)
38-
executionDatastoreManager, err = NewPebbleDatastoreManager(
39-
logger.With().Str("pebbledb", "endata").Logger(),
40-
datastoreDir, nil)
41-
if err != nil {
42-
return nil, fmt.Errorf("could not create PebbleDatastoreManager for execution data: %w", err)
43-
}
44-
} else {
45-
return nil, fmt.Errorf("does not support badger data store for execution data")
27+
logger.Info().Msgf("Using Pebble datastore for execution data at %s", datastoreDir)
28+
executionDatastoreManager, err = NewPebbleDatastoreManager(
29+
logger.With().Str("pebbledb", "endata").Logger(),
30+
datastoreDir, nil)
31+
if err != nil {
32+
return nil, fmt.Errorf("could not create PebbleDatastoreManager for execution data: %w", err)
4633
}
4734

4835
return executionDatastoreManager, nil

0 commit comments

Comments
 (0)