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

[Verification] rolls-in persistent architecture #728

Merged
merged 591 commits into from Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
591 commits
Select commit Hold shift + click to select a range
0b8af37
adds more godocs
yhassanzadeh13 Apr 19, 2021
2dec4c8
Merge branch 'master' into yahya/5208-fetcher-engine
yhassanzadeh13 Apr 19, 2021
6670f03
adds qualifier
yhassanzadeh13 Apr 19, 2021
a0f6777
adds concurrency support for testing update on chunk data requests
yhassanzadeh13 Apr 20, 2021
c004066
Merge remote-tracking branch 'origin/yahya/5208-fetcher-engine' into …
yhassanzadeh13 Apr 20, 2021
eafc48b
adds godoc for qualifier
yhassanzadeh13 Apr 20, 2021
b273ebe
adds incremental qualifier and wires it to the code
yhassanzadeh13 Apr 20, 2021
784ff13
adds more godoc for incremental qualifier
yhassanzadeh13 Apr 20, 2021
9346de2
changes requesting logic
yhassanzadeh13 Apr 20, 2021
3192aac
refactors interface of request qualifier
yhassanzadeh13 Apr 20, 2021
9a8503b
adds qualifying requests logic to requester
yhassanzadeh13 Apr 20, 2021
e42ca99
adds retry after field to chunk requests
yhassanzadeh13 Apr 20, 2021
6e9e905
adds increment attempt and retry after
yhassanzadeh13 Apr 20, 2021
ad321fe
adds targets to chunk request status
yhassanzadeh13 Apr 20, 2021
b6d2b00
resolves fixtures and tests after refactoring chunk data request
yhassanzadeh13 Apr 20, 2021
ee8020e
refactors interface of chunk data pack requester
yhassanzadeh13 Apr 20, 2021
101c5e3
Merge remote-tracking branch 'origin/master' into yahya/5208-fetcher-…
yhassanzadeh13 Apr 20, 2021
dfd5573
removes commented parts
yhassanzadeh13 Apr 20, 2021
7df540c
refactors chunk requests interface to only deal with chunk data requests
yhassanzadeh13 Apr 21, 2021
20c798c
adds id for chunk data request
yhassanzadeh13 Apr 21, 2021
615c775
fixes lint issues
yhassanzadeh13 Apr 21, 2021
6a4d360
adds attempt as return value of by ID
yhassanzadeh13 Apr 21, 2021
c602a62
refactors broken tests
yhassanzadeh13 Apr 21, 2021
40e19de
re-generate mocks
yhassanzadeh13 Apr 21, 2021
7b74f79
adds chunk data request list fixture
yhassanzadeh13 Apr 21, 2021
c204f70
fixes test for pending chunk with sealed block
yhassanzadeh13 Apr 21, 2021
51ecdbf
fixes chunk data pack request fixtures target ID
yhassanzadeh13 Apr 21, 2021
a2146bf
adds chunk data pack request list
yhassanzadeh13 Apr 21, 2021
0d4e126
fixes requesting chunk data pack
yhassanzadeh13 Apr 21, 2021
dfbd285
fixes test request pending chunk data pack
yhassanzadeh13 Apr 21, 2021
248cb5c
fuxes test request pending chunk sealed block hybrid
yhassanzadeh13 Apr 21, 2021
e6a68eb
Merge remote-tracking branch 'origin/master' into yahya/5208-fetcher-…
yhassanzadeh13 Apr 21, 2021
f6ec6c4
cleans up fixtures for chunk request status
yhassanzadeh13 Apr 21, 2021
f611b55
makes chunk request status private
yhassanzadeh13 Apr 21, 2021
713f586
refactors behavior on duplicate locators
yhassanzadeh13 Apr 21, 2021
1f35643
Update engine/verification/fetcher/engine.go
yhassanzadeh13 Apr 21, 2021
52da338
Update engine/verification/fetcher/engine.go
yhassanzadeh13 Apr 21, 2021
f13c674
Update engine/verification/fetcher/engine.go
yhassanzadeh13 Apr 21, 2021
e45c98c
refactors checking node status at block ID
yhassanzadeh13 Apr 21, 2021
b4a3f3b
Merge remote-tracking branch 'origin/yahya/5208-fetcher-engine' into …
yhassanzadeh13 Apr 21, 2021
dc4a867
fixes shallow copy
yhassanzadeh13 Apr 21, 2021
332a1bd
makes an error nested
yhassanzadeh13 Apr 22, 2021
15a81d2
Merge remote-tracking branch 'origin/master' into yahya/5208-fetcher-…
yhassanzadeh13 Apr 22, 2021
7c84b56
Update utils/unittest/fixtures.go
yhassanzadeh13 Apr 22, 2021
22e69e7
Merge remote-tracking branch 'origin/master' into yahya/5208-fetcher-…
yhassanzadeh13 Apr 22, 2021
d0af0d8
caches last sealed on local variable extrinsic to loop
yhassanzadeh13 Apr 22, 2021
e93359e
fixes lint issue
yhassanzadeh13 Apr 22, 2021
34d57ec
Update engine/verification/requester/requester_test.go
yhassanzadeh13 Apr 22, 2021
4bbc200
Update utils/unittest/fixtures.go
yhassanzadeh13 Apr 22, 2021
19c0bfb
Update engine/verification/fetcher/engine_test.go
yhassanzadeh13 Apr 22, 2021
f1a33f8
Update engine/verification/fetcher/engine_test.go
yhassanzadeh13 Apr 22, 2021
1788db5
fixes lints and typos on requester tests
yhassanzadeh13 Apr 22, 2021
e65bc69
adds comment for testcase
yhassanzadeh13 Apr 22, 2021
dbba9bc
adds timeout for ready and done methods of engine in tests
yhassanzadeh13 Apr 22, 2021
924f468
Update engine/verification/fetcher/engine_test.go
yhassanzadeh13 Apr 22, 2021
852831f
Update engine/verification/fetcher/engine_test.go
yhassanzadeh13 Apr 22, 2021
4befbd5
Update engine/verification/fetcher/engine_test.go
yhassanzadeh13 Apr 22, 2021
272a5d1
fixes lint
yhassanzadeh13 Apr 22, 2021
930e4bf
removing unnecessary log
yhassanzadeh13 Apr 22, 2021
e8c43ce
adds comment for a fatal level log
yhassanzadeh13 Apr 22, 2021
4a1296d
consolidates a log at requester engine
yhassanzadeh13 Apr 22, 2021
8d39d0e
Merge branch 'master' into yahya/5208-fetcher-engine
yhassanzadeh13 Apr 22, 2021
db0a672
adds capacity to chunklist of chunk status
yhassanzadeh13 Apr 22, 2021
a3b0acf
Merge remote-tracking branch 'origin/yahya/5208-fetcher-engine' into …
yhassanzadeh13 Apr 22, 2021
885aa52
runs consumer check asynchronously
yhassanzadeh13 Apr 22, 2021
2dcbcbf
refactors loop variable
yhassanzadeh13 Apr 22, 2021
3766f89
Merge remote-tracking branch 'origin/master' into yahya/5208-fetcher-…
yhassanzadeh13 Apr 23, 2021
168d092
fixes lint
yhassanzadeh13 Apr 23, 2021
fb2fe84
Merge branch 'master' into yahya/5208-fetcher-engine
yhassanzadeh13 Apr 23, 2021
b2f97bb
Merge remote-tracking branch 'origin/yahya/5208-fetcher-engine' into …
yhassanzadeh13 Apr 23, 2021
a6e8575
fixes lint
yhassanzadeh13 Apr 23, 2021
9719e56
fixes lint issues and interface
yhassanzadeh13 Apr 23, 2021
6ffaf95
refactors chunk request and moves request info to request status
yhassanzadeh13 Apr 23, 2021
1ada8d5
refactors update retry after
yhassanzadeh13 Apr 23, 2021
bbb35e1
adds request info
yhassanzadeh13 Apr 23, 2021
3769d24
refactors attempt type
yhassanzadeh13 Apr 23, 2021
a6fcfe9
updates mock
yhassanzadeh13 Apr 23, 2021
c5367c9
adds qualifier functions
yhassanzadeh13 Apr 23, 2021
e6dfb0d
fixes mocking issue
yhassanzadeh13 Apr 24, 2021
6e3ec57
adds mock for qualifier
yhassanzadeh13 Apr 24, 2021
1765030
fixes tests with qualifier
yhassanzadeh13 Apr 24, 2021
8b3f384
moves qualifier functions to utils and generates exponential backoff
yhassanzadeh13 Apr 24, 2021
b50a63e
merges master into branch
yhassanzadeh13 Apr 27, 2021
998fd0c
fixes lint issues.
yhassanzadeh13 Apr 27, 2021
7c5876e
removes request qualifier
yhassanzadeh13 Apr 27, 2021
4a68fdc
migrates qualifier logic to requester engine
yhassanzadeh13 Apr 27, 2021
21ca38d
Merge remote-tracking branch 'origin/master' into yahya/5428-exponent…
yhassanzadeh13 Apr 27, 2021
86d0f63
moves exponential backoff to chunk requests
yhassanzadeh13 Apr 27, 2021
1b750e7
adds history update functions
yhassanzadeh13 Apr 27, 2021
45f47f6
adds godoc
yhassanzadeh13 Apr 27, 2021
5b4a01f
refactors tests with updater
yhassanzadeh13 Apr 27, 2021
a43a1a4
adds with updater scenario
yhassanzadeh13 Apr 27, 2021
aadb873
adds draft for retry after test in exponential mode
yhassanzadeh13 Apr 27, 2021
d7ef0be
updates exponential backup behavior
yhassanzadeh13 Apr 27, 2021
a711ee4
adds tests for chunk request updater
yhassanzadeh13 Apr 27, 2021
5481ad3
adds comment for with updater scenario
yhassanzadeh13 Apr 28, 2021
d6517d1
adds godoc for exponential updater
yhassanzadeh13 Apr 28, 2021
73ff6e9
Merge remote-tracking branch 'origin/master' into yahya/5428-exponent…
yhassanzadeh13 Apr 28, 2021
2188920
fixes mock for pending chunks
yhassanzadeh13 Apr 28, 2021
c98c7d7
fixes requester tests
yhassanzadeh13 Apr 28, 2021
3028aa1
logs updating dispatched requests
yhassanzadeh13 Apr 28, 2021
6e437c8
updates chunk requests interface
yhassanzadeh13 Apr 28, 2021
5e6d947
adds contains for identifier list
yhassanzadeh13 Apr 28, 2021
aaed073
refactors test with new qualifier
yhassanzadeh13 Apr 28, 2021
0401838
fixes tests with request info and update mocking
yhassanzadeh13 Apr 28, 2021
222f33d
fixes a bug on requester side
yhassanzadeh13 Apr 28, 2021
8eb1bf3
adds test dispatching requests on hybrid case
yhassanzadeh13 Apr 28, 2021
f9db537
removes unlimited qualifier
yhassanzadeh13 Apr 28, 2021
d436788
Merge remote-tracking branch 'origin/master' into yahya/5428-exponent…
yhassanzadeh13 Apr 29, 2021
cbd62f3
adds godoc to requester
yhassanzadeh13 Apr 29, 2021
d93bd53
fixes log
yhassanzadeh13 Apr 29, 2021
b2eaca9
fixes tests
yhassanzadeh13 Apr 29, 2021
03cab00
refactors test organization
yhassanzadeh13 Apr 29, 2021
bc9c663
adds more godoc to the tests
yhassanzadeh13 Apr 29, 2021
50de26d
Merge remote-tracking branch 'origin/master' into yahya/5428-exponent…
yhassanzadeh13 Apr 29, 2021
3b0cad9
adds more comment to tests
yhassanzadeh13 Apr 29, 2021
445819a
adds godoc for request qualifier methods
yhassanzadeh13 Apr 29, 2021
4ff097f
Merge remote-tracking branch 'origin/master' into yahya/5428-exponent…
yhassanzadeh13 Apr 29, 2021
b0587eb
minor refactors on chunk requests
yhassanzadeh13 Apr 29, 2021
840515e
fixes lint issues with tests
yhassanzadeh13 Apr 29, 2021
8e1f591
adds more test to chunk requests
yhassanzadeh13 Apr 29, 2021
421e324
fixes lint issues
yhassanzadeh13 Apr 29, 2021
d874af4
moves test setup to mock package and refactors tests
yhassanzadeh13 Apr 30, 2021
10f51f0
Merge remote-tracking branch 'origin/master' into yahya/5292-assigner…
yhassanzadeh13 Apr 30, 2021
3b11268
refactors test helpers
yhassanzadeh13 Apr 30, 2021
503e612
refactors tracers and loggers on tests
yhassanzadeh13 Apr 30, 2021
090978b
adds todos
yhassanzadeh13 Apr 30, 2021
aa0dc3d
Merge remote-tracking branch 'origin/master' into yahya/5292-assigner…
yhassanzadeh13 May 3, 2021
9b49725
fixes lint issue after merge
yhassanzadeh13 May 3, 2021
62064b9
refactors mock execution node in verification tests
yhassanzadeh13 May 3, 2021
ecaeba4
adds chunk data pack of helper
yhassanzadeh13 May 3, 2021
c6b6e93
moves fixture to the new package and refactors setup mock chunk provider
yhassanzadeh13 May 3, 2021
f231720
Merge remote-tracking branch 'origin/yahya/5292-assigner-fetcher-inte…
yhassanzadeh13 May 3, 2021
a24363c
refactors tests with complete execution receipt list methods
yhassanzadeh13 May 3, 2021
040cd76
adds godocs for test helpers
yhassanzadeh13 May 3, 2021
15d46d5
adds chunk of test helper
yhassanzadeh13 May 3, 2021
7e9eb82
enables mock consensus node for multiple results and refactors tests
yhassanzadeh13 May 3, 2021
dee75e0
adds batch ready and done helpers to unittest
yhassanzadeh13 May 4, 2021
0225989
adds done helper for generic node
yhassanzadeh13 May 4, 2021
010c4d8
reorganizes new verification node constructor
yhassanzadeh13 May 4, 2021
160f713
adds handler engine registration method and its implementation
yhassanzadeh13 May 4, 2021
df82596
fixes lint issues in verification tests
yhassanzadeh13 May 4, 2021
0f02d25
wires up the assigner and fetcher tests
yhassanzadeh13 May 4, 2021
91473e0
addresses system chunk collection verification
yhassanzadeh13 May 4, 2021
e001510
avoids stopping verification node on tests
yhassanzadeh13 May 4, 2021
0435b56
fixes collection ID of system chunk on fixtures
yhassanzadeh13 May 4, 2021
de7bf48
adds logger to consumer module
yhassanzadeh13 May 4, 2021
0f5044c
fixes lint issues
yhassanzadeh13 May 4, 2021
052b570
fixes a bug with chunk consumer notifier
yhassanzadeh13 May 4, 2021
ae99dab
wip with assigner and fetcher tests
yhassanzadeh13 May 4, 2021
1e84484
refactors imports
yhassanzadeh13 May 4, 2021
657e59e
fixes import cycle and mocking issues
yhassanzadeh13 May 4, 2021
6a6f6ef
work in progress with system chunk
yhassanzadeh13 May 5, 2021
fda7186
encapsulates validating chunks and fixes notifying sealed blocks
yhassanzadeh13 May 5, 2021
fb25bc7
fixes tests on fetcher engine
yhassanzadeh13 May 5, 2021
2ba31c9
Merge remote-tracking branch 'origin/master' into yahya/5292-assigner…
yhassanzadeh13 May 5, 2021
9d71f42
fixes executor id for execution results fixture
yhassanzadeh13 May 5, 2021
dce7527
fixes integration test
yhassanzadeh13 May 5, 2021
0ea5908
cleans up tests
yhassanzadeh13 May 5, 2021
6febb12
adds documentation
yhassanzadeh13 May 5, 2021
dcd6baa
refactors tests
yhassanzadeh13 May 5, 2021
badd654
decouples validating collections
yhassanzadeh13 May 5, 2021
11bc124
cleans up tests
yhassanzadeh13 May 5, 2021
dd24309
refactors a godoc
yhassanzadeh13 May 5, 2021
f27bf86
adds godoc to the test.
yhassanzadeh13 May 6, 2021
f3b9fd6
Merge remote-tracking branch 'origin/master' into yahya/5292-assigner…
yhassanzadeh13 May 6, 2021
b8c1958
adds mock assertions
yhassanzadeh13 May 6, 2021
e385e1e
fixes documentations
yhassanzadeh13 May 6, 2021
ebaa474
fixes log messages
yhassanzadeh13 May 6, 2021
0f93263
fixes logs
yhassanzadeh13 May 6, 2021
5d6f009
fixes tests
yhassanzadeh13 May 6, 2021
6f31298
adds metric collector interface
yhassanzadeh13 May 7, 2021
84e475d
refactors metrics name
yhassanzadeh13 May 7, 2021
9e170cb
adds metrics variables
yhassanzadeh13 May 7, 2021
2e02819
adds verification name spaces
yhassanzadeh13 May 11, 2021
8705a92
Merge remote-tracking branch 'origin/master' into yahya/5292-assigner…
yhassanzadeh13 May 11, 2021
3f8ebe5
adds chunk locator ID method to chunk status
yhassanzadeh13 May 11, 2021
766b28b
extends error messages with identifiers
yhassanzadeh13 May 11, 2021
b34e6d4
refactors order of calling consumer on sealed block
yhassanzadeh13 May 11, 2021
1c7bedd
Update engine/verification/test/assignerfetcher_test.go
yhassanzadeh13 May 11, 2021
760e723
Update engine/verification/test/assignerfetcher_test.go
yhassanzadeh13 May 11, 2021
fe03f96
fixes lints
yhassanzadeh13 May 11, 2021
61ff720
refactors ready-done-aware test helpers
yhassanzadeh13 May 11, 2021
64c8a27
Merge remote-tracking branch 'origin/master' into yahya/5292-assigner…
yhassanzadeh13 May 11, 2021
8e53920
refactors tests with require component ready and done
yhassanzadeh13 May 11, 2021
ac1bdb5
Merge branch 'yahya/5292-assigner-fetcher-integration-test' into yahy…
yhassanzadeh13 May 11, 2021
a05c476
fixes godocs
yhassanzadeh13 May 11, 2021
d119554
fixes namespace
yhassanzadeh13 May 11, 2021
5abc63c
adds metrics and registrations
yhassanzadeh13 May 11, 2021
a4d3895
implements metrics methods
yhassanzadeh13 May 11, 2021
ab17d2d
wires in metrics to fetcher and requester
yhassanzadeh13 May 11, 2021
aafe23c
fixes TestProcessAssignedChunkHappyPath
yhassanzadeh13 May 11, 2021
ca37128
fixes TestChunkResponse_RemovingStatusFails
yhassanzadeh13 May 11, 2021
1d4ca6a
fixes TestProcessAssignChunkSealedAfterRequest
yhassanzadeh13 May 11, 2021
1441b6b
fixes TestChunkResponse_InvalidChunkDataPack TestChunkResponse_Missin…
yhassanzadeh13 May 11, 2021
596ba5d
fixes TestSkipChunkOfSealedBlock
yhassanzadeh13 May 11, 2021
51cf47b
Merge remote-tracking branch 'origin/master' into yahya/5427-fetcher-…
yhassanzadeh13 May 11, 2021
fcc94af
refactors metrics to mock in requester tests
yhassanzadeh13 May 11, 2021
3f8969a
fixes TestHandleChunkDataPack_HappyPath
yhassanzadeh13 May 11, 2021
bbf0279
fixes TestCompleteRequestingUnsealedChunkLifeCycle
yhassanzadeh13 May 12, 2021
80b95e0
fixes TestRequestPendingChunkSealedBlock_Hybrid
yhassanzadeh13 May 12, 2021
d64699a
Merge remote-tracking branch 'origin/master' into yahya/5427-fetcher-…
yhassanzadeh13 May 12, 2021
45252a8
fixes TestDispatchingRequests_Hybrid
yhassanzadeh13 May 12, 2021
b788a3f
reorganizes the code
yhassanzadeh13 May 12, 2021
a1f398b
adds metrics support for chunk status
yhassanzadeh13 May 12, 2021
254e421
adds metrics for chunk requests mempool size
yhassanzadeh13 May 12, 2021
8c442b2
generates mocks for mempools
yhassanzadeh13 May 12, 2021
7e7fad4
adds tracer labels
yhassanzadeh13 May 12, 2021
2027c5c
adds context to chunk status
yhassanzadeh13 May 12, 2021
94587a6
adds tracer to fetcher engine
yhassanzadeh13 May 12, 2021
75d6ffe
adds tracer for pushing chunk to verifier and validating it
yhassanzadeh13 May 12, 2021
f0e2084
Merge remote-tracking branch 'origin/master' into yahya/5427-fetcher-…
yhassanzadeh13 May 12, 2021
a5573ef
adds tracer labels for requester engine
yhassanzadeh13 May 12, 2021
75d168c
adds tracer to requester engine
yhassanzadeh13 May 12, 2021
00a0d2d
removes is system chunk from match engine
yhassanzadeh13 May 12, 2021
116f66f
moves happy path verification test to utils
yhassanzadeh13 May 13, 2021
1a67629
refactors demo with happy path
yhassanzadeh13 May 13, 2021
830de73
Merge remote-tracking branch 'origin/master' into yahya/5427-fetcher-…
yhassanzadeh13 May 13, 2021
0030198
fixes lint issues
yhassanzadeh13 May 13, 2021
08c34cc
adds random calls for our new metrics
yhassanzadeh13 May 13, 2021
7c378df
refactors tracing on fetcher engine
yhassanzadeh13 May 13, 2021
6b964f0
fixes godocs
yhassanzadeh13 May 13, 2021
826907b
refactors metrics
yhassanzadeh13 May 13, 2021
2f1a912
Merge branch 'master' into yahya/5427-fetcher-and-requester-metrics
yhassanzadeh13 May 14, 2021
cfde9c1
Merge branch 'master' into yahya/5427-fetcher-and-requester-metrics
yhassanzadeh13 May 14, 2021
4fa9144
WIP
yhassanzadeh13 May 14, 2021
6d4645c
adds chunk request mempool
yhassanzadeh13 May 17, 2021
f47487e
wires in new engines
yhassanzadeh13 May 17, 2021
7d8c563
fixes dependency issue in cmd
yhassanzadeh13 May 17, 2021
91e99c4
swaps component orders
yhassanzadeh13 May 18, 2021
eb863c4
removes handler checking from requester
yhassanzadeh13 May 18, 2021
9448f7c
reorganizes component initializations
yhassanzadeh13 May 18, 2021
9b4a28b
reports error on block consumer initialization
yhassanzadeh13 May 18, 2021
19e1ac5
separates chunk consumer and block consumer as separate modules
yhassanzadeh13 May 18, 2021
fb641e9
removes checking handler fatal logs
yhassanzadeh13 May 18, 2021
4f4855e
adds comments for verification parameters
yhassanzadeh13 May 19, 2021
48f1c3f
Merge remote-tracking branch 'origin/master' into yahya/5521-roll-in-…
yhassanzadeh13 May 19, 2021
b2fafd9
fixes lint
yhassanzadeh13 May 19, 2021
d715159
updates mock network
yhassanzadeh13 May 19, 2021
91697b1
migrates constants and refactors data types
yhassanzadeh13 May 19, 2021
06fb98d
fixes a comment
yhassanzadeh13 May 19, 2021
00dad92
Merge branch 'master' into yahya/5521-roll-in-new-verificaiton
yhassanzadeh13 May 20, 2021
9559281
refactors bootstrapping fetcher and requester as modules
yhassanzadeh13 May 20, 2021
892598a
groups requester and fetcher in the same component
yhassanzadeh13 May 20, 2021
1cd712e
wires in done dependency
yhassanzadeh13 May 20, 2021
e6f318e
Merge remote-tracking branch 'origin/master' into yahya/5521-roll-in-…
yhassanzadeh13 May 31, 2021
a00c2b3
fixes lint issues
yhassanzadeh13 May 31, 2021
a5ecf42
Merge remote-tracking branch 'origin/master' into yahya/5521-roll-in-…
yhassanzadeh13 Jun 2, 2021
1481140
sets chunk and block workers
yhassanzadeh13 Jun 2, 2021
9cd3053
Merge remote-tracking branch 'origin/master' into yahya/5521-roll-in-…
yhassanzadeh13 Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
338 changes: 139 additions & 199 deletions cmd/verification/main.go

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions engine/testutil/nodes.go
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/onflow/flow-go/engine/verification/fetcher/chunkconsumer"
"github.com/onflow/flow-go/engine/verification/finder"
"github.com/onflow/flow-go/engine/verification/match"
verificationrequester "github.com/onflow/flow-go/engine/verification/requester"
vereq "github.com/onflow/flow-go/engine/verification/requester"
"github.com/onflow/flow-go/engine/verification/verifier"
"github.com/onflow/flow-go/fvm"
"github.com/onflow/flow-go/ledger/common/pathfinder"
Expand Down Expand Up @@ -889,19 +889,22 @@ func NewVerificationNode(t testing.TB,
}

if node.RequesterEngine == nil {
node.RequesterEngine, err = verificationrequester.New(node.Log,
node.RequesterEngine, err = vereq.New(node.Log,
node.State,
node.Net,
node.Tracer,
collector,
node.ChunkRequests,
100*time.Millisecond,
vereq.DefaultRequestInterval,
// requests are only qualified if their retryAfter is elapsed.
verificationrequester.RetryAfterQualifier,
vereq.RetryAfterQualifier,
// exponential backoff with multiplier of 2, minimum interval of a second, and
// maximum interval of an hour.
mempool.ExponentialUpdater(2, time.Hour, time.Second),
2)
mempool.ExponentialUpdater(
vereq.DefaultBackoffMultiplier,
vereq.DefaultBackoffMaxInterval,
vereq.DefaultBackoffMinInterval),
vereq.DefaultRequestTargets)

require.NoError(t, err)
}
Expand All @@ -925,7 +928,7 @@ func NewVerificationNode(t testing.TB,
node.ProcessedChunkIndex,
node.ChunksQueue,
node.FetcherEngine,
int64(3)) // defaults number of workers to 3.
chunkconsumer.DefaultChunkWorkers) // defaults number of workers to 3.
}

if node.AssignerEngine == nil {
Expand All @@ -945,7 +948,7 @@ func NewVerificationNode(t testing.TB,
node.Blocks,
node.State,
node.AssignerEngine,
int64(3)) // defaults number of workers to 3.
blockconsumer.DefaultBlockWorkers)
require.NoError(t, err)
}

Expand Down
5 changes: 4 additions & 1 deletion engine/verification/assigner/blockconsumer/consumer.go
Expand Up @@ -14,6 +14,9 @@ import (
"github.com/onflow/flow-go/storage"
)

// DefaultBlockWorkers is the number of blocks processed in parallel.
const DefaultBlockWorkers = uint64(5)

// BlockConsumer listens to the OnFinalizedBlock event
// and notifies the consumer to check in the job queue
// (i.e., its block reader) for new block jobs.
Expand Down Expand Up @@ -42,7 +45,7 @@ func NewBlockConsumer(log zerolog.Logger,
blocks storage.Blocks,
state protocol.State,
blockProcessor assigner.FinalizedBlockProcessor,
maxProcessing int64) (*BlockConsumer, uint64, error) {
maxProcessing uint64) (*BlockConsumer, uint64, error) {

lg := log.With().Str("module", "block_consumer").Logger()

Expand Down
Expand Up @@ -116,7 +116,7 @@ func withConsumer(
withBlockConsumer func(*blockconsumer.BlockConsumer, []*flow.Block),
) {
unittest.RunWithBadgerDB(t, func(db *badger.DB) {
maxProcessing := int64(workerCount)
maxProcessing := uint64(workerCount)

processedHeight := bstorage.NewConsumerProgress(db, module.ConsumeProgressVerificationBlockHeight)
collector := &metrics.NoopCollector{}
Expand Down
5 changes: 3 additions & 2 deletions engine/verification/fetcher/chunkconsumer/consumer.go
Expand Up @@ -12,7 +12,8 @@ import (
)

const (
DefaultJobIndex = uint64(0)
DefaultJobIndex = uint64(0)
DefaultChunkWorkers = uint64(20)
)

// ChunkConsumer consumes the jobs from the job queue, and pass it to the
Expand All @@ -28,7 +29,7 @@ func NewChunkConsumer(
processedIndex storage.ConsumerProgress, // to persist the processed index
chunksQueue storage.ChunksQueue, // to read jobs (chunks) from
engine fetcher.AssignedChunkProcessor, // to process jobs (chunks)
maxProcessing int64, // max number of jobs to be processed in parallel
maxProcessing uint64, // max number of jobs to be processed in parallel
) *ChunkConsumer {
worker := NewWorker(engine)
engine.WithChunkConsumerNotifier(worker)
Expand Down
Expand Up @@ -141,7 +141,7 @@ func WithConsumer(
withConsumer func(*chunkconsumer.ChunkConsumer, *storage.ChunksQueue),
) {
unittest.RunWithBadgerDB(t, func(db *badger.DB) {
maxProcessing := int64(3)
maxProcessing := uint64(3)

processedIndex := storage.NewConsumerProgress(db, module.ConsumeProgressVerificationChunkIndex)
chunksQueue := storage.NewChunkQueue(db)
Expand Down
3 changes: 0 additions & 3 deletions engine/verification/fetcher/engine.go
Expand Up @@ -94,9 +94,6 @@ func (e *Engine) WithChunkConsumerNotifier(notifier module.ProcessingNotifier) {

// Ready initializes the engine and returns a channel that is closed when the initialization is done
func (e *Engine) Ready() <-chan struct{} {
if e.chunkConsumerNotifier == nil {
e.log.Fatal().Msg("missing chunk consumer notifier callback in verification fetcher engine")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this change is to resolve a cyclic dependency that causes node crash on startup:

Hence, we discard this checking and rely on the fact that similar to any other component of a node, missing a chunkConsumerNotifier literally leads the node to crash with panic upon processing the first chunk. This is the same strategy we take about other components, e.g., network, which missing assignment of that on a node panics the first time node tries sending a message.

The other solution would be to decouple the component initialization and startup on the scaffold, but not sure of its side effects on other nodes (considerable on a separate PR).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it will introduce a race condition at startup where sometimes the node will crash. I don't think the network component has the same behaviour (it may error before the mesh network is set up but it won't crash the node). It would be better to avoid this if we can.

What we do for some other engines with a similar dependency structure (eg. epochmgr, compliance) is embed the dependency within the engine and have the engine manage the lifecycle of the dependency. Then both the dependency and the engine can be instantiated in one Component block in the scaffold.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9559281 and 892598a

return e.unit.Ready()
}

Expand Down
25 changes: 19 additions & 6 deletions engine/verification/requester/requester.go
Expand Up @@ -22,6 +22,23 @@ import (
"github.com/onflow/flow-go/utils/logging"
)

const (
// DefaultRequestInterval is the time interval that requester engine tries requesting chunk data packs.
DefaultRequestInterval = 1000 * time.Millisecond

// DefaultBackoffMultiplier is the base of exponent in exponential backoff multiplier for backing off requests for chunk data packs.
DefaultBackoffMultiplier = float64(2)

// DefaultBackoffMinInterval is the minimum time interval a chunk data pack request waits before dispatching.
DefaultBackoffMinInterval = 1 * time.Millisecond

// DefaultBackoffMaxInterval is the maximum time interval a chunk data pack request waits before dispatching.
DefaultBackoffMaxInterval = 1 * time.Minute

// DefaultRequestTargets is the maximum number of execution nodes a chunk data pack request is dispatched to.
DefaultRequestTargets = 2
)

// Engine implements a ChunkDataPackRequester that is responsible of receiving chunk data pack requests,
// dispatching it to the execution nodes, receiving the requested chunk data pack from execution nodes,
// and passing it to the registered handler.
Expand All @@ -41,7 +58,7 @@ type Engine struct {

// internal logic
retryInterval time.Duration // determines time in milliseconds for retrying chunk data requests.
requestTargets uint // maximum number of execution nodes being asked for a chunk data pack.
requestTargets uint64 // maximum number of execution nodes being asked for a chunk data pack.
pendingRequests mempool.ChunkRequests // used to track requested chunks.
reqQualifierFunc RequestQualifierFunc // used to decide whether to dispatch a request at a certain cycle.
reqUpdaterFunc mempool.ChunkRequestHistoryUpdaterFunc // used to atomically update chunk request info on mempool.
Expand All @@ -56,7 +73,7 @@ func New(log zerolog.Logger,
retryInterval time.Duration,
reqQualifierFunc RequestQualifierFunc,
reqUpdaterFunc mempool.ChunkRequestHistoryUpdaterFunc,
requestTargets uint) (*Engine, error) {
requestTargets uint64) (*Engine, error) {

e := &Engine{
log: log.With().Str("engine", "requester").Logger(),
Expand Down Expand Up @@ -116,10 +133,6 @@ func (e *Engine) Process(originID flow.Identifier, event interface{}) error {

// Ready initializes the engine and returns a channel that is closed when the initialization is done.
func (e *Engine) Ready() <-chan struct{} {
if e.handler == nil {
e.log.Fatal().Msg("could not start requester engine with missing chunk data pack handler")
}

delay := time.Duration(0)
// run a periodic check to retry requesting chunk data packs.
// if onTimer takes longer than retryInterval, the next call will be blocked until the previous
Expand Down
2 changes: 1 addition & 1 deletion engine/verification/requester/requester_test.go
Expand Up @@ -41,7 +41,7 @@ type RequesterEngineTestSuite struct {
verIdentity *flow.Identity // verification node

// parameters
requestTargets uint
requestTargets uint64
retryInterval time.Duration // determines time in milliseconds for retrying chunk data requests.
}

Expand Down
9 changes: 5 additions & 4 deletions module/jobqueue/consumer.go
Expand Up @@ -29,7 +29,7 @@ type Consumer struct {
worker Worker // to process job and notify consumer when finish processing a job

// Config
maxProcessing int64 // max number of jobs to be processed concurrently
maxProcessing uint64 // max number of jobs to be processed concurrently

// State Variables
running bool // a signal to control whether to start processing more jobs. Useful for waiting
Expand All @@ -49,7 +49,7 @@ func NewConsumer(
jobs module.Jobs,
progress storage.ConsumerProgress,
worker Worker,
maxProcessing int64,
maxProcessing uint64,
) *Consumer {
return &Consumer{
log: log.With().Str("sub_module", "job_queue").Logger(),
Expand Down Expand Up @@ -259,12 +259,13 @@ func (c *Consumer) processableJobs() ([]*jobAtIndex, uint64, error) {
// processableJobs check the worker's capacity and if sufficient, read
// jobs from the storage, return the processable jobs, and the processed
// index
func processableJobs(jobs module.Jobs, processings map[uint64]*jobStatus, maxProcessing int64, processedIndex uint64) ([]*jobAtIndex, uint64, error) {
func processableJobs(jobs module.Jobs, processings map[uint64]*jobStatus, maxProcessing uint64, processedIndex uint64) ([]*jobAtIndex, uint64,
error) {
processables := make([]*jobAtIndex, 0)

// count how many jobs are still processing,
// in order to decide whether to process a new job
processing := int64(0)
processing := uint64(0)

// if still have processing capacity, find the next processable job
for i := processedIndex + 1; processing < maxProcessing; i++ {
Expand Down
2 changes: 1 addition & 1 deletion module/jobqueue/consumer_behavior_test.go
Expand Up @@ -450,7 +450,7 @@ func assertProcessed(t testing.TB, cp storage.ConsumerProgress, expectProcessed

func newTestConsumer(cp storage.ConsumerProgress, jobs module.Jobs, worker jobqueue.Worker) module.JobConsumer {
log := unittest.Logger().With().Str("module", "consumer").Logger()
maxProcessing := int64(3)
maxProcessing := uint64(3)
c := jobqueue.NewConsumer(log, jobs, cp, worker, maxProcessing)
return c
}
Expand Down
4 changes: 2 additions & 2 deletions module/jobqueue/consumer_test.go
Expand Up @@ -19,7 +19,7 @@ import (
func TestProcessableJobs(t *testing.T) {
t.Parallel()

maxProcessing := int64(3)
maxProcessing := uint64(3)

t.Run("no job, nothing to process", func(t *testing.T) {
jobs := NewMockJobs() // no job in the queue
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestProcessedIndexDeletion(t *testing.T) {
jobs := NewMockJobs()
progress := badger.NewConsumerProgress(db, "consumer")
worker := newMockWorker()
maxProcessing := int64(3)
maxProcessing := uint64(3)
c := NewConsumer(log, jobs, progress, worker, maxProcessing)
worker.WithConsumer(c)

Expand Down
27 changes: 27 additions & 0 deletions network/mocknetwork/message_processor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.