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: change the blob txs encoding assumption to be opaque rlp #5569

Merged
merged 3 commits into from
Jun 3, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented May 29, 2023

Treat the blob txs as opaque rlp like any other tx,

now the essential validation of beacon block commitments and payload's versioned hashes is entrusted to EL via new payload v3

TODO

  • Update the commitment to transaction helper fn used in mock and test

@g11tech g11tech requested a review from a team as a code owner May 29, 2023 12:32
@github-actions
Copy link
Contributor

github-actions bot commented May 29, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: eb822b2 Previous: 2fbe6fa Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 750.68 us/op 522.40 us/op 1.44
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 43.423 us/op 45.860 us/op 0.95
BLS verify - blst-native 1.1498 ms/op 1.2258 ms/op 0.94
BLS verifyMultipleSignatures 3 - blst-native 2.3424 ms/op 2.4940 ms/op 0.94
BLS verifyMultipleSignatures 8 - blst-native 5.0271 ms/op 5.3790 ms/op 0.93
BLS verifyMultipleSignatures 32 - blst-native 18.163 ms/op 19.480 ms/op 0.93
BLS aggregatePubkeys 32 - blst-native 24.275 us/op 26.281 us/op 0.92
BLS aggregatePubkeys 128 - blst-native 94.834 us/op 101.22 us/op 0.94
getAttestationsForBlock 51.793 ms/op 53.857 ms/op 0.96
isKnown best case - 1 super set check 250.00 ns/op 265.00 ns/op 0.94
isKnown normal case - 2 super set checks 241.00 ns/op 251.00 ns/op 0.96
isKnown worse case - 16 super set checks 239.00 ns/op 253.00 ns/op 0.94
CheckpointStateCache - add get delete 4.7130 us/op 5.2050 us/op 0.91
validate gossip signedAggregateAndProof - struct 2.6653 ms/op 2.7949 ms/op 0.95
validate gossip attestation - struct 1.2720 ms/op 1.3443 ms/op 0.95
pickEth1Vote - no votes 1.2167 ms/op 1.2943 ms/op 0.94
pickEth1Vote - max votes 9.1764 ms/op 10.595 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.9404 ms/op 9.1826 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 13.805 ms/op 13.978 ms/op 0.99
pickEth1Vote - Eth1Data fastSerialize value x2048 613.11 us/op 648.90 us/op 0.94
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.3381 ms/op 4.8312 ms/op 1.52
bytes32 toHexString 480.00 ns/op 513.00 ns/op 0.94
bytes32 Buffer.toString(hex) 341.00 ns/op 364.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 537.00 ns/op 582.00 ns/op 0.92
bytes32 Buffer.toString(hex) + 0x 337.00 ns/op 360.00 ns/op 0.94
Object access 1 prop 0.16000 ns/op 0.17900 ns/op 0.89
Map access 1 prop 0.16400 ns/op 0.16400 ns/op 1.00
Object get x1000 6.4150 ns/op 6.8630 ns/op 0.93
Map get x1000 0.57800 ns/op 0.55500 ns/op 1.04
Object set x1000 49.561 ns/op 54.502 ns/op 0.91
Map set x1000 41.697 ns/op 43.897 ns/op 0.95
Return object 10000 times 0.22460 ns/op 0.24300 ns/op 0.92
Throw Error 10000 times 4.0779 us/op 4.2298 us/op 0.96
fastMsgIdFn sha256 / 200 bytes 3.2950 us/op 3.5190 us/op 0.94
fastMsgIdFn h32 xxhash / 200 bytes 270.00 ns/op 293.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 200 bytes 381.00 ns/op 410.00 ns/op 0.93
fastMsgIdFn sha256 / 1000 bytes 11.054 us/op 11.616 us/op 0.95
fastMsgIdFn h32 xxhash / 1000 bytes 395.00 ns/op 428.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 1000 bytes 441.00 ns/op 482.00 ns/op 0.91
fastMsgIdFn sha256 / 10000 bytes 99.155 us/op 103.64 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.8030 us/op 1.9620 us/op 0.92
fastMsgIdFn h64 xxhash / 10000 bytes 1.2920 us/op 1.3720 us/op 0.94
enrSubnets - fastDeserialize 64 bits 1.2230 us/op 1.2870 us/op 0.95
enrSubnets - ssz BitVector 64 bits 480.00 ns/op 489.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 173.00 ns/op 174.00 ns/op 0.99
enrSubnets - ssz BitVector 4 bits 483.00 ns/op 494.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 103.33 us/op 106.72 us/op 0.97
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 131.39 us/op 133.14 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 162.68 us/op 165.60 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 303.47 us/op 302.52 us/op 1.00
prioritizePeers score 0:0 att 64-1 sync 4-1 364.48 us/op 366.11 us/op 1.00
array of 16000 items push then shift 1.5993 us/op 1.6208 us/op 0.99
LinkedList of 16000 items push then shift 8.6880 ns/op 8.7090 ns/op 1.00
array of 16000 items push then pop 88.617 ns/op 74.267 ns/op 1.19
LinkedList of 16000 items push then pop 8.2690 ns/op 8.6630 ns/op 0.95
array of 24000 items push then shift 2.2751 us/op 2.3500 us/op 0.97
LinkedList of 24000 items push then shift 8.6510 ns/op 8.7670 ns/op 0.99
array of 24000 items push then pop 74.572 ns/op 78.499 ns/op 0.95
LinkedList of 24000 items push then pop 8.1300 ns/op 8.4300 ns/op 0.96
intersect bitArray bitLen 8 12.774 ns/op 13.324 ns/op 0.96
intersect array and set length 8 76.079 ns/op 78.246 ns/op 0.97
intersect bitArray bitLen 128 42.077 ns/op 43.825 ns/op 0.96
intersect array and set length 128 1.0417 us/op 1.0655 us/op 0.98
Buffer.concat 32 items 2.8410 us/op 2.8810 us/op 0.99
Uint8Array.set 32 items 2.8120 us/op 2.6610 us/op 1.06
transfer serialized Status (84 B) 1.9970 us/op 2.0480 us/op 0.98
copy serialized Status (84 B) 1.6460 us/op 1.7500 us/op 0.94
transfer serialized SignedVoluntaryExit (112 B) 2.1530 us/op 2.0960 us/op 1.03
copy serialized SignedVoluntaryExit (112 B) 1.8550 us/op 1.7810 us/op 1.04
transfer serialized ProposerSlashing (416 B) 2.9600 us/op 2.3710 us/op 1.25
copy serialized ProposerSlashing (416 B) 2.9300 us/op 2.5060 us/op 1.17
transfer serialized Attestation (485 B) 2.4360 us/op 3.0340 us/op 0.80
copy serialized Attestation (485 B) 2.3720 us/op 2.8620 us/op 0.83
transfer serialized AttesterSlashing (33232 B) 2.5790 us/op 2.7770 us/op 0.93
copy serialized AttesterSlashing (33232 B) 5.4750 us/op 5.3490 us/op 1.02
transfer serialized Small SignedBeaconBlock (128000 B) 2.8460 us/op 3.0870 us/op 0.92
copy serialized Small SignedBeaconBlock (128000 B) 39.984 us/op 13.306 us/op 3.00
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2100 us/op 3.4270 us/op 0.94
copy serialized Avg SignedBeaconBlock (200000 B) 18.522 us/op 18.398 us/op 1.01
transfer serialized BlobsSidecar (524380 B) 3.0950 us/op 3.3080 us/op 0.94
copy serialized BlobsSidecar (524380 B) 168.07 us/op 161.13 us/op 1.04
transfer serialized Big SignedBeaconBlock (1000000 B) 3.0940 us/op 3.4810 us/op 0.89
copy serialized Big SignedBeaconBlock (1000000 B) 278.67 us/op 252.89 us/op 1.10
pass gossip attestations to forkchoice per slot 2.6131 ms/op 2.6902 ms/op 0.97
forkChoice updateHead vc 100000 bc 64 eq 0 2.0114 ms/op 2.1250 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 0 11.491 ms/op 11.877 ms/op 0.97
forkChoice updateHead vc 1000000 bc 64 eq 0 21.332 ms/op 22.595 ms/op 0.94
forkChoice updateHead vc 600000 bc 320 eq 0 16.066 ms/op 16.940 ms/op 0.95
forkChoice updateHead vc 600000 bc 1200 eq 0 76.983 ms/op 82.157 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 1000 19.984 ms/op 21.550 ms/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 10000 21.946 ms/op 23.301 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 300000 30.083 ms/op 32.300 ms/op 0.93
computeDeltas 3.5684 ms/op 3.7145 ms/op 0.96
computeProposerBoostScoreFromBalances 1.7282 ms/op 1.8342 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei normalcase 2.0508 ms/op 2.2842 ms/op 0.90
altair processAttestation - 250000 vs - 7PWei worstcase 3.2933 ms/op 4.6743 ms/op 0.70
altair processAttestation - setStatus - 1/6 committees join 139.73 us/op 149.80 us/op 0.93
altair processAttestation - setStatus - 1/3 committees join 268.61 us/op 288.45 us/op 0.93
altair processAttestation - setStatus - 1/2 committees join 354.35 us/op 379.90 us/op 0.93
altair processAttestation - setStatus - 2/3 committees join 459.25 us/op 477.35 us/op 0.96
altair processAttestation - setStatus - 4/5 committees join 636.68 us/op 673.86 us/op 0.94
altair processAttestation - setStatus - 100% committees join 751.28 us/op 778.71 us/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase 15.573 ms/op 16.329 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.057 ms/op 28.390 ms/op 0.92
altair processBlock - 250000 vs - 7PWei worstcase 47.497 ms/op 49.849 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 64.178 ms/op 72.065 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1962 ms/op 2.2711 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei worstcase 26.615 ms/op 32.184 ms/op 0.83
altair processEth1Data - 250000 vs - 7PWei normalcase 459.10 us/op 673.47 us/op 0.68
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.6630 us/op 13.976 us/op 0.48
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 19.506 us/op 44.388 us/op 0.44
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.2120 us/op 18.028 us/op 0.46
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.3610 us/op 12.133 us/op 0.52
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 77.097 us/op 123.59 us/op 0.62
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 627.46 us/op 748.75 us/op 0.84
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 889.87 us/op 1.3014 ms/op 0.68
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 847.66 us/op 1.2035 ms/op 0.70
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.1721 ms/op 3.9087 ms/op 0.56
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.4959 ms/op 2.4567 ms/op 0.61
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.7984 ms/op 6.1965 ms/op 0.61
Tree 40 250000 create 292.24 ms/op 674.34 ms/op 0.43
Tree 40 250000 get(125000) 176.81 ns/op 211.44 ns/op 0.84
Tree 40 250000 set(125000) 871.47 ns/op 1.4488 us/op 0.60
Tree 40 250000 toArray() 16.427 ms/op 27.384 ms/op 0.60
Tree 40 250000 iterate all - toArray() + loop 16.606 ms/op 27.072 ms/op 0.61
Tree 40 250000 iterate all - get(i) 66.131 ms/op 82.526 ms/op 0.80
MutableVector 250000 create 10.422 ms/op 13.666 ms/op 0.76
MutableVector 250000 get(125000) 6.2790 ns/op 7.1030 ns/op 0.88
MutableVector 250000 set(125000) 236.83 ns/op 462.31 ns/op 0.51
MutableVector 250000 toArray() 2.5775 ms/op 4.0761 ms/op 0.63
MutableVector 250000 iterate all - toArray() + loop 2.7278 ms/op 4.0973 ms/op 0.67
MutableVector 250000 iterate all - get(i) 1.4239 ms/op 1.6344 ms/op 0.87
Array 250000 create 2.3895 ms/op 3.9871 ms/op 0.60
Array 250000 clone - spread 1.0589 ms/op 1.7381 ms/op 0.61
Array 250000 get(125000) 0.52700 ns/op 1.4710 ns/op 0.36
Array 250000 set(125000) 0.59500 ns/op 1.1430 ns/op 0.52
Array 250000 iterate all - loop 77.360 us/op 93.101 us/op 0.83
effectiveBalanceIncrements clone Uint8Array 300000 24.591 us/op 62.321 us/op 0.39
effectiveBalanceIncrements clone MutableVector 300000 323.00 ns/op 443.00 ns/op 0.73
effectiveBalanceIncrements rw all Uint8Array 300000 159.19 us/op 179.48 us/op 0.89
effectiveBalanceIncrements rw all MutableVector 300000 75.350 ms/op 122.63 ms/op 0.61
phase0 afterProcessEpoch - 250000 vs - 7PWei 110.64 ms/op 132.78 ms/op 0.83
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.987 ms/op 44.583 ms/op 0.92
altair processEpoch - mainnet_e81889 313.29 ms/op 400.97 ms/op 0.78
mainnet_e81889 - altair beforeProcessEpoch 60.208 ms/op 85.907 ms/op 0.70
mainnet_e81889 - altair processJustificationAndFinalization 17.904 us/op 26.497 us/op 0.68
mainnet_e81889 - altair processInactivityUpdates 5.2359 ms/op 8.5535 ms/op 0.61
mainnet_e81889 - altair processRewardsAndPenalties 63.943 ms/op 73.573 ms/op 0.87
mainnet_e81889 - altair processRegistryUpdates 2.5410 us/op 6.8740 us/op 0.37
mainnet_e81889 - altair processSlashings 440.00 ns/op 1.3770 us/op 0.32
mainnet_e81889 - altair processEth1DataReset 498.00 ns/op 1.3820 us/op 0.36
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2462 ms/op 1.5900 ms/op 0.78
mainnet_e81889 - altair processSlashingsReset 4.9350 us/op 9.1770 us/op 0.54
mainnet_e81889 - altair processRandaoMixesReset 4.5420 us/op 12.931 us/op 0.35
mainnet_e81889 - altair processHistoricalRootsUpdate 689.00 ns/op 1.8850 us/op 0.37
mainnet_e81889 - altair processParticipationFlagUpdates 2.5400 us/op 8.1920 us/op 0.31
mainnet_e81889 - altair processSyncCommitteeUpdates 465.00 ns/op 828.00 ns/op 0.56
mainnet_e81889 - altair afterProcessEpoch 115.92 ms/op 154.65 ms/op 0.75
phase0 processEpoch - mainnet_e58758 314.37 ms/op 476.93 ms/op 0.66
mainnet_e58758 - phase0 beforeProcessEpoch 119.19 ms/op 216.31 ms/op 0.55
mainnet_e58758 - phase0 processJustificationAndFinalization 15.506 us/op 34.993 us/op 0.44
mainnet_e58758 - phase0 processRewardsAndPenalties 53.647 ms/op 84.693 ms/op 0.63
mainnet_e58758 - phase0 processRegistryUpdates 7.9100 us/op 19.168 us/op 0.41
mainnet_e58758 - phase0 processSlashings 530.00 ns/op 1.7350 us/op 0.31
mainnet_e58758 - phase0 processEth1DataReset 537.00 ns/op 1.7090 us/op 0.31
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 960.93 us/op 1.8808 ms/op 0.51
mainnet_e58758 - phase0 processSlashingsReset 3.0800 us/op 8.0910 us/op 0.38
mainnet_e58758 - phase0 processRandaoMixesReset 4.6690 us/op 8.3210 us/op 0.56
mainnet_e58758 - phase0 processHistoricalRootsUpdate 771.00 ns/op 1.2160 us/op 0.63
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.9770 us/op 9.2110 us/op 0.54
mainnet_e58758 - phase0 afterProcessEpoch 91.000 ms/op 108.62 ms/op 0.84
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2245 ms/op 1.3220 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4610 ms/op 2.0880 ms/op 0.70
altair processInactivityUpdates - 250000 normalcase 24.507 ms/op 25.212 ms/op 0.97
altair processInactivityUpdates - 250000 worstcase 25.496 ms/op 21.285 ms/op 1.20
phase0 processRegistryUpdates - 250000 normalcase 6.8120 us/op 7.9510 us/op 0.86
phase0 processRegistryUpdates - 250000 badcase_full_deposits 265.38 us/op 305.16 us/op 0.87
phase0 processRegistryUpdates - 250000 worstcase 0.5 132.55 ms/op 131.86 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 63.501 ms/op 65.317 ms/op 0.97
altair processRewardsAndPenalties - 250000 worstcase 67.737 ms/op 71.896 ms/op 0.94
phase0 getAttestationDeltas - 250000 normalcase 6.6784 ms/op 7.1754 ms/op 0.93
phase0 getAttestationDeltas - 250000 worstcase 6.3293 ms/op 7.1329 ms/op 0.89
phase0 processSlashings - 250000 worstcase 3.2912 ms/op 3.6614 ms/op 0.90
altair processSyncCommitteeUpdates - 250000 169.86 ms/op 186.28 ms/op 0.91
BeaconState.hashTreeRoot - No change 272.00 ns/op 352.00 ns/op 0.77
BeaconState.hashTreeRoot - 1 full validator 51.762 us/op 54.563 us/op 0.95
BeaconState.hashTreeRoot - 32 full validator 528.93 us/op 507.51 us/op 1.04
BeaconState.hashTreeRoot - 512 full validator 5.5428 ms/op 6.2891 ms/op 0.88
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 62.903 us/op 67.987 us/op 0.93
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 886.14 us/op 944.45 us/op 0.94
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.384 ms/op 12.189 ms/op 0.93
BeaconState.hashTreeRoot - 1 balances 50.451 us/op 48.692 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 442.67 us/op 455.28 us/op 0.97
BeaconState.hashTreeRoot - 512 balances 4.1897 ms/op 4.2205 ms/op 0.99
BeaconState.hashTreeRoot - 250000 balances 73.254 ms/op 74.872 ms/op 0.98
aggregationBits - 2048 els - zipIndexesInBitList 15.440 us/op 16.825 us/op 0.92
regular array get 100000 times 42.481 us/op 33.413 us/op 1.27
wrappedArray get 100000 times 41.669 us/op 33.443 us/op 1.25
arrayWithProxy get 100000 times 15.940 ms/op 17.642 ms/op 0.90
ssz.Root.equals 534.00 ns/op 608.00 ns/op 0.88
byteArrayEquals 532.00 ns/op 576.00 ns/op 0.92
shuffle list - 16384 els 6.6498 ms/op 7.1263 ms/op 0.93
shuffle list - 250000 els 99.158 ms/op 103.47 ms/op 0.96
processSlot - 1 slots 8.2430 us/op 9.3760 us/op 0.88
processSlot - 32 slots 1.3097 ms/op 1.4401 ms/op 0.91
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.875 ms/op 35.075 ms/op 1.05
getCommitteeAssignments - req 1 vs - 250000 vc 2.8047 ms/op 3.0159 ms/op 0.93
getCommitteeAssignments - req 100 vs - 250000 vc 4.0320 ms/op 4.2539 ms/op 0.95
getCommitteeAssignments - req 1000 vs - 250000 vc 4.3681 ms/op 4.5677 ms/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.5900 ns/op 4.8600 ns/op 0.94
state getBlockRootAtSlot - 250000 vs - 7PWei 859.96 ns/op 1.0642 us/op 0.81
computeProposers - vc 250000 10.209 ms/op 11.699 ms/op 0.87
computeEpochShuffling - vc 250000 99.513 ms/op 105.15 ms/op 0.95
getNextSyncCommittee - vc 250000 172.14 ms/op 175.47 ms/op 0.98
computeSigningRoot for AttestationData 13.389 us/op 13.930 us/op 0.96
hash AttestationData serialized data then Buffer.toString(base64) 2.3122 us/op 2.6133 us/op 0.88
toHexString serialized data 1.0242 us/op 1.0737 us/op 0.95
Buffer.toString(base64) 292.71 ns/op 332.23 ns/op 0.88

by benchmarkbot/action

@wemeetagain wemeetagain merged commit dd11c95 into unstable Jun 3, 2023
@wemeetagain wemeetagain deleted the ftb/payloadv3-rlp branch June 3, 2023 18:16
@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.

2 participants