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

Stream Duties Client Implementation #5867

Merged
merged 213 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
2da2e37
include validator client stream
rauljordan May 15, 2020
1832c6d
Update validator/client/validator_attest.go
rauljordan May 15, 2020
929c2ce
gazelle
rauljordan May 15, 2020
07090ed
Merge branch 'client-stream-duties' of github.com:prysmaticlabs/prysm…
rauljordan May 15, 2020
735efba
Merge branch 'master' into client-stream-duties
rauljordan May 15, 2020
341c552
rem extraneous logs
rauljordan May 15, 2020
c915e29
Merge branch 'client-stream-duties' of github.com:prysmaticlabs/prysm…
rauljordan May 15, 2020
b29dd21
fixing tests
rauljordan May 15, 2020
f8e0ae2
resolve most tests
rauljordan May 15, 2020
3fc8eaf
gaz
rauljordan May 15, 2020
2141a76
add lock
rauljordan May 15, 2020
dcac9ca
ivan feedback
rauljordan May 15, 2020
337d8cd
pass tests for update protect
rauljordan May 15, 2020
dd1428b
Merge branch 'master' into client-stream-duties
rauljordan May 16, 2020
10d360f
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 16, 2020
aa2a785
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 16, 2020
67f6817
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 16, 2020
817e8a5
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 17, 2020
c2ca798
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 17, 2020
c4b7dbd
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
a66fffa
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
76c1cf9
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
64fb758
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
a0dc414
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
e382d78
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
96044ae
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
951d298
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
f95438f
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
d35b682
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 18, 2020
64a4fe3
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 19, 2020
3d0339a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 19, 2020
1c873f6
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 19, 2020
e020e51
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 19, 2020
f809489
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 19, 2020
3f9c317
gaz
rauljordan May 19, 2020
ad0da88
duties gaz
rauljordan May 19, 2020
1979dd7
no need for canonical head slot
rauljordan May 19, 2020
efe921c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 19, 2020
1f4315a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
43d31bd
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
01cfd0c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
8c0e967
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
a2ad1fa
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
0d8d55a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
1d791ec
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
8ca68e3
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
fb78890
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 20, 2020
023a42b
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 21, 2020
3fe204a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 21, 2020
414f50e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 22, 2020
71fea1f
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 22, 2020
16019dc
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 22, 2020
bb7b80a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 22, 2020
019f513
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 22, 2020
d48c7a0
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 22, 2020
414b61c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 23, 2020
7163d9d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 23, 2020
0f4c993
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 25, 2020
2b05397
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 25, 2020
31903cc
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 25, 2020
c6179f6
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 25, 2020
39c33c5
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
183f1f9
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
da6563c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
c475276
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
bcb4683
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
6079f25
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
66508c7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
ad740f7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 26, 2020
176de3a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 27, 2020
bcaa965
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 27, 2020
e1a8ad5
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 27, 2020
6593cc7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 27, 2020
1b39303
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 27, 2020
7f688dc
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 27, 2020
2a93f9d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
3d3c0f8
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
adcb379
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
a19b910
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
46ca4e1
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
ea64665
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
e4e608d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 28, 2020
50c2ae5
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
5a17569
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
ff474a8
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
e39b839
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
30594c9
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
8390ca8
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
e17c744
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
babc57b
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
b6efe08
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
f810191
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 29, 2020
e108349
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 31, 2020
caf15fb
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 31, 2020
f0e1c2e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] May 31, 2020
e4934eb
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
b8b781c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
2a4619e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
120adfe
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
5644a27
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
d8650be
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
5ba736d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
90fdb7e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
943c924
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
c2bd4a8
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 1, 2020
ef3f1ef
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 2, 2020
3fd4467
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 2, 2020
ec6812c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 2, 2020
234d1e0
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 2, 2020
3c5ec64
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
cc54ea7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
e6a8be8
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
37a8e3c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
e18fa92
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
6578a56
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
b906005
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
1d4d90e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
e8423a5
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 3, 2020
9d8790b
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
a338ae6
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
330c973
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
a0aa213
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
72ae827
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
afbd096
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
c0448e0
fix ctx leak
rauljordan Jun 4, 2020
aa58db7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
107102a
fmt
rauljordan Jun 4, 2020
5285e54
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 4, 2020
a46061d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
2c6dd47
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
d2f56dc
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
8a8c0a1
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
b6115a1
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
0a54e8d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
1be7970
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
bbf8ba8
add in feature flag
rauljordan Jun 5, 2020
8573407
Merge branch 'client-stream-duties' of github.com:prysmaticlabs/prysm…
rauljordan Jun 5, 2020
b813562
add streaming subpackage
rauljordan Jun 5, 2020
5a98026
add polling/streaming separation
rauljordan Jun 5, 2020
2c039d8
able to build
rauljordan Jun 5, 2020
761330d
fix duplicate package names
rauljordan Jun 5, 2020
5b4c41d
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
9ddc97e
fix polling
rauljordan Jun 5, 2020
185345d
Merge branch 'client-stream-duties' of github.com:prysmaticlabs/prysm…
rauljordan Jun 5, 2020
bf12680
imports
rauljordan Jun 5, 2020
89da83b
confirm it works
rauljordan Jun 5, 2020
d3d46cd
fixed up comment
rauljordan Jun 5, 2020
dd053dc
go lint comments
rauljordan Jun 5, 2020
3cdb202
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 5, 2020
3c6fa38
gaz
rauljordan Jun 5, 2020
d4c7401
Merge branch 'client-stream-duties' of github.com:prysmaticlabs/prysm…
rauljordan Jun 5, 2020
4bba515
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 6, 2020
562e2bf
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 6, 2020
bd3960b
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 6, 2020
90c77a6
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 6, 2020
074dcfb
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 7, 2020
b55fa3c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 8, 2020
d463d71
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 8, 2020
b3c3522
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 8, 2020
ae6a321
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 9, 2020
e803a4e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 9, 2020
8803b83
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 9, 2020
f46ef34
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 9, 2020
b7e190e
resolve confs
rauljordan Jun 10, 2020
5f43eae
build
rauljordan Jun 10, 2020
ab96efd
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 10, 2020
f08c976
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
ab8fab4
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
09a5c57
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
3bf4351
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
5935a71
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
7164da3
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
82944e1
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
4dc8bad
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
63a0dd7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
ac9ceaf
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
e2ea6d3
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 11, 2020
fc0495a
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
3b7b87f
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
f621bc2
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
2f83d4c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
147a9dc
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
7f57cea
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
69c552c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
f5fc206
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
effb50e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 12, 2020
f910e89
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 13, 2020
a4b75df
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 14, 2020
409c35c
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 14, 2020
d73590b
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 14, 2020
db86068
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 14, 2020
e590eab
fix up confs
rauljordan Jun 15, 2020
eef02f0
Merge branch 'client-stream-duties' of github.com:prysmaticlabs/prysm…
rauljordan Jun 15, 2020
a031e74
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
e3239a7
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
6aef3ca
Update validator/client/streaming/service_test.go
rauljordan Jun 15, 2020
d830eb8
tidy
rauljordan Jun 15, 2020
75c3899
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
d0a9710
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
77279f8
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
321af4e
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
c65c3bb
fmt
rauljordan Jun 15, 2020
b9734ea
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
c9ca9b4
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 15, 2020
0e7c681
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 16, 2020
0656523
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 16, 2020
89d7697
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 16, 2020
c041355
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 16, 2020
4341481
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 16, 2020
c9f9fbc
add stream duties to e2e
rauljordan Jun 17, 2020
bbbeb44
Merge refs/heads/master into client-stream-duties
prylabs-bulldozer[bot] Jun 17, 2020
5cdca39
add stream duties to e2e flags
rauljordan Jun 18, 2020
892c279
Merge branch 'master' into client-stream-duties
rauljordan Jun 18, 2020
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
4 changes: 3 additions & 1 deletion validator/client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
"validator.go",
"validator_aggregate.go",
"validator_attest.go",
"validator_duties.go",
"validator_log.go",
"validator_metrics.go",
"validator_propose.go",
Expand Down Expand Up @@ -63,6 +64,7 @@ go_test(
"service_test.go",
"validator_aggregate_test.go",
"validator_attest_test.go",
"validator_duties_test.go",
"validator_propose_test.go",
"validator_test.go",
],
Expand Down Expand Up @@ -93,4 +95,4 @@ go_test(
"@com_github_sirupsen_logrus//hooks/test:go_default_library",
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
],
)
)
12 changes: 5 additions & 7 deletions validator/client/fake_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type fakeValidator struct {
WaitForSyncedCalled bool
NextSlotCalled bool
CanonicalHeadSlotCalled bool
UpdateDutiesCalled bool
StreamDutiesCalled bool
UpdateProtectionsCalled bool
RoleAtCalled bool
AttestToBlockHeadCalled bool
Expand All @@ -26,10 +26,9 @@ type fakeValidator struct {
ProposeBlockArg1 uint64
AttestToBlockHeadArg1 uint64
RoleAtArg1 uint64
UpdateDutiesArg1 uint64
NextSlotRet <-chan uint64
PublicKey string
UpdateDutiesRet error
StreamDutiesRet error
RolesAtRet []validatorRole
}

Expand Down Expand Up @@ -72,10 +71,9 @@ func (fv *fakeValidator) NextSlot() <-chan uint64 {
return fv.NextSlotRet
}

func (fv *fakeValidator) UpdateDuties(_ context.Context, slot uint64) error {
fv.UpdateDutiesCalled = true
fv.UpdateDutiesArg1 = slot
return fv.UpdateDutiesRet
func (fv *fakeValidator) StreamDuties(_ context.Context) error {
fv.StreamDutiesCalled = true
return fv.StreamDutiesRet
}

func (fv *fakeValidator) UpdateProtections(_ context.Context, slot uint64) error {
Expand Down
30 changes: 14 additions & 16 deletions validator/client/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Validator interface {
NextSlot() <-chan uint64
SlotDeadline(slot uint64) time.Time
LogValidatorGainsAndLosses(ctx context.Context, slot uint64) error
UpdateDuties(ctx context.Context, slot uint64) error
StreamDuties(ctx context.Context) error
UpdateProtections(ctx context.Context, slot uint64) error
RolesAt(ctx context.Context, slot uint64) (map[[48]byte][]validatorRole, error) // validator pubKey -> roles
SubmitAttestation(ctx context.Context, slot uint64, pubKey [48]byte)
Expand All @@ -43,8 +43,8 @@ type Validator interface {
// Order of operations:
// 1 - Initialize validator data
// 2 - Wait for validator activation
// 3 - Wait for the next slot start
// 4 - Update assignments
// 3 - Listen to a server-side stream of validator duties
// 4 - Wait for the next slot start
// 5 - Determine role at current slot
// 6 - Perform assigned role, if any
func run(ctx context.Context, v Validator) {
Expand All @@ -64,13 +64,20 @@ func run(ctx context.Context, v Validator) {
if err := v.WaitForActivation(ctx); err != nil {
log.Fatalf("Could not wait for validator activation: %v", err)
}
log.Info("Got activation")
headSlot, err := v.CanonicalHeadSlot(ctx)
if err != nil {
log.Fatalf("Could not get current canonical head slot: %v", err)
}
if err := v.UpdateDuties(ctx, headSlot); err != nil {
handleAssignmentError(err, headSlot)
}
log.Info("Got canonical head slot")
// We listen to a server-side stream of validator duties in the
// background of the validator client.
go func() {
log.Info("Requesting duties stream")
if err := v.StreamDuties(ctx); err != nil {
handleAssignmentError(err, headSlot)
}
}()
for {
ctx, span := trace.StartSpan(ctx, "validator.processSlot")

Expand All @@ -81,23 +88,14 @@ func run(ctx context.Context, v Validator) {
case slot := <-v.NextSlot():
span.AddAttributes(trace.Int64Attribute("slot", int64(slot)))
deadline := v.SlotDeadline(slot)
slotCtx, cancel := context.WithDeadline(ctx, deadline)
slotCtx, _ := context.WithDeadline(ctx, deadline)
// Report this validator client's rewards and penalties throughout its lifecycle.
log := log.WithField("slot", slot)
log.WithField("deadline", deadline).Debug("Set deadline for proposals and attestations")
if err := v.LogValidatorGainsAndLosses(slotCtx, slot); err != nil {
log.WithError(err).Error("Could not report validator's rewards/penalties")
}

// Keep trying to update assignments if they are nil or if we are past an
// epoch transition in the beacon node's state.
if err := v.UpdateDuties(ctx, slot); err != nil {
handleAssignmentError(err, slot)
cancel()
span.End()
continue
}

if featureconfig.Get().ProtectAttester {
if err := v.UpdateProtections(ctx, slot); err != nil {
log.WithError(err).Error("Could not update validator protection")
Expand Down
46 changes: 0 additions & 46 deletions validator/client/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ package client

import (
"context"
"errors"
"testing"
"time"

"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/testutil"
logTest "github.com/sirupsen/logrus/hooks/test"
)

func cancelledContext() context.Context {
Expand Down Expand Up @@ -54,49 +51,6 @@ func TestCancelledContext_WaitsForActivation(t *testing.T) {
}
}

func TestUpdateDuties_NextSlot(t *testing.T) {
v := &fakeValidator{}
ctx, cancel := context.WithCancel(context.Background())

slot := uint64(55)
ticker := make(chan uint64)
v.NextSlotRet = ticker
go func() {
ticker <- slot

cancel()
}()

run(ctx, v)

if !v.UpdateDutiesCalled {
t.Fatalf("Expected UpdateAssignments(%d) to be called", slot)
}
if v.UpdateDutiesArg1 != slot {
t.Errorf("UpdateAssignments was called with wrong argument. Want=%d, got=%d", slot, v.UpdateDutiesArg1)
}
}

func TestUpdateDuties_HandlesError(t *testing.T) {
hook := logTest.NewGlobal()
v := &fakeValidator{}
ctx, cancel := context.WithCancel(context.Background())

slot := uint64(55)
ticker := make(chan uint64)
v.NextSlotRet = ticker
go func() {
ticker <- slot

cancel()
}()
v.UpdateDutiesRet = errors.New("bad")

run(ctx, v)

testutil.AssertLogsContain(t, hook, "Failed to update assignments")
}

func TestRoleAt_NextSlot(t *testing.T) {
v := &fakeValidator{}
ctx, cancel := context.WithCancel(context.Background())
Expand Down
5 changes: 2 additions & 3 deletions validator/client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func (v *ValidatorService) Start() {
}
v.validator = &validator{
db: valDB,
dutiesByEpoch: make(map[uint64][]*ethpb.DutiesResponse_Duty, 2), // 2 epochs worth of duties.
validatorClient: ethpb.NewBeaconNodeValidatorClient(v.conn),
beaconClient: ethpb.NewBeaconChainClient(v.conn),
node: ethpb.NewNodeClient(v.conn),
Expand All @@ -200,9 +201,7 @@ func (v *ValidatorService) Stop() error {
return nil
}

// Status ...
//
// WIP - not done.
// Status of the validator service's health.
func (v *ValidatorService) Status() error {
if v.conn == nil {
return errors.New("no connection to beacon RPC")
Expand Down