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

feat: add call support to verified requests for prover #5462

Merged
merged 9 commits into from
May 15, 2023

Conversation

nazarhussain
Copy link
Contributor

Motivation

Make the prover more feature rich.

Description

Add support for eth call method.

Partially #4706

Steps to test or reproduce

  • Run all tests.

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d2c6085 Previous: ae3fda6 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 495.99 us/op 910.44 us/op 0.54
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 46.377 us/op 58.273 us/op 0.80
BLS verify - blst-native 1.2242 ms/op 1.4803 ms/op 0.83
BLS verifyMultipleSignatures 3 - blst-native 2.4881 ms/op 2.9992 ms/op 0.83
BLS verifyMultipleSignatures 8 - blst-native 5.3870 ms/op 6.3097 ms/op 0.85
BLS verifyMultipleSignatures 32 - blst-native 19.346 ms/op 23.132 ms/op 0.84
BLS aggregatePubkeys 32 - blst-native 25.950 us/op 31.519 us/op 0.82
BLS aggregatePubkeys 128 - blst-native 100.52 us/op 123.56 us/op 0.81
getAttestationsForBlock 55.755 ms/op 71.060 ms/op 0.78
isKnown best case - 1 super set check 262.00 ns/op 308.00 ns/op 0.85
isKnown normal case - 2 super set checks 262.00 ns/op 309.00 ns/op 0.85
isKnown worse case - 16 super set checks 266.00 ns/op 311.00 ns/op 0.86
CheckpointStateCache - add get delete 4.9470 us/op 6.5720 us/op 0.75
validate gossip signedAggregateAndProof - struct 2.7825 ms/op 3.4604 ms/op 0.80
validate gossip attestation - struct 1.3150 ms/op 1.6546 ms/op 0.79
pickEth1Vote - no votes 1.2573 ms/op 1.6203 ms/op 0.78
pickEth1Vote - max votes 10.120 ms/op 12.016 ms/op 0.84
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.1484 ms/op 11.135 ms/op 0.82
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.540 ms/op 17.261 ms/op 0.84
pickEth1Vote - Eth1Data fastSerialize value x2048 691.68 us/op 897.02 us/op 0.77
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.7216 ms/op 6.0434 ms/op 0.78
bytes32 toHexString 510.00 ns/op 750.00 ns/op 0.68
bytes32 Buffer.toString(hex) 342.00 ns/op 499.00 ns/op 0.69
bytes32 Buffer.toString(hex) from Uint8Array 549.00 ns/op 733.00 ns/op 0.75
bytes32 Buffer.toString(hex) + 0x 350.00 ns/op 476.00 ns/op 0.74
Object access 1 prop 0.16000 ns/op 0.23400 ns/op 0.68
Map access 1 prop 0.15700 ns/op 0.19200 ns/op 0.82
Object get x1000 7.0640 ns/op 9.6600 ns/op 0.73
Map get x1000 0.61000 ns/op 0.67100 ns/op 0.91
Object set x1000 53.337 ns/op 73.455 ns/op 0.73
Map set x1000 43.408 ns/op 62.081 ns/op 0.70
Return object 10000 times 0.43100 ns/op 0.30140 ns/op 1.43
Throw Error 10000 times 4.2276 us/op 5.3549 us/op 0.79
fastMsgIdFn sha256 / 200 bytes 3.4570 us/op 4.4110 us/op 0.78
fastMsgIdFn h32 xxhash / 200 bytes 297.00 ns/op 375.00 ns/op 0.79
fastMsgIdFn h64 xxhash / 200 bytes 387.00 ns/op 556.00 ns/op 0.70
fastMsgIdFn sha256 / 1000 bytes 11.623 us/op 14.985 us/op 0.78
fastMsgIdFn h32 xxhash / 1000 bytes 414.00 ns/op 533.00 ns/op 0.78
fastMsgIdFn h64 xxhash / 1000 bytes 460.00 ns/op 669.00 ns/op 0.69
fastMsgIdFn sha256 / 10000 bytes 106.72 us/op 129.84 us/op 0.82
fastMsgIdFn h32 xxhash / 10000 bytes 1.9390 us/op 2.4620 us/op 0.79
fastMsgIdFn h64 xxhash / 10000 bytes 1.3330 us/op 1.7640 us/op 0.76
enrSubnets - fastDeserialize 64 bits 1.3070 us/op 1.9640 us/op 0.67
enrSubnets - ssz BitVector 64 bits 518.00 ns/op 703.00 ns/op 0.74
enrSubnets - fastDeserialize 4 bits 207.00 ns/op 231.00 ns/op 0.90
enrSubnets - ssz BitVector 4 bits 642.00 ns/op 709.00 ns/op 0.91
prioritizePeers score -10:0 att 32-0.1 sync 2-0 124.36 us/op 149.13 us/op 0.83
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 149.05 us/op 182.65 us/op 0.82
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 184.34 us/op 218.53 us/op 0.84
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 331.81 us/op 427.55 us/op 0.78
prioritizePeers score 0:0 att 64-1 sync 4-1 367.43 us/op 516.55 us/op 0.71
array of 16000 items push then shift 1.5888 us/op 2.0831 us/op 0.76
LinkedList of 16000 items push then shift 8.6330 ns/op 11.580 ns/op 0.75
array of 16000 items push then pop 86.516 ns/op 118.86 ns/op 0.73
LinkedList of 16000 items push then pop 8.5880 ns/op 10.749 ns/op 0.80
array of 24000 items push then shift 2.3838 us/op 2.9338 us/op 0.81
LinkedList of 24000 items push then shift 8.6950 ns/op 11.503 ns/op 0.76
array of 24000 items push then pop 73.402 ns/op 101.47 ns/op 0.72
LinkedList of 24000 items push then pop 8.4450 ns/op 11.227 ns/op 0.75
intersect bitArray bitLen 8 14.848 ns/op 17.914 ns/op 0.83
intersect array and set length 8 74.932 ns/op 116.16 ns/op 0.65
intersect bitArray bitLen 128 45.604 ns/op 57.645 ns/op 0.79
intersect array and set length 128 1.0357 us/op 1.5749 us/op 0.66
Buffer.concat 32 items 2.8450 us/op 3.8010 us/op 0.75
Uint8Array.set 32 items 2.0920 us/op 3.3260 us/op 0.63
pass gossip attestations to forkchoice per slot 2.6781 ms/op 4.5011 ms/op 0.59
computeDeltas 2.8504 ms/op 3.7422 ms/op 0.76
computeProposerBoostScoreFromBalances 1.7841 ms/op 2.1442 ms/op 0.83
altair processAttestation - 250000 vs - 7PWei normalcase 2.0760 ms/op 3.6835 ms/op 0.56
altair processAttestation - 250000 vs - 7PWei worstcase 3.3181 ms/op 5.5239 ms/op 0.60
altair processAttestation - setStatus - 1/6 committees join 139.25 us/op 196.15 us/op 0.71
altair processAttestation - setStatus - 1/3 committees join 273.87 us/op 385.14 us/op 0.71
altair processAttestation - setStatus - 1/2 committees join 367.01 us/op 473.83 us/op 0.77
altair processAttestation - setStatus - 2/3 committees join 465.24 us/op 564.30 us/op 0.82
altair processAttestation - setStatus - 4/5 committees join 636.57 us/op 854.93 us/op 0.74
altair processAttestation - setStatus - 100% committees join 719.34 us/op 970.31 us/op 0.74
altair processBlock - 250000 vs - 7PWei normalcase 16.047 ms/op 20.059 ms/op 0.80
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.243 ms/op 36.580 ms/op 0.74
altair processBlock - 250000 vs - 7PWei worstcase 45.071 ms/op 71.446 ms/op 0.63
altair processBlock - 250000 vs - 7PWei worstcase hashState 68.478 ms/op 88.829 ms/op 0.77
phase0 processBlock - 250000 vs - 7PWei normalcase 2.0761 ms/op 2.9190 ms/op 0.71
phase0 processBlock - 250000 vs - 7PWei worstcase 29.436 ms/op 42.589 ms/op 0.69
altair processEth1Data - 250000 vs - 7PWei normalcase 479.32 us/op 772.37 us/op 0.62
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 6.6330 us/op 7.3370 us/op 0.90
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 19.664 us/op 22.358 us/op 0.88
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 8.2980 us/op 9.7650 us/op 0.85
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 6.1910 us/op 6.6850 us/op 0.93
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 74.498 us/op 80.427 us/op 0.93
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 617.13 us/op 905.23 us/op 0.68
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 903.47 us/op 1.0430 ms/op 0.87
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 906.86 us/op 1.0142 ms/op 0.89
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.3501 ms/op 3.6817 ms/op 0.64
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.4666 ms/op 2.5152 ms/op 0.58
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 3.9056 ms/op 7.4058 ms/op 0.53
Tree 40 250000 create 309.92 ms/op 412.32 ms/op 0.75
Tree 40 250000 get(125000) 184.44 ns/op 237.88 ns/op 0.78
Tree 40 250000 set(125000) 827.20 ns/op 1.1489 us/op 0.72
Tree 40 250000 toArray() 16.576 ms/op 24.104 ms/op 0.69
Tree 40 250000 iterate all - toArray() + loop 17.089 ms/op 22.976 ms/op 0.74
Tree 40 250000 iterate all - get(i) 66.037 ms/op 87.166 ms/op 0.76
MutableVector 250000 create 9.0361 ms/op 13.291 ms/op 0.68
MutableVector 250000 get(125000) 6.1040 ns/op 8.1820 ns/op 0.75
MutableVector 250000 set(125000) 255.76 ns/op 338.98 ns/op 0.75
MutableVector 250000 toArray() 2.8187 ms/op 3.7486 ms/op 0.75
MutableVector 250000 iterate all - toArray() + loop 3.0917 ms/op 4.0314 ms/op 0.77
MutableVector 250000 iterate all - get(i) 1.5267 ms/op 1.9208 ms/op 0.79
Array 250000 create 2.8302 ms/op 3.3140 ms/op 0.85
Array 250000 clone - spread 1.2417 ms/op 1.5466 ms/op 0.80
Array 250000 get(125000) 0.59800 ns/op 0.75100 ns/op 0.80
Array 250000 set(125000) 0.68000 ns/op 0.83700 ns/op 0.81
Array 250000 iterate all - loop 84.031 us/op 106.33 us/op 0.79
effectiveBalanceIncrements clone Uint8Array 300000 29.498 us/op 40.202 us/op 0.73
effectiveBalanceIncrements clone MutableVector 300000 394.00 ns/op 493.00 ns/op 0.80
effectiveBalanceIncrements rw all Uint8Array 300000 172.74 us/op 207.00 us/op 0.83
effectiveBalanceIncrements rw all MutableVector 300000 84.767 ms/op 106.54 ms/op 0.80
phase0 afterProcessEpoch - 250000 vs - 7PWei 113.26 ms/op 148.13 ms/op 0.76
phase0 beforeProcessEpoch - 250000 vs - 7PWei 39.629 ms/op 37.778 ms/op 1.05
altair processEpoch - mainnet_e81889 338.62 ms/op 356.42 ms/op 0.95
mainnet_e81889 - altair beforeProcessEpoch 67.215 ms/op 52.739 ms/op 1.27
mainnet_e81889 - altair processJustificationAndFinalization 15.937 us/op 19.084 us/op 0.84
mainnet_e81889 - altair processInactivityUpdates 5.0173 ms/op 5.8403 ms/op 0.86
mainnet_e81889 - altair processRewardsAndPenalties 63.483 ms/op 74.165 ms/op 0.86
mainnet_e81889 - altair processRegistryUpdates 2.7010 us/op 3.1090 us/op 0.87
mainnet_e81889 - altair processSlashings 700.00 ns/op 601.00 ns/op 1.16
mainnet_e81889 - altair processEth1DataReset 511.00 ns/op 1.0790 us/op 0.47
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2445 ms/op 1.4364 ms/op 0.87
mainnet_e81889 - altair processSlashingsReset 4.8770 us/op 5.3520 us/op 0.91
mainnet_e81889 - altair processRandaoMixesReset 12.649 us/op 4.8920 us/op 2.59
mainnet_e81889 - altair processHistoricalRootsUpdate 947.00 ns/op 597.00 ns/op 1.59
mainnet_e81889 - altair processParticipationFlagUpdates 2.6940 us/op 3.6690 us/op 0.73
mainnet_e81889 - altair processSyncCommitteeUpdates 1.3050 us/op 1.2470 us/op 1.05
mainnet_e81889 - altair afterProcessEpoch 132.65 ms/op 155.59 ms/op 0.85
phase0 processEpoch - mainnet_e58758 372.83 ms/op 402.49 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 141.59 ms/op 140.00 ms/op 1.01
mainnet_e58758 - phase0 processJustificationAndFinalization 16.564 us/op 20.551 us/op 0.81
mainnet_e58758 - phase0 processRewardsAndPenalties 63.463 ms/op 65.685 ms/op 0.97
mainnet_e58758 - phase0 processRegistryUpdates 7.6890 us/op 8.6620 us/op 0.89
mainnet_e58758 - phase0 processSlashings 474.00 ns/op 607.00 ns/op 0.78
mainnet_e58758 - phase0 processEth1DataReset 473.00 ns/op 495.00 ns/op 0.96
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0049 ms/op 1.1372 ms/op 0.88
mainnet_e58758 - phase0 processSlashingsReset 3.8600 us/op 3.4910 us/op 1.11
mainnet_e58758 - phase0 processRandaoMixesReset 4.6260 us/op 4.5710 us/op 1.01
mainnet_e58758 - phase0 processHistoricalRootsUpdate 604.00 ns/op 686.00 ns/op 0.88
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.1490 us/op 5.4770 us/op 0.76
mainnet_e58758 - phase0 afterProcessEpoch 99.610 ms/op 114.45 ms/op 0.87
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2557 ms/op 1.2664 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6093 ms/op 1.5241 ms/op 1.06
altair processInactivityUpdates - 250000 normalcase 25.197 ms/op 25.637 ms/op 0.98
altair processInactivityUpdates - 250000 worstcase 26.403 ms/op 27.194 ms/op 0.97
phase0 processRegistryUpdates - 250000 normalcase 6.9380 us/op 6.7310 us/op 1.03
phase0 processRegistryUpdates - 250000 badcase_full_deposits 236.05 us/op 258.42 us/op 0.91
phase0 processRegistryUpdates - 250000 worstcase 0.5 125.52 ms/op 133.41 ms/op 0.94
altair processRewardsAndPenalties - 250000 normalcase 68.317 ms/op 71.124 ms/op 0.96
altair processRewardsAndPenalties - 250000 worstcase 69.671 ms/op 75.591 ms/op 0.92
phase0 getAttestationDeltas - 250000 normalcase 6.5902 ms/op 6.7709 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 6.7369 ms/op 6.7128 ms/op 1.00
phase0 processSlashings - 250000 worstcase 3.6097 ms/op 3.4498 ms/op 1.05
altair processSyncCommitteeUpdates - 250000 184.63 ms/op 186.02 ms/op 0.99
BeaconState.hashTreeRoot - No change 267.00 ns/op 366.00 ns/op 0.73
BeaconState.hashTreeRoot - 1 full validator 51.820 us/op 58.014 us/op 0.89
BeaconState.hashTreeRoot - 32 full validator 542.25 us/op 522.71 us/op 1.04
BeaconState.hashTreeRoot - 512 full validator 5.2476 ms/op 5.8558 ms/op 0.90
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 66.174 us/op 61.891 us/op 1.07
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 908.70 us/op 915.60 us/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.696 ms/op 11.741 ms/op 1.00
BeaconState.hashTreeRoot - 1 balances 50.031 us/op 49.530 us/op 1.01
BeaconState.hashTreeRoot - 32 balances 448.17 us/op 468.68 us/op 0.96
BeaconState.hashTreeRoot - 512 balances 4.3038 ms/op 4.6765 ms/op 0.92
BeaconState.hashTreeRoot - 250000 balances 71.701 ms/op 78.941 ms/op 0.91
aggregationBits - 2048 els - zipIndexesInBitList 15.397 us/op 15.962 us/op 0.96
regular array get 100000 times 32.950 us/op 34.167 us/op 0.96
wrappedArray get 100000 times 32.866 us/op 34.316 us/op 0.96
arrayWithProxy get 100000 times 15.907 ms/op 17.295 ms/op 0.92
ssz.Root.equals 542.00 ns/op 556.00 ns/op 0.97
byteArrayEquals 584.00 ns/op 547.00 ns/op 1.07
shuffle list - 16384 els 6.6747 ms/op 7.1112 ms/op 0.94
shuffle list - 250000 els 98.031 ms/op 103.81 ms/op 0.94
processSlot - 1 slots 8.9740 us/op 8.9840 us/op 1.00
processSlot - 32 slots 1.3151 ms/op 1.3854 ms/op 0.95
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.502 ms/op 40.480 ms/op 0.90
getCommitteeAssignments - req 1 vs - 250000 vc 2.9142 ms/op 3.1384 ms/op 0.93
getCommitteeAssignments - req 100 vs - 250000 vc 4.1163 ms/op 4.3899 ms/op 0.94
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4396 ms/op 4.7509 ms/op 0.93
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2300 ns/op 4.7100 ns/op 1.11
state getBlockRootAtSlot - 250000 vs - 7PWei 903.85 ns/op 944.34 ns/op 0.96
computeProposers - vc 250000 10.661 ms/op 11.047 ms/op 0.97
computeEpochShuffling - vc 250000 98.876 ms/op 105.33 ms/op 0.94
getNextSyncCommittee - vc 250000 169.45 ms/op 185.03 ms/op 0.92
computeSigningRoot for AttestationData 13.231 us/op 14.270 us/op 0.93
hash AttestationData serialized data then Buffer.toString(base64) 2.3083 us/op 2.5381 us/op 0.91
toHexString serialized data 997.26 ns/op 1.1313 us/op 0.88
Buffer.toString(base64) 301.34 ns/op 336.20 ns/op 0.90

by benchmarkbot/action

@nazarhussain nazarhussain self-assigned this May 8, 2023
@nazarhussain nazarhussain marked this pull request as ready for review May 8, 2023 20:43
@nazarhussain nazarhussain requested a review from a team as a code owner May 8, 2023 20:43
Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

@nazarhussain How does the VM instance resolve SLOAD SSTORE opcodes?

packages/prover/scripts/generate_fixtures.ts Show resolved Hide resolved
Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

Looks great!

@nazarhussain nazarhussain merged commit 375d660 into unstable May 15, 2023
@nazarhussain nazarhussain deleted the nh/prover-eth-call branch May 15, 2023 13:01
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.9.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants