Skip to content

fix: get attestation block head#9500

Draft
twoeths wants to merge 1 commit into
unstablefrom
te/fix_attestation_block_head
Draft

fix: get attestation block head#9500
twoeths wants to merge 1 commit into
unstablefrom
te/fix_attestation_block_head

Conversation

@twoeths

@twoeths twoeths commented Jun 10, 2026

Copy link
Copy Markdown
Member

Motivation

  • the head block from verifyHeadBlockIsKnown() is always with default status

Description

  • pass attestation index to get the correct variant
  • new forkchoice. getAttestationHeadBlock()
  • extract duplicate logic to getAttestationPayloadStatus()

AI Assistance Disclosure

  • created with the help of Claude

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the fork-choice logic to resolve the specific payload-status variant (PENDING, EMPTY, or FULL) that an attestation votes for based on its slot and index, introducing the getAttestationHeadBlock helper. This helper is integrated into the gossip validation path for attestations and aggregates. The reviewer identified a critical issue in the error handling within verifyHeadBlockIsKnown: catching all errors and throwing a REJECT action is incorrect when the error is ATTESTS_TO_FUTURE_BLOCK, which should instead trigger an IGNORE action. A code suggestion was provided to properly differentiate these error cases.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +783 to +791
let headBlock: ProtoBlock | null;
try {
headBlock = chain.forkChoice.getAttestationHeadBlock(toRootHex(beaconBlockRoot), attestationSlot, index);
} catch (_e) {
throw new AttestationError(GossipAction.REJECT, {
code: AttestationErrorCode.INVALID_PAYLOAD_STATUS_VALUE,
attDataIndex: index,
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Catching all errors from getAttestationHeadBlock and blindly throwing INVALID_PAYLOAD_STATUS_VALUE with GossipAction.REJECT is problematic. If the error thrown is ATTESTS_TO_FUTURE_BLOCK (e.g., when attestationSlot < headBlock.slot), the attestation is attesting to a future block. According to the gossip validation rules, such attestations should not be considered (i.e., GossipAction.IGNORE), rather than being rejected as having an invalid payload status value.

We should inspect the caught error and handle ATTESTS_TO_FUTURE_BLOCK separately (e.g., by throwing an AttestationError with GossipAction.IGNORE and an appropriate error code like UNKNOWN_OR_PREFINALIZED_BEACON_BLOCK_ROOT or similar).

Suggested change
let headBlock: ProtoBlock | null;
try {
headBlock = chain.forkChoice.getAttestationHeadBlock(toRootHex(beaconBlockRoot), attestationSlot, index);
} catch (_e) {
throw new AttestationError(GossipAction.REJECT, {
code: AttestationErrorCode.INVALID_PAYLOAD_STATUS_VALUE,
attDataIndex: index,
});
}
let headBlock: ProtoBlock | null;
try {
headBlock = chain.forkChoice.getAttestationHeadBlock(toRootHex(beaconBlockRoot), attestationSlot, index);
} catch (e) {
if (e && typeof e === "object" && "err" in e && (e as any).err?.code === "ATTESTS_TO_FUTURE_BLOCK") {
throw new AttestationError(GossipAction.IGNORE, {
code: AttestationErrorCode.UNKNOWN_OR_PREFINALIZED_BEACON_BLOCK_ROOT,
root: toRootHex(beaconBlockRoot),
});
}
throw new AttestationError(GossipAction.REJECT, {
code: AttestationErrorCode.INVALID_PAYLOAD_STATUS_VALUE,
attDataIndex: index,
});
}

@github-actions

Copy link
Copy Markdown
Contributor

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 0377b85 Previous: b00d95d Ratio
runFastConfirmationRules vc:600000 bc:96 eq:10000 4.3120 us/op 16.200 us/op 0.27
Full benchmark results
Benchmark suite Current: 0377b85 Previous: b00d95d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 884.69 us/op 991.33 us/op 0.89
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.660 us/op 39.086 us/op 1.01
BLS verify - blst 726.10 us/op 718.67 us/op 1.01
BLS verifyMultipleSignatures 3 - blst 1.3650 ms/op 1.2966 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst 2.1744 ms/op 2.0583 ms/op 1.06
BLS verifyMultipleSignatures 32 - blst 6.8211 ms/op 6.5330 ms/op 1.04
BLS verifyMultipleSignatures 64 - blst 13.256 ms/op 12.728 ms/op 1.04
BLS verifyMultipleSignatures 128 - blst 25.764 ms/op 24.933 ms/op 1.03
BLS deserializing 10000 signatures 643.21 ms/op 617.27 ms/op 1.04
BLS deserializing 100000 signatures 6.4371 s/op 6.2171 s/op 1.04
BLS verifyMultipleSignatures - same message - 3 - blst 711.83 us/op 763.76 us/op 0.93
BLS verifyMultipleSignatures - same message - 8 - blst 862.57 us/op 871.80 us/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst 1.5877 ms/op 1.5161 ms/op 1.05
BLS verifyMultipleSignatures - same message - 64 - blst 2.4044 ms/op 2.3563 ms/op 1.02
BLS verifyMultipleSignatures - same message - 128 - blst 4.0836 ms/op 3.9695 ms/op 1.03
BLS aggregatePubkeys 32 - blst 17.823 us/op 17.318 us/op 1.03
BLS aggregatePubkeys 128 - blst 63.757 us/op 61.503 us/op 1.04
getSlashingsAndExits - default max 47.552 us/op 54.141 us/op 0.88
getSlashingsAndExits - 2k 392.55 us/op 410.85 us/op 0.96
proposeBlockBody type=full, size=empty 1.1159 ms/op 1.6291 ms/op 0.68
isKnown best case - 1 super set check 166.00 ns/op 164.00 ns/op 1.01
isKnown normal case - 2 super set checks 176.00 ns/op 160.00 ns/op 1.10
isKnown worse case - 16 super set checks 166.00 ns/op 160.00 ns/op 1.04
validate api signedAggregateAndProof - struct 1.5278 ms/op 1.4784 ms/op 1.03
validate gossip signedAggregateAndProof - struct 1.5296 ms/op 1.4630 ms/op 1.05
batch validate gossip attestation - vc 640000 - chunk 32 109.54 us/op 109.15 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 64 95.776 us/op 94.521 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 128 89.045 us/op 88.802 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 256 86.245 us/op 87.446 us/op 0.99
bytes32 toHexString 300.00 ns/op 280.00 ns/op 1.07
bytes32 Buffer.toString(hex) 161.00 ns/op 172.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 231.00 ns/op 230.00 ns/op 1.00
bytes32 Buffer.toString(hex) + 0x 166.00 ns/op 169.00 ns/op 0.98
Return object 10000 times 0.21670 ns/op 0.20940 ns/op 1.03
Throw Error 10000 times 3.4516 us/op 3.2741 us/op 1.05
toHex 92.583 ns/op 87.330 ns/op 1.06
Buffer.from 84.747 ns/op 78.893 ns/op 1.07
shared Buffer 56.684 ns/op 51.680 ns/op 1.10
fastMsgIdFn sha256 / 200 bytes 1.4690 us/op 1.4510 us/op 1.01
fastMsgIdFn h32 xxhash / 200 bytes 155.00 ns/op 152.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 200 bytes 204.00 ns/op 205.00 ns/op 1.00
fastMsgIdFn sha256 / 1000 bytes 4.7610 us/op 4.6410 us/op 1.03
fastMsgIdFn h32 xxhash / 1000 bytes 243.00 ns/op 243.00 ns/op 1.00
fastMsgIdFn h64 xxhash / 1000 bytes 252.00 ns/op 247.00 ns/op 1.02
fastMsgIdFn sha256 / 10000 bytes 42.047 us/op 41.387 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 1.2970 us/op 1.2730 us/op 1.02
fastMsgIdFn h64 xxhash / 10000 bytes 843.00 ns/op 815.00 ns/op 1.03
enrSubnets - fastDeserialize 64 bits 753.00 ns/op 729.00 ns/op 1.03
enrSubnets - ssz BitVector 64 bits 263.00 ns/op 261.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 107.00 ns/op 103.00 ns/op 1.04
enrSubnets - ssz BitVector 4 bits 262.00 ns/op 260.00 ns/op 1.01
prioritizePeers score -10:0 att 32-0.1 sync 2-0 206.59 us/op 200.52 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 234.28 us/op 236.67 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 343.67 us/op 350.49 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 605.05 us/op 597.09 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 721.71 us/op 690.15 us/op 1.05
array of 16000 items push then shift 1.3113 us/op 1.2340 us/op 1.06
LinkedList of 16000 items push then shift 7.2190 ns/op 7.5300 ns/op 0.96
array of 16000 items push then pop 65.456 ns/op 67.508 ns/op 0.97
LinkedList of 16000 items push then pop 6.0380 ns/op 5.9020 ns/op 1.02
array of 24000 items push then shift 1.9523 us/op 1.8409 us/op 1.06
LinkedList of 24000 items push then shift 7.0430 ns/op 7.3250 ns/op 0.96
array of 24000 items push then pop 91.573 ns/op 93.709 ns/op 0.98
LinkedList of 24000 items push then pop 6.0420 ns/op 6.0140 ns/op 1.00
intersect bitArray bitLen 8 4.8620 ns/op 4.6740 ns/op 1.04
intersect array and set length 8 29.923 ns/op 28.898 ns/op 1.04
intersect bitArray bitLen 128 24.281 ns/op 23.685 ns/op 1.03
intersect array and set length 128 504.21 ns/op 494.10 ns/op 1.02
bitArray.getTrueBitIndexes() bitLen 128 967.00 ns/op 1.0240 us/op 0.94
bitArray.getTrueBitIndexes() bitLen 248 1.7460 us/op 1.7990 us/op 0.97
bitArray.getTrueBitIndexes() bitLen 512 3.6030 us/op 3.6810 us/op 0.98
Full columns - reconstruct all 6 blobs 125.47 us/op 122.97 us/op 1.02
Full columns - reconstruct half of the blobs out of 6 95.053 us/op 72.095 us/op 1.32
Full columns - reconstruct single blob out of 6 31.533 us/op 33.913 us/op 0.93
Half columns - reconstruct all 6 blobs 383.56 ms/op 384.20 ms/op 1.00
Half columns - reconstruct half of the blobs out of 6 194.97 ms/op 192.78 ms/op 1.01
Half columns - reconstruct single blob out of 6 67.555 ms/op 68.649 ms/op 0.98
Full columns - reconstruct all 10 blobs 170.99 us/op 221.10 us/op 0.77
Full columns - reconstruct half of the blobs out of 10 130.82 us/op 155.64 us/op 0.84
Full columns - reconstruct single blob out of 10 32.111 us/op 31.734 us/op 1.01
Half columns - reconstruct all 10 blobs 637.21 ms/op 620.38 ms/op 1.03
Half columns - reconstruct half of the blobs out of 10 317.92 ms/op 315.38 ms/op 1.01
Half columns - reconstruct single blob out of 10 66.751 ms/op 68.014 ms/op 0.98
Full columns - reconstruct all 20 blobs 754.48 us/op 1.3090 ms/op 0.58
Full columns - reconstruct half of the blobs out of 20 229.67 us/op 265.59 us/op 0.86
Full columns - reconstruct single blob out of 20 33.596 us/op 30.209 us/op 1.11
Half columns - reconstruct all 20 blobs 1.2688 s/op 1.2662 s/op 1.00
Half columns - reconstruct half of the blobs out of 20 651.26 ms/op 625.85 ms/op 1.04
Half columns - reconstruct single blob out of 20 68.236 ms/op 67.361 ms/op 1.01
Set add up to 64 items then delete first 2.6065 us/op 2.0634 us/op 1.26
OrderedSet add up to 64 items then delete first 3.3874 us/op 3.2745 us/op 1.03
Set add up to 64 items then delete last 2.3986 us/op 2.0492 us/op 1.17
OrderedSet add up to 64 items then delete last 3.4546 us/op 3.2300 us/op 1.07
Set add up to 64 items then delete middle 2.2061 us/op 2.0607 us/op 1.07
OrderedSet add up to 64 items then delete middle 4.9895 us/op 4.7182 us/op 1.06
Set add up to 128 items then delete first 4.2522 us/op 5.8737 us/op 0.72
OrderedSet add up to 128 items then delete first 6.3670 us/op 6.3611 us/op 1.00
Set add up to 128 items then delete last 4.1372 us/op 5.6867 us/op 0.73
OrderedSet add up to 128 items then delete last 6.1074 us/op 5.7545 us/op 1.06
Set add up to 128 items then delete middle 4.0236 us/op 5.7045 us/op 0.71
OrderedSet add up to 128 items then delete middle 12.109 us/op 11.538 us/op 1.05
Set add up to 256 items then delete first 7.9092 us/op 12.355 us/op 0.64
OrderedSet add up to 256 items then delete first 11.794 us/op 12.344 us/op 0.96
Set add up to 256 items then delete last 7.9400 us/op 11.489 us/op 0.69
OrderedSet add up to 256 items then delete last 12.112 us/op 11.506 us/op 1.05
Set add up to 256 items then delete middle 7.8797 us/op 11.358 us/op 0.69
OrderedSet add up to 256 items then delete middle 35.684 us/op 36.032 us/op 0.99
runFastConfirmationRules vc:100000 bc:96 eq:0 3.4200 us/op 3.2240 us/op 1.06
runFastConfirmationRules vc:600000 bc:96 eq:0 3.7360 us/op 11.029 us/op 0.34
runFastConfirmationRules vc:1000000 bc:96 eq:0 4.4610 us/op 10.653 us/op 0.42
runFastConfirmationRules vc:600000 bc:320 eq:0 6.7170 us/op 12.950 us/op 0.52
runFastConfirmationRules vc:600000 bc:1200 eq:0 23.462 us/op 21.117 us/op 1.11
runFastConfirmationRules vc:600000 bc:96 eq:1000 4.3840 us/op 4.6900 us/op 0.93
runFastConfirmationRules vc:600000 bc:96 eq:10000 4.3120 us/op 16.200 us/op 0.27
runFastConfirmationRules vc:600000 bc:96 eq:300000 7.5890 us/op 21.254 us/op 0.36
pass gossip attestations to forkchoice per slot 2.6002 ms/op 2.4957 ms/op 1.04
forkChoice updateHead vc 100000 bc 64 eq 0 448.16 us/op 390.71 us/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 0 2.6462 ms/op 2.3807 ms/op 1.11
forkChoice updateHead vc 1000000 bc 64 eq 0 4.3902 ms/op 3.9193 ms/op 1.12
forkChoice updateHead vc 600000 bc 320 eq 0 2.6714 ms/op 2.3979 ms/op 1.11
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7216 ms/op 2.5837 ms/op 1.05
forkChoice updateHead vc 600000 bc 7200 eq 0 3.3251 ms/op 3.1510 ms/op 1.06
forkChoice updateHead vc 600000 bc 64 eq 1000 2.7383 ms/op 2.3902 ms/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 10000 2.8905 ms/op 2.5109 ms/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 300000 7.1295 ms/op 6.6832 ms/op 1.07
computeDeltas 1400000 validators 0% inactive 12.985 ms/op 12.337 ms/op 1.05
computeDeltas 1400000 validators 10% inactive 12.210 ms/op 11.393 ms/op 1.07
computeDeltas 1400000 validators 20% inactive 11.322 ms/op 10.589 ms/op 1.07
computeDeltas 1400000 validators 50% inactive 8.6160 ms/op 8.2496 ms/op 1.04
computeDeltas 2100000 validators 0% inactive 19.661 ms/op 18.780 ms/op 1.05
computeDeltas 2100000 validators 10% inactive 18.478 ms/op 17.384 ms/op 1.06
computeDeltas 2100000 validators 20% inactive 17.131 ms/op 15.855 ms/op 1.08
computeDeltas 2100000 validators 50% inactive 10.170 ms/op 9.3154 ms/op 1.09
altair processAttestation - 250000 vs - 7PWei normalcase 1.7630 ms/op 2.3047 ms/op 0.76
altair processAttestation - 250000 vs - 7PWei worstcase 2.4925 ms/op 3.1455 ms/op 0.79
altair processAttestation - setStatus - 1/6 committees join 101.07 us/op 98.543 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 202.78 us/op 198.62 us/op 1.02
altair processAttestation - setStatus - 1/2 committees join 289.46 us/op 284.71 us/op 1.02
altair processAttestation - setStatus - 2/3 committees join 368.54 us/op 374.49 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 515.93 us/op 827.45 us/op 0.62
altair processAttestation - setStatus - 100% committees join 595.19 us/op 615.06 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 2.8732 ms/op 4.6754 ms/op 0.61
altair processBlock - 250000 vs - 7PWei normalcase hashState 14.190 ms/op 14.480 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase 20.006 ms/op 24.062 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase hashState 38.955 ms/op 49.052 ms/op 0.79
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2730 ms/op 1.4936 ms/op 0.85
phase0 processBlock - 250000 vs - 7PWei worstcase 17.435 ms/op 16.467 ms/op 1.06
altair processEth1Data - 250000 vs - 7PWei normalcase 304.60 us/op 286.24 us/op 1.06
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.5450 us/op 4.1260 us/op 0.86
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.561 us/op 22.548 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.1180 us/op 8.4470 us/op 0.72
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 3.7790 us/op 5.0570 us/op 0.75
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 98.349 us/op 103.46 us/op 0.95
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3770 ms/op 1.4849 ms/op 0.93
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8210 ms/op 1.8140 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8117 ms/op 1.7497 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.5593 ms/op 3.5424 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0473 ms/op 2.0522 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9028 ms/op 4.1913 ms/op 0.93
Tree 40 250000 create 316.97 ms/op 343.25 ms/op 0.92
Tree 40 250000 get(125000) 98.613 ns/op 92.156 ns/op 1.07
Tree 40 250000 set(125000) 1.0888 us/op 966.11 ns/op 1.13
Tree 40 250000 toArray() 9.8163 ms/op 14.899 ms/op 0.66
Tree 40 250000 iterate all - toArray() + loop 9.4126 ms/op 15.257 ms/op 0.62
Tree 40 250000 iterate all - get(i) 36.038 ms/op 40.287 ms/op 0.89
Array 250000 create 2.1172 ms/op 2.1522 ms/op 0.98
Array 250000 clone - spread 663.67 us/op 671.27 us/op 0.99
Array 250000 get(125000) 0.29300 ns/op 0.29400 ns/op 1.00
Array 250000 set(125000) 0.29700 ns/op 0.29400 ns/op 1.01
Array 250000 iterate all - loop 58.768 us/op 56.916 us/op 1.03
phase0 afterProcessEpoch - 250000 vs - 7PWei 39.729 ms/op 39.136 ms/op 1.02
Array.fill - length 1000000 2.3866 ms/op 2.3832 ms/op 1.00
Array push - length 1000000 7.7110 ms/op 9.4883 ms/op 0.81
Array.get 0.20631 ns/op 0.19947 ns/op 1.03
Uint8Array.get 0.23957 ns/op 0.22782 ns/op 1.05
phase0 beforeProcessEpoch - 250000 vs - 7PWei 11.967 ms/op 15.719 ms/op 0.76
altair processEpoch - mainnet_e81889 258.22 ms/op 301.69 ms/op 0.86
mainnet_e81889 - altair beforeProcessEpoch 21.951 ms/op 38.035 ms/op 0.58
mainnet_e81889 - altair processJustificationAndFinalization 7.0520 us/op 6.9870 us/op 1.01
mainnet_e81889 - altair processInactivityUpdates 3.5230 ms/op 6.4626 ms/op 0.55
mainnet_e81889 - altair processRewardsAndPenalties 18.191 ms/op 19.574 ms/op 0.93
mainnet_e81889 - altair processRegistryUpdates 540.00 ns/op 529.00 ns/op 1.02
mainnet_e81889 - altair processSlashings 133.00 ns/op 139.00 ns/op 0.96
mainnet_e81889 - altair processEth1DataReset 131.00 ns/op 126.00 ns/op 1.04
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7685 ms/op 6.2076 ms/op 0.28
mainnet_e81889 - altair processSlashingsReset 727.00 ns/op 669.00 ns/op 1.09
mainnet_e81889 - altair processRandaoMixesReset 1.1100 us/op 1.4200 us/op 0.78
mainnet_e81889 - altair processHistoricalRootsUpdate 135.00 ns/op 134.00 ns/op 1.01
mainnet_e81889 - altair processParticipationFlagUpdates 445.00 ns/op 448.00 ns/op 0.99
mainnet_e81889 - altair processSyncCommitteeUpdates 107.00 ns/op 106.00 ns/op 1.01
mainnet_e81889 - altair afterProcessEpoch 42.983 ms/op 40.367 ms/op 1.06
capella processEpoch - mainnet_e217614 725.31 ms/op 828.08 ms/op 0.88
mainnet_e217614 - capella beforeProcessEpoch 56.998 ms/op 55.504 ms/op 1.03
mainnet_e217614 - capella processJustificationAndFinalization 5.2140 us/op 6.3620 us/op 0.82
mainnet_e217614 - capella processInactivityUpdates 11.352 ms/op 15.115 ms/op 0.75
mainnet_e217614 - capella processRewardsAndPenalties 85.896 ms/op 90.777 ms/op 0.95
mainnet_e217614 - capella processRegistryUpdates 4.5780 us/op 4.3120 us/op 1.06
mainnet_e217614 - capella processSlashings 133.00 ns/op 126.00 ns/op 1.06
mainnet_e217614 - capella processEth1DataReset 126.00 ns/op 125.00 ns/op 1.01
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.9820 ms/op 16.862 ms/op 0.35
mainnet_e217614 - capella processSlashingsReset 697.00 ns/op 660.00 ns/op 1.06
mainnet_e217614 - capella processRandaoMixesReset 1.0560 us/op 1.2900 us/op 0.82
mainnet_e217614 - capella processHistoricalRootsUpdate 133.00 ns/op 124.00 ns/op 1.07
mainnet_e217614 - capella processParticipationFlagUpdates 443.00 ns/op 417.00 ns/op 1.06
mainnet_e217614 - capella afterProcessEpoch 110.22 ms/op 107.00 ms/op 1.03
phase0 processEpoch - mainnet_e58758 274.49 ms/op 326.98 ms/op 0.84
mainnet_e58758 - phase0 beforeProcessEpoch 56.314 ms/op 70.634 ms/op 0.80
mainnet_e58758 - phase0 processJustificationAndFinalization 5.4990 us/op 6.3660 us/op 0.86
mainnet_e58758 - phase0 processRewardsAndPenalties 15.318 ms/op 15.682 ms/op 0.98
mainnet_e58758 - phase0 processRegistryUpdates 2.3220 us/op 2.1860 us/op 1.06
mainnet_e58758 - phase0 processSlashings 135.00 ns/op 126.00 ns/op 1.07
mainnet_e58758 - phase0 processEth1DataReset 134.00 ns/op 124.00 ns/op 1.08
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 836.18 us/op 850.63 us/op 0.98
mainnet_e58758 - phase0 processSlashingsReset 937.00 ns/op 856.00 ns/op 1.09
mainnet_e58758 - phase0 processRandaoMixesReset 1.1940 us/op 1.2180 us/op 0.98
mainnet_e58758 - phase0 processHistoricalRootsUpdate 133.00 ns/op 129.00 ns/op 1.03
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.1210 us/op 1.2140 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 33.316 ms/op 32.358 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1107 ms/op 950.62 us/op 1.17
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.2613 ms/op 1.5048 ms/op 0.84
altair processInactivityUpdates - 250000 normalcase 11.362 ms/op 12.079 ms/op 0.94
altair processInactivityUpdates - 250000 worstcase 10.842 ms/op 12.019 ms/op 0.90
phase0 processRegistryUpdates - 250000 normalcase 2.3050 us/op 2.0470 us/op 1.13
phase0 processRegistryUpdates - 250000 badcase_full_deposits 147.10 us/op 134.22 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 59.023 ms/op 67.706 ms/op 0.87
altair processRewardsAndPenalties - 250000 normalcase 15.249 ms/op 16.522 ms/op 0.92
altair processRewardsAndPenalties - 250000 worstcase 13.542 ms/op 15.444 ms/op 0.88
phase0 getAttestationDeltas - 250000 normalcase 5.4671 ms/op 5.3498 ms/op 1.02
phase0 getAttestationDeltas - 250000 worstcase 5.5467 ms/op 5.4497 ms/op 1.02
phase0 processSlashings - 250000 worstcase 62.452 us/op 61.963 us/op 1.01
altair processSyncCommitteeUpdates - 250000 9.9994 ms/op 12.389 ms/op 0.81
BeaconState.hashTreeRoot - No change 165.00 ns/op 162.00 ns/op 1.02
BeaconState.hashTreeRoot - 1 full validator 56.691 us/op 87.518 us/op 0.65
BeaconState.hashTreeRoot - 32 full validator 609.64 us/op 854.28 us/op 0.71
BeaconState.hashTreeRoot - 512 full validator 5.9627 ms/op 9.4566 ms/op 0.63
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 71.405 us/op 106.83 us/op 0.67
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0418 ms/op 1.5574 ms/op 0.67
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.904 ms/op 21.127 ms/op 0.61
BeaconState.hashTreeRoot - 1 balances 56.864 us/op 82.518 us/op 0.69
BeaconState.hashTreeRoot - 32 balances 545.59 us/op 758.08 us/op 0.72
BeaconState.hashTreeRoot - 512 balances 4.5646 ms/op 8.6228 ms/op 0.53
BeaconState.hashTreeRoot - 250000 balances 118.37 ms/op 151.00 ms/op 0.78
aggregationBits - 2048 els - zipIndexesInBitList 20.661 us/op 21.631 us/op 0.96
regular array get 100000 times 23.308 us/op 23.204 us/op 1.00
wrappedArray get 100000 times 23.320 us/op 23.188 us/op 1.01
arrayWithProxy get 100000 times 10.409 ms/op 17.273 ms/op 0.60
ssz.Root.equals 21.809 ns/op 76.051 ns/op 0.29
byteArrayEquals 21.547 ns/op 22.729 ns/op 0.95
Buffer.compare 9.0090 ns/op 9.6110 ns/op 0.94
processSlot - 1 slots 8.2170 us/op 12.009 us/op 0.68
processSlot - 32 slots 1.5912 ms/op 2.1689 ms/op 0.73
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.4207 ms/op 5.4772 ms/op 0.62
getCommitteeAssignments - req 1 vs - 250000 vc 1.7013 ms/op 1.6515 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 3.4661 ms/op 3.3508 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7228 ms/op 3.6222 ms/op 1.03
findModifiedValidators - 10000 modified validators 801.04 ms/op 775.91 ms/op 1.03
findModifiedValidators - 1000 modified validators 543.42 ms/op 460.31 ms/op 1.18
findModifiedValidators - 100 modified validators 355.61 ms/op 298.57 ms/op 1.19
findModifiedValidators - 10 modified validators 310.98 ms/op 236.47 ms/op 1.32
findModifiedValidators - 1 modified validators 225.34 ms/op 164.84 ms/op 1.37
findModifiedValidators - no difference 205.12 ms/op 195.14 ms/op 1.05
migrate state 1500000 validators, 3400 modified, 2000 new 2.9499 s/op 3.4140 s/op 0.86
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.7700 ns/op 3.6500 ns/op 1.03
state getBlockRootAtSlot - 250000 vs - 7PWei 356.39 ns/op 402.63 ns/op 0.89
computeProposerIndex 100000 validators 1.3353 ms/op 1.3639 ms/op 0.98
getNextSyncCommitteeIndices 1000 validators 2.9088 ms/op 2.8767 ms/op 1.01
getNextSyncCommitteeIndices 10000 validators 25.594 ms/op 25.611 ms/op 1.00
getNextSyncCommitteeIndices 100000 validators 84.334 ms/op 91.556 ms/op 0.92
computeProposers - vc 250000 569.63 us/op 554.37 us/op 1.03
computeEpochShuffling - vc 250000 40.033 ms/op 39.615 ms/op 1.01
getNextSyncCommittee - vc 250000 9.7191 ms/op 10.744 ms/op 0.90
nodejs block root to RootHex using toHex 96.309 ns/op 94.457 ns/op 1.02
nodejs block root to RootHex using toRootHex 57.102 ns/op 53.106 ns/op 1.08
nodejs fromHex(blob) 801.51 us/op 918.76 us/op 0.87
nodejs fromHexInto(blob) 646.69 us/op 649.99 us/op 0.99
nodejs block root to RootHex using the deprecated toHexString 515.11 ns/op 522.61 ns/op 0.99
nodejs byteArrayEquals 32 bytes (block root) 26.544 ns/op 26.142 ns/op 1.02
nodejs byteArrayEquals 48 bytes (pubkey) 38.587 ns/op 38.124 ns/op 1.01
nodejs byteArrayEquals 96 bytes (signature) 36.982 ns/op 34.435 ns/op 1.07
nodejs byteArrayEquals 1024 bytes 44.652 ns/op 41.547 ns/op 1.07
nodejs byteArrayEquals 131072 bytes (blob) 1.7885 us/op 1.7793 us/op 1.01
browser block root to RootHex using toHex 149.33 ns/op 146.10 ns/op 1.02
browser block root to RootHex using toRootHex 134.97 ns/op 132.50 ns/op 1.02
browser fromHex(blob) 1.5749 ms/op 1.5964 ms/op 0.99
browser fromHexInto(blob) 640.09 us/op 618.55 us/op 1.03
browser block root to RootHex using the deprecated toHexString 352.88 ns/op 342.53 ns/op 1.03
browser byteArrayEquals 32 bytes (block root) 28.186 ns/op 27.324 ns/op 1.03
browser byteArrayEquals 48 bytes (pubkey) 40.056 ns/op 38.543 ns/op 1.04
browser byteArrayEquals 96 bytes (signature) 75.080 ns/op 71.361 ns/op 1.05
browser byteArrayEquals 1024 bytes 759.44 ns/op 727.06 ns/op 1.04
browser byteArrayEquals 131072 bytes (blob) 95.811 us/op 92.597 us/op 1.03

by benchmarkbot/action

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