Skip to content

refactor: use consistent names for state after payload is applied - #9175

Merged
ensi321 merged 2 commits into
unstablefrom
nflaig/consistent-post-payload-state-naming
Apr 7, 2026
Merged

refactor: use consistent names for state after payload is applied#9175
ensi321 merged 2 commits into
unstablefrom
nflaig/consistent-post-payload-state-naming

Conversation

@nflaig

@nflaig nflaig commented Apr 4, 2026

Copy link
Copy Markdown
Member

Rename postEnvelopeState to postPayloadState for consistency with the naming used in importExecutionPayload and regen caching methods.

Closes #9126

@nflaig
nflaig requested a review from a team as a code owner April 4, 2026 11:00

@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 codebase to rename 'envelope state' references to 'payload state' for improved clarity and consistency. Key changes include renaming variables like envelopeStateRoot to payloadStateRoot and updating the function computeEnvelopeStateRoot to computePayloadEnvelopeStateRoot. The review feedback suggests further simplifying the function name to computePayloadStateRoot and ensuring that associated metric sources and enum members are updated accordingly to maintain a uniform naming convention.

Comment thread packages/beacon-node/src/chain/produceBlock/computeNewStateRoot.ts
Comment thread packages/beacon-node/src/chain/produceBlock/computeNewStateRoot.ts
Comment thread packages/state-transition/src/stateTransition.ts
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: df93e72 Previous: f866249 Ratio
Array.fill - length 1000000 1.9364 ms/op 6.6628 ms/op 0.29
Full benchmark results
Benchmark suite Current: df93e72 Previous: f866249 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 863.43 us/op 893.05 us/op 0.97
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.368 us/op 38.415 us/op 1.02
BLS verify - blst 699.29 us/op 693.57 us/op 1.01
BLS verifyMultipleSignatures 3 - blst 1.2615 ms/op 1.3078 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst 2.0307 ms/op 2.0628 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst 6.3071 ms/op 6.8791 ms/op 0.92
BLS verifyMultipleSignatures 64 - blst 12.852 ms/op 12.540 ms/op 1.02
BLS verifyMultipleSignatures 128 - blst 24.091 ms/op 24.404 ms/op 0.99
BLS deserializing 10000 signatures 612.66 ms/op 624.69 ms/op 0.98
BLS deserializing 100000 signatures 6.1113 s/op 6.2284 s/op 0.98
BLS verifyMultipleSignatures - same message - 3 - blst 761.54 us/op 783.37 us/op 0.97
BLS verifyMultipleSignatures - same message - 8 - blst 893.81 us/op 809.42 us/op 1.10
BLS verifyMultipleSignatures - same message - 32 - blst 1.3920 ms/op 1.4841 ms/op 0.94
BLS verifyMultipleSignatures - same message - 64 - blst 2.2916 ms/op 2.2910 ms/op 1.00
BLS verifyMultipleSignatures - same message - 128 - blst 3.9102 ms/op 3.8881 ms/op 1.01
BLS aggregatePubkeys 32 - blst 16.925 us/op 17.248 us/op 0.98
BLS aggregatePubkeys 128 - blst 59.732 us/op 61.787 us/op 0.97
getSlashingsAndExits - default max 49.573 us/op 46.194 us/op 1.07
getSlashingsAndExits - 2k 352.24 us/op 341.61 us/op 1.03
proposeBlockBody type=full, size=empty 604.53 us/op 592.10 us/op 1.02
isKnown best case - 1 super set check 165.00 ns/op 183.00 ns/op 0.90
isKnown normal case - 2 super set checks 167.00 ns/op 191.00 ns/op 0.87
isKnown worse case - 16 super set checks 164.00 ns/op 184.00 ns/op 0.89
validate api signedAggregateAndProof - struct 1.4497 ms/op 1.4921 ms/op 0.97
validate gossip signedAggregateAndProof - struct 1.4272 ms/op 1.4835 ms/op 0.96
batch validate gossip attestation - vc 640000 - chunk 32 105.53 us/op 104.41 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 94.565 us/op 93.355 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 128 92.022 us/op 88.363 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 256 86.315 us/op 86.583 us/op 1.00
bytes32 toHexString 277.00 ns/op 302.00 ns/op 0.92
bytes32 Buffer.toString(hex) 177.00 ns/op 191.00 ns/op 0.93
bytes32 Buffer.toString(hex) from Uint8Array 256.00 ns/op 271.00 ns/op 0.94
bytes32 Buffer.toString(hex) + 0x 180.00 ns/op 193.00 ns/op 0.93
Return object 10000 times 0.20470 ns/op 0.21640 ns/op 0.95
Throw Error 10000 times 3.1688 us/op 3.3296 us/op 0.95
toHex 89.950 ns/op 107.60 ns/op 0.84
Buffer.from 82.644 ns/op 87.879 ns/op 0.94
shared Buffer 57.306 ns/op 59.493 ns/op 0.96
fastMsgIdFn sha256 / 200 bytes 1.4080 us/op 1.5030 us/op 0.94
fastMsgIdFn h32 xxhash / 200 bytes 153.00 ns/op 173.00 ns/op 0.88
fastMsgIdFn h64 xxhash / 200 bytes 193.00 ns/op 226.00 ns/op 0.85
fastMsgIdFn sha256 / 1000 bytes 4.5030 us/op 4.6950 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 240.00 ns/op 261.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 1000 bytes 236.00 ns/op 266.00 ns/op 0.89
fastMsgIdFn sha256 / 10000 bytes 39.194 us/op 41.541 us/op 0.94
fastMsgIdFn h32 xxhash / 10000 bytes 1.1860 us/op 1.2570 us/op 0.94
fastMsgIdFn h64 xxhash / 10000 bytes 758.00 ns/op 816.00 ns/op 0.93
send data - 1000 256B messages 4.0812 ms/op 4.2544 ms/op 0.96
send data - 1000 512B messages 4.2157 ms/op 4.4394 ms/op 0.95
send data - 1000 1024B messages 4.5362 ms/op 4.4547 ms/op 1.02
send data - 1000 1200B messages 4.6890 ms/op 5.0626 ms/op 0.93
send data - 1000 2048B messages 4.8953 ms/op 5.0141 ms/op 0.98
send data - 1000 4096B messages 5.6380 ms/op 5.7487 ms/op 0.98
send data - 1000 16384B messages 59.723 ms/op 25.322 ms/op 2.36
send data - 1000 65536B messages 210.14 ms/op 152.49 ms/op 1.38
enrSubnets - fastDeserialize 64 bits 695.00 ns/op 769.00 ns/op 0.90
enrSubnets - ssz BitVector 64 bits 242.00 ns/op 280.00 ns/op 0.86
enrSubnets - fastDeserialize 4 bits 100.00 ns/op 125.00 ns/op 0.80
enrSubnets - ssz BitVector 4 bits 249.00 ns/op 272.00 ns/op 0.92
prioritizePeers score -10:0 att 32-0.1 sync 2-0 194.75 us/op 203.27 us/op 0.96
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 222.53 us/op 235.94 us/op 0.94
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 325.17 us/op 337.67 us/op 0.96
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 589.21 us/op 607.70 us/op 0.97
prioritizePeers score 0:0 att 64-1 sync 4-1 686.05 us/op 693.53 us/op 0.99
array of 16000 items push then shift 1.1977 us/op 1.2611 us/op 0.95
LinkedList of 16000 items push then shift 8.1530 ns/op 7.2710 ns/op 1.12
array of 16000 items push then pop 70.089 ns/op 65.184 ns/op 1.08
LinkedList of 16000 items push then pop 6.3330 ns/op 5.7710 ns/op 1.10
array of 24000 items push then shift 1.7684 us/op 1.8202 us/op 0.97
LinkedList of 24000 items push then shift 7.4530 ns/op 6.7620 ns/op 1.10
array of 24000 items push then pop 91.194 ns/op 90.037 ns/op 1.01
LinkedList of 24000 items push then pop 5.9330 ns/op 5.7900 ns/op 1.02
intersect bitArray bitLen 8 4.5850 ns/op 4.5920 ns/op 1.00
intersect array and set length 8 28.149 ns/op 28.541 ns/op 0.99
intersect bitArray bitLen 128 22.914 ns/op 23.189 ns/op 0.99
intersect array and set length 128 474.40 ns/op 475.06 ns/op 1.00
bitArray.getTrueBitIndexes() bitLen 128 1.0280 us/op 1.0540 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 248 1.7420 us/op 1.7290 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 512 3.5210 us/op 3.4340 us/op 1.03
Full columns - reconstruct all 6 blobs 167.40 us/op 190.66 us/op 0.88
Full columns - reconstruct half of the blobs out of 6 94.972 us/op 73.470 us/op 1.29
Full columns - reconstruct single blob out of 6 32.519 us/op 31.208 us/op 1.04
Half columns - reconstruct all 6 blobs 367.36 ms/op 379.75 ms/op 0.97
Half columns - reconstruct half of the blobs out of 6 181.55 ms/op 191.08 ms/op 0.95
Half columns - reconstruct single blob out of 6 65.839 ms/op 68.134 ms/op 0.97
Full columns - reconstruct all 10 blobs 172.78 us/op 320.45 us/op 0.54
Full columns - reconstruct half of the blobs out of 10 153.59 us/op 133.19 us/op 1.15
Full columns - reconstruct single blob out of 10 30.045 us/op 31.830 us/op 0.94
Half columns - reconstruct all 10 blobs 597.59 ms/op 631.97 ms/op 0.95
Half columns - reconstruct half of the blobs out of 10 311.61 ms/op 318.45 ms/op 0.98
Half columns - reconstruct single blob out of 10 64.438 ms/op 70.081 ms/op 0.92
Full columns - reconstruct all 20 blobs 739.37 us/op 1.8523 ms/op 0.40
Full columns - reconstruct half of the blobs out of 20 383.62 us/op 228.53 us/op 1.68
Full columns - reconstruct single blob out of 20 44.235 us/op 29.403 us/op 1.50
Half columns - reconstruct all 20 blobs 1.2037 s/op 1.2149 s/op 0.99
Half columns - reconstruct half of the blobs out of 20 607.18 ms/op 610.80 ms/op 0.99
Half columns - reconstruct single blob out of 20 65.356 ms/op 66.591 ms/op 0.98
Set add up to 64 items then delete first 2.3480 us/op 1.9609 us/op 1.20
OrderedSet add up to 64 items then delete first 3.1089 us/op 3.1491 us/op 0.99
Set add up to 64 items then delete last 2.1864 us/op 2.1073 us/op 1.04
OrderedSet add up to 64 items then delete last 3.2110 us/op 3.1741 us/op 1.01
Set add up to 64 items then delete middle 2.0419 us/op 2.0189 us/op 1.01
OrderedSet add up to 64 items then delete middle 4.6239 us/op 4.4835 us/op 1.03
Set add up to 128 items then delete first 3.9349 us/op 4.0364 us/op 0.97
OrderedSet add up to 128 items then delete first 5.8372 us/op 6.0489 us/op 0.96
Set add up to 128 items then delete last 3.7711 us/op 3.7659 us/op 1.00
OrderedSet add up to 128 items then delete last 5.7252 us/op 5.5836 us/op 1.03
Set add up to 128 items then delete middle 3.7473 us/op 3.6755 us/op 1.02
OrderedSet add up to 128 items then delete middle 11.600 us/op 11.131 us/op 1.04
Set add up to 256 items then delete first 7.4577 us/op 7.5028 us/op 0.99
OrderedSet add up to 256 items then delete first 11.225 us/op 11.523 us/op 0.97
Set add up to 256 items then delete last 7.4506 us/op 7.4708 us/op 1.00
OrderedSet add up to 256 items then delete last 11.623 us/op 10.997 us/op 1.06
Set add up to 256 items then delete middle 7.4226 us/op 7.2479 us/op 1.02
OrderedSet add up to 256 items then delete middle 34.741 us/op 33.049 us/op 1.05
pass gossip attestations to forkchoice per slot 2.4578 ms/op 2.4734 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 367.60 us/op 369.65 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 2.1913 ms/op 2.2074 ms/op 0.99
forkChoice updateHead vc 1000000 bc 64 eq 0 3.6513 ms/op 3.6922 ms/op 0.99
forkChoice updateHead vc 600000 bc 320 eq 0 2.1942 ms/op 2.2071 ms/op 0.99
forkChoice updateHead vc 600000 bc 1200 eq 0 2.2439 ms/op 2.2758 ms/op 0.99
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8776 ms/op 2.5051 ms/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 1000 2.7170 ms/op 2.7538 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 10000 2.8091 ms/op 2.9527 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 300000 6.3533 ms/op 7.1601 ms/op 0.89
computeDeltas 1400000 validators 0% inactive 11.765 ms/op 11.794 ms/op 1.00
computeDeltas 1400000 validators 10% inactive 11.206 ms/op 11.117 ms/op 1.01
computeDeltas 1400000 validators 20% inactive 10.060 ms/op 10.129 ms/op 0.99
computeDeltas 1400000 validators 50% inactive 7.7360 ms/op 7.8241 ms/op 0.99
computeDeltas 2100000 validators 0% inactive 17.664 ms/op 17.657 ms/op 1.00
computeDeltas 2100000 validators 10% inactive 16.479 ms/op 16.790 ms/op 0.98
computeDeltas 2100000 validators 20% inactive 15.056 ms/op 15.057 ms/op 1.00
computeDeltas 2100000 validators 50% inactive 8.8414 ms/op 11.705 ms/op 0.76
altair processAttestation - 250000 vs - 7PWei normalcase 1.8037 ms/op 1.8455 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei worstcase 2.4996 ms/op 2.5884 ms/op 0.97
altair processAttestation - setStatus - 1/6 committees join 93.200 us/op 93.820 us/op 0.99
altair processAttestation - setStatus - 1/3 committees join 186.60 us/op 191.04 us/op 0.98
altair processAttestation - setStatus - 1/2 committees join 277.88 us/op 270.37 us/op 1.03
altair processAttestation - setStatus - 2/3 committees join 349.30 us/op 351.93 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 520.91 us/op 481.77 us/op 1.08
altair processAttestation - setStatus - 100% committees join 567.76 us/op 572.82 us/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase 3.8091 ms/op 3.7840 ms/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase hashState 15.556 ms/op 14.451 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase 22.998 ms/op 20.824 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase hashState 48.285 ms/op 40.204 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei normalcase 1.4763 ms/op 1.5243 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei worstcase 17.509 ms/op 18.888 ms/op 0.93
altair processEth1Data - 250000 vs - 7PWei normalcase 292.47 us/op 284.17 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.4040 us/op 4.0810 us/op 0.83
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.188 us/op 20.656 us/op 0.98
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 7.2710 us/op 8.0080 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 3.4810 us/op 3.9420 us/op 0.88
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 85.678 us/op 103.48 us/op 0.83
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3151 ms/op 1.4054 ms/op 0.94
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7240 ms/op 1.7933 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7345 ms/op 1.7805 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.6556 ms/op 4.8461 ms/op 0.75
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9765 ms/op 2.3810 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9508 ms/op 4.3870 ms/op 0.90
Tree 40 250000 create 311.50 ms/op 420.49 ms/op 0.74
Tree 40 250000 get(125000) 88.838 ns/op 92.734 ns/op 0.96
Tree 40 250000 set(125000) 967.20 ns/op 1.1302 us/op 0.86
Tree 40 250000 toArray() 15.500 ms/op 22.570 ms/op 0.69
Tree 40 250000 iterate all - toArray() + loop 15.475 ms/op 25.351 ms/op 0.61
Tree 40 250000 iterate all - get(i) 37.028 ms/op 43.767 ms/op 0.85
Array 250000 create 2.2030 ms/op 2.5750 ms/op 0.86
Array 250000 clone - spread 640.72 us/op 841.12 us/op 0.76
Array 250000 get(125000) 0.28400 ns/op 0.29500 ns/op 0.96
Array 250000 set(125000) 0.28400 ns/op 0.29800 ns/op 0.95
Array 250000 iterate all - loop 55.499 us/op 58.260 us/op 0.95
phase0 afterProcessEpoch - 250000 vs - 7PWei 38.201 ms/op 42.281 ms/op 0.90
Array.fill - length 1000000 1.9364 ms/op 6.6628 ms/op 0.29
Array push - length 1000000 7.4189 ms/op 13.797 ms/op 0.54
Array.get 0.20244 ns/op 0.20772 ns/op 0.97
Uint8Array.get 0.23098 ns/op 0.23314 ns/op 0.99
phase0 beforeProcessEpoch - 250000 vs - 7PWei 16.714 ms/op 22.844 ms/op 0.73
altair processEpoch - mainnet_e81889 252.65 ms/op 297.57 ms/op 0.85
mainnet_e81889 - altair beforeProcessEpoch 14.646 ms/op 21.744 ms/op 0.67
mainnet_e81889 - altair processJustificationAndFinalization 6.1960 us/op 6.7930 us/op 0.91
mainnet_e81889 - altair processInactivityUpdates 4.7633 ms/op 5.3338 ms/op 0.89
mainnet_e81889 - altair processRewardsAndPenalties 19.704 ms/op 20.125 ms/op 0.98
mainnet_e81889 - altair processRegistryUpdates 541.00 ns/op 574.00 ns/op 0.94
mainnet_e81889 - altair processSlashings 127.00 ns/op 155.00 ns/op 0.82
mainnet_e81889 - altair processEth1DataReset 385.00 ns/op 156.00 ns/op 2.47
mainnet_e81889 - altair processEffectiveBalanceUpdates 5.0252 ms/op 5.4794 ms/op 0.92
mainnet_e81889 - altair processSlashingsReset 689.00 ns/op 725.00 ns/op 0.95
mainnet_e81889 - altair processRandaoMixesReset 1.2860 us/op 1.4590 us/op 0.88
mainnet_e81889 - altair processHistoricalRootsUpdate 130.00 ns/op 160.00 ns/op 0.81
mainnet_e81889 - altair processParticipationFlagUpdates 420.00 ns/op 498.00 ns/op 0.84
mainnet_e81889 - altair processSyncCommitteeUpdates 102.00 ns/op 127.00 ns/op 0.80
mainnet_e81889 - altair afterProcessEpoch 42.719 ms/op 41.846 ms/op 1.02
capella processEpoch - mainnet_e217614 815.34 ms/op 854.81 ms/op 0.95
mainnet_e217614 - capella beforeProcessEpoch 56.668 ms/op 64.235 ms/op 0.88
mainnet_e217614 - capella processJustificationAndFinalization 6.3410 us/op 6.6550 us/op 0.95
mainnet_e217614 - capella processInactivityUpdates 14.804 ms/op 17.545 ms/op 0.84
mainnet_e217614 - capella processRewardsAndPenalties 87.100 ms/op 97.715 ms/op 0.89
mainnet_e217614 - capella processRegistryUpdates 4.4650 us/op 4.4960 us/op 0.99
mainnet_e217614 - capella processSlashings 130.00 ns/op 154.00 ns/op 0.84
mainnet_e217614 - capella processEth1DataReset 124.00 ns/op 153.00 ns/op 0.81
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.334 ms/op 19.076 ms/op 0.70
mainnet_e217614 - capella processSlashingsReset 660.00 ns/op 706.00 ns/op 0.93
mainnet_e217614 - capella processRandaoMixesReset 1.2980 us/op 1.4400 us/op 0.90
mainnet_e217614 - capella processHistoricalRootsUpdate 130.00 ns/op 151.00 ns/op 0.86
mainnet_e217614 - capella processParticipationFlagUpdates 410.00 ns/op 470.00 ns/op 0.87
mainnet_e217614 - capella afterProcessEpoch 102.65 ms/op 107.26 ms/op 0.96
phase0 processEpoch - mainnet_e58758 283.77 ms/op 327.55 ms/op 0.87
mainnet_e58758 - phase0 beforeProcessEpoch 59.146 ms/op 71.564 ms/op 0.83
mainnet_e58758 - phase0 processJustificationAndFinalization 5.6560 us/op 6.6420 us/op 0.85
mainnet_e58758 - phase0 processRewardsAndPenalties 15.022 ms/op 16.608 ms/op 0.90
mainnet_e58758 - phase0 processRegistryUpdates 2.1130 us/op 2.2460 us/op 0.94
mainnet_e58758 - phase0 processSlashings 124.00 ns/op 219.00 ns/op 0.57
mainnet_e58758 - phase0 processEth1DataReset 122.00 ns/op 150.00 ns/op 0.81
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 759.78 us/op 821.01 us/op 0.93
mainnet_e58758 - phase0 processSlashingsReset 823.00 ns/op 918.00 ns/op 0.90
mainnet_e58758 - phase0 processRandaoMixesReset 1.1020 us/op 1.3440 us/op 0.82
mainnet_e58758 - phase0 processHistoricalRootsUpdate 130.00 ns/op 154.00 ns/op 0.84
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0890 us/op 1.2020 us/op 0.91
mainnet_e58758 - phase0 afterProcessEpoch 31.596 ms/op 32.482 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 923.67 us/op 1.5169 ms/op 0.61
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4443 ms/op 1.8855 ms/op 0.77
altair processInactivityUpdates - 250000 normalcase 9.8144 ms/op 11.266 ms/op 0.87
altair processInactivityUpdates - 250000 worstcase 9.9744 ms/op 11.214 ms/op 0.89
phase0 processRegistryUpdates - 250000 normalcase 2.0060 us/op 2.4640 us/op 0.81
phase0 processRegistryUpdates - 250000 badcase_full_deposits 136.01 us/op 138.70 us/op 0.98
phase0 processRegistryUpdates - 250000 worstcase 0.5 58.788 ms/op 58.342 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 14.806 ms/op 15.721 ms/op 0.94
altair processRewardsAndPenalties - 250000 worstcase 13.846 ms/op 15.370 ms/op 0.90
phase0 getAttestationDeltas - 250000 normalcase 4.9767 ms/op 5.1237 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 5.0324 ms/op 5.3249 ms/op 0.95
phase0 processSlashings - 250000 worstcase 56.074 us/op 59.488 us/op 0.94
altair processSyncCommitteeUpdates - 250000 9.3783 ms/op 10.173 ms/op 0.92
BeaconState.hashTreeRoot - No change 166.00 ns/op 186.00 ns/op 0.89
BeaconState.hashTreeRoot - 1 full validator 64.249 us/op 76.174 us/op 0.84
BeaconState.hashTreeRoot - 32 full validator 758.51 us/op 847.60 us/op 0.89
BeaconState.hashTreeRoot - 512 full validator 5.8942 ms/op 7.4864 ms/op 0.79
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 77.859 us/op 96.901 us/op 0.80
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2183 ms/op 1.4030 ms/op 0.87
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.444 ms/op 15.659 ms/op 0.86
BeaconState.hashTreeRoot - 1 balances 60.106 us/op 75.997 us/op 0.79
BeaconState.hashTreeRoot - 32 balances 633.04 us/op 701.90 us/op 0.90
BeaconState.hashTreeRoot - 512 balances 4.6971 ms/op 5.7724 ms/op 0.81
BeaconState.hashTreeRoot - 250000 balances 119.06 ms/op 136.43 ms/op 0.87
aggregationBits - 2048 els - zipIndexesInBitList 18.374 us/op 19.528 us/op 0.94
regular array get 100000 times 21.655 us/op 22.288 us/op 0.97
wrappedArray get 100000 times 21.791 us/op 22.208 us/op 0.98
arrayWithProxy get 100000 times 9.2415 ms/op 9.3311 ms/op 0.99
ssz.Root.equals 20.128 ns/op 20.653 ns/op 0.97
byteArrayEquals 20.038 ns/op 20.420 ns/op 0.98
Buffer.compare 8.3420 ns/op 8.4650 ns/op 0.99
processSlot - 1 slots 8.2450 us/op 8.6080 us/op 0.96
processSlot - 32 slots 1.8014 ms/op 1.7962 ms/op 1.00
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.7035 ms/op 5.6614 ms/op 0.83
getCommitteeAssignments - req 1 vs - 250000 vc 1.5637 ms/op 1.6177 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 3.2203 ms/op 3.3229 ms/op 0.97
getCommitteeAssignments - req 1000 vs - 250000 vc 3.4546 ms/op 3.5965 ms/op 0.96
findModifiedValidators - 10000 modified validators 688.42 ms/op 627.39 ms/op 1.10
findModifiedValidators - 1000 modified validators 446.93 ms/op 447.92 ms/op 1.00
findModifiedValidators - 100 modified validators 286.29 ms/op 295.70 ms/op 0.97
findModifiedValidators - 10 modified validators 227.49 ms/op 221.11 ms/op 1.03
findModifiedValidators - 1 modified validators 141.36 ms/op 158.10 ms/op 0.89
findModifiedValidators - no difference 162.59 ms/op 154.94 ms/op 1.05
migrate state 1500000 validators, 3400 modified, 2000 new 3.1522 s/op 2.9887 s/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.5600 ns/op 3.5600 ns/op 1.00
state getBlockRootAtSlot - 250000 vs - 7PWei 409.87 ns/op 361.19 ns/op 1.13
computeProposerIndex 100000 validators 1.3311 ms/op 1.2896 ms/op 1.03
getNextSyncCommitteeIndices 1000 validators 2.8258 ms/op 2.7291 ms/op 1.04
getNextSyncCommitteeIndices 10000 validators 25.765 ms/op 24.165 ms/op 1.07
getNextSyncCommitteeIndices 100000 validators 88.162 ms/op 83.871 ms/op 1.05
computeProposers - vc 250000 535.23 us/op 527.49 us/op 1.01
computeEpochShuffling - vc 250000 39.171 ms/op 38.289 ms/op 1.02
getNextSyncCommittee - vc 250000 9.4707 ms/op 9.4313 ms/op 1.00
nodejs block root to RootHex using toHex 103.29 ns/op 104.18 ns/op 0.99
nodejs block root to RootHex using toRootHex 65.963 ns/op 65.775 ns/op 1.00
nodejs fromHex(blob) 783.32 us/op 700.82 us/op 1.12
nodejs fromHexInto(blob) 622.17 us/op 600.69 us/op 1.04
nodejs block root to RootHex using the deprecated toHexString 447.01 ns/op 443.78 ns/op 1.01
nodejs byteArrayEquals 32 bytes (block root) 24.809 ns/op 24.682 ns/op 1.01
nodejs byteArrayEquals 48 bytes (pubkey) 36.113 ns/op 35.757 ns/op 1.01
nodejs byteArrayEquals 96 bytes (signature) 31.290 ns/op 31.083 ns/op 1.01
nodejs byteArrayEquals 1024 bytes 38.235 ns/op 36.856 ns/op 1.04
nodejs byteArrayEquals 131072 bytes (blob) 1.6994 us/op 1.6818 us/op 1.01
browser block root to RootHex using toHex 138.56 ns/op 136.91 ns/op 1.01
browser block root to RootHex using toRootHex 125.94 ns/op 124.08 ns/op 1.02
browser fromHex(blob) 1.5174 ms/op 1.4550 ms/op 1.04
browser fromHexInto(blob) 600.79 us/op 598.68 us/op 1.00
browser block root to RootHex using the deprecated toHexString 435.66 ns/op 440.68 ns/op 0.99
browser byteArrayEquals 32 bytes (block root) 26.421 ns/op 26.756 ns/op 0.99
browser byteArrayEquals 48 bytes (pubkey) 37.617 ns/op 37.511 ns/op 1.00
browser byteArrayEquals 96 bytes (signature) 70.862 ns/op 70.408 ns/op 1.01
browser byteArrayEquals 1024 bytes 720.18 ns/op 724.13 ns/op 0.99
browser byteArrayEquals 131072 bytes (blob) 91.185 us/op 91.694 us/op 0.99

by benchmarkbot/action

@nflaig

nflaig commented Apr 5, 2026

Copy link
Copy Markdown
Member Author

@lodekeeper can you review this PR, is the naming aligned with the consensus spec naming?

@lodekeeper

Copy link
Copy Markdown
Contributor

@nflaig Reviewed — the naming aligns with the consensus spec.

The spec's fork-choice store uses payload_states (the state dict after process_execution_payload), which maps directly to postPayloadState in camelCase. The rename from postEnvelopeStatepostPayloadState matches this. Similarly, postStatepostBlockState parallels the spec's block_states vs payload_states distinction.

The function name computePayloadEnvelopeStateRoot (keeping "Envelope") is also correct — it computes the state_root field for the ExecutionPayloadEnvelope container, which is a different concept from the post-payload state itself.

@matthewkeil matthewkeil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tend to lean towards keeping the Payload vs PayloadEnvelope naming convention consistent for all places. I tend to go back and forth on which I prefer but in honestly they both feel fine to me. Mostly just think we should pick one and stick with it everywhere. Up to you which you prefer.

*
*/
export function computeEnvelopeStateRoot(
export function computePayloadEnvelopeStateRoot(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did you choose to use the full PayloadEnvelope notation here. Would computePayloadStateRoot be more uniform?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

because this function computes the state root of the envelope for the ExecutionPayloadEnvelope container

lodekeeper pointed this out in this comment too

The function name computePayloadEnvelopeStateRoot (keeping "Envelope") is also correct — it computes the state_root field for the ExecutionPayloadEnvelope container, which is a different concept from the post-payload state itself.

I had it as computePayloadStateRoot initially but then realized it's semantically less accurate

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.

Thanks for the feedback. Agreed consistency matters — we went with specifically because it computes the state_root field for the ExecutionPayloadEnvelope container (per spec: assert envelope.state_root == hash_tree_root(state)). Including "Envelope" clarifies the semantic: it's the root that lives in the envelope, not just the post-payload state root. Happy to revisit if there's a strong preference, but this felt like the more precise name.


const hashTreeRootTimer = metrics?.stateHashTreeRootTime.startTimer({
source: StateHashTreeRootSource.computeEnvelopeStateRoot,
source: StateHashTreeRootSource.computePayloadEnvelopeStateRoot,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment about PayloadEnvelope as the function name

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

see comment above #9175 (comment)

@nflaig

nflaig commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

I tend to lean towards keeping the Payload vs PayloadEnvelope naming convention consistent for all places.

there is a nuance to this, the envelope is the object used to transport the payload (a wrapper) that contains extra metadata

so just picking one and using it everywhere is less accurate, this nuance also exists in the spec, there is signed_envelope (even omitting the term "payload" entirely) and there is payload_states (without the term "envelope")

@matthewkeil matthewkeil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok. I'm fine now that you explained the nuance

@ensi321
ensi321 merged commit 572fb81 into unstable Apr 7, 2026
19 of 20 checks passed
@ensi321
ensi321 deleted the nflaig/consistent-post-payload-state-naming branch April 7, 2026 04:26
@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.53%. Comparing base (f866249) to head (d3e5904).
⚠️ Report is 9 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #9175   +/-   ##
=========================================
  Coverage     52.53%   52.53%           
=========================================
  Files           848      848           
  Lines         61429    61427    -2     
  Branches       4528     4528           
=========================================
  Hits          32270    32270           
+ Misses        29094    29092    -2     
  Partials         65       65           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ensi321 added a commit that referenced this pull request Apr 17, 2026
…#9218)

## Summary

Depends on #9215

- Remove `payloadPresent` parameter from regen interfaces
(`addCheckpointState`, `updatePreComputedCheckpoint`,
`getCheckpointStateOrBytes`, `getCheckpointStateSync`)
- Remove `processPayloadState`, `upgradeForGloas` from
`IStateRegenerator`
- Remove `PayloadStatus` → `payloadPresent` conversion logic from regen
(queued.ts, regen.ts)
- Remove `UNEXPECTED_PAYLOAD_STATUS` and `INTERNAL_ERROR` regen error
codes
- Remove `CheckpointHexPayload` type and `fcCheckpointToHexPayload`
helper — all callers now use `CheckpointHex`
- Delete `computePayloadEnvelopeStateRoot()` and remove
`payloadEnvelopeStateRoot` from `ProduceFullGloas` type
- Remove `computePayloadEnvelopeStateRoot` from
`StateHashTreeRootSource` enum
- Rename `processBlockState` → `processState` and `postBlockState` →
`postState` to remove dual-state naming

Reverts #9175

## Test plan

- [x] `pnpm check-types` passes
- [x] `pnpm lint` passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wemeetagain

Copy link
Copy Markdown
Member

🎉 This PR is included in v1.43.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.

use consistent names for state after payload is applied

5 participants