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

Sync feature/stable-cadence branch with master #4655

Merged
merged 339 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
339 commits
Select commit Hold shift + click to select a range
6098a7f
decreases time interval of peer manager
yhassanzadeh13 Jun 6, 2023
938a36e
skips connecting to already connected peers
yhassanzadeh13 Jun 6, 2023
f77621c
adds is connected method
yhassanzadeh13 Jun 6, 2023
4fbe8af
Merge remote-tracking branch 'origin/master' into yahya/6470-alsp-par…
yhassanzadeh13 Jun 6, 2023
0342aee
reduces backup
yhassanzadeh13 Jun 7, 2023
5bb3fc4
fixes closure of authorized peers
yhassanzadeh13 Jun 7, 2023
d5cf92a
adds disallow listing test
yhassanzadeh13 Jun 7, 2023
a1cd316
adds godoc
yhassanzadeh13 Jun 7, 2023
f3dd70d
separate the connection gater for each node in test util
yhassanzadeh13 Jun 7, 2023
2a033db
extends a documentation
yhassanzadeh13 Jun 7, 2023
e8b7178
adds misbehavior and disallowlisting test
yhassanzadeh13 Jun 7, 2023
a1a1f00
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 7, 2023
afde747
updates mocks
yhassanzadeh13 Jun 7, 2023
38539e6
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 7, 2023
276d352
fixes build issues
yhassanzadeh13 Jun 7, 2023
dd43a63
lint fix
yhassanzadeh13 Jun 7, 2023
14fe8db
renames block list to disallow list
yhassanzadeh13 Jun 7, 2023
a2fd745
renames block list to disallow list
yhassanzadeh13 Jun 7, 2023
8af9228
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 7, 2023
f5c8bd3
fuxes herocache metrics issue
yhassanzadeh13 Jun 7, 2023
7c2b1d7
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 7, 2023
1da07ed
fixes nil dependecy issue
yhassanzadeh13 Jun 7, 2023
1445fbd
lint fix
yhassanzadeh13 Jun 8, 2023
c1ac0a4
fixes nil pointer exception
yhassanzadeh13 Jun 8, 2023
20ed7a3
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 8, 2023
3a9df70
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 9, 2023
16d09f3
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 12, 2023
6435656
adds a comment
yhassanzadeh13 Jun 12, 2023
1f77da8
Update network/disallow.go
yhassanzadeh13 Jun 12, 2023
ae12a36
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
0a996e5
Update network/alsp/manager/manager.go
yhassanzadeh13 Jun 12, 2023
c3c81e7
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
3b43e0b
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
8e5d412
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
c5b48af
Update module/metrics/labels.go
yhassanzadeh13 Jun 12, 2023
8c1cd97
Update network/alsp/manager/manager_test.go
yhassanzadeh13 Jun 12, 2023
5cd8855
Update network/alsp/manager/manager_test.go
yhassanzadeh13 Jun 12, 2023
282ef12
Update network/alsp/manager/manager_test.go
yhassanzadeh13 Jun 12, 2023
aa6228a
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
088dbb3
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
58f4090
Update network/p2p/p2pnode/internal/cache.go
yhassanzadeh13 Jun 12, 2023
f1d581f
Update network/disallow.go
yhassanzadeh13 Jun 12, 2023
14f7d60
adds documentation for integration testing
yhassanzadeh13 Jun 12, 2023
bb9c358
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 12, 2023
850310e
Update network/alsp/manager/manager_test.go
yhassanzadeh13 Jun 12, 2023
37bedd3
resolves shadow variables
yhassanzadeh13 Jun 12, 2023
06a1fbe
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 12, 2023
eefca22
Update network/alsp/manager/manager.go
yhassanzadeh13 Jun 12, 2023
3e3cd10
Update network/alsp/manager/manager.go
yhassanzadeh13 Jun 12, 2023
9264afb
Update network/p2p/connection/peerManager.go
yhassanzadeh13 Jun 12, 2023
554c7d5
renames and refactors a cache and libp2p method
yhassanzadeh13 Jun 12, 2023
e42d58c
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 12, 2023
0c60366
lint fix
yhassanzadeh13 Jun 12, 2023
5e98a72
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 12, 2023
473153b
adds readme
yhassanzadeh13 Jun 12, 2023
0ee0a2a
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 12, 2023
cb7744e
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 13, 2023
e6a2f38
Update network/alsp/manager/manager_test.go
yhassanzadeh13 Jun 13, 2023
0d54873
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 13, 2023
9f07e0f
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 13, 2023
121987e
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 14, 2023
520c2ef
Update network/alsp/manager/README.md
yhassanzadeh13 Jun 14, 2023
c9e5140
Update network/alsp/manager/README.md
yhassanzadeh13 Jun 14, 2023
da1d5c4
Update network/alsp/manager/README.md
yhassanzadeh13 Jun 14, 2023
f5c7d2d
Update network/p2p/p2pnode/libp2pNode.go
yhassanzadeh13 Jun 14, 2023
c8ff213
Update network/alsp/manager/README.md
yhassanzadeh13 Jun 14, 2023
b483f08
Update network/alsp/manager/README.md
yhassanzadeh13 Jun 14, 2023
3d3f69f
Update network/alsp/manager/README.md
yhassanzadeh13 Jun 14, 2023
a9233f7
Update network/alsp/manager/manager_test.go
yhassanzadeh13 Jun 14, 2023
430b369
adds disallow-listed status to cache
yhassanzadeh13 Jun 14, 2023
722fc29
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
yhassanzadeh13 Jun 14, 2023
be550f2
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
yhassanzadeh13 Jun 14, 2023
a3c613c
switches a log level
yhassanzadeh13 Jun 14, 2023
95535ab
fixes duplicate metrics panic
yhassanzadeh13 Jun 14, 2023
63ff727
created default penalty params
gomisha Jun 15, 2023
1d358f8
typo
gomisha Jun 16, 2023
99828d6
typo
gomisha Jun 16, 2023
a2ea980
un-exported disallowListingThreshold
gomisha Jun 16, 2023
9de85fe
increase timeout to fix flakiness
gomisha Jun 16, 2023
26ebb22
typos
gomisha Jun 17, 2023
1ff3044
revert back InitialDecaySpeed
gomisha Jun 17, 2023
a33dd37
typo
gomisha Jun 17, 2023
4e53cc8
WIP TestHandleReportedMisbehavior_And_DisallowListing_RepeatOffender_…
gomisha Jun 18, 2023
dedbab3
debug test failure
gomisha Jun 19, 2023
e38f9a6
updated manager
yhassanzadeh13 Jun 19, 2023
060c1f3
Merge remote-tracking branch 'origin/misha/6766-adjust-node-penalty-d…
yhassanzadeh13 Jun 19, 2023
661b92e
replaced sleep with function option to decay to zero
gomisha Jun 20, 2023
ba3ef45
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jun 20, 2023
270cc40
clean up
gomisha Jun 21, 2023
79e00f3
clean up - removed func DefaultParams()
gomisha Jun 21, 2023
5144f91
moved out test helper functions to separate file
gomisha Jun 21, 2023
8caa38e
moved WithDecayFunc() to test helper
gomisha Jun 21, 2023
7403dcf
rename to fastDecay, fastDecayFunc
gomisha Jun 21, 2023
444ccef
lint fix
gomisha Jun 21, 2023
e10d556
check spam record fields on each violation
gomisha Jun 22, 2023
bd1116f
fix tests - get spam record before each check
gomisha Jun 22, 2023
5cfc254
using loop of expected decays - test failing
gomisha Jun 23, 2023
6a770b3
decay list implementation
gomisha Jun 24, 2023
9d093c4
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jun 24, 2023
0daeb03
more debugging, decays in test
gomisha Jun 24, 2023
f84fbcd
check penalty was decayed by expected decay after each disallow listing
gomisha Jun 25, 2023
a2c5e9f
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jul 6, 2023
7c31c0c
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jul 6, 2023
0705c9a
using updated testutils.LibP2PNodeForMiddlewareFixture(t, 3)
gomisha Jul 7, 2023
f657343
disable p2p backoff so test passes
gomisha Jul 7, 2023
1795d3b
clean up
gomisha Jul 7, 2023
e784dde
reduce wait time for connecting
gomisha Jul 7, 2023
812f331
remove data driven table
gomisha Jul 7, 2023
26e950f
removed timestamp from logs
gomisha Jul 7, 2023
fa5765f
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jul 31, 2023
0431cf2
build fix
gomisha Jul 31, 2023
52d335a
removed unused PenaltyParams
gomisha Jul 31, 2023
a6baa91
changed some logging messages from Info() to Trace()
gomisha Jul 31, 2023
6977771
Add TotalComputationUsed metric in Chunk
m-Peter Jul 21, 2023
28acd89
Fix failing tests after adding TotalComputationUsed metric in Chunk
m-Peter Jul 28, 2023
dc00408
Add assertions to ensure that TotalComputationUsed for a Chunk is no …
m-Peter Aug 1, 2023
f673f49
Update assertion to check that `TotalComputationUsed` is greater than…
m-Peter Aug 1, 2023
5ebdb11
Add merge_group to CI to allow using built in GH merge queue work flow
Kay-Zee Aug 8, 2023
a5ad931
Merge branch 'master' into add-total-computation-used-to-chunk
m-Peter Aug 9, 2023
172c5b7
Merge branch 'master' into kan/transition-to-merge-queue
Kay-Zee Aug 11, 2023
b40f664
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Aug 12, 2023
f7b7b62
CacheFactory unexported, test helpers moved to test
gomisha Aug 12, 2023
2e027bc
DecayFunc unexported
gomisha Aug 12, 2023
e5cf8fd
model.DisallowListingThreshold clean up
gomisha Aug 12, 2023
133a24b
heartbeat interval log update
gomisha Aug 12, 2023
7e75e86
heartbeat interval log update 2
gomisha Aug 12, 2023
05c9f9f
renamed loop variables
gomisha Aug 14, 2023
e8cb9db
Comment fix
gomisha Aug 14, 2023
14325cd
refactor to use adjustDecayFunc(), removed DecayList from spam record
gomisha Aug 14, 2023
55cc428
updated docs for adjustDecayFunc()
gomisha Aug 14, 2023
c5557a7
split epoch tests to 2 sub-suites
jordanschalm Aug 14, 2023
f3f3bb3
add docs, update Makefile
jordanschalm Aug 14, 2023
26942c9
update CI, flaky test monitor, bors
jordanschalm Aug 14, 2023
6083ed3
fix private references
jordanschalm Aug 14, 2023
a0863b8
changes spork id to be computed with the test logic
yhassanzadeh13 Aug 14, 2023
c95dec1
lint fix
yhassanzadeh13 Aug 14, 2023
7bda8d2
clean up
gomisha Aug 15, 2023
78adc27
wip
yhassanzadeh13 Aug 15, 2023
7102357
fixes tests
yhassanzadeh13 Aug 15, 2023
05a3972
Merge branch 'yahya/test-fixtures-cleanup' into yahya/middleware-test…
yhassanzadeh13 Aug 15, 2023
b460fe7
relocates tag observable logic to test suite
yhassanzadeh13 Aug 15, 2023
ed3cb28
removes unused returned value
yhassanzadeh13 Aug 15, 2023
99233ab
[Network] Fix chunk datapack size and timeout limits (#4623)
peterargue Aug 15, 2023
3b4b810
cleans up is connected test helper
yhassanzadeh13 Aug 15, 2023
dbc14e5
adds spork id to libp2p node
yhassanzadeh13 Aug 15, 2023
72f4d96
moves publish logic
yhassanzadeh13 Aug 15, 2023
68e225f
fixes broken tests for publish migration
yhassanzadeh13 Aug 15, 2023
3041445
Apply suggestions from code review
jordanschalm Aug 16, 2023
579e951
Run FlakyTestMonitor on changed workflows/ci.yml
jordanschalm Aug 16, 2023
7721590
cosmetic change to test flaky test monitor
jordanschalm Aug 16, 2023
7579c8e
Revert "cosmetic change to test flaky test monitor"
jordanschalm Aug 16, 2023
7824795
Merge branch 'master' into jordan/split-epoch-tests
jordanschalm Aug 16, 2023
7e481e4
Merge branch 'master' into yahya/test-fixtures-cleanup
yhassanzadeh13 Aug 16, 2023
9bdecc9
Update network/internal/testutils/testUtil.go
yhassanzadeh13 Aug 16, 2023
232873a
Merge branch 'master' into kan/transition-to-merge-queue
Kay-Zee Aug 16, 2023
c5870f7
fixes tests
yhassanzadeh13 Aug 16, 2023
2de77ca
updates mocks
yhassanzadeh13 Aug 16, 2023
a90d17c
Merge pull request #4607 from onflow/kan/transition-to-merge-queue
Kay-Zee Aug 16, 2023
e47a3e0
increases timeout for disallowlisting test
yhassanzadeh13 Aug 16, 2023
6edb42d
Merge branch 'master' into yahya/test-fixtures-cleanup
yhassanzadeh13 Aug 16, 2023
43c72f5
fixes all scoring tests
yhassanzadeh13 Aug 16, 2023
fd68f3c
fixes tracer tests
yhassanzadeh13 Aug 16, 2023
6c65145
fixes subscription package tests
yhassanzadeh13 Aug 16, 2023
3e8a2a7
Merge pull request #4169 from onflow/add-summary-to-workflow
Kay-Zee Aug 16, 2023
da8f475
moves spork id to network builder
yhassanzadeh13 Aug 16, 2023
f01cf41
replaces channel with topic on outgoing message scope
yhassanzadeh13 Aug 16, 2023
2e21367
fixes errors in test fixtures
yhassanzadeh13 Aug 16, 2023
e832806
Merge branch 'master' into yahya/test-fixtures-cleanup
yhassanzadeh13 Aug 16, 2023
9382f64
fixes tests
yhassanzadeh13 Aug 16, 2023
9ab2620
simplify adjustDecayFunc() with switch-case
gomisha Aug 17, 2023
f820c09
flaky test fix
gomisha Aug 17, 2023
491cbcb
Merge pull request #4577 from onflow/add-total-computation-used-to-chunk
janezpodhostnik Aug 17, 2023
e3dee97
adds message space interface
yhassanzadeh13 Aug 17, 2023
01a4bf0
Merge branch 'master' into yahya/test-fixtures-cleanup
yhassanzadeh13 Aug 17, 2023
026f9e6
moves message scopes to implementation packages
yhassanzadeh13 Aug 17, 2023
a64cf0d
Merge pull request #4627 from onflow/yahya/test-fixtures-cleanup
yhassanzadeh13 Aug 17, 2023
4bb1098
Merge branch 'master' into yahya/middleware-test-fixture-cleanup-2
yhassanzadeh13 Aug 17, 2023
49d464d
refactors message scopes to use the interface type
yhassanzadeh13 Aug 17, 2023
8071ab9
resolves import cycles
yhassanzadeh13 Aug 17, 2023
fb8820d
fixes import ailiases
yhassanzadeh13 Aug 17, 2023
7591e33
fixes improt cycles
yhassanzadeh13 Aug 17, 2023
c820722
re-generates mocks
yhassanzadeh13 Aug 17, 2023
ff4122b
fixes build
yhassanzadeh13 Aug 17, 2023
996ac1f
fixes tests
yhassanzadeh13 Aug 17, 2023
dc8a3b5
fixes tests
yhassanzadeh13 Aug 17, 2023
67f6053
fixes tests
yhassanzadeh13 Aug 17, 2023
a5eabe1
fixes tests
yhassanzadeh13 Aug 17, 2023
6be66ba
Merge pull request #4626 from onflow/jordan/split-epoch-tests
gomisha Aug 18, 2023
6db0d8d
skims off the spork id from libp2p node
yhassanzadeh13 Aug 18, 2023
14c8939
lint and test fix
yhassanzadeh13 Aug 18, 2023
4d296ee
fixes build errors
yhassanzadeh13 Aug 18, 2023
d306a89
updates mocks
yhassanzadeh13 Aug 18, 2023
06595b5
Merge branch 'master' into yahya/middleware-test-fixture-cleanup-2
yhassanzadeh13 Aug 18, 2023
008cbea
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Aug 18, 2023
b107e35
lint fix
gomisha Aug 18, 2023
e648a4a
store chunk data pack in a separate database
zhangchiqing Aug 11, 2023
ccef0d4
skip flakey test
zhangchiqing Aug 11, 2023
1893401
fix flag
zhangchiqing Aug 11, 2023
577c706
add test case
zhangchiqing Aug 11, 2023
a3ff57b
address review comments
zhangchiqing Aug 14, 2023
f8614b3
add comment
zhangchiqing Aug 14, 2023
8fdd554
remove chunkdatapack'Store method
zhangchiqing Aug 15, 2023
4c494b5
rollback stored chunk data pack when fails to store execution result
zhangchiqing Aug 16, 2023
b4b9af9
refactor save execution result
zhangchiqing Aug 17, 2023
e4842dc
ignore the error from rollback chunk data pack
zhangchiqing Aug 17, 2023
b826100
fix refactor
zhangchiqing Aug 17, 2023
21bd1f4
Apply suggestions from code review
zhangchiqing Aug 17, 2023
fc076f4
skip flakey test
zhangchiqing Aug 18, 2023
eb73add
skip flakey test
zhangchiqing Aug 18, 2023
8a111a0
Merge pull request #4618 from onflow/leo/store-chunk-data-separate-dir
zhangchiqing Aug 18, 2023
a07337e
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Aug 21, 2023
d69d388
Merge branch 'master' into yahya/middleware-test-fixture-cleanup-2
yhassanzadeh13 Aug 21, 2023
7e04afd
changes signature of start and stop nodes
yhassanzadeh13 Aug 21, 2023
ae9a88b
encapsulates timeouts as package variables
yhassanzadeh13 Aug 21, 2023
e2e3aa0
refactors the test based on mesh tracer
yhassanzadeh13 Aug 21, 2023
411be7a
revises comments
yhassanzadeh13 Aug 21, 2023
d6ab000
removes retrial
yhassanzadeh13 Aug 21, 2023
2ac3173
reduces retrial
yhassanzadeh13 Aug 21, 2023
a0ebb63
removes debug log
yhassanzadeh13 Aug 21, 2023
fe29da3
ads a log message
yhassanzadeh13 Aug 21, 2023
fe774b1
Merge pull request #4485 from onflow/misha/6766-adjust-node-penalty-d…
gomisha Aug 22, 2023
f8558f2
removes redundant test
yhassanzadeh13 Aug 22, 2023
50edc53
Merge branch 'master' into yahya/fix-network-partitioning-test
yhassanzadeh13 Aug 22, 2023
60ef5a3
Merge branch 'master' into yahya/middleware-test-fixture-cleanup-2
yhassanzadeh13 Aug 22, 2023
ac36801
Change queue.String() to iterate through children instead of queue ex…
Kay-Zee Aug 22, 2023
ab52153
separates bft tests into sub-packages and sub-ci jobs
yhassanzadeh13 Aug 22, 2023
df7c137
adds bft test ci command
yhassanzadeh13 Aug 22, 2023
030db28
Merge pull request #4650 from onflow/kan/fix-string-function
Kay-Zee Aug 22, 2023
03ceebd
Merge branch 'master' into yahya/6857-bft-testing-ci-fix
yhassanzadeh13 Aug 22, 2023
2b8f0b1
lint fix
gomisha Aug 23, 2023
7fee19b
Merge branch 'master' into yahya/middleware-test-fixture-cleanup-2
gomisha Aug 23, 2023
dabbdb3
adds a comment explaning tag observables and their limitations
yhassanzadeh13 Aug 23, 2023
56292e5
Merge remote-tracking branch 'origin/yahya/middleware-test-fixture-cl…
yhassanzadeh13 Aug 23, 2023
78c30a2
adds a comment explaining tag observables and their limitations
yhassanzadeh13 Aug 23, 2023
d899924
Update network/p2p/test/topic_validator_test.go
yhassanzadeh13 Aug 23, 2023
7a34ebf
Update network/p2p/scoring/app_score_test.go
yhassanzadeh13 Aug 23, 2023
a77c0bc
Update network/p2p/scoring/app_score_test.go
yhassanzadeh13 Aug 23, 2023
63865cc
Merge pull request #4629 from onflow/yahya/middleware-test-fixture-cl…
yhassanzadeh13 Aug 23, 2023
879d246
Merge branch 'master' into yahya/fix-network-partitioning-test
yhassanzadeh13 Aug 23, 2023
7048be2
consolidates the test
yhassanzadeh13 Aug 23, 2023
7f0d0b9
Merge remote-tracking branch 'origin/yahya/fix-network-partitioning-t…
yhassanzadeh13 Aug 23, 2023
28e7d12
Merge pull request #4651 from onflow/yahya/6857-bft-testing-ci-fix
yhassanzadeh13 Aug 23, 2023
68a75a4
Merge pull request #4647 from onflow/yahya/fix-network-partitioning-test
yhassanzadeh13 Aug 23, 2023
e301d8d
Merge remote-tracking branch 'origin/master' into yahya/6851-refactor…
yhassanzadeh13 Aug 23, 2023
7fefe6b
fixes merge conflicts
yhassanzadeh13 Aug 23, 2023
daddb31
fixes lint
yhassanzadeh13 Aug 23, 2023
b59818f
Update network/p2p/middleware/middleware.go
yhassanzadeh13 Aug 24, 2023
701e14d
removes maybe from the test
yhassanzadeh13 Aug 24, 2023
5618fa1
Merge remote-tracking branch 'origin/yahya/6851-refactoring-middlewar…
yhassanzadeh13 Aug 24, 2023
a8f28b9
Merge pull request #4635 from onflow/yahya/6851-refactoring-middleware
yhassanzadeh13 Aug 24, 2023
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
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- 'auto-cadence-upgrade/**'
- 'feature/**'
- 'v[0-9]+.[0-9]+'
merge_group:
branches:
- master

env:
GO_VERSION: "1.20"
Expand Down Expand Up @@ -189,10 +192,13 @@ jobs:
matrix:
make:
- make -C integration access-tests
- make -C integration bft-tests
- make -C integration bft-framework-tests
- make -C integration bft-protocol-tests
- make -C integration bft-gossipsub-tests
- make -C integration collection-tests
- make -C integration consensus-tests
- make -C integration epochs-tests
- make -C integration epochs-cohort1-tests
- make -C integration epochs-cohort2-tests
- make -C integration execution-tests
- make -C integration ghost-tests
- make -C integration mvp-tests
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/flaky-test-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
paths:
- '.github/workflows/flaky-test-monitor.yml'
- '.github/workflows/ci.yml'

env:
BIGQUERY_DATASET: production_src_flow_test_metrics
Expand Down Expand Up @@ -128,13 +129,19 @@ jobs:
include:
- target: access-tests
test_category: integration-access
- target: bft-tests
test_category: integration-bft
- target: bft-protocol-tests
test_category: integration-bft-protocol
- target: bft-framework-tests
test_category: integration-bft-framework
- target: bft-gossipsub-tests
test_category: integration-bft-gossipsub
- target: collection-tests
test_category: integration-collection
- target: consensus-tests
test_category: integration-consensus
- target: epochs-tests
- target: epochs-cohort1-tests
test_category: integration-epochs
- target: epochs-cohort2-tests
test_category: integration-epochs
- target: execution-tests
test_category: integration-execution
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
if [[ "${{ inputs.promote }}" = true ]]; then
echo "promoting boot-tools.tar"
gsutil cp boot-tools.tar gs://flow-genesis-bootstrap/boot-tools.tar
SUMMARY=$'# Tool Build and Upload Summary \n Your tools were uploaded to the following GCS objects \n * Boot Tools gs://flow-genesis-bootstrap/boot-tools.tar \n * Util util.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/util.tar'
else
echo "not promoting boot-tools.tar"
SUMMARY=$'# Tool Build and Upload Summary \n Your tools were uploaded to the following GCS objects \n * Boot Tools gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/boot-tools.tar \n * Util util.tar gs://flow-genesis-bootstrap/tools/${{ inputs.tag }}/util.tar'
fi
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
7 changes: 5 additions & 2 deletions bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ status = [
"Unit Tests (utils)",
"Unit Tests (others)",
"Integration Tests (make -C integration access-tests)",
"Integration Tests (make -C integration bft-tests)",
"Integration Tests (make -C integration bft-framework-tests)",
"Integration Tests (make -C integration bft-gossipsub-tests)",
"Integration Tests (make -C integration bft-protocol-tests)",
"Integration Tests (make -C integration collection-tests)",
"Integration Tests (make -C integration consensus-tests)",
"Integration Tests (make -C integration epochs-tests)",
"Integration Tests (make -C integration epochs-cohort1-tests)",
"Integration Tests (make -C integration epochs-cohort2-tests)",
"Integration Tests (make -C integration execution-tests)",
"Integration Tests (make -C integration ghost-tests)",
"Integration Tests (make -C integration mvp-tests)",
Expand Down
3 changes: 2 additions & 1 deletion cmd/access/node_builder/access_node_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ func (builder *FlowAccessNodeBuilder) initNetwork(nodeID module.Local,
IdentityProvider: builder.IdentityProvider,
ReceiveCache: receiveCache,
ConduitFactory: conduit.NewDefaultConduitFactory(),
SporkId: builder.SporkID,
AlspCfg: &alspmgr.MisbehaviorReportManagerConfig{
Logger: builder.Logger,
SpamRecordCacheSize: builder.FlowConfig.NetworkConfig.AlspConfig.SpamRecordCacheSize,
Expand Down Expand Up @@ -1404,7 +1405,7 @@ func (builder *FlowAccessNodeBuilder) initMiddleware(nodeID flow.Identifier,
Libp2pNode: libp2pNode,
FlowId: nodeID,
BitSwapMetrics: builder.Metrics.Bitswap,
RootBlockID: builder.SporkID,
SporkId: builder.SporkID,
UnicastMessageTimeout: middleware.DefaultUnicastTimeout,
IdTranslator: builder.IDTranslator,
Codec: builder.CodecFactory(),
Expand Down
38 changes: 37 additions & 1 deletion cmd/execution_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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/ipfs/go-cid"
badger "github.com/ipfs/go-ds-badger2"
"github.com/onflow/flow-core-contracts/lib/go/templates"
Expand Down Expand Up @@ -82,6 +83,7 @@ import (
storageerr "github.com/onflow/flow-go/storage"
storage "github.com/onflow/flow-go/storage/badger"
"github.com/onflow/flow-go/storage/badger/procedure"
sutil "github.com/onflow/flow-go/storage/util"
)

const (
Expand Down Expand Up @@ -627,14 +629,48 @@ func (exeNode *ExecutionNode) LoadExecutionDataGetter(node *NodeConfig) error {
return nil
}

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

opts := badgerDB.
DefaultOptions(dbPath).
WithKeepL0InMemory(true).
WithLogger(log).

// the ValueLogFileSize option specifies how big the value of a
// key-value pair is allowed to be saved into badger.
// exceeding this limit, will fail with an error like this:
// could not store data: Value with size <xxxx> exceeded 1073741824 limit
// Maximum value size is 10G, needed by execution node
// TODO: finding a better max value for each node type
WithValueLogFileSize(256 << 23).
WithValueLogMaxEntries(100000) // Default is 1000000

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

func (exeNode *ExecutionNode) LoadExecutionState(
node *NodeConfig,
) (
module.ReadyDoneAware,
error,
) {

chunkDataPacks := storage.NewChunkDataPacks(node.Metrics.Cache, node.DB, node.Storage.Collections, exeNode.exeConf.chunkDataPackCacheSize)
chunkDataPackDB, err := openChunkDataPackDB(exeNode.exeConf.chunkDataPackDir, node.Logger)
if err != nil {
return nil, err
}
exeNode.builder.ShutdownFunc(func() error {
if err := chunkDataPackDB.Close(); err != nil {
return fmt.Errorf("error closing chunk data pack database: %w", err)
}
return nil
})
chunkDataPacks := storage.NewChunkDataPacks(node.Metrics.Cache, chunkDataPackDB, node.Storage.Collections, exeNode.exeConf.chunkDataPackCacheSize)

// Needed for gRPC server, make sure to assign to main scoped vars
exeNode.events = storage.NewEvents(node.Metrics.Cache, node.DB)
Expand Down
2 changes: 2 additions & 0 deletions cmd/execution_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ExecutionConfig struct {
transactionResultsCacheSize uint
checkpointDistance uint
checkpointsToKeep uint
chunkDataPackDir string
chunkDataPackCacheSize uint
chunkDataPackRequestsCacheSize uint32
requestInterval time.Duration
Expand Down Expand Up @@ -80,6 +81,7 @@ func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) {
flags.BoolVar(&exeConf.computationConfig.ExtensiveTracing, "extensive-tracing", false, "adds high-overhead tracing to execution")
flags.BoolVar(&exeConf.computationConfig.CadenceTracing, "cadence-tracing", false, "enables cadence runtime level tracing")
flags.IntVar(&exeConf.computationConfig.MaxConcurrency, "computer-max-concurrency", 1, "set to greater than 1 to enable concurrent transaction execution")
flags.StringVar(&exeConf.chunkDataPackDir, "chunk-data-pack-dir", filepath.Join(homedir, ".flow", "chunk_data_packs"), "directory to use for storing chunk data packs")
flags.UintVar(&exeConf.chunkDataPackCacheSize, "chdp-cache", storage.DefaultCacheSize, "cache size for chunk data packs")
flags.Uint32Var(&exeConf.chunkDataPackRequestsCacheSize, "chdp-request-queue", mempool.DefaultChunkDataPackRequestQueueSize, "queue size for chunk data pack requests")
flags.DurationVar(&exeConf.requestInterval, "request-interval", 60*time.Second, "the interval between requests for the requester engine")
Expand Down
3 changes: 2 additions & 1 deletion cmd/observer/node_builder/observer_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ func (builder *ObserverServiceBuilder) initNetwork(nodeID module.Local,
IdentityProvider: builder.IdentityProvider,
ReceiveCache: receiveCache,
ConduitFactory: conduit.NewDefaultConduitFactory(),
SporkId: builder.SporkID,
AlspCfg: &alspmgr.MisbehaviorReportManagerConfig{
Logger: builder.Logger,
SpamRecordCacheSize: builder.FlowConfig.NetworkConfig.AlspConfig.SpamRecordCacheSize,
Expand Down Expand Up @@ -1031,7 +1032,7 @@ func (builder *ObserverServiceBuilder) initMiddleware(nodeID flow.Identifier,
Libp2pNode: libp2pNode,
FlowId: nodeID,
BitSwapMetrics: builder.Metrics.Bitswap,
RootBlockID: builder.SporkID,
SporkId: builder.SporkID,
UnicastMessageTimeout: middleware.DefaultUnicastTimeout,
IdTranslator: builder.IDTranslator,
Codec: builder.CodecFactory(),
Expand Down
3 changes: 2 additions & 1 deletion cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func (fnb *FlowNodeBuilder) InitFlowNetworkWithConduitFactory(
Libp2pNode: fnb.LibP2PNode,
FlowId: fnb.Me.NodeID(),
BitSwapMetrics: fnb.Metrics.Bitswap,
RootBlockID: fnb.SporkID,
SporkId: fnb.SporkID,
UnicastMessageTimeout: fnb.FlowConfig.NetworkConfig.UnicastMessageTimeout,
IdTranslator: fnb.IDTranslator,
Codec: fnb.CodecFactory(),
Expand All @@ -465,6 +465,7 @@ func (fnb *FlowNodeBuilder) InitFlowNetworkWithConduitFactory(
Logger: fnb.Logger,
Codec: fnb.CodecFactory(),
Me: fnb.Me,
SporkId: fnb.SporkID,
MiddlewareFactory: func() (network.Middleware, error) { return fnb.Middleware, nil },
Topology: topology.NewFullyConnectedTopology(),
SubscriptionManager: subscriptionManager,
Expand Down
13 changes: 11 additions & 2 deletions cmd/util/cmd/truncate-database/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
)

var (
flagDatadir string
flagDatadir string
flagChunkDataPackDir string
)

var Cmd = &cobra.Command{
Expand All @@ -24,14 +25,22 @@ func init() {
"directory that stores the protocol state")
_ = Cmd.MarkFlagRequired("datadir")

Cmd.Flags().StringVar(&flagChunkDataPackDir, "chunk-data-pack-dir", "",
"directory that stores the chunk data pack")
_ = Cmd.MarkFlagRequired("chunk-data-pack-dir")
}

func run(*cobra.Command, []string) {

log.Info().Msg("Opening database with truncate")
log.Info().Msg("Opening protocol database with truncate")

db := common.InitStorageWithTruncate(flagDatadir, true)
defer db.Close()

log.Info().Msg("ProtocolDB Truncated")

chunkdb := common.InitStorageWithTruncate(flagChunkDataPackDir, true)
defer chunkdb.Close()

log.Info().Msg("Truncated")
}
1 change: 1 addition & 0 deletions engine/execution/block_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (ar *BlockAttestationResult) ChunkAt(index int) *flow.Chunk {
len(execRes.TransactionResults()),
attestRes.eventCommit,
attestRes.endStateCommit,
execRes.executionSnapshot.TotalComputationUsed(),
)
}

Expand Down
4 changes: 4 additions & 0 deletions engine/execution/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ func TestBroadcastToMultipleVerificationNodes(t *testing.T) {
receipt, _ = args[2].(*flow.ExecutionReceipt)

assert.Equal(t, block.ID(), receipt.ExecutionResult.BlockID)
for i, chunk := range receipt.ExecutionResult.Chunks {
assert.EqualValues(t, i, chunk.CollectionIndex)
assert.Greater(t, chunk.TotalComputationUsed, uint64(0))
}
}).
Return(nil)

Expand Down
24 changes: 22 additions & 2 deletions engine/execution/ingestion/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ func TestChunkIndexIsSet(t *testing.T) {
unittest.StateCommitmentFixture(),
21,
unittest.IdentifierFixture(),
unittest.StateCommitmentFixture())
unittest.StateCommitmentFixture(),
17995,
)

assert.Equal(t, i, int(chunk.Index))
assert.Equal(t, i, int(chunk.CollectionIndex))
Expand All @@ -433,11 +435,29 @@ func TestChunkNumberOfTxsIsSet(t *testing.T) {
unittest.StateCommitmentFixture(),
i,
unittest.IdentifierFixture(),
unittest.StateCommitmentFixture())
unittest.StateCommitmentFixture(),
17995,
)

assert.Equal(t, i, int(chunk.NumberOfTransactions))
}

func TestChunkTotalComputationUsedIsSet(t *testing.T) {

i := mathRand.Uint64()
chunk := flow.NewChunk(
unittest.IdentifierFixture(),
3,
unittest.StateCommitmentFixture(),
21,
unittest.IdentifierFixture(),
unittest.StateCommitmentFixture(),
i,
)

assert.Equal(t, i, chunk.TotalComputationUsed)
}

func TestExecuteOneBlock(t *testing.T) {
runWithEngine(t, func(ctx testingContext) {

Expand Down
44 changes: 33 additions & 11 deletions engine/execution/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,51 @@ func (s *state) SaveExecutionResults(
trace.EXEStateSaveExecutionResults)
defer span.End()

err := s.saveExecutionResults(ctx, result)
if err != nil {
return fmt.Errorf("could not save execution results: %w", err)
}

//outside batch because it requires read access
err = s.UpdateHighestExecutedBlockIfHigher(childCtx, result.ExecutableBlock.Block.Header)
if err != nil {
return fmt.Errorf("cannot update highest executed block: %w", err)
}
return nil
}

func (s *state) saveExecutionResults(
ctx context.Context,
result *execution.ComputationResult,
) (err error) {
header := result.ExecutableBlock.Block.Header
blockID := header.ID()

err = s.chunkDataPacks.Store(result.AllChunkDataPacks())
if err != nil {
return fmt.Errorf("can not store multiple chunk data pack: %w", err)
}

// Write Batch is BadgerDB feature designed for handling lots of writes
// in efficient and automatic manner, hence pushing all the updates we can
// in efficient and atomic manner, hence pushing all the updates we can
// as tightly as possible to let Badger manage it.
// Note, that it does not guarantee atomicity as transactions has size limit,
// but it's the closest thing to atomicity we could have
batch := badgerstorage.NewBatch(s.db)

for _, chunkDataPack := range result.AllChunkDataPacks() {
err := s.chunkDataPacks.BatchStore(chunkDataPack, batch)
defer func() {
// Rollback if an error occurs during batch operations
if err != nil {
return fmt.Errorf("cannot store chunk data pack: %w", err)
chunks := result.AllChunkDataPacks()
chunkIDs := make([]flow.Identifier, 0, len(chunks))
for _, chunk := range chunks {
chunkIDs = append(chunkIDs, chunk.ID())
}
_ = s.chunkDataPacks.Remove(chunkIDs)
}
}
}()

err := s.events.BatchStore(blockID, []flow.EventsList{result.AllEvents()}, batch)
err = s.events.BatchStore(blockID, []flow.EventsList{result.AllEvents()}, batch)
if err != nil {
return fmt.Errorf("cannot store events: %w", err)
}
Expand Down Expand Up @@ -347,11 +374,6 @@ func (s *state) SaveExecutionResults(
return fmt.Errorf("batch flush error: %w", err)
}

//outside batch because it requires read access
err = s.UpdateHighestExecutedBlockIfHigher(childCtx, header)
if err != nil {
return fmt.Errorf("cannot update highest executed block: %w", err)
}
return nil
}

Expand Down
5 changes: 4 additions & 1 deletion engine/execution/state/unittest/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ package unittest
import (
"github.com/onflow/flow-go/crypto"
"github.com/onflow/flow-go/engine/execution"
"github.com/onflow/flow-go/fvm/meter"
"github.com/onflow/flow-go/fvm/storage/snapshot"
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/module/mempool/entity"
"github.com/onflow/flow-go/utils/unittest"
)

func StateInteractionsFixture() *snapshot.ExecutionSnapshot {
return &snapshot.ExecutionSnapshot{}
return &snapshot.ExecutionSnapshot{
Meter: meter.NewMeter(meter.DefaultParameters()),
}
}

func ComputationResultFixture(
Expand Down
Loading