-
Notifications
You must be signed in to change notification settings - Fork 195
[Access] Refactor storage collections for access node #7093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
eca55cd
fde54c9
a109af6
f326355
435b991
6cd812c
208fb81
a5f43fb
705399d
b70d475
5013f21
3287ed1
07288a9
f38988b
1a15b10
e4bf8e5
99bbf77
14469d0
db502ad
35692d7
127859b
cbb01aa
311b44b
a9c3140
6ab6b8c
7053720
2267d64
e1455ee
a77dede
509efe7
dab7142
2bd20e8
80a2eaf
57e4c8e
d343b5c
78dec17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,6 +144,7 @@ type ExecutionNode struct { | |
receipts storageerr.ExecutionReceipts | ||
myReceipts storageerr.MyExecutionReceipts | ||
commits storageerr.Commits | ||
collections storageerr.Collections | ||
|
||
chunkDataPackDB *pebble.DB | ||
chunkDataPacks storageerr.ChunkDataPacks | ||
|
@@ -194,9 +195,6 @@ func (builder *ExecutionNodeBuilder) LoadComponentsAndModules() { | |
AdminCommand("set-uploader-enabled", func(config *NodeConfig) commands.AdminCommand { | ||
return uploaderCommands.NewToggleUploaderCommand(exeNode.blockDataUploader) | ||
}). | ||
AdminCommand("get-transactions", func(conf *NodeConfig) commands.AdminCommand { | ||
return storageCommands.NewGetTransactionsCommand(conf.State, conf.Storage.Payloads, conf.Storage.Collections) | ||
}). | ||
AdminCommand("protocol-snapshot", func(conf *NodeConfig) commands.AdminCommand { | ||
return storageCommands.NewProtocolSnapshotCommand( | ||
conf.Logger, | ||
|
@@ -206,6 +204,7 @@ func (builder *ExecutionNodeBuilder) LoadComponentsAndModules() { | |
exeNode.exeConf.triedir, | ||
) | ||
}). | ||
Module("load collections", exeNode.LoadCollections). | ||
Module("mutable follower state", exeNode.LoadMutableFollowerState). | ||
Module("system specs", exeNode.LoadSystemSpecs). | ||
Module("execution metrics", exeNode.LoadExecutionMetrics). | ||
|
@@ -218,6 +217,9 @@ func (builder *ExecutionNodeBuilder) LoadComponentsAndModules() { | |
Module("blobservice peer manager dependencies", exeNode.LoadBlobservicePeerManagerDependencies). | ||
Module("bootstrap", exeNode.LoadBootstrapper). | ||
Module("register store", exeNode.LoadRegisterStore). | ||
AdminCommand("get-transactions", func(conf *NodeConfig) commands.AdminCommand { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why move this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the That said, this change should be in a different PR, let me check. |
||
return storageCommands.NewGetTransactionsCommand(conf.State, conf.Storage.Payloads, exeNode.collections) | ||
}). | ||
Component("execution state ledger", exeNode.LoadExecutionStateLedger). | ||
|
||
// TODO: Modules should be able to depends on components | ||
|
@@ -259,6 +261,13 @@ func (builder *ExecutionNodeBuilder) LoadComponentsAndModules() { | |
Component("grpc server", exeNode.LoadGrpcServer) | ||
} | ||
|
||
func (exeNode *ExecutionNode) LoadCollections(node *NodeConfig) error { | ||
db := badgerimpl.ToDB(node.DB) | ||
transactions := store.NewTransactions(node.Metrics.Cache, db) | ||
exeNode.collections = store.NewCollections(db, transactions) | ||
return nil | ||
} | ||
|
||
func (exeNode *ExecutionNode) LoadMutableFollowerState(node *NodeConfig) error { | ||
// For now, we only support state implementations from package badger. | ||
// If we ever support different implementations, the following can be replaced by a type-aware factory | ||
|
@@ -467,7 +476,7 @@ func (exeNode *ExecutionNode) LoadGCPBlockDataUploader( | |
asyncUploader, | ||
node.Storage.Blocks, | ||
exeNode.commits, | ||
node.Storage.Collections, | ||
exeNode.collections, | ||
exeNode.events, | ||
exeNode.results, | ||
exeNode.txResults, | ||
|
@@ -745,7 +754,7 @@ func (exeNode *ExecutionNode) LoadExecutionState( | |
return nil | ||
}) | ||
chunkDataPacks := store.NewChunkDataPacks(node.Metrics.Cache, | ||
pebbleimpl.ToDB(chunkDataPackDB), node.Storage.Collections, exeNode.exeConf.chunkDataPackCacheSize) | ||
pebbleimpl.ToDB(chunkDataPackDB), exeNode.collections, exeNode.exeConf.chunkDataPackCacheSize) | ||
|
||
getLatestFinalized := func() (uint64, error) { | ||
final, err := node.State.Final().Head() | ||
|
@@ -763,7 +772,6 @@ func (exeNode *ExecutionNode) LoadExecutionState( | |
exeNode.commits, | ||
node.Storage.Blocks, | ||
node.Storage.Headers, | ||
node.Storage.Collections, | ||
chunkDataPacks, | ||
exeNode.results, | ||
exeNode.myReceipts, | ||
|
@@ -1107,7 +1115,7 @@ func (exeNode *ExecutionNode) LoadIngestionEngine( | |
colFetcher, | ||
node.Storage.Headers, | ||
node.Storage.Blocks, | ||
node.Storage.Collections, | ||
exeNode.collections, | ||
exeNode.executionState, | ||
node.State, | ||
exeNode.collector, | ||
|
Uh oh!
There was an error while loading. Please reload this page.