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

Implement withdrawals in capella #4730

Merged
merged 9 commits into from
Nov 26, 2022
Merged

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Nov 7, 2022

TODO:
new spec tests release awaited for integration, else they pass (tested locally from the shared google drive tar)

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

looks good, minor comment

packages/state-transition/src/block/processWithdrawals.ts Outdated Show resolved Hide resolved
@g11tech g11tech changed the title remove epoch queue and process withdrawals on block processing Remove epoch queue and process withdrawals on block processing Nov 8, 2022
@g11tech g11tech marked this pull request as ready for review November 11, 2022 08:31
@g11tech g11tech requested a review from a team as a code owner November 11, 2022 08:31
@g11tech g11tech marked this pull request as draft November 11, 2022 08:32
@g11tech g11tech changed the base branch from g11tech/withdrawals to unstable November 11, 2022 08:33
@g11tech g11tech marked this pull request as ready for review November 11, 2022 08:41
@dapplion dapplion marked this pull request as draft November 11, 2022 11:48
@g11tech g11tech changed the title Remove epoch queue and process withdrawals on block processing Implement withdrawals in capella Nov 15, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 29b24f8 Previous: 798ec16 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.6770 ms/op 2.1973 ms/op 0.76
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 60.718 us/op 78.344 us/op 0.78
BLS verify - blst-native 2.1697 ms/op 1.8574 ms/op 1.17
BLS verifyMultipleSignatures 3 - blst-native 4.4872 ms/op 3.8074 ms/op 1.18
BLS verifyMultipleSignatures 8 - blst-native 9.6957 ms/op 8.2074 ms/op 1.18
BLS verifyMultipleSignatures 32 - blst-native 35.250 ms/op 29.707 ms/op 1.19
BLS aggregatePubkeys 32 - blst-native 46.451 us/op 39.475 us/op 1.18
BLS aggregatePubkeys 128 - blst-native 181.42 us/op 153.56 us/op 1.18
getAttestationsForBlock 78.795 ms/op 94.775 ms/op 0.83
isKnown best case - 1 super set check 495.00 ns/op 430.00 ns/op 1.15
isKnown normal case - 2 super set checks 483.00 ns/op 416.00 ns/op 1.16
isKnown worse case - 16 super set checks 477.00 ns/op 408.00 ns/op 1.17
CheckpointStateCache - add get delete 8.8630 us/op 9.2810 us/op 0.95
validate gossip signedAggregateAndProof - struct 5.0389 ms/op 4.2693 ms/op 1.18
validate gossip attestation - struct 2.3779 ms/op 2.0323 ms/op 1.17
pickEth1Vote - no votes 2.2261 ms/op 2.0766 ms/op 1.07
pickEth1Vote - max votes 18.406 ms/op 21.563 ms/op 0.85
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.631 ms/op 11.508 ms/op 1.10
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.880 ms/op 21.067 ms/op 0.99
pickEth1Vote - Eth1Data fastSerialize value x2048 1.4344 ms/op 1.5440 ms/op 0.93
pickEth1Vote - Eth1Data fastSerialize tree x2048 12.194 ms/op 14.377 ms/op 0.85
bytes32 toHexString 912.00 ns/op 1.0940 us/op 0.83
bytes32 Buffer.toString(hex) 724.00 ns/op 682.00 ns/op 1.06
bytes32 Buffer.toString(hex) from Uint8Array 982.00 ns/op 949.00 ns/op 1.03
bytes32 Buffer.toString(hex) + 0x 738.00 ns/op 674.00 ns/op 1.09
Object access 1 prop 0.34500 ns/op 0.37800 ns/op 0.91
Map access 1 prop 0.30600 ns/op 0.29500 ns/op 1.04
Object get x1000 11.113 ns/op 17.600 ns/op 0.63
Map get x1000 1.0780 ns/op 1.0060 ns/op 1.07
Object set x1000 73.617 ns/op 122.43 ns/op 0.60
Map set x1000 49.359 ns/op 74.084 ns/op 0.67
Return object 10000 times 0.43410 ns/op 0.37320 ns/op 1.16
Throw Error 10000 times 5.9603 us/op 6.0318 us/op 0.99
fastMsgIdFn sha256 / 200 bytes 4.7740 us/op 4.2560 us/op 1.12
fastMsgIdFn h32 xxhash / 200 bytes 576.00 ns/op 560.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 200 bytes 763.00 ns/op 801.00 ns/op 0.95
fastMsgIdFn sha256 / 1000 bytes 15.480 us/op 13.283 us/op 1.17
fastMsgIdFn h32 xxhash / 1000 bytes 741.00 ns/op 689.00 ns/op 1.08
fastMsgIdFn h64 xxhash / 1000 bytes 850.00 ns/op 792.00 ns/op 1.07
fastMsgIdFn sha256 / 10000 bytes 134.83 us/op 112.49 us/op 1.20
fastMsgIdFn h32 xxhash / 10000 bytes 2.6520 us/op 2.4070 us/op 1.10
fastMsgIdFn h64 xxhash / 10000 bytes 1.9270 us/op 1.7200 us/op 1.12
enrSubnets - fastDeserialize 64 bits 2.5290 us/op 2.7230 us/op 0.93
enrSubnets - ssz BitVector 64 bits 769.00 ns/op 777.00 ns/op 0.99
enrSubnets - fastDeserialize 4 bits 359.00 ns/op 398.00 ns/op 0.90
enrSubnets - ssz BitVector 4 bits 798.00 ns/op 774.00 ns/op 1.03
prioritizePeers score -10:0 att 32-0.1 sync 2-0 81.977 us/op 96.267 us/op 0.85
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 117.13 us/op 124.00 us/op 0.94
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 191.84 us/op 220.30 us/op 0.87
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 381.15 us/op 465.31 us/op 0.82
prioritizePeers score 0:0 att 64-1 sync 4-1 428.95 us/op 458.48 us/op 0.94
RateTracker 1000000 limit, 1 obj count per request 184.33 ns/op 191.80 ns/op 0.96
RateTracker 1000000 limit, 2 obj count per request 134.93 ns/op 143.71 ns/op 0.94
RateTracker 1000000 limit, 4 obj count per request 109.41 ns/op 121.03 ns/op 0.90
RateTracker 1000000 limit, 8 obj count per request 96.589 ns/op 110.30 ns/op 0.88
RateTracker with prune 3.8630 us/op 4.5160 us/op 0.86
array of 16000 items push then shift 51.599 us/op 2.7760 us/op 18.59
LinkedList of 16000 items push then shift 12.156 ns/op 17.637 ns/op 0.69
array of 16000 items push then pop 207.79 ns/op 232.74 ns/op 0.89
LinkedList of 16000 items push then pop 12.200 ns/op 16.658 ns/op 0.73
array of 24000 items push then shift 77.376 us/op 3.9873 us/op 19.41
LinkedList of 24000 items push then shift 12.933 ns/op 20.950 ns/op 0.62
array of 24000 items push then pop 192.87 ns/op 213.79 ns/op 0.90
LinkedList of 24000 items push then pop 12.352 ns/op 18.086 ns/op 0.68
intersect bitArray bitLen 8 10.769 ns/op 11.747 ns/op 0.92
intersect array and set length 8 132.28 ns/op 168.79 ns/op 0.78
intersect bitArray bitLen 128 57.920 ns/op 61.886 ns/op 0.94
intersect array and set length 128 1.7387 us/op 2.2954 us/op 0.76
Buffer.concat 32 items 1.8850 ns/op 1.8440 ns/op 1.02
pass gossip attestations to forkchoice per slot 3.6045 ms/op 4.0467 ms/op 0.89
computeDeltas 4.4696 ms/op 5.5338 ms/op 0.81
computeProposerBoostScoreFromBalances 803.82 us/op 921.36 us/op 0.87
altair processAttestation - 250000 vs - 7PWei normalcase 3.2918 ms/op 4.0587 ms/op 0.81
altair processAttestation - 250000 vs - 7PWei worstcase 5.5545 ms/op 6.0815 ms/op 0.91
altair processAttestation - setStatus - 1/6 committees join 178.67 us/op 206.35 us/op 0.87
altair processAttestation - setStatus - 1/3 committees join 353.77 us/op 395.21 us/op 0.90
altair processAttestation - setStatus - 1/2 committees join 508.97 us/op 555.64 us/op 0.92
altair processAttestation - setStatus - 2/3 committees join 659.37 us/op 713.14 us/op 0.92
altair processAttestation - setStatus - 4/5 committees join 921.65 us/op 991.22 us/op 0.93
altair processAttestation - setStatus - 100% committees join 1.1202 ms/op 1.1791 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase 23.740 ms/op 27.074 ms/op 0.88
altair processBlock - 250000 vs - 7PWei normalcase hashState 35.286 ms/op 38.348 ms/op 0.92
altair processBlock - 250000 vs - 7PWei worstcase 80.736 ms/op 90.970 ms/op 0.89
altair processBlock - 250000 vs - 7PWei worstcase hashState 103.16 ms/op 95.395 ms/op 1.08
phase0 processBlock - 250000 vs - 7PWei normalcase 3.8116 ms/op 3.6318 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei worstcase 53.110 ms/op 46.727 ms/op 1.14
altair processEth1Data - 250000 vs - 7PWei normalcase 698.94 us/op 863.11 us/op 0.81
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 10.994 us/op
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 36.313 us/op
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 12.993 us/op
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 13.156 us/op
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 144.14 us/op
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.0662 ms/op
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 141069 11.987 ms/op
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 250000 21.639 ms/op
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 250000 74.468 ms/op
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 250000 43.456 ms/op
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 250000 116.79 ms/op
Tree 40 250000 create 682.61 ms/op 783.29 ms/op 0.87
Tree 40 250000 get(125000) 227.74 ns/op 291.05 ns/op 0.78
Tree 40 250000 set(125000) 2.4197 us/op 2.4198 us/op 1.00
Tree 40 250000 toArray() 27.431 ms/op 32.108 ms/op 0.85
Tree 40 250000 iterate all - toArray() + loop 27.900 ms/op 32.022 ms/op 0.87
Tree 40 250000 iterate all - get(i) 110.87 ms/op 111.51 ms/op 0.99
MutableVector 250000 create 14.611 ms/op 17.771 ms/op 0.82
MutableVector 250000 get(125000) 10.988 ns/op 14.730 ns/op 0.75
MutableVector 250000 set(125000) 603.15 ns/op 684.44 ns/op 0.88
MutableVector 250000 toArray() 6.0905 ms/op 7.4780 ms/op 0.81
MutableVector 250000 iterate all - toArray() + loop 6.4330 ms/op 7.9777 ms/op 0.81
MutableVector 250000 iterate all - get(i) 2.6718 ms/op 3.2931 ms/op 0.81
Array 250000 create 6.0500 ms/op 7.0501 ms/op 0.86
Array 250000 clone - spread 2.5992 ms/op 4.0869 ms/op 0.64
Array 250000 get(125000) 1.1400 ns/op 1.6690 ns/op 0.68
Array 250000 set(125000) 1.1340 ns/op 1.6830 ns/op 0.67
Array 250000 iterate all - loop 150.92 us/op 167.94 us/op 0.90
effectiveBalanceIncrements clone Uint8Array 300000 219.84 us/op 105.24 us/op 2.09
effectiveBalanceIncrements clone MutableVector 300000 687.00 ns/op 1.3330 us/op 0.52
effectiveBalanceIncrements rw all Uint8Array 300000 247.54 us/op 252.50 us/op 0.98
effectiveBalanceIncrements rw all MutableVector 300000 145.77 ms/op 224.09 ms/op 0.65
phase0 afterProcessEpoch - 250000 vs - 7PWei 199.93 ms/op 206.57 ms/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 57.889 ms/op 72.614 ms/op 0.80
altair processEpoch - mainnet_e81889 562.95 ms/op 576.26 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 122.47 ms/op 144.19 ms/op 0.85
mainnet_e81889 - altair processJustificationAndFinalization 16.724 us/op 21.545 us/op 0.78
mainnet_e81889 - altair processInactivityUpdates 9.0752 ms/op 11.015 ms/op 0.82
mainnet_e81889 - altair processRewardsAndPenalties 128.19 ms/op 93.257 ms/op 1.37
mainnet_e81889 - altair processRegistryUpdates 2.6650 us/op 3.0670 us/op 0.87
mainnet_e81889 - altair processSlashings 694.00 ns/op 895.00 ns/op 0.78
mainnet_e81889 - altair processEth1DataReset 706.00 ns/op 852.00 ns/op 0.83
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.2894 ms/op 2.4101 ms/op 0.95
mainnet_e81889 - altair processSlashingsReset 5.2800 us/op 5.1790 us/op 1.02
mainnet_e81889 - altair processRandaoMixesReset 6.4910 us/op 5.4170 us/op 1.20
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0410 us/op 981.00 ns/op 1.06
mainnet_e81889 - altair processParticipationFlagUpdates 3.1740 us/op 2.6100 us/op 1.22
mainnet_e81889 - altair processSyncCommitteeUpdates 970.00 ns/op 676.00 ns/op 1.43
mainnet_e81889 - altair afterProcessEpoch 198.99 ms/op 195.85 ms/op 1.02
phase0 processEpoch - mainnet_e58758 485.80 ms/op 529.28 ms/op 0.92
mainnet_e58758 - phase0 beforeProcessEpoch 190.74 ms/op 232.98 ms/op 0.82
mainnet_e58758 - phase0 processJustificationAndFinalization 18.132 us/op 20.043 us/op 0.90
mainnet_e58758 - phase0 processRewardsAndPenalties 104.99 ms/op 84.139 ms/op 1.25
mainnet_e58758 - phase0 processRegistryUpdates 7.7220 us/op 9.0610 us/op 0.85
mainnet_e58758 - phase0 processSlashings 575.00 ns/op 726.00 ns/op 0.79
mainnet_e58758 - phase0 processEth1DataReset 583.00 ns/op 723.00 ns/op 0.81
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.7557 ms/op 1.9179 ms/op 0.92
mainnet_e58758 - phase0 processSlashingsReset 3.4250 us/op 4.6760 us/op 0.73
mainnet_e58758 - phase0 processRandaoMixesReset 4.1530 us/op 5.6210 us/op 0.74
mainnet_e58758 - phase0 processHistoricalRootsUpdate 632.00 ns/op 860.00 ns/op 0.73
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4740 us/op 4.9210 us/op 0.71
mainnet_e58758 - phase0 afterProcessEpoch 164.09 ms/op 171.08 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.0319 ms/op 2.6377 ms/op 0.77
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.2479 ms/op 3.5122 ms/op 0.64
altair processInactivityUpdates - 250000 normalcase 38.864 ms/op 38.426 ms/op 1.01
altair processInactivityUpdates - 250000 worstcase 32.839 ms/op 46.771 ms/op 0.70
phase0 processRegistryUpdates - 250000 normalcase 5.9210 us/op 7.9430 us/op 0.75
phase0 processRegistryUpdates - 250000 badcase_full_deposits 366.25 us/op 416.65 us/op 0.88
phase0 processRegistryUpdates - 250000 worstcase 0.5 194.02 ms/op 210.81 ms/op 0.92
altair processRewardsAndPenalties - 250000 normalcase 107.32 ms/op 126.71 ms/op 0.85
altair processRewardsAndPenalties - 250000 worstcase 73.044 ms/op 88.594 ms/op 0.82
phase0 getAttestationDeltas - 250000 normalcase 12.322 ms/op 13.710 ms/op 0.90
phase0 getAttestationDeltas - 250000 worstcase 12.478 ms/op 14.248 ms/op 0.88
phase0 processSlashings - 250000 worstcase 5.6791 ms/op 5.4241 ms/op 1.05
altair processSyncCommitteeUpdates - 250000 283.90 ms/op 287.81 ms/op 0.99
BeaconState.hashTreeRoot - No change 555.00 ns/op 466.00 ns/op 1.19
BeaconState.hashTreeRoot - 1 full validator 73.806 us/op 54.853 us/op 1.35
BeaconState.hashTreeRoot - 32 full validator 752.51 us/op 643.48 us/op 1.17
BeaconState.hashTreeRoot - 512 full validator 8.7764 ms/op 7.7072 ms/op 1.14
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 88.156 us/op 77.634 us/op 1.14
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2658 ms/op 1.1537 ms/op 1.10
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.954 ms/op 15.613 ms/op 1.09
BeaconState.hashTreeRoot - 1 balances 69.493 us/op 52.339 us/op 1.33
BeaconState.hashTreeRoot - 32 balances 628.10 us/op 573.04 us/op 1.10
BeaconState.hashTreeRoot - 512 balances 6.2330 ms/op 5.8179 ms/op 1.07
BeaconState.hashTreeRoot - 250000 balances 101.18 ms/op 98.383 ms/op 1.03
aggregationBits - 2048 els - zipIndexesInBitList 28.864 us/op 37.088 us/op 0.78
regular array get 100000 times 62.002 us/op 67.371 us/op 0.92
wrappedArray get 100000 times 60.740 us/op 67.403 us/op 0.90
arrayWithProxy get 100000 times 28.455 ms/op 28.845 ms/op 0.99
ssz.Root.equals 497.00 ns/op 565.00 ns/op 0.88
byteArrayEquals 473.00 ns/op 468.00 ns/op 1.01
shuffle list - 16384 els 11.811 ms/op 11.198 ms/op 1.05
shuffle list - 250000 els 169.06 ms/op 164.60 ms/op 1.03
processSlot - 1 slots 12.938 us/op 11.971 us/op 1.08
processSlot - 32 slots 1.9028 ms/op 1.7341 ms/op 1.10
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 361.26 us/op 380.41 us/op 0.95
getCommitteeAssignments - req 1 vs - 250000 vc 5.3670 ms/op 5.2758 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 7.9194 ms/op 7.3015 ms/op 1.08
getCommitteeAssignments - req 1000 vs - 250000 vc 8.4143 ms/op 7.7252 ms/op 1.09
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 7.5900 ns/op 10.540 ns/op 0.72
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0857 us/op 1.2475 us/op 0.87
computeProposers - vc 250000 16.966 ms/op 17.345 ms/op 0.98
computeEpochShuffling - vc 250000 173.08 ms/op 168.21 ms/op 1.03
getNextSyncCommittee - vc 250000 283.88 ms/op 285.29 ms/op 1.00

by benchmarkbot/action

@dapplion
Copy link
Contributor

Note from @g11tech : "Tests (e2e + sim) won't pass until ethereum/consensus-specs does a new release including latest spec tests and content. Promised data from researchers is ~ end of the week Nov 14 - Nov 18

@@ -59,6 +62,11 @@ export function specTestIterator(configDirpath: string, testRunners: Record<stri
}

for (const testHandler of readdirSyncSpec(testRunnerDirpath)) {
if (
["full_withdrawals", "partial_withdrawals", "bls_to_execution_change", "withdrawals"].includes(testHandler)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be removed once new spec tests land right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ummm, new test runners for them need to be written, is part of the TODO tracker here #4680

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.

Overall looks good! Some misc comments + request for performance tests

@dapplion dapplion added the spec-capella 🦉 Issues targeting the Capella spec version label Nov 18, 2022
@dapplion
Copy link
Contributor

dapplion commented Nov 21, 2022

@g11tech The test name is too long, could you drop "capella"? "getExpectedWithdrawals" is enough for now. Also remove "normalcase" tags for the long names for something that fits the print. Just use acronyms or something short that can be mapped to its meaning.

capella getExpectedWithdrawals
    ✔ capella getExpectedWithdrawals - 250000 bestcase                    38501.52 ops/s    25.97300 us/op        -        625 runs   3.08 s
    ✔ capella getExpectedWithdrawals - 250000 normalcase - 100% withdr    46427.41 ops/s    21.53900 us/op        -       1351 runs   4.57 s
    ✔ capella getExpectedWithdrawals - 250000 normalcase - 70% withdra    38704.18 ops/s    25.83700 us/op        -       1266 runs   3.52 s
    ✔ capella getExpectedWithdrawals - 250000 normalcase - 40% withdra    6.676219 ops/s    149.7854 ms/op        -          7 runs   2.45 s
    ✔ capella getExpectedWithdrawals - 250000 normalcase - 10% withdra    6.671051 ops/s    149.9014 ms/op        -          7 runs   2.53 s
    ✔ capella getExpectedWithdrawals - 250000 slighly degraded case -     37674.72 ops/s    26.54300 us/op        -       1263 runs   3.54 s
    ✔ capella getExpectedWithdrawals - 250000 degraded case - 90% with    34015.92 ops/s    29.39800 us/op        -       2334 runs   4.77 s
    ✔ capella getExpectedWithdrawals - 250000 highly degraded case - 9    32956.53 ops/s    30.34300 us/op        -        541 runs   2.73 s
    ✔ capella getExpectedWithdrawals - 250000 worstcase - lowBalance      6.686989 ops/s    149.5441 ms/op        -          7 runs   2.58 s
    ✔ capella getExpectedWithdrawals - 250000 worstcase - no withdrawa    6.470228 ops/s    154.5541 ms/op        -          7 runs   2.67 s

Why does the normalcase - 70% withdra take 25 us, and then normalcase - 40% withdra takes 150ms ? That x6000 times increase

@g11tech g11tech marked this pull request as ready for review November 22, 2022 14:17
@g11tech g11tech marked this pull request as draft November 22, 2022 14:17
@g11tech
Copy link
Contributor Author

g11tech commented Nov 22, 2022

from latest run```
✔ vc - 250000 bestcase - LBR: 0 - BCR: 0 - ineligible: 0 53367.49 ops/s 18.73800 us/op - 2657 runs 4.96 s
✔ vc - 250000 normalcase - LBR: 0.05 - BCR: 0 - ineligible: 0.05 52438.38 ops/s 19.07000 us/op - 3885 runs 7.14 s
✔ vc - 250000 normalcase - LBR: 0.05 - BCR: 0.3 - ineligible: 0.34 8.293244 ops/s 120.5801 ms/op - 7 runs 2.13 s
✔ vc - 250000 normalcase - LBR: 0.05 - BCR: 0.6 - ineligible: 0.64 8.257720 ops/s 121.0988 ms/op - 7 runs 2.10 s
✔ vc - 250000 normalcase - LBR: 0.05 - BCR: 0.9 - ineligible: 0.93 8.278587 ops/s 120.7936 ms/op - 7 runs 2.16 s
✔ vc - 250000 degraded - LBR: 0.1 - BCR: 0.1 - ineligible: 0.19 8.264214 ops/s 121.0036 ms/op - 7 runs 2.17 s
✔ vc - 250000 degraded - LBR: 0.3 - BCR: 0.1 - ineligible: 0.39 8.121191 ops/s 123.1346 ms/op - 7 runs 2.19 s
✔ vc - 250000 degraded- LBR: 0.4 - BCR: 0.1 - ineligible: 0.46 8.109943 ops/s 123.3054 ms/op - 7 runs 2.21 s
✔ vc - 250000 worstcase - LBR: 1 - BCR: 0 - ineligible: 1 8.265848 ops/s 120.9797 ms/op - 7 runs 2.18 s
✔ vc - 250000 worstcase - LBR: 0 - BCR: 1 - ineligible: 1 7.245151 ops/s 138.0233 ms/op - 51 runs 8.44


clearly performance degradation happens pretty fast and then stays that way, so may be javascript virtual machine gc is kicking into action, would be excited to see how these look in @dapplion 's PR

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.

Something is wrong in the benchmarks still @g11tech the time to complete should grow progressively on each degraded case. If all times are the same this PR cannot be merged

 getExpectedWithdrawals
    ✔ vc - 250000 eb 1 eth1 1 we 0 wn 0                                   121285.6 ops/s    8.245000 us/op        -        646 runs   4.07 s
    ✔ vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0                           15963.99 ops/s    62.64100 us/op        -        443 runs   3.01 s
    ✔ vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0                           21.34639 ops/s    46.84633 ms/op        -         31 runs   3.35 s
    ✔ vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0                           21.09553 ops/s    47.40340 ms/op        -         37 runs   3.59 s
    ✔ vc - 250000 eb 0 eth1 0 we 0 wn 0                                   21.35403 ops/s    46.82957 ms/op        -         12 runs   3.60 s
    ✔ vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache                           7.729008 ops/s    129.3827 ms/op        -         12 runs   3.13 s

@dapplion
Copy link
Contributor

@g11tech Benchmarks fixed 👍 reverted to using a rand() function but deterministic

  getExpectedWithdrawals
    ✔ vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15                         23630.61 ops/s    42.31800 us/op        -       2419 runs   5.45 s
    ✔ vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219                11216.92 ops/s    89.15100 us/op        -        304 runs   2.93 s
    ✔ vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42                 16537.95 ops/s    60.46700 us/op        -        703 runs   3.08 s
    ✔ vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18                 20744.31 ops/s    48.20600 us/op        -        317 runs   2.50 s
    ✔ vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020                   3250.098 ops/s    307.6830 us/op        -       1120 runs   4.12 s
    ✔ vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777                876.3505 ops/s    1.141096 ms/op        -        813 runs   3.77 s
    ✔ vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 141069               93.73472 ops/s    10.66841 ms/op        -         64 runs   2.07 s
    ✔ vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 250000                     55.27471 ops/s    18.09146 ms/op        -         31 runs   1.93 s
    ✔ vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 250000             13.51712 ops/s    73.98023 ms/op        -         13 runs   2.33 s
    ✔ vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 250000                     28.66458 ops/s    34.88626 ms/op        -         19 runs   2.07 s
    ✔ vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 250000             9.634900 ops/s    103.7894 ms/op        -         12 runs   2.58 s

process partial full withdrawals

block processWithdrawals and processBlsToExecutionChange

handle serialize/deserialize for execution api

stub interop with the geth

add withdrawals CI test run

update spec version

fix some of tests

skip unsupported spec tests

fix unit tests

fix issues and some of specs as a result

code improvement

fix the credential change

fix spec tests, skip the ones which are confirmed not correct

reset yarn lock

cleanup added libs

improve wording

Co-authored-by: Lion - dapplion <[email protected]>

improve wording

Co-authored-by: Lion - dapplion <[email protected]>

add blsToExecutionChanges empty list while producing block

fix the genesis state init and genesis spec tests for capella

fix the amount conversion

lint

handle capella state for test/utils/state

remove epoch queue and process withdrawals on block processing

remove WithdrawalQueue from types

lint

add withdrawals and txs to the log

fix amount in tests

update the fixed geth image and fix tests

interop with ethereumjs

add nethermind image run to the withdrawals ci run

fix the log gen

fix killing error

lint

simplify eth1 prefix address check

add interop

have deposits with withdrawals enabled for testing

lint

handle withdrawal null response

replace latest validator index by next validator index logic

trigger

saturate balance decrease to 0

use validdators.getReadonly

remove recipient

update the latest to next validator index in the test file

use genesisTemplate as the template var

Co-authored-by: Lion - dapplion <[email protected]>

improve wording of error

Co-authored-by: Lion - dapplion <[email protected]>

incorporate feedback

fixes

fix test

add perf test for getExpectedWithdrawals

fix perf test

pass config for phase0 to create cache

fix perf test

update balance for withdraw

fix the random generation

fix the epoch in expected withdrawals

refac perf test data gen

comment cleanup

shorten the log

further shorten

fix data gen

improve comment

Fix performance tests

lint fix

prep for bls to execution changes validation signature test

Fix benchmarks

fix build

fix test

fix type error

reset the test

fix the pubkey for withdrawal signature validation

export capella types individually

disable nethermind withdrawals

port back to previous spec version

fix build

fix spec name

fix val
@g11tech g11tech marked this pull request as ready for review November 26, 2022 14:36
@g11tech g11tech enabled auto-merge (squash) November 26, 2022 14:51
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.

LGTM! Withdrowoooool

       .___,   
    ___('v')___
    `"-\._./-"'
        ^ ^    

@g11tech g11tech merged commit c1ab090 into unstable Nov 26, 2022
@g11tech g11tech deleted the g11tech/without-epoch-queue branch November 26, 2022 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec-capella 🦉 Issues targeting the Capella spec version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants