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

fix!: update validator liveness API to be spec compliant #5667

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jun 18, 2023

Motivation

Current implementation of validator liveness API is not spec compliant, see getLiveness.

The API was initially introduced in

and further updated here

Description

Update validator liveness API to conform with latest beacon API spec (liveness.yaml)

  • use POST instead of GET
  • remove epoch from response data
  • pass epoch as path param instead of query
  • pass validator indices in request body instead of query
  • update URL to /eth/v1/validator/liveness/{epoch}
  • throw ApiError instead of normal Error to improve error handling/logging

This change is breaking as it introduces an incompatibility with older Lodestar versions but due to the fact that our implementation was never spec compliant I doubt it will cause any issues with other downstream tooling.

@nflaig nflaig requested a review from a team as a code owner June 18, 2023 16:47
@github-actions
Copy link
Contributor

github-actions bot commented Jun 18, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 1ef6de4 Previous: 7c54a7b Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0265 ms/op 999.28 us/op 1.03
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 46.258 us/op 49.398 us/op 0.94
BLS verify - blst-native 1.2151 ms/op 1.2294 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.4343 ms/op 2.4835 ms/op 0.98
BLS verifyMultipleSignatures 8 - blst-native 5.2507 ms/op 5.3432 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst-native 19.100 ms/op 19.363 ms/op 0.99
BLS aggregatePubkeys 32 - blst-native 25.527 us/op 25.802 us/op 0.99
BLS aggregatePubkeys 128 - blst-native 100.01 us/op 101.26 us/op 0.99
getAttestationsForBlock 61.609 ms/op 58.965 ms/op 1.04
isKnown best case - 1 super set check 265.00 ns/op 263.00 ns/op 1.01
isKnown normal case - 2 super set checks 260.00 ns/op 255.00 ns/op 1.02
isKnown worse case - 16 super set checks 256.00 ns/op 257.00 ns/op 1.00
CheckpointStateCache - add get delete 5.0830 us/op 5.3580 us/op 0.95
validate gossip signedAggregateAndProof - struct 2.8150 ms/op 2.8639 ms/op 0.98
validate gossip attestation - struct 1.3469 ms/op 1.3503 ms/op 1.00
pickEth1Vote - no votes 1.3169 ms/op 1.3847 ms/op 0.95
pickEth1Vote - max votes 8.7117 ms/op 10.475 ms/op 0.83
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.8053 ms/op 9.4063 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 16.570 ms/op 15.320 ms/op 1.08
pickEth1Vote - Eth1Data fastSerialize value x2048 687.57 us/op 678.66 us/op 1.01
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.8828 ms/op 7.3198 ms/op 0.67
bytes32 toHexString 503.00 ns/op 580.00 ns/op 0.87
bytes32 Buffer.toString(hex) 360.00 ns/op 417.00 ns/op 0.86
bytes32 Buffer.toString(hex) from Uint8Array 558.00 ns/op 616.00 ns/op 0.91
bytes32 Buffer.toString(hex) + 0x 368.00 ns/op 405.00 ns/op 0.91
Object access 1 prop 0.16500 ns/op 0.18900 ns/op 0.87
Map access 1 prop 0.15300 ns/op 0.16800 ns/op 0.91
Object get x1000 6.3490 ns/op 6.8420 ns/op 0.93
Map get x1000 0.59700 ns/op 0.67100 ns/op 0.89
Object set x1000 53.397 ns/op 67.850 ns/op 0.79
Map set x1000 43.922 ns/op 55.320 ns/op 0.79
Return object 10000 times 0.23140 ns/op 0.24930 ns/op 0.93
Throw Error 10000 times 4.1548 us/op 4.4592 us/op 0.93
fastMsgIdFn sha256 / 200 bytes 3.4270 us/op 3.7520 us/op 0.91
fastMsgIdFn h32 xxhash / 200 bytes 273.00 ns/op 331.00 ns/op 0.82
fastMsgIdFn h64 xxhash / 200 bytes 395.00 ns/op 517.00 ns/op 0.76
fastMsgIdFn sha256 / 1000 bytes 11.926 us/op 12.149 us/op 0.98
fastMsgIdFn h32 xxhash / 1000 bytes 416.00 ns/op 468.00 ns/op 0.89
fastMsgIdFn h64 xxhash / 1000 bytes 474.00 ns/op 587.00 ns/op 0.81
fastMsgIdFn sha256 / 10000 bytes 106.08 us/op 110.20 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 2.0120 us/op 2.0610 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.4490 us/op 1.5160 us/op 0.96
enrSubnets - fastDeserialize 64 bits 1.3830 us/op 2.0830 us/op 0.66
enrSubnets - ssz BitVector 64 bits 527.00 ns/op 699.00 ns/op 0.75
enrSubnets - fastDeserialize 4 bits 189.00 ns/op 233.00 ns/op 0.81
enrSubnets - ssz BitVector 4 bits 518.00 ns/op 696.00 ns/op 0.74
prioritizePeers score -10:0 att 32-0.1 sync 2-0 131.61 us/op 141.38 us/op 0.93
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 139.52 us/op 153.54 us/op 0.91
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 178.43 us/op 195.89 us/op 0.91
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 312.60 us/op 375.83 us/op 0.83
prioritizePeers score 0:0 att 64-1 sync 4-1 366.32 us/op 455.24 us/op 0.80
array of 16000 items push then shift 1.6701 us/op 1.7552 us/op 0.95
LinkedList of 16000 items push then shift 8.9870 ns/op 10.505 ns/op 0.86
array of 16000 items push then pop 89.910 ns/op 130.59 ns/op 0.69
LinkedList of 16000 items push then pop 8.6750 ns/op 10.301 ns/op 0.84
array of 24000 items push then shift 2.4503 us/op 2.4906 us/op 0.98
LinkedList of 24000 items push then shift 9.1270 ns/op 11.606 ns/op 0.79
array of 24000 items push then pop 81.142 ns/op 100.75 ns/op 0.81
LinkedList of 24000 items push then pop 8.7220 ns/op 10.552 ns/op 0.83
intersect bitArray bitLen 8 13.704 ns/op 14.189 ns/op 0.97
intersect array and set length 8 77.538 ns/op 105.05 ns/op 0.74
intersect bitArray bitLen 128 45.054 ns/op 46.730 ns/op 0.96
intersect array and set length 128 1.0683 us/op 1.3194 us/op 0.81
Buffer.concat 32 items 2.6300 us/op 2.9010 us/op 0.91
Uint8Array.set 32 items 2.8690 us/op 2.5610 us/op 1.12
transfer serialized Status (84 B) 2.3370 us/op 2.2690 us/op 1.03
copy serialized Status (84 B) 1.8910 us/op 1.8530 us/op 1.02
transfer serialized SignedVoluntaryExit (112 B) 2.3130 us/op 2.7100 us/op 0.85
copy serialized SignedVoluntaryExit (112 B) 1.9100 us/op 1.9140 us/op 1.00
transfer serialized ProposerSlashing (416 B) 3.2310 us/op 2.8090 us/op 1.15
copy serialized ProposerSlashing (416 B) 3.4070 us/op 3.4940 us/op 0.98
transfer serialized Attestation (485 B) 3.5840 us/op 2.9190 us/op 1.23
copy serialized Attestation (485 B) 3.2900 us/op 3.4120 us/op 0.96
transfer serialized AttesterSlashing (33232 B) 3.1640 us/op 2.9080 us/op 1.09
copy serialized AttesterSlashing (33232 B) 7.0010 us/op 8.3450 us/op 0.84
transfer serialized Small SignedBeaconBlock (128000 B) 2.9950 us/op 2.8980 us/op 1.03
copy serialized Small SignedBeaconBlock (128000 B) 15.767 us/op 21.109 us/op 0.75
transfer serialized Avg SignedBeaconBlock (200000 B) 3.1370 us/op 3.4130 us/op 0.92
copy serialized Avg SignedBeaconBlock (200000 B) 21.399 us/op 36.623 us/op 0.58
transfer serialized BlobsSidecar (524380 B) 3.3670 us/op 3.3190 us/op 1.01
copy serialized BlobsSidecar (524380 B) 147.21 us/op 83.488 us/op 1.76
transfer serialized Big SignedBeaconBlock (1000000 B) 3.5140 us/op 3.6590 us/op 0.96
copy serialized Big SignedBeaconBlock (1000000 B) 325.97 us/op 385.38 us/op 0.85
pass gossip attestations to forkchoice per slot 2.6698 ms/op 2.7385 ms/op 0.97
forkChoice updateHead vc 100000 bc 64 eq 0 2.2720 ms/op 2.2827 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 11.601 ms/op 15.436 ms/op 0.75
forkChoice updateHead vc 1000000 bc 64 eq 0 18.976 ms/op 18.979 ms/op 1.00
forkChoice updateHead vc 600000 bc 320 eq 0 16.879 ms/op 17.071 ms/op 0.99
forkChoice updateHead vc 600000 bc 1200 eq 0 83.366 ms/op 85.143 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 1000 21.725 ms/op 21.018 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 10000 23.120 ms/op 22.753 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 31.429 ms/op 33.689 ms/op 0.93
computeDeltas 4.0013 ms/op 3.0721 ms/op 1.30
computeProposerBoostScoreFromBalances 1.8238 ms/op 1.8093 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei normalcase 2.9280 ms/op 3.4067 ms/op 0.86
altair processAttestation - 250000 vs - 7PWei worstcase 3.8023 ms/op 4.3271 ms/op 0.88
altair processAttestation - setStatus - 1/6 committees join 142.06 us/op 150.63 us/op 0.94
altair processAttestation - setStatus - 1/3 committees join 287.30 us/op 299.13 us/op 0.96
altair processAttestation - setStatus - 1/2 committees join 389.27 us/op 399.18 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 484.97 us/op 483.36 us/op 1.00
altair processAttestation - setStatus - 4/5 committees join 685.94 us/op 695.04 us/op 0.99
altair processAttestation - setStatus - 100% committees join 836.38 us/op 809.25 us/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase 20.611 ms/op 18.498 ms/op 1.11
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.548 ms/op 27.078 ms/op 1.13
altair processBlock - 250000 vs - 7PWei worstcase 58.398 ms/op 50.977 ms/op 1.15
altair processBlock - 250000 vs - 7PWei worstcase hashState 80.568 ms/op 74.414 ms/op 1.08
phase0 processBlock - 250000 vs - 7PWei normalcase 2.7519 ms/op 2.3185 ms/op 1.19
phase0 processBlock - 250000 vs - 7PWei worstcase 32.724 ms/op 31.311 ms/op 1.05
altair processEth1Data - 250000 vs - 7PWei normalcase 631.28 us/op 587.80 us/op 1.07
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.2600 us/op 8.8160 us/op 1.05
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 35.265 us/op 29.622 us/op 1.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 11.644 us/op 11.396 us/op 1.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 9.7560 us/op 10.031 us/op 0.97
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 138.17 us/op 121.88 us/op 1.13
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 785.01 us/op 1.0109 ms/op 0.78
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.0819 ms/op 969.32 us/op 1.12
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0347 ms/op 909.13 us/op 1.14
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.6887 ms/op 2.7209 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.8711 ms/op 1.5087 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.5538 ms/op 4.1415 ms/op 1.34
Tree 40 250000 create 433.86 ms/op 416.49 ms/op 1.04
Tree 40 250000 get(125000) 206.48 ns/op 190.85 ns/op 1.08
Tree 40 250000 set(125000) 1.2413 us/op 1.0286 us/op 1.21
Tree 40 250000 toArray() 23.333 ms/op 22.266 ms/op 1.05
Tree 40 250000 iterate all - toArray() + loop 23.131 ms/op 21.139 ms/op 1.09
Tree 40 250000 iterate all - get(i) 79.033 ms/op 76.250 ms/op 1.04
MutableVector 250000 create 14.814 ms/op 11.697 ms/op 1.27
MutableVector 250000 get(125000) 6.8180 ns/op 6.4500 ns/op 1.06
MutableVector 250000 set(125000) 294.12 ns/op 293.80 ns/op 1.00
MutableVector 250000 toArray() 4.2280 ms/op 4.3259 ms/op 0.98
MutableVector 250000 iterate all - toArray() + loop 4.2065 ms/op 4.0404 ms/op 1.04
MutableVector 250000 iterate all - get(i) 1.5857 ms/op 1.5584 ms/op 1.02
Array 250000 create 3.8840 ms/op 2.9307 ms/op 1.33
Array 250000 clone - spread 1.3057 ms/op 1.1283 ms/op 1.16
Array 250000 get(125000) 0.62600 ns/op 0.55700 ns/op 1.12
Array 250000 set(125000) 0.71400 ns/op 0.62700 ns/op 1.14
Array 250000 iterate all - loop 110.38 us/op 83.141 us/op 1.33
effectiveBalanceIncrements clone Uint8Array 300000 59.863 us/op 30.999 us/op 1.93
effectiveBalanceIncrements clone MutableVector 300000 396.00 ns/op 338.00 ns/op 1.17
effectiveBalanceIncrements rw all Uint8Array 300000 173.84 us/op 170.44 us/op 1.02
effectiveBalanceIncrements rw all MutableVector 300000 99.995 ms/op 90.105 ms/op 1.11
phase0 afterProcessEpoch - 250000 vs - 7PWei 119.04 ms/op 117.89 ms/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.167 ms/op 43.978 ms/op 0.91
altair processEpoch - mainnet_e81889 361.96 ms/op 327.52 ms/op 1.11
mainnet_e81889 - altair beforeProcessEpoch 74.371 ms/op 53.086 ms/op 1.40
mainnet_e81889 - altair processJustificationAndFinalization 18.742 us/op 19.284 us/op 0.97
mainnet_e81889 - altair processInactivityUpdates 6.2935 ms/op 6.3005 ms/op 1.00
mainnet_e81889 - altair processRewardsAndPenalties 74.775 ms/op 65.228 ms/op 1.15
mainnet_e81889 - altair processRegistryUpdates 4.2180 us/op 2.7470 us/op 1.54
mainnet_e81889 - altair processSlashings 570.00 ns/op 541.00 ns/op 1.05
mainnet_e81889 - altair processEth1DataReset 719.00 ns/op 572.00 ns/op 1.26
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.4009 ms/op 1.2623 ms/op 1.90
mainnet_e81889 - altair processSlashingsReset 5.9910 us/op 4.7430 us/op 1.26
mainnet_e81889 - altair processRandaoMixesReset 7.2640 us/op 7.2620 us/op 1.00
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3860 us/op 838.00 ns/op 1.65
mainnet_e81889 - altair processParticipationFlagUpdates 2.5550 us/op 2.4060 us/op 1.06
mainnet_e81889 - altair processSyncCommitteeUpdates 595.00 ns/op 779.00 ns/op 0.76
mainnet_e81889 - altair afterProcessEpoch 135.76 ms/op 131.69 ms/op 1.03
phase0 processEpoch - mainnet_e58758 412.42 ms/op 371.22 ms/op 1.11
mainnet_e58758 - phase0 beforeProcessEpoch 159.46 ms/op 114.26 ms/op 1.40
mainnet_e58758 - phase0 processJustificationAndFinalization 20.990 us/op 17.820 us/op 1.18
mainnet_e58758 - phase0 processRewardsAndPenalties 70.605 ms/op 61.876 ms/op 1.14
mainnet_e58758 - phase0 processRegistryUpdates 11.289 us/op 8.6890 us/op 1.30
mainnet_e58758 - phase0 processSlashings 1.2100 us/op 565.00 ns/op 2.14
mainnet_e58758 - phase0 processEth1DataReset 601.00 ns/op 709.00 ns/op 0.85
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0592 ms/op 1.1167 ms/op 0.95
mainnet_e58758 - phase0 processSlashingsReset 4.2310 us/op 3.9500 us/op 1.07
mainnet_e58758 - phase0 processRandaoMixesReset 4.8730 us/op 4.9880 us/op 0.98
mainnet_e58758 - phase0 processHistoricalRootsUpdate 759.00 ns/op 1.1200 us/op 0.68
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.4190 us/op 4.7860 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 104.93 ms/op 102.27 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.5086 ms/op 1.2511 ms/op 1.21
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.7145 ms/op 1.5188 ms/op 1.13
altair processInactivityUpdates - 250000 normalcase 27.320 ms/op 25.358 ms/op 1.08
altair processInactivityUpdates - 250000 worstcase 24.260 ms/op 29.813 ms/op 0.81
phase0 processRegistryUpdates - 250000 normalcase 8.6490 us/op 7.9780 us/op 1.08
phase0 processRegistryUpdates - 250000 badcase_full_deposits 347.33 us/op 274.66 us/op 1.26
phase0 processRegistryUpdates - 250000 worstcase 0.5 151.77 ms/op 114.42 ms/op 1.33
altair processRewardsAndPenalties - 250000 normalcase 64.278 ms/op 72.339 ms/op 0.89
altair processRewardsAndPenalties - 250000 worstcase 76.100 ms/op 77.500 ms/op 0.98
phase0 getAttestationDeltas - 250000 normalcase 8.0076 ms/op 10.486 ms/op 0.76
phase0 getAttestationDeltas - 250000 worstcase 6.8714 ms/op 9.5280 ms/op 0.72
phase0 processSlashings - 250000 worstcase 3.7249 ms/op 3.9337 ms/op 0.95
altair processSyncCommitteeUpdates - 250000 197.00 ms/op 185.02 ms/op 1.06
BeaconState.hashTreeRoot - No change 370.00 ns/op 280.00 ns/op 1.32
BeaconState.hashTreeRoot - 1 full validator 56.987 us/op 53.718 us/op 1.06
BeaconState.hashTreeRoot - 32 full validator 597.78 us/op 571.64 us/op 1.05
BeaconState.hashTreeRoot - 512 full validator 6.1538 ms/op 5.7095 ms/op 1.08
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 69.483 us/op 67.097 us/op 1.04
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 983.82 us/op 908.80 us/op 1.08
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.439 ms/op 12.471 ms/op 1.08
BeaconState.hashTreeRoot - 1 balances 53.211 us/op 51.750 us/op 1.03
BeaconState.hashTreeRoot - 32 balances 497.12 us/op 459.68 us/op 1.08
BeaconState.hashTreeRoot - 512 balances 4.7084 ms/op 4.5646 ms/op 1.03
BeaconState.hashTreeRoot - 250000 balances 79.142 ms/op 77.613 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 17.656 us/op 18.862 us/op 0.94
regular array get 100000 times 33.694 us/op 43.459 us/op 0.78
wrappedArray get 100000 times 33.581 us/op 33.290 us/op 1.01
arrayWithProxy get 100000 times 15.979 ms/op 17.213 ms/op 0.93
ssz.Root.equals 556.00 ns/op 572.00 ns/op 0.97
byteArrayEquals 551.00 ns/op 570.00 ns/op 0.97
shuffle list - 16384 els 6.9614 ms/op 7.0420 ms/op 0.99
shuffle list - 250000 els 103.02 ms/op 102.63 ms/op 1.00
processSlot - 1 slots 11.381 us/op 9.9770 us/op 1.14
processSlot - 32 slots 1.7061 ms/op 1.4398 ms/op 1.18
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 39.571 ms/op 37.287 ms/op 1.06
getCommitteeAssignments - req 1 vs - 250000 vc 3.0207 ms/op 2.9839 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 4.2821 ms/op 4.2224 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6731 ms/op 4.5788 ms/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2200 ns/op 4.9900 ns/op 1.05
state getBlockRootAtSlot - 250000 vs - 7PWei 687.40 ns/op 1.1684 us/op 0.59
computeProposers - vc 250000 11.330 ms/op 11.336 ms/op 1.00
computeEpochShuffling - vc 250000 111.28 ms/op 105.83 ms/op 1.05
getNextSyncCommittee - vc 250000 193.14 ms/op 186.06 ms/op 1.04
computeSigningRoot for AttestationData 14.478 us/op 14.331 us/op 1.01
hash AttestationData serialized data then Buffer.toString(base64) 2.5836 us/op 2.5052 us/op 1.03
toHexString serialized data 1.1848 us/op 1.2089 us/op 0.98
Buffer.toString(base64) 358.61 ns/op 359.56 ns/op 1.00

by benchmarkbot/action

@nflaig nflaig marked this pull request as draft June 18, 2023 17:25
@dapplion
Copy link
Contributor

@nflaig could you look into why the API spec tests did not catch this?

@nflaig
Copy link
Member Author

nflaig commented Jun 19, 2023

@dapplion yeah was wondering the same, haven't investigated it yet but will do. It might also be worth to see if we can validate pattern to ensure we are encoding correctly to prevent issues like the graffiti not being hex encoded.

@nflaig nflaig force-pushed the nflaig/update-liveness-api branch from ef64e04 to 99f17e4 Compare June 19, 2023 14:50
for (const response of previousEpochLiveness) {
if (response.epoch !== previousEpoch) {
// Server sending bad data
throw Error(`Inconsistent livenessResponseData epoch ${response.epoch} != ${previousEpoch}`);
Copy link
Member Author

Choose a reason for hiding this comment

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

Epoch is no longer part of response, no need to check this

@nflaig nflaig marked this pull request as ready for review June 19, 2023 14:55
wemeetagain
wemeetagain previously approved these changes Jun 19, 2023
@wemeetagain wemeetagain merged commit f677434 into unstable Jun 20, 2023
@wemeetagain wemeetagain deleted the nflaig/update-liveness-api branch June 20, 2023 14:04
@nflaig
Copy link
Member Author

nflaig commented Jun 24, 2023

could you look into why the API spec tests did not catch this?

@dapplion this was not caught because our oapi spec tests check against v2.3.0 and not the latest spec (v2.4.1)

It might also be worth to see if we can validate pattern to ensure we are encoding correctly

This seems to be validated already

ajv.addFormat("hex", /^0x[a-fA-F0-9]+$/);

@wemeetagain
Copy link
Member

🎉 This PR is included in v1.10.0 🎉

@nflaig nflaig added the meta-breaking-change Introduces breaking changes to DB, Validator, Beacon Node, or CLI interfaces. Handle with care! label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-breaking-change Introduces breaking changes to DB, Validator, Beacon Node, or CLI interfaces. Handle with care!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants