Skip to content

feat: integrate zig state transition#9516

Draft
spiral-ladder wants to merge 25 commits into
unstablefrom
bing/lodestar-z-stf
Draft

feat: integrate zig state transition#9516
spiral-ladder wants to merge 25 commits into
unstablefrom
bing/lodestar-z-stf

Conversation

@spiral-ladder

Copy link
Copy Markdown
Contributor

No description provided.

@spiral-ladder spiral-ladder self-assigned this Jun 16, 2026

@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 integrates a native (Zig) state transition implementation into Lodestar, allowing state transitions and slot processing to be delegated to native bindings when the --chain.nativeStateView flag is enabled. Feedback on these changes highlights several key issues: blindly casting signedBlock to SignedBeaconBlock during serialization will fail for blinded blocks, and re-creating epochCtx from scratch when reloading cached states introduces a major performance bottleneck. Additionally, using a relative link: path for the native dependency in package.json makes the package non-portable, and there is a duplicated comment in the parity test file that should be cleaned up.

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 +129 to +131
const blockBytes = config
.getForkTypes(signedBlock.message.slot)
.SignedBeaconBlock.serialize(signedBlock as SignedBeaconBlock);

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

The signedBlock parameter can be either a SignedBeaconBlock or a SignedBlindedBeaconBlock. Casting it blindly to SignedBeaconBlock and serializing it with the SignedBeaconBlock schema will fail or produce corrupt serialized bytes when processing a blinded block. You should check if the block is blinded and serialize it using the appropriate schema.

Suggested change
const blockBytes = config
.getForkTypes(signedBlock.message.slot)
.SignedBeaconBlock.serialize(signedBlock as SignedBeaconBlock);
const forkTypes = config.getForkTypes(signedBlock.message.slot);
const isBlinded = "executionPayloadHeader" in signedBlock.message.body;
const blockBytes = isBlinded
? forkTypes.SignedBlindedBeaconBlock.serialize(signedBlock as SignedBlindedBeaconBlock)
: forkTypes.SignedBeaconBlock.serialize(signedBlock as SignedBeaconBlock);

Comment on lines +48 to +56
function reloadCachedState(prev: CachedBeaconStateAllForks, postStateBytes: Uint8Array): CachedBeaconStateAllForks {
const {config, epochCtx} = prev;
const view = getStateTypeFromBytes(config, postStateBytes).deserializeToViewDU(postStateBytes);
return createCachedBeaconState(
view,
{config, pubkeyCache: epochCtx.pubkeyCache},
{skipSyncPubkeys: true}
) as CachedBeaconStateAllForks;
}

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

Re-creating the epochCtx (EpochContext) from scratch via createCachedBeaconState on every block or slot transition is a major performance bottleneck. This discards all cached shufflings, proposer indices, and other precomputed epoch-specific values, defeating the performance benefits of CachedBeaconState. Consider refactoring this to incrementally update or reuse the existing epochCtx instead of discarding it.

Comment on lines +24 to +31
// generateValidator returns the same hardcoded pubkey for every validator, which makes the
// native binding's global pubkey_to_index map collapse to a single entry while index_to_pubkey
// keeps N. That leaves syncPubkeys's consistency check tripping on the second createFromBytes
// call. Production states always have unique pubkeys, so just patch the test fixture.
// generateValidator returns the same hardcoded pubkey for every validator, which makes the
// native binding's global pubkey_to_index map collapse to a single entry while index_to_pubkey
// keeps N — tripping syncPubkeys's consistency check on the second createFromBytes call.
// Production states always have unique pubkeys; patch the fixture with unique valid BLS pubkeys.

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.

medium

The comment explaining why the test fixture is patched with unique BLS pubkeys is duplicated word-for-word. Please remove the redundant copy.

Suggested change
// generateValidator returns the same hardcoded pubkey for every validator, which makes the
// native binding's global pubkey_to_index map collapse to a single entry while index_to_pubkey
// keeps N. That leaves syncPubkeys's consistency check tripping on the second createFromBytes
// call. Production states always have unique pubkeys, so just patch the test fixture.
// generateValidator returns the same hardcoded pubkey for every validator, which makes the
// native binding's global pubkey_to_index map collapse to a single entry while index_to_pubkey
// keeps N — tripping syncPubkeys's consistency check on the second createFromBytes call.
// Production states always have unique pubkeys; patch the fixture with unique valid BLS pubkeys.
// generateValidator returns the same hardcoded pubkey for every validator, which makes the
// native binding's global pubkey_to_index map collapse to a single entry while index_to_pubkey
// keeps N — tripping syncPubkeys's consistency check on the second createFromBytes call.
// Production states always have unique pubkeys; patch the fixture with unique valid BLS pubkeys.

Comment thread packages/state-transition/package.json Outdated
"@lodestar/params": "workspace:^",
"@lodestar/types": "workspace:^",
"@lodestar/utils": "workspace:^",
"@chainsafe/lodestar-z": "link:../../../lodestar-z-native-stf",

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.

medium

Using a relative link: path pointing outside the repository root (../../../lodestar-z-native-stf) makes the package non-portable. This will break in CI/CD environments, Docker builds, or for other developers unless they manually clone the native STF repository at that exact relative path. Consider defining this as a workspace dependency if it is part of the same monorepo, or fetch it via a git URL / npm registry if it is external.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 4695a33 Previous: c04b424 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.3477 ms/op 960.74 us/op 1.40
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 41.396 us/op 39.199 us/op 1.06
BLS verify - blst 766.99 us/op 625.83 us/op 1.23
BLS verifyMultipleSignatures 3 - blst 1.3831 ms/op 1.2903 ms/op 1.07
BLS verifyMultipleSignatures 8 - blst 2.4962 ms/op 2.0318 ms/op 1.23
BLS verifyMultipleSignatures 32 - blst 7.0769 ms/op 6.7150 ms/op 1.05
BLS verifyMultipleSignatures 64 - blst 14.269 ms/op 12.680 ms/op 1.13
BLS verifyMultipleSignatures 128 - blst 26.372 ms/op 24.983 ms/op 1.06
BLS deserializing 10000 signatures 646.10 ms/op 612.46 ms/op 1.05
BLS deserializing 100000 signatures 6.4383 s/op 6.1430 s/op 1.05
BLS verifyMultipleSignatures - same message - 3 - blst 804.26 us/op 744.61 us/op 1.08
BLS verifyMultipleSignatures - same message - 8 - blst 964.46 us/op 870.81 us/op 1.11
BLS verifyMultipleSignatures - same message - 32 - blst 1.5587 ms/op 1.4437 ms/op 1.08
BLS verifyMultipleSignatures - same message - 64 - blst 2.4475 ms/op 2.2820 ms/op 1.07
BLS verifyMultipleSignatures - same message - 128 - blst 4.1523 ms/op 3.8647 ms/op 1.07
BLS aggregatePubkeys 32 - blst 18.019 us/op 17.114 us/op 1.05
BLS aggregatePubkeys 128 - blst 64.161 us/op 61.409 us/op 1.04
getSlashingsAndExits - default max 58.154 us/op 48.938 us/op 1.19
getSlashingsAndExits - 2k 425.95 us/op 351.99 us/op 1.21
proposeBlockBody type=full, size=empty 783.38 us/op 686.97 us/op 1.14
isKnown best case - 1 super set check 432.00 ns/op 161.00 ns/op 2.68
isKnown normal case - 2 super set checks 174.00 ns/op 158.00 ns/op 1.10
isKnown worse case - 16 super set checks 173.00 ns/op 156.00 ns/op 1.11
validate api signedAggregateAndProof - struct 1.5541 ms/op 1.4535 ms/op 1.07
validate gossip signedAggregateAndProof - struct 1.5463 ms/op 1.4413 ms/op 1.07
batch validate gossip attestation - vc 640000 - chunk 32 107.15 us/op 106.04 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 97.300 us/op 93.145 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 128 89.844 us/op 86.600 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 256 88.179 us/op 85.032 us/op 1.04
bytes32 toHexString 292.00 ns/op 272.00 ns/op 1.07
bytes32 Buffer.toString(hex) 170.00 ns/op 158.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 237.00 ns/op 218.00 ns/op 1.09
bytes32 Buffer.toString(hex) + 0x 172.00 ns/op 160.00 ns/op 1.07
Return object 10000 times 0.21720 ns/op 0.20770 ns/op 1.05
Throw Error 10000 times 3.4855 us/op 3.1767 us/op 1.10
toHex 96.841 ns/op 85.431 ns/op 1.13
Buffer.from 87.758 ns/op 77.480 ns/op 1.13
shared Buffer 58.769 ns/op 50.674 ns/op 1.16
fastMsgIdFn sha256 / 200 bytes 1.4740 us/op 1.4370 us/op 1.03
fastMsgIdFn h32 xxhash / 200 bytes 157.00 ns/op 147.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 200 bytes 217.00 ns/op 188.00 ns/op 1.15
fastMsgIdFn sha256 / 1000 bytes 4.8210 us/op 4.5780 us/op 1.05
fastMsgIdFn h32 xxhash / 1000 bytes 246.00 ns/op 237.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 1000 bytes 265.00 ns/op 245.00 ns/op 1.08
fastMsgIdFn sha256 / 10000 bytes 42.851 us/op 40.446 us/op 1.06
fastMsgIdFn h32 xxhash / 10000 bytes 1.3070 us/op 1.2140 us/op 1.08
fastMsgIdFn h64 xxhash / 10000 bytes 862.00 ns/op 776.00 ns/op 1.11
enrSubnets - fastDeserialize 64 bits 809.00 ns/op 674.00 ns/op 1.20
enrSubnets - ssz BitVector 64 bits 265.00 ns/op 256.00 ns/op 1.04
enrSubnets - fastDeserialize 4 bits 107.00 ns/op 94.000 ns/op 1.14
enrSubnets - ssz BitVector 4 bits 261.00 ns/op 256.00 ns/op 1.02
prioritizePeers score -10:0 att 32-0.1 sync 2-0 215.55 us/op 200.62 us/op 1.07
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 254.63 us/op 229.12 us/op 1.11
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 370.74 us/op 331.01 us/op 1.12
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 852.56 us/op 585.67 us/op 1.46
prioritizePeers score 0:0 att 64-1 sync 4-1 829.24 us/op 679.35 us/op 1.22
array of 16000 items push then shift 1.3589 us/op 1.2099 us/op 1.12
LinkedList of 16000 items push then shift 7.8310 ns/op 7.1000 ns/op 1.10
array of 16000 items push then pop 83.207 ns/op 64.367 ns/op 1.29
LinkedList of 16000 items push then pop 6.4230 ns/op 5.7460 ns/op 1.12
array of 24000 items push then shift 1.9717 us/op 1.7797 us/op 1.11
LinkedList of 24000 items push then shift 7.3940 ns/op 6.8670 ns/op 1.08
array of 24000 items push then pop 111.12 ns/op 91.375 ns/op 1.22
LinkedList of 24000 items push then pop 6.2780 ns/op 5.8240 ns/op 1.08
intersect bitArray bitLen 8 4.8400 ns/op 4.6060 ns/op 1.05
intersect array and set length 8 30.295 ns/op 28.123 ns/op 1.08
intersect bitArray bitLen 128 24.318 ns/op 23.128 ns/op 1.05
intersect array and set length 128 507.43 ns/op 478.25 ns/op 1.06
bitArray.getTrueBitIndexes() bitLen 128 1.0910 us/op 924.00 ns/op 1.18
bitArray.getTrueBitIndexes() bitLen 248 1.8210 us/op 1.6740 us/op 1.09
bitArray.getTrueBitIndexes() bitLen 512 3.7720 us/op 3.4810 us/op 1.08
Full columns - reconstruct all 6 blobs 120.23 us/op 178.91 us/op 0.67
Full columns - reconstruct half of the blobs out of 6 75.601 us/op 138.79 us/op 0.54
Full columns - reconstruct single blob out of 6 29.748 us/op 33.038 us/op 0.90
Half columns - reconstruct all 6 blobs 410.10 ms/op 380.08 ms/op 1.08
Half columns - reconstruct half of the blobs out of 6 205.47 ms/op 193.40 ms/op 1.06
Half columns - reconstruct single blob out of 6 72.178 ms/op 70.036 ms/op 1.03
Full columns - reconstruct all 10 blobs 203.50 us/op 261.71 us/op 0.78
Full columns - reconstruct half of the blobs out of 10 106.93 us/op 175.96 us/op 0.61
Full columns - reconstruct single blob out of 10 33.112 us/op 30.761 us/op 1.08
Half columns - reconstruct all 10 blobs 677.56 ms/op 631.25 ms/op 1.07
Half columns - reconstruct half of the blobs out of 10 343.08 ms/op 314.65 ms/op 1.09
Half columns - reconstruct single blob out of 10 73.423 ms/op 67.636 ms/op 1.09
Full columns - reconstruct all 20 blobs 1.4211 ms/op 770.56 us/op 1.84
Full columns - reconstruct half of the blobs out of 20 210.86 us/op 391.78 us/op 0.54
Full columns - reconstruct single blob out of 20 33.448 us/op 31.082 us/op 1.08
Half columns - reconstruct all 20 blobs 1.3649 s/op 1.2607 s/op 1.08
Half columns - reconstruct half of the blobs out of 20 683.21 ms/op 638.76 ms/op 1.07
Half columns - reconstruct single blob out of 20 72.917 ms/op 68.747 ms/op 1.06
Set add up to 64 items then delete first 2.8383 us/op 2.4466 us/op 1.16
OrderedSet add up to 64 items then delete first 3.6284 us/op 3.3958 us/op 1.07
Set add up to 64 items then delete last 2.5423 us/op 2.6284 us/op 0.97
OrderedSet add up to 64 items then delete last 3.6142 us/op 3.3022 us/op 1.09
Set add up to 64 items then delete middle 2.3222 us/op 2.5361 us/op 0.92
OrderedSet add up to 64 items then delete middle 5.1485 us/op 5.2811 us/op 0.97
Set add up to 128 items then delete first 4.5013 us/op 5.0818 us/op 0.89
OrderedSet add up to 128 items then delete first 6.6658 us/op 6.7381 us/op 0.99
Set add up to 128 items then delete last 4.4968 us/op 4.8271 us/op 0.93
OrderedSet add up to 128 items then delete last 6.3061 us/op 5.7443 us/op 1.10
Set add up to 128 items then delete middle 4.2311 us/op 4.4919 us/op 0.94
OrderedSet add up to 128 items then delete middle 12.550 us/op 12.277 us/op 1.02
Set add up to 256 items then delete first 8.1089 us/op 9.1731 us/op 0.88
OrderedSet add up to 256 items then delete first 12.178 us/op 12.938 us/op 0.94
Set add up to 256 items then delete last 8.2125 us/op 9.2366 us/op 0.89
OrderedSet add up to 256 items then delete last 12.576 us/op 11.524 us/op 1.09
Set add up to 256 items then delete middle 8.2327 us/op 8.8426 us/op 0.93
OrderedSet add up to 256 items then delete middle 37.655 us/op 35.854 us/op 1.05
runFastConfirmationRules vc:100000 bc:96 eq:0 2.3040 us/op 2.2200 us/op 1.04
runFastConfirmationRules vc:600000 bc:96 eq:0 2.4230 us/op 2.3080 us/op 1.05
runFastConfirmationRules vc:1000000 bc:96 eq:0 2.3460 us/op 2.2210 us/op 1.06
runFastConfirmationRules vc:600000 bc:320 eq:0 4.9230 us/op 4.7720 us/op 1.03
runFastConfirmationRules vc:600000 bc:1200 eq:0 18.627 us/op 18.625 us/op 1.00
runFastConfirmationRules vc:600000 bc:96 eq:1000 2.2630 us/op 2.1830 us/op 1.04
runFastConfirmationRules vc:600000 bc:96 eq:10000 2.5280 us/op 2.1530 us/op 1.17
runFastConfirmationRules vc:600000 bc:96 eq:300000 2.3890 us/op 2.1760 us/op 1.10
pass gossip attestations to forkchoice per slot 2.5773 ms/op 2.4370 ms/op 1.06
forkChoice updateHead vc 100000 bc 64 eq 0 462.95 us/op 390.35 us/op 1.19
forkChoice updateHead vc 600000 bc 64 eq 0 2.7619 ms/op 2.4184 ms/op 1.14
forkChoice updateHead vc 1000000 bc 64 eq 0 4.5963 ms/op 3.8799 ms/op 1.18
forkChoice updateHead vc 600000 bc 320 eq 0 2.7644 ms/op 2.3662 ms/op 1.17
forkChoice updateHead vc 600000 bc 1200 eq 0 2.8230 ms/op 2.4183 ms/op 1.17
forkChoice updateHead vc 600000 bc 7200 eq 0 3.1576 ms/op 3.7233 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 1000 2.7600 ms/op 2.3880 ms/op 1.16
forkChoice updateHead vc 600000 bc 64 eq 10000 2.8753 ms/op 2.5006 ms/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 300000 7.7342 ms/op 6.5241 ms/op 1.19
computeDeltas 1400000 validators 0% inactive 13.352 ms/op 12.215 ms/op 1.09
computeDeltas 1400000 validators 10% inactive 12.776 ms/op 11.454 ms/op 1.12
computeDeltas 1400000 validators 20% inactive 11.557 ms/op 10.395 ms/op 1.11
computeDeltas 1400000 validators 50% inactive 8.6696 ms/op 7.9777 ms/op 1.09
computeDeltas 2100000 validators 0% inactive 20.717 ms/op 18.159 ms/op 1.14
computeDeltas 2100000 validators 10% inactive 18.673 ms/op 16.917 ms/op 1.10
computeDeltas 2100000 validators 20% inactive 17.394 ms/op 15.687 ms/op 1.11
computeDeltas 2100000 validators 50% inactive 13.353 ms/op 12.054 ms/op 1.11
altair processAttestation - 250000 vs - 7PWei normalcase 2.0903 ms/op 2.4461 ms/op 0.85
altair processAttestation - 250000 vs - 7PWei worstcase 2.8443 ms/op 3.3218 ms/op 0.86
altair processAttestation - setStatus - 1/6 committees join 106.40 us/op 98.157 us/op 1.08
altair processAttestation - setStatus - 1/3 committees join 205.06 us/op 191.05 us/op 1.07
altair processAttestation - setStatus - 1/2 committees join 304.69 us/op 290.08 us/op 1.05
altair processAttestation - setStatus - 2/3 committees join 387.85 us/op 364.97 us/op 1.06
altair processAttestation - setStatus - 4/5 committees join 534.59 us/op 515.57 us/op 1.04
altair processAttestation - setStatus - 100% committees join 632.62 us/op 593.06 us/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase 4.1234 ms/op 4.1862 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 17.671 ms/op 17.964 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase 20.540 ms/op 23.993 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase hashState 41.728 ms/op 47.999 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei normalcase 1.3724 ms/op 1.3827 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei worstcase 17.942 ms/op 18.710 ms/op 0.96
altair processEth1Data - 250000 vs - 7PWei normalcase 299.33 us/op 290.94 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 4.7080 us/op 3.6160 us/op 1.30
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 22.124 us/op 23.071 us/op 0.96
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.1230 us/op 6.5090 us/op 0.94
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.2410 us/op 5.0190 us/op 0.84
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 99.277 us/op 92.364 us/op 1.07
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.4243 ms/op 1.4206 ms/op 1.00
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8866 ms/op 1.9056 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8638 ms/op 1.8223 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.8082 ms/op 4.2578 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.1283 ms/op 2.0748 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.1105 ms/op 4.8563 ms/op 0.85
Tree 40 250000 create 325.40 ms/op 354.00 ms/op 0.92
Tree 40 250000 get(125000) 104.87 ns/op 92.867 ns/op 1.13
Tree 40 250000 set(125000) 1.0693 us/op 1.0016 us/op 1.07
Tree 40 250000 toArray() 9.7474 ms/op 17.150 ms/op 0.57
Tree 40 250000 iterate all - toArray() + loop 10.518 ms/op 17.244 ms/op 0.61
Tree 40 250000 iterate all - get(i) 38.535 ms/op 41.220 ms/op 0.93
Array 250000 create 2.0575 ms/op 2.2525 ms/op 0.91
Array 250000 clone - spread 641.94 us/op 693.53 us/op 0.93
Array 250000 get(125000) 0.29800 ns/op 0.29300 ns/op 1.02
Array 250000 set(125000) 0.30400 ns/op 0.29400 ns/op 1.03
Array 250000 iterate all - loop 57.749 us/op 57.288 us/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 40.833 ms/op 40.491 ms/op 1.01
Array.fill - length 1000000 2.4788 ms/op 2.4558 ms/op 1.01
Array push - length 1000000 8.1615 ms/op 10.257 ms/op 0.80
Array.get 0.20742 ns/op 0.20871 ns/op 0.99
Uint8Array.get 0.25851 ns/op 0.23319 ns/op 1.11
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.318 ms/op 16.546 ms/op 0.74
altair processEpoch - mainnet_e81889 259.54 ms/op 342.62 ms/op 0.76
mainnet_e81889 - altair beforeProcessEpoch 20.252 ms/op 26.531 ms/op 0.76
mainnet_e81889 - altair processJustificationAndFinalization 5.2290 us/op 31.686 ms/op 0.00
mainnet_e81889 - altair processInactivityUpdates 3.5848 ms/op 7.9668 ms/op 0.45
mainnet_e81889 - altair processRewardsAndPenalties 18.580 ms/op 24.551 ms/op 0.76
mainnet_e81889 - altair processRegistryUpdates 558.00 ns/op 761.00 ns/op 0.73
mainnet_e81889 - altair processSlashings 139.00 ns/op 149.00 ns/op 0.93
mainnet_e81889 - altair processEth1DataReset 137.00 ns/op 128.00 ns/op 1.07
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6638 ms/op 6.9145 ms/op 0.24
mainnet_e81889 - altair processSlashingsReset 699.00 ns/op 861.00 ns/op 0.81
mainnet_e81889 - altair processRandaoMixesReset 1.0890 us/op 1.3800 us/op 0.79
mainnet_e81889 - altair processHistoricalRootsUpdate 134.00 ns/op 127.00 ns/op 1.06
mainnet_e81889 - altair processParticipationFlagUpdates 423.00 ns/op 457.00 ns/op 0.93
mainnet_e81889 - altair processSyncCommitteeUpdates 106.00 ns/op 106.00 ns/op 1.00
mainnet_e81889 - altair afterProcessEpoch 42.377 ms/op 42.119 ms/op 1.01
capella processEpoch - mainnet_e217614 777.95 ms/op 991.07 ms/op 0.78
mainnet_e217614 - capella beforeProcessEpoch 60.819 ms/op 94.419 ms/op 0.64
mainnet_e217614 - capella processJustificationAndFinalization 5.9150 us/op 9.1720 us/op 0.64
mainnet_e217614 - capella processInactivityUpdates 12.142 ms/op 22.088 ms/op 0.55
mainnet_e217614 - capella processRewardsAndPenalties 93.889 ms/op 109.02 ms/op 0.86
mainnet_e217614 - capella processRegistryUpdates 4.5500 us/op 4.5420 us/op 1.00
mainnet_e217614 - capella processSlashings 135.00 ns/op 129.00 ns/op 1.05
mainnet_e217614 - capella processEth1DataReset 133.00 ns/op 127.00 ns/op 1.05
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.0234 ms/op 23.170 ms/op 0.26
mainnet_e217614 - capella processSlashingsReset 678.00 ns/op 718.00 ns/op 0.94
mainnet_e217614 - capella processRandaoMixesReset 1.2860 us/op 1.5900 us/op 0.81
mainnet_e217614 - capella processHistoricalRootsUpdate 132.00 ns/op 132.00 ns/op 1.00
mainnet_e217614 - capella processParticipationFlagUpdates 433.00 ns/op 520.00 ns/op 0.83
mainnet_e217614 - capella afterProcessEpoch 111.64 ms/op 108.78 ms/op 1.03
phase0 processEpoch - mainnet_e58758 303.37 ms/op 382.31 ms/op 0.79
mainnet_e58758 - phase0 beforeProcessEpoch 61.720 ms/op 86.770 ms/op 0.71
mainnet_e58758 - phase0 processJustificationAndFinalization 6.1870 us/op 7.5440 us/op 0.82
mainnet_e58758 - phase0 processRewardsAndPenalties 15.712 ms/op 18.359 ms/op 0.86
mainnet_e58758 - phase0 processRegistryUpdates 2.3140 us/op 2.3280 us/op 0.99
mainnet_e58758 - phase0 processSlashings 354.00 ns/op 131.00 ns/op 2.70
mainnet_e58758 - phase0 processEth1DataReset 137.00 ns/op 127.00 ns/op 1.08
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 879.94 us/op 1.2703 ms/op 0.69
mainnet_e58758 - phase0 processSlashingsReset 896.00 ns/op 931.00 ns/op 0.96
mainnet_e58758 - phase0 processRandaoMixesReset 1.8800 us/op 1.3490 us/op 1.39
mainnet_e58758 - phase0 processHistoricalRootsUpdate 141.00 ns/op 126.00 ns/op 1.12
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.2380 us/op 1.1440 us/op 1.08
mainnet_e58758 - phase0 afterProcessEpoch 34.829 ms/op 32.831 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0336 ms/op 980.58 us/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6088 ms/op 1.5138 ms/op 1.06
altair processInactivityUpdates - 250000 normalcase 10.705 ms/op 11.828 ms/op 0.91
altair processInactivityUpdates - 250000 worstcase 10.796 ms/op 13.682 ms/op 0.79
phase0 processRegistryUpdates - 250000 normalcase 2.3870 us/op 2.3240 us/op 1.03
phase0 processRegistryUpdates - 250000 badcase_full_deposits 157.13 us/op 142.93 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 62.229 ms/op 68.679 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 15.250 ms/op 15.476 ms/op 0.99
altair processRewardsAndPenalties - 250000 worstcase 14.964 ms/op 14.750 ms/op 1.01
phase0 getAttestationDeltas - 250000 normalcase 8.9393 ms/op 7.3727 ms/op 1.21
phase0 getAttestationDeltas - 250000 worstcase 5.6746 ms/op 5.1649 ms/op 1.10
phase0 processSlashings - 250000 worstcase 67.123 us/op 59.426 us/op 1.13
altair processSyncCommitteeUpdates - 250000 10.661 ms/op 11.241 ms/op 0.95
BeaconState.hashTreeRoot - No change 168.00 ns/op 160.00 ns/op 1.05
BeaconState.hashTreeRoot - 1 full validator 74.364 us/op 74.342 us/op 1.00
BeaconState.hashTreeRoot - 32 full validator 818.22 us/op 842.12 us/op 0.97
BeaconState.hashTreeRoot - 512 full validator 6.7023 ms/op 8.8084 ms/op 0.76
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 93.122 us/op 110.63 us/op 0.84
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4110 ms/op 1.4046 ms/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 15.811 ms/op 20.159 ms/op 0.78
BeaconState.hashTreeRoot - 1 balances 84.095 us/op 83.801 us/op 1.00
BeaconState.hashTreeRoot - 32 balances 823.30 us/op 805.24 us/op 1.02
BeaconState.hashTreeRoot - 512 balances 5.4046 ms/op 6.5694 ms/op 0.82
BeaconState.hashTreeRoot - 250000 balances 134.45 ms/op 147.10 ms/op 0.91
aggregationBits - 2048 els - zipIndexesInBitList 22.051 us/op 19.211 us/op 1.15
regular array get 100000 times 23.552 us/op 22.148 us/op 1.06
wrappedArray get 100000 times 23.480 us/op 22.215 us/op 1.06
arrayWithProxy get 100000 times 10.321 ms/op 11.467 ms/op 0.90
ssz.Root.equals 21.802 ns/op 20.458 ns/op 1.07
byteArrayEquals 21.638 ns/op 20.396 ns/op 1.06
Buffer.compare 9.5790 ns/op 8.4550 ns/op 1.13
processSlot - 1 slots 9.2170 us/op 9.3930 us/op 0.98
processSlot - 32 slots 2.0275 ms/op 2.0455 ms/op 0.99
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.7533 ms/op 3.9645 ms/op 0.95
getCommitteeAssignments - req 1 vs - 250000 vc 1.7014 ms/op 1.6439 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 3.4991 ms/op 3.3393 ms/op 1.05
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7647 ms/op 3.5601 ms/op 1.06
findModifiedValidators - 10000 modified validators 963.54 ms/op 716.20 ms/op 1.35
findModifiedValidators - 1000 modified validators 579.86 ms/op 641.66 ms/op 0.90
findModifiedValidators - 100 modified validators 337.71 ms/op 283.51 ms/op 1.19
findModifiedValidators - 10 modified validators 302.37 ms/op 257.25 ms/op 1.18
findModifiedValidators - 1 modified validators 185.83 ms/op 204.19 ms/op 0.91
findModifiedValidators - no difference 206.13 ms/op 181.76 ms/op 1.13
migrate state 1500000 validators, 3400 modified, 2000 new 2.6712 s/op 2.8393 s/op 0.94
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.7600 ns/op 3.5900 ns/op 1.05
state getBlockRootAtSlot - 250000 vs - 7PWei 274.60 ns/op 399.70 ns/op 0.69
computeProposerIndex 100000 validators 1.3025 ms/op 1.2907 ms/op 1.01
getNextSyncCommitteeIndices 1000 validators 2.8255 ms/op 2.7737 ms/op 1.02
getNextSyncCommitteeIndices 10000 validators 24.948 ms/op 24.596 ms/op 1.01
getNextSyncCommitteeIndices 100000 validators 86.640 ms/op 85.722 ms/op 1.01
computeProposers - vc 250000 554.14 us/op 534.74 us/op 1.04
computeEpochShuffling - vc 250000 39.246 ms/op 38.599 ms/op 1.02
getNextSyncCommittee - vc 250000 9.3522 ms/op 9.2023 ms/op 1.02
nodejs block root to RootHex using toHex 98.153 ns/op 85.313 ns/op 1.15
nodejs block root to RootHex using toRootHex 58.615 ns/op 50.873 ns/op 1.15
nodejs fromHex(blob) 735.39 us/op 704.59 us/op 1.04
nodejs fromHexInto(blob) 670.44 us/op 605.79 us/op 1.11
nodejs block root to RootHex using the deprecated toHexString 568.31 ns/op 471.12 ns/op 1.21
nodejs byteArrayEquals 32 bytes (block root) 26.065 ns/op 24.988 ns/op 1.04
nodejs byteArrayEquals 48 bytes (pubkey) 37.714 ns/op 36.158 ns/op 1.04
nodejs byteArrayEquals 96 bytes (signature) 48.615 ns/op 32.534 ns/op 1.49
nodejs byteArrayEquals 1024 bytes 45.659 ns/op 38.828 ns/op 1.18
nodejs byteArrayEquals 131072 bytes (blob) 1.7594 us/op 1.6897 us/op 1.04
browser block root to RootHex using toHex 147.09 ns/op 138.50 ns/op 1.06
browser block root to RootHex using toRootHex 131.88 ns/op 126.22 ns/op 1.04
browser fromHex(blob) 1.5495 ms/op 1.4276 ms/op 1.09
browser fromHexInto(blob) 665.69 us/op 615.60 us/op 1.08
browser block root to RootHex using the deprecated toHexString 389.76 ns/op 486.19 ns/op 0.80
browser byteArrayEquals 32 bytes (block root) 27.956 ns/op 27.012 ns/op 1.03
browser byteArrayEquals 48 bytes (pubkey) 39.388 ns/op 38.535 ns/op 1.02
browser byteArrayEquals 96 bytes (signature) 73.801 ns/op 72.809 ns/op 1.01
browser byteArrayEquals 1024 bytes 751.03 ns/op 731.19 ns/op 1.03
browser byteArrayEquals 131072 bytes (blob) 94.937 us/op 93.373 us/op 1.02

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.

1 participant