Skip to content
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

[EFM] Sync master -> feature/efm-recovery #6332

Merged
merged 224 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
54e7c1e
Added basic connection to VersionControl
Guitarheroua May 29, 2024
cf375f5
Added basic connection to VersionControl
Guitarheroua May 29, 2024
3591ead
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jun 11, 2024
6e315a8
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jun 13, 2024
8c92ca1
Added script executor test
Guitarheroua Jun 14, 2024
17b545e
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jun 19, 2024
3134a63
Added tests
Guitarheroua Jun 20, 2024
eee1b8c
Merge branch 'master' into AndriiSlisarchuk/5789-version-control-inte…
Guitarheroua Jun 20, 2024
5fde816
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jul 2, 2024
472f05f
Fixed remarks
Guitarheroua Jul 3, 2024
cc26ec3
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jul 3, 2024
199eff6
Fixed test
Guitarheroua Jul 3, 2024
79293de
Added skeleton for storage db interface for execution data and pebble…
UlyanaAndrukhiv Jul 4, 2024
a6607f6
Added extra flag for pebble db to AN and ON, updated tracker storage
UlyanaAndrukhiv Jul 4, 2024
cc483f0
Merge branch 'master' of github.com:The-K-R-O-K/flow-go into UlyanaAn…
UlyanaAndrukhiv Jul 4, 2024
e674089
Updated imports name
UlyanaAndrukhiv Jul 4, 2024
1c106c0
Added StorageItem interface for storage element
UlyanaAndrukhiv Jul 4, 2024
9c2eb41
Merged with master
UlyanaAndrukhiv Jul 8, 2024
bc3fecd
Updated flow/go-ethereum version to newer according pebble datastore …
UlyanaAndrukhiv Jul 8, 2024
fa6c296
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 8, 2024
9c51532
Updated Keys method for badger wrapper
UlyanaAndrukhiv Jul 8, 2024
bfcdc3a
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 9, 2024
9132f86
Updated imports name
UlyanaAndrukhiv Jul 9, 2024
22fdd73
Updated go-ethereum version
UlyanaAndrukhiv Jul 9, 2024
bf0fe01
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jul 10, 2024
a1d69e3
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jul 10, 2024
cef8873
Fixed script executor remarks
Guitarheroua Jul 10, 2024
d2274f4
Merge branch 'master' into AndriiSlisarchuk/5789-version-control-inte…
Guitarheroua Jul 11, 2024
1a5453d
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jul 16, 2024
78555c5
Fixed initialization order
Guitarheroua Jul 17, 2024
409687e
Added ExecutionDataDBMode
UlyanaAndrukhiv Jul 17, 2024
6594f6c
Added consumer progress impl for pebble storage
UlyanaAndrukhiv Jul 17, 2024
47eec47
Updated imports name, updated AN, ON builders according to execution …
UlyanaAndrukhiv Jul 17, 2024
5a65a49
Merged with master
UlyanaAndrukhiv Jul 17, 2024
a5a4187
add support for detecting if accounts differ without reporting differ…
turbolent Jul 17, 2024
de2ff4b
go mod tidy
turbolent Jul 17, 2024
81442ee
Reverted back tracker changes
UlyanaAndrukhiv Jul 18, 2024
4ba781b
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 18, 2024
4efe3af
Reverted back using new pebble ConsumerProgress, updated execution da…
UlyanaAndrukhiv Jul 18, 2024
49945aa
Merge branch 'UlyanaAndrukhiv/6017-pebble-as-execution-datastore-db' …
UlyanaAndrukhiv Jul 18, 2024
bc2b46c
Updated observer builder
UlyanaAndrukhiv Jul 18, 2024
6851b55
Renamed stogare interface, removed unnecessary calls for it
UlyanaAndrukhiv Jul 18, 2024
83c00f0
Removed flag from integration test
UlyanaAndrukhiv Jul 18, 2024
b62c4bb
Added skeleton for new rest call
AndriiDiachuk Jul 19, 2024
8197027
Merge branch 'AndriiSlisarchuk/5788-version-control-module' of github…
Guitarheroua Jul 23, 2024
2871bc9
fixed remarks
Guitarheroua Jul 23, 2024
f6d6999
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 23, 2024
4161837
Added tear down
Guitarheroua Jul 23, 2024
653d970
Added rest call model and implementation for method
AndriiDiachuk Jul 23, 2024
78097d5
Updated pebble and badger wrapper according to renaming
UlyanaAndrukhiv Jul 23, 2024
f53dd08
Updated go-ds-pebble version, updated pebble storage wrapper accordin…
UlyanaAndrukhiv Jul 23, 2024
3a8734a
cleanup
ramtinms Jul 23, 2024
ccef0d9
typos
ramtinms Jul 23, 2024
5097bcb
clean up
ramtinms Jul 23, 2024
a62f2a8
clean up
ramtinms Jul 23, 2024
469e90c
code deduplication
ramtinms Jul 24, 2024
6f17c14
fix typo
ramtinms Jul 24, 2024
b8e319c
move balance rounding error check to emulator
ramtinms Jul 24, 2024
cbf3f60
fix test
ramtinms Jul 24, 2024
65f7c3d
clean up
ramtinms Jul 24, 2024
637b013
clean up
ramtinms Jul 24, 2024
2e0966f
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 24, 2024
8f73879
fixing typos
ramtinms Jul 24, 2024
b9c884b
Merge branch 'ramtin/evm-code-cleanup-and-doc-improvement-part2' of g…
ramtinms Jul 24, 2024
e6b83e0
Added tests for account balance call
AndriiDiachuk Jul 24, 2024
4a05acf
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 24, 2024
a22d5c8
Merge branch 'master' into AndriiSlisarchuk/5789-version-control-inte…
Guitarheroua Jul 24, 2024
b19e1ca
Renamed new types, added godoc
UlyanaAndrukhiv Jul 24, 2024
85b0400
Merge branch 'UlyanaAndrukhiv/6017-pebble-as-execution-datastore-db' …
UlyanaAndrukhiv Jul 24, 2024
8e145f9
Added intergration test for pebble db
UlyanaAndrukhiv Jul 24, 2024
847a4e5
fixed remark
Guitarheroua Jul 24, 2024
540972b
Added comments
Guitarheroua Jul 24, 2024
02eb4b0
Added more description in a code
Guitarheroua Jul 24, 2024
50da13c
improve emulator tests
ramtinms Jul 24, 2024
480d608
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 24, 2024
9ca4eb5
update tests
ramtinms Jul 24, 2024
15c9030
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 24, 2024
2199e2e
Updated documentation
UlyanaAndrukhiv Jul 25, 2024
105e26b
Updated godoc according to comments
UlyanaAndrukhiv Jul 25, 2024
8ceef54
Update engine/access/rest/routes/account_balance.go
AndriiDiachuk Jul 25, 2024
5c468a3
Merge branch 'master' into add-rest-endpoint-GetAccountsBalance
AndriiDiachuk Jul 25, 2024
e02ed46
Added request for new call
AndriiDiachuk Jul 25, 2024
97c945d
Added test for get account keys request
AndriiDiachuk Jul 25, 2024
a0c2d70
Added missing implementation parts and added test for GetAccountKeys …
AndriiDiachuk Jul 25, 2024
444babb
Linted, added missing proxy handler method fot GetAccountBalance call
AndriiDiachuk Jul 25, 2024
80fe193
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 25, 2024
8fa71f7
Fixed remarks from comments
AndriiDiachuk Jul 26, 2024
b0aa121
Merge branch 'master' into add-rest-endpoint-GetAccountsBalance
AndriiDiachuk Jul 26, 2024
f67a91b
Added missing test cases
AndriiDiachuk Jul 26, 2024
5ee18ea
Added missing else keyword
AndriiDiachuk Jul 26, 2024
38738ac
Merge branch 'add-rest-endpoint-GetAccountsBalance' of github.com:And…
AndriiDiachuk Jul 26, 2024
22630f6
Updated normalizeUrl function
AndriiDiachuk Jul 26, 2024
58af3ec
Merge branch 'master' into add-rest-endpoint-GetAccountKeys
AndriiDiachuk Jul 26, 2024
07d5510
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 26, 2024
fd1e178
use [email protected]
jordanschalm Jul 28, 2024
4a09cd5
make tidy
jordanschalm Jul 28, 2024
7e73ba3
Merge branch 'master' into jord/merge-efm-recovery-crescendo
jordanschalm Jul 28, 2024
917b2d2
remove reference to recover_epoch tx
jordanschalm Jul 28, 2024
46d0d91
Revert "remove reference to recover_epoch tx"
jordanschalm Jul 28, 2024
0fd15f6
remove unused recover-epoch test utils
jordanschalm Jul 28, 2024
114e246
update bn2 command
jordanschalm Jul 29, 2024
7ac6037
typo
jordanschalm Jul 29, 2024
a287b1a
bump extension length
jordanschalm Jul 29, 2024
c89c383
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 29, 2024
bdb3f45
implement program recovery for fungible tokens
turbolent Jul 29, 2024
35ee1da
improve reporting of cyclic link migration errors
turbolent Jul 29, 2024
9a381e6
always report checking errors for system contracts
turbolent Jul 29, 2024
b536559
add a test case for Mainnet's SystemContractChanges
turbolent Jul 29, 2024
9464095
Merge branch 'master' into bastian/fungible-token-program-recovery
turbolent Jul 30, 2024
8ff3fde
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 30, 2024
8f6580e
Merge branch 'master' into add-rest-endpoint-GetAccountsBalance
AndriiDiachuk Jul 30, 2024
a346c90
Merge branch 'add-rest-endpoint-GetAccountsBalance' of github.com:And…
AndriiDiachuk Jul 30, 2024
201414e
Added missing test for router
AndriiDiachuk Jul 30, 2024
9bf6848
Updated according to comments
UlyanaAndrukhiv Jul 30, 2024
6fa2660
Merge branch 'master' of github.com:AndriiDiachuk/flow-go into add-re…
AndriiDiachuk Jul 30, 2024
a849f01
Merge branch 'master' into add-rest-endpoint-GetAccountKeys
AndriiDiachuk Jul 30, 2024
ee8bd3c
Update engine/access/rpc/backend/script_executor.go
Guitarheroua Jul 30, 2024
513d6be
Updated documentation for integration test
UlyanaAndrukhiv Jul 30, 2024
91abece
Merge branch 'master' into jord/merge-efm-recovery-crescendo
jordanschalm Jul 30, 2024
cb4b8ae
Added comment for pebble CillectGarbage
UlyanaAndrukhiv Jul 30, 2024
a43122d
Merge pull request #6279 from onflow/bastian/improve-cyclic-link-repo…
turbolent Jul 30, 2024
ba46534
Merge pull request #6280 from onflow/bastian/report-import-contract-c…
turbolent Jul 30, 2024
fe90d86
Fixed normilizeUrl function to habdle /keys case
AndriiDiachuk Jul 30, 2024
ba8c00d
Added tests with mulpiple keys cases
AndriiDiachuk Jul 30, 2024
6f9367a
Merge branch 'master' into add-rest-endpoint-GetAccountKeys
AndriiDiachuk Jul 30, 2024
5f43ff4
Update model/flow/epoch.go
jordanschalm Jul 30, 2024
1fa427e
Merge branch 'master' into jord/merge-efm-recovery-crescendo
jordanschalm Jul 30, 2024
c158096
Merge pull request #6270 from onflow/jord/merge-efm-recovery-crescendo
jordanschalm Jul 30, 2024
0cc5a75
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
ramtinms Jul 30, 2024
6c46cee
improve naming
turbolent Jul 30, 2024
e7d2475
enable program recovery on all networks but Mainnet
turbolent Jul 30, 2024
bab6314
implement new functions required by current FungibleToken standard
turbolent Jul 30, 2024
c9ad7ca
test program recovery in checking migration
turbolent Jul 30, 2024
234a346
Merge branch 'master' into bastian/fungible-token-program-recovery
turbolent Jul 30, 2024
0e6de67
add new required argument
turbolent Jul 30, 2024
f283050
Merge pull request #6253 from AndriiDiachuk/add-rest-endpoint-GetAcco…
peterargue Jul 31, 2024
5884847
Merge pull request #6278 from onflow/bastian/fungible-token-program-r…
turbolent Jul 31, 2024
769f5d7
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 31, 2024
b3854ee
Update engine/access/rest/models/account.go
AndriiDiachuk Jul 31, 2024
bc6862c
Fixed remarks
AndriiDiachuk Jul 31, 2024
46303a4
Updated the replace
UlyanaAndrukhiv Jul 31, 2024
51b1085
Merge branch 'UlyanaAndrukhiv/6017-pebble-as-execution-datastore-db' …
UlyanaAndrukhiv Jul 31, 2024
27c7349
Merged
AndriiDiachuk Jul 31, 2024
0f1d457
Update to Cadence v1.0.0-preview.42
turbolent Jul 31, 2024
fe3da4c
add new parameter to MigratedPathCapability
turbolent Jul 31, 2024
60e14fd
Merge pull request #6288 from onflow/auto-update-onflow-cadence-v1.0.…
turbolent Jul 31, 2024
406a64a
Merge branch 'master' into UlyanaAndrukhiv/6017-pebble-as-execution-d…
UlyanaAndrukhiv Jul 31, 2024
fe6313c
deprecate legacy self destruct
ramtinms Jul 31, 2024
d719f5f
Merge pull request #6180 from The-K-R-O-K/UlyanaAndrukhiv/6017-pebble…
peterargue Jul 31, 2024
291965e
Merge pull request #6264 from AndriiDiachuk/add-rest-endpoint-GetAcco…
Guitarheroua Aug 1, 2024
f040a44
Merge branch 'master' into AndriiSlisarchuk/5789-version-control-inte…
Guitarheroua Aug 1, 2024
3e9b1a5
Fixed remarks
Guitarheroua Aug 1, 2024
1f2e3e3
Merge branch 'AndriiSlisarchuk/5789-version-control-integration-to-sc…
Guitarheroua Aug 1, 2024
d450093
Merge branch 'master' into ramtin/evm-depricate-legacy-self-destruct
sideninja Aug 1, 2024
e66fe24
Merge pull request #6134 from The-K-R-O-K/AndriiSlisarchuk/5789-versi…
Guitarheroua Aug 2, 2024
0324a9f
Merge branch 'master' into ramtin/evm-code-cleanup-and-doc-improvemen…
sideninja Aug 2, 2024
8c89495
Merge pull request #6252 from onflow/ramtin/evm-code-cleanup-and-doc-…
ramtinms Aug 2, 2024
c5b9e46
Merge pull request #6225 from onflow/bastian/account-diff
turbolent Aug 2, 2024
fd0a128
fix collection ID check
ramtinms Aug 5, 2024
fbd4fdf
check in flight data for account exist check
ramtinms Aug 5, 2024
cdcba60
Merge branch 'ramtin/evm-depricate-legacy-self-destruct' into ramtin/…
ramtinms Aug 5, 2024
935bd69
add tests
ramtinms Aug 5, 2024
e599782
update test
ramtinms Aug 5, 2024
1a5b953
improve factory pattern tests
ramtinms Aug 6, 2024
f421ded
keep the check on nil for methods
ramtinms Aug 7, 2024
0f87b8d
add test for proxy call tracing
ramtinms Aug 7, 2024
0d1d79f
fix test
ramtinms Aug 7, 2024
d3d2db2
add debug logs for tracer
ramtinms Aug 7, 2024
a257952
.
ramtinms Aug 7, 2024
1e56d00
Merge branch 'master' into ramtin/evm-depricate-legacy-self-destruct
ramtinms Aug 7, 2024
d962cfb
Fixed bug with option
UlyanaAndrukhiv Aug 7, 2024
320071d
Added more tests, refactored blocks tests
UlyanaAndrukhiv Aug 7, 2024
13f48dc
fix merge conflicts
ramtinms Aug 7, 2024
050505d
add tracer reset
ramtinms Aug 7, 2024
b46a84b
move reset to higher level
ramtinms Aug 7, 2024
2bd1062
Merge pull request #6289 from onflow/ramtin/evm-depricate-legacy-self…
ramtinms Aug 7, 2024
698a8d0
Merge pull request #6295 from onflow/ramtin/evm-patch-storage-root-issue
j1010001 Aug 7, 2024
040f853
Merge branch 'master' into ramtin/evm-patch-tracer
j1010001 Aug 7, 2024
27abb83
Set Capability issue handler
SupunS Aug 7, 2024
29ec7b8
Merge pull request #6303 from onflow/supun/fix-cap-migration
j1010001 Aug 7, 2024
762d8bb
Merge branch 'master' into ramtin/evm-patch-tracer
ramtinms Aug 8, 2024
1dd0921
Merge pull request #6299 from onflow/ramtin/evm-patch-tracer
ramtinms Aug 8, 2024
73cdded
Merge branch 'master' into UlyanaAndrukhiv/6056-rest-select-option-bug
UlyanaAndrukhiv Aug 8, 2024
e4ab7ed
fix formatting of addresses in error messages
turbolent Aug 8, 2024
1d177c9
use new StorageCapMigration and add IssueStorageCapConMigration
turbolent Aug 8, 2024
da47e87
Add reproducer for cap-migration accessing two accounts
SupunS Aug 8, 2024
8c28fee
Update to Cadence v1.0.0-preview.43
SupunS Aug 8, 2024
97bc1d9
Add reporting to issue storage capcon
SupunS Aug 8, 2024
f4e316a
Merge pull request #6306 from onflow/bastian/fix-storage-cap-migration
SupunS Aug 8, 2024
142633b
Add reproducer
SupunS Aug 9, 2024
7979b5a
Merge branch 'master' into UlyanaAndrukhiv/6056-rest-select-option-bug
UlyanaAndrukhiv Aug 9, 2024
610abde
Merge pull request #6300 from The-K-R-O-K/UlyanaAndrukhiv/6056-rest-s…
Guitarheroua Aug 9, 2024
8f7b413
Restructured logic for processing epoch recover to avoid a case where…
durkmurder Aug 9, 2024
2158798
Merge pull request #6313 from onflow/yurii/efm-recovery-event-process…
jordanschalm Aug 9, 2024
5dae66b
Report and skip storage caps with no borrow type
SupunS Aug 9, 2024
d3ea857
Update to cadence v1.0.0-preview.44
SupunS Aug 9, 2024
69c5da9
Merge branch 'master' of https://github.com/onflow/flow-go into supun…
SupunS Aug 9, 2024
a53b9b8
Merge pull request #6312 from onflow/supun/fix-storage-cap-migration
SupunS Aug 9, 2024
71b47e8
merge changes after issuing cap cons
turbolent Aug 10, 2024
c8d1209
commit changes to storage
turbolent Aug 10, 2024
31f8c09
add tests
turbolent Aug 10, 2024
263f1c4
Merge pull request #6315 from onflow/bastian/fix-issue-storage-cap-co…
SupunS Aug 10, 2024
4031014
Update to Cadence v1.0.0-preview.44
turbolent Aug 11, 2024
d04c252
Merge pull request #6317 from onflow/auto-update-onflow-cadence-v1.0.…
turbolent Aug 12, 2024
1bdf71a
Avoid conversion from sema-type to StaticType in storage cap migration
SupunS Aug 12, 2024
edee8b7
Rename EpochCommitSafetyThreshold -> FinalizationSafetyThreshold
durkmurder Aug 12, 2024
c2fa794
Update to cadence v1.0.0-preview.45
SupunS Aug 12, 2024
5807882
Add comment
SupunS Aug 12, 2024
24c54c5
Merge pull request #6323 from onflow/yurii/kvstore-member-rename
durkmurder Aug 12, 2024
d63da0e
Merge pull request #6322 from onflow/supun/refactor-storage-cap-migra…
turbolent Aug 12, 2024
9ce6926
Update to Cadence v1.0.0-preview.46
turbolent Aug 12, 2024
78f29cd
Update to match Cadence migration changes
SupunS Aug 12, 2024
a06ed0b
Update to cadence v1.0.0-preview.47
SupunS Aug 13, 2024
3a2217d
Merge pull request #6326 from onflow/auto-update-onflow-cadence-v1.0.…
turbolent Aug 13, 2024
a0da8eb
Report the stored path of the capability
SupunS Aug 13, 2024
2bdf7eb
Update to cadence v1.0.0-preview.48
SupunS Aug 13, 2024
69bb9f2
Update to cadence v1.0.0-preview.48
SupunS Aug 13, 2024
91a9fe4
Update to Cadence v1.0.0-preview.48
turbolent Aug 13, 2024
0f74678
Merge branch 'auto-update-onflow-cadence-v1.0.0-preview.48' into supu…
turbolent Aug 13, 2024
30bc437
Merge branch 'supun/improve-reporting' of https://github.com/onflow/f…
SupunS Aug 13, 2024
67d5beb
Merge pull request #6328 from onflow/supun/improve-reporting
SupunS Aug 13, 2024
e178add
Merge branch 'master' of https://github.com/onflow/flow-go into yurii…
durkmurder Aug 13, 2024
4943a68
Tidy
durkmurder Aug 14, 2024
06b4a51
Merge branch 'feature/efm-recovery' into yurii/sync-master-to-efm-rec…
Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 88 additions & 48 deletions cmd/access/node_builder/access_node_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ import (
"strings"
"time"

"github.com/cockroachdb/pebble"
"github.com/dgraph-io/badger/v2"
"github.com/ipfs/boxo/bitswap"
"github.com/ipfs/go-cid"
badger "github.com/ipfs/go-ds-badger2"
"github.com/ipfs/go-datastore"
badgerds "github.com/ipfs/go-ds-badger2"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/routing"
"github.com/onflow/crypto"
Expand Down Expand Up @@ -69,6 +72,7 @@ import (
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
execdatacache "github.com/onflow/flow-go/module/executiondatasync/execution_data/cache"
"github.com/onflow/flow-go/module/executiondatasync/pruner"
edstorage "github.com/onflow/flow-go/module/executiondatasync/storage"
"github.com/onflow/flow-go/module/executiondatasync/tracker"
finalizer "github.com/onflow/flow-go/module/finalizer/consensus"
"github.com/onflow/flow-go/module/grpcserver"
Expand Down Expand Up @@ -106,7 +110,7 @@ import (
"github.com/onflow/flow-go/state/protocol/blocktimer"
"github.com/onflow/flow-go/storage"
bstorage "github.com/onflow/flow-go/storage/badger"
pStorage "github.com/onflow/flow-go/storage/pebble"
pstorage "github.com/onflow/flow-go/storage/pebble"
"github.com/onflow/flow-go/utils/grpcutils"
)

Expand Down Expand Up @@ -148,6 +152,7 @@ type AccessNodeConfig struct {
rpcMetricsEnabled bool
executionDataSyncEnabled bool
publicNetworkExecutionDataEnabled bool
executionDataDBMode string
executionDataPrunerHeightRangeTarget uint64
executionDataPrunerThreshold uint64
executionDataPruningInterval time.Duration
Expand Down Expand Up @@ -257,6 +262,7 @@ func DefaultAccessNodeConfig() *AccessNodeConfig {
MaxRetryDelay: edrequester.DefaultMaxRetryDelay,
},
executionDataIndexingEnabled: false,
executionDataDBMode: execution_data.ExecutionDataDBModeBadger.String(),
executionDataPrunerHeightRangeTarget: 0,
executionDataPrunerThreshold: pruner.DefaultThreshold,
executionDataPruningInterval: pruner.DefaultPruningInterval,
Expand All @@ -265,7 +271,7 @@ func DefaultAccessNodeConfig() *AccessNodeConfig {
scriptExecutorConfig: query.NewDefaultConfig(),
scriptExecMinBlock: 0,
scriptExecMaxBlock: math.MaxUint64,
registerCacheType: pStorage.CacheTypeTwoQueue.String(),
registerCacheType: pstorage.CacheTypeTwoQueue.String(),
registerCacheSize: 0,
programCacheSize: 0,
checkPayerBalance: false,
Expand Down Expand Up @@ -315,7 +321,7 @@ type FlowAccessNodeBuilder struct {
IndexerDependencies *cmd.DependencyList
collectionExecutedMetric module.CollectionExecutedMetric
ExecutionDataPruner *pruner.Pruner
ExecutionDataDatastore *badger.Datastore
ExecutionDatastoreManager edstorage.DatastoreManager
ExecutionDataTracker tracker.Storage
versionControl *version.VersionControl

Expand Down Expand Up @@ -522,13 +528,15 @@ func (builder *FlowAccessNodeBuilder) BuildConsensusFollower() *FlowAccessNodeBu
}

func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccessNodeBuilder {
var ds datastore.Batching
var bs network.BlobService
var processedBlockHeight storage.ConsumerProgress
var processedNotifications storage.ConsumerProgress
var bsDependable *module.ProxiedReadyDoneAware
var execDataDistributor *edrequester.ExecutionDataDistributor
var execDataCacheBackend *herocache.BlockExecutionData
var executionDataStoreCache *execdatacache.ExecutionDataCache
var executionDataDBMode execution_data.ExecutionDataDBMode

// setup dependency chain to ensure indexer starts after the requester
requesterDependable := module.NewProxiedReadyDoneAware()
Expand All @@ -547,12 +555,26 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
return err
}

builder.ExecutionDataDatastore, err = badger.NewDatastore(datastoreDir, &badger.DefaultOptions)
executionDataDBMode, err = execution_data.ParseExecutionDataDBMode(builder.executionDataDBMode)
if err != nil {
return err
return fmt.Errorf("could not parse execution data DB mode: %w", err)
}

if executionDataDBMode == execution_data.ExecutionDataDBModePebble {
builder.ExecutionDatastoreManager, err = edstorage.NewPebbleDatastoreManager(datastoreDir, nil)
if err != nil {
return fmt.Errorf("could not create PebbleDatastoreManager for execution data: %w", err)
}
} else {
builder.ExecutionDatastoreManager, err = edstorage.NewBadgerDatastoreManager(datastoreDir, &badgerds.DefaultOptions)
if err != nil {
return fmt.Errorf("could not create BadgerDatastoreManager for execution data: %w", err)
}
}
ds = builder.ExecutionDatastoreManager.Datastore()

builder.ShutdownFunc(func() error {
if err := builder.ExecutionDataDatastore.Close(); err != nil {
if err := builder.ExecutionDatastoreManager.Close(); err != nil {
return fmt.Errorf("could not close execution data datastore: %w", err)
}
return nil
Expand All @@ -563,13 +585,21 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
Module("processed block height consumer progress", func(node *cmd.NodeConfig) error {
// Note: progress is stored in the datastore's DB since that is where the jobqueue
// writes execution data to.
processedBlockHeight = bstorage.NewConsumerProgress(builder.ExecutionDataDatastore.DB, module.ConsumeProgressExecutionDataRequesterBlockHeight)
if executionDataDBMode == execution_data.ExecutionDataDBModeBadger {
processedBlockHeight = bstorage.NewConsumerProgress(builder.ExecutionDatastoreManager.DB().(*badger.DB), module.ConsumeProgressExecutionDataRequesterBlockHeight)
} else {
processedBlockHeight = pstorage.NewConsumerProgress(builder.ExecutionDatastoreManager.DB().(*pebble.DB), module.ConsumeProgressExecutionDataRequesterBlockHeight)
}
return nil
}).
Module("processed notifications consumer progress", func(node *cmd.NodeConfig) error {
// Note: progress is stored in the datastore's DB since that is where the jobqueue
// writes execution data to.
processedNotifications = bstorage.NewConsumerProgress(builder.ExecutionDataDatastore.DB, module.ConsumeProgressExecutionDataRequesterNotification)
if executionDataDBMode == execution_data.ExecutionDataDBModeBadger {
processedNotifications = bstorage.NewConsumerProgress(builder.ExecutionDatastoreManager.DB().(*badger.DB), module.ConsumeProgressExecutionDataRequesterNotification)
} else {
processedNotifications = pstorage.NewConsumerProgress(builder.ExecutionDatastoreManager.DB().(*pebble.DB), module.ConsumeProgressExecutionDataRequesterNotification)
}
return nil
}).
Module("blobservice peer manager dependencies", func(node *cmd.NodeConfig) error {
Expand All @@ -578,7 +608,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
return nil
}).
Module("execution datastore", func(node *cmd.NodeConfig) error {
builder.ExecutionDataBlobstore = blobs.NewBlobstore(builder.ExecutionDataDatastore)
builder.ExecutionDataBlobstore = blobs.NewBlobstore(ds)
builder.ExecutionDataStore = execution_data.NewExecutionDataStore(builder.ExecutionDataBlobstore, execution_data.DefaultSerializer)
return nil
}).
Expand Down Expand Up @@ -621,7 +651,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
}

var err error
bs, err = node.EngineRegistry.RegisterBlobService(channels.ExecutionDataService, builder.ExecutionDataDatastore, opts...)
bs, err = node.EngineRegistry.RegisterBlobService(channels.ExecutionDataService, ds, opts...)
if err != nil {
return nil, fmt.Errorf("could not register blob service: %w", err)
}
Expand Down Expand Up @@ -746,7 +776,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
prunerMetrics,
builder.ExecutionDataTracker,
pruner.WithPruneCallback(func(ctx context.Context) error {
return builder.ExecutionDataDatastore.CollectGarbage(ctx)
return builder.ExecutionDatastoreManager.CollectGarbage(ctx)
}),
pruner.WithHeightRangeTarget(builder.executionDataPrunerHeightRangeTarget),
pruner.WithThreshold(builder.executionDataPrunerThreshold),
Expand Down Expand Up @@ -782,7 +812,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
net := builder.AccessNodeConfig.PublicNetworkConfig.Network

var err error
builder.PublicBlobService, err = net.RegisterBlobService(channels.PublicExecutionDataService, builder.ExecutionDataDatastore, opts...)
builder.PublicBlobService, err = net.RegisterBlobService(channels.PublicExecutionDataService, ds, opts...)
if err != nil {
return nil, fmt.Errorf("could not register blob service: %w", err)
}
Expand Down Expand Up @@ -816,15 +846,15 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
// other components from starting while bootstrapping the register db since it may
// take hours to complete.

pdb, err := pStorage.OpenRegisterPebbleDB(builder.registersDBPath)
pdb, err := pstorage.OpenRegisterPebbleDB(builder.registersDBPath)
if err != nil {
return nil, fmt.Errorf("could not open registers db: %w", err)
}
builder.ShutdownFunc(func() error {
return pdb.Close()
})

bootstrapped, err := pStorage.IsBootstrapped(pdb)
bootstrapped, err := pstorage.IsBootstrapped(pdb)
if err != nil {
return nil, fmt.Errorf("could not check if registers db is bootstrapped: %w", err)
}
Expand Down Expand Up @@ -856,7 +886,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
}

rootHash := ledger.RootHash(builder.RootSeal.FinalState)
bootstrap, err := pStorage.NewRegisterBootstrap(pdb, checkpointFile, checkpointHeight, rootHash, builder.Logger)
bootstrap, err := pstorage.NewRegisterBootstrap(pdb, checkpointFile, checkpointHeight, rootHash, builder.Logger)
if err != nil {
return nil, fmt.Errorf("could not create registers bootstrap: %w", err)
}
Expand All @@ -869,18 +899,18 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
}
}

registers, err := pStorage.NewRegisters(pdb)
registers, err := pstorage.NewRegisters(pdb)
if err != nil {
return nil, fmt.Errorf("could not create registers storage: %w", err)
}

if builder.registerCacheSize > 0 {
cacheType, err := pStorage.ParseCacheType(builder.registerCacheType)
cacheType, err := pstorage.ParseCacheType(builder.registerCacheType)
if err != nil {
return nil, fmt.Errorf("could not parse register cache type: %w", err)
}
cacheMetrics := metrics.NewCacheCollector(builder.RootChainID)
registersCache, err := pStorage.NewRegistersCache(registers, cacheType, builder.registerCacheSize, cacheMetrics)
registersCache, err := pstorage.NewRegistersCache(registers, cacheType, builder.registerCacheSize, cacheMetrics)
if err != nil {
return nil, fmt.Errorf("could not create registers cache: %w", err)
}
Expand Down Expand Up @@ -948,7 +978,7 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionSyncComponents() *FlowAccess
builder.programCacheSize > 0,
)

err = builder.ScriptExecutor.Initialize(builder.ExecutionIndexer, scripts)
err = builder.ScriptExecutor.Initialize(builder.ExecutionIndexer, scripts, builder.versionControl)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1263,6 +1293,10 @@ func (builder *FlowAccessNodeBuilder) extraFlags() {
"execution-data-max-retry-delay",
defaultConfig.executionDataConfig.MaxRetryDelay,
"maximum delay for exponential backoff when fetching execution data fails e.g. 5m")
flags.StringVar(&builder.executionDataDBMode,
"execution-data-db",
defaultConfig.executionDataDBMode,
"[experimental] the DB type for execution datastore. One of [badger, pebble]")
flags.Uint64Var(&builder.executionDataPrunerHeightRangeTarget,
"execution-data-height-range-target",
defaultConfig.executionDataPrunerHeightRangeTarget,
Expand Down Expand Up @@ -1553,6 +1587,8 @@ func (builder *FlowAccessNodeBuilder) Build() (cmd.Node, error) {

ingestionDependable := module.NewProxiedReadyDoneAware()
builder.IndexerDependencies.Add(ingestionDependable)
versionControlDependable := module.NewProxiedReadyDoneAware()
builder.IndexerDependencies.Add(versionControlDependable)
var lastFullBlockHeight *counters.PersistentStrictMonotonicCounter

builder.
Expand Down Expand Up @@ -1750,6 +1786,38 @@ func (builder *FlowAccessNodeBuilder) Build() (cmd.Node, error) {

return nil
}).
Component("version control", func(node *cmd.NodeConfig) (module.ReadyDoneAware, error) {
if !builder.versionControlEnabled {
noop := &module.NoopReadyDoneAware{}
versionControlDependable.Init(noop)
return noop, nil
}

nodeVersion, err := build.Semver()
if err != nil {
return nil, fmt.Errorf("could not load node version for version control. "+
"version (%s) is not semver compliant: %w. Make sure a valid semantic version is provided in the VERSION environment variable", build.Version(), err)
}

versionControl, err := version.NewVersionControl(
builder.Logger,
node.Storage.VersionBeacons,
nodeVersion,
builder.SealedRootBlock.Header.Height,
builder.LastFinalizedHeader.Height,
)
if err != nil {
return nil, fmt.Errorf("could not create version control: %w", err)
}

// VersionControl needs to consume BlockFinalized events.
node.ProtocolEvents.AddConsumer(versionControl)

builder.versionControl = versionControl
versionControlDependable.Init(builder.versionControl)

return versionControl, nil
}).
Component("RPC engine", func(node *cmd.NodeConfig) (module.ReadyDoneAware, error) {
config := builder.rpcConf
backendConfig := config.BackendConfig
Expand Down Expand Up @@ -1944,34 +2012,6 @@ func (builder *FlowAccessNodeBuilder) Build() (cmd.Node, error) {
return builder.RequestEng, nil
})

if builder.versionControlEnabled {
builder.Component("version control", func(node *cmd.NodeConfig) (module.ReadyDoneAware, error) {
nodeVersion, err := build.Semver()
if err != nil {
return nil, fmt.Errorf("could not load node version for version control. "+
"version (%s) is not semver compliant: %w. Make sure a valid semantic version is provided in the VERSION environment variable", build.Version(), err)
}

versionControl, err := version.NewVersionControl(
builder.Logger,
node.Storage.VersionBeacons,
nodeVersion,
builder.SealedRootBlock.Header.Height,
builder.LastFinalizedHeader.Height,
)
if err != nil {
return nil, fmt.Errorf("could not create version control: %w", err)
}

// VersionControl needs to consume BlockFinalized events.
node.ProtocolEvents.AddConsumer(versionControl)

builder.versionControl = versionControl

return versionControl, nil
})
}

if builder.supportsObserver {
builder.Component("public sync request handler", func(node *cmd.NodeConfig) (module.ReadyDoneAware, error) {
syncRequestHandler, err := synceng.NewRequestHandlerEngine(
Expand Down
16 changes: 8 additions & 8 deletions cmd/execution_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (

awsconfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
badgerDB "github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2"
"github.com/ipfs/boxo/bitswap"
"github.com/ipfs/go-cid"
badger "github.com/ipfs/go-ds-badger2"
badgerds "github.com/ipfs/go-ds-badger2"
"github.com/onflow/cadence"
"github.com/onflow/flow-core-contracts/lib/go/templates"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -154,7 +154,7 @@ type ExecutionNode struct {
executionDataStore execution_data.ExecutionDataStore
toTriggerCheckpoint *atomic.Bool // create the checkpoint trigger to be controlled by admin tool, and listened by the compactor
stopControl *stop.StopControl // stop the node at given block height
executionDataDatastore *badger.Datastore
executionDataDatastore *badgerds.Datastore
executionDataPruner *pruner.Pruner
executionDataBlobstore blobs.Blobstore
executionDataTracker tracker.Storage
Expand Down Expand Up @@ -669,8 +669,8 @@ func (exeNode *ExecutionNode) LoadExecutionDataDatastore(
if err != nil {
return err
}
dsOpts := &badger.DefaultOptions
ds, err := badger.NewDatastore(datastoreDir, dsOpts)
dsOpts := &badgerds.DefaultOptions
ds, err := badgerds.NewDatastore(datastoreDir, dsOpts)
if err != nil {
return err
}
Expand All @@ -691,10 +691,10 @@ func (exeNode *ExecutionNode) LoadExecutionDataGetter(node *NodeConfig) error {
return nil
}

func OpenChunkDataPackDB(dbPath string, logger zerolog.Logger) (*badgerDB.DB, error) {
func OpenChunkDataPackDB(dbPath string, logger zerolog.Logger) (*badger.DB, error) {
log := sutil.NewLogger(logger)

opts := badgerDB.
opts := badger.
DefaultOptions(dbPath).
WithKeepL0InMemory(true).
WithLogger(log).
Expand All @@ -708,7 +708,7 @@ func OpenChunkDataPackDB(dbPath string, logger zerolog.Logger) (*badgerDB.DB, er
WithValueLogFileSize(256 << 23).
WithValueLogMaxEntries(100000) // Default is 1000000

db, err := badgerDB.Open(opts)
db, err := badger.Open(opts)
if err != nil {
return nil, fmt.Errorf("could not open chunk data pack badger db at path %v: %w", dbPath, err)
}
Expand Down
Loading
Loading