Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: check gas limit in header received from builder #7336

Open
wants to merge 7 commits into
base: unstable
Choose a base branch
from

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jan 7, 2025

Motivation

As per spec the builder must adhere to the preferred gas limit of the validator

The builder MUST build an execution payload whose gas_limit is equal to the gas_limit of the latest registration for pubkey, or as close as is possible under the consensus rules.

but currently we are not validating this anywhere and rely on honest builder behavior which is not great considering there are only two builder that produce most of the blocks.

Description

This PR adds a check the to builder flow that compares the expected gas limit against the target gas limit (ie. preferred gas limit of validator) and rejects the builder block in case there is a mismatch which will trigger the fallback to local block.

The expected gas limit is calculated based on this spec

def expected_gas_limit(parent_gas_limit, target_gas_limit):
  max_gas_limit_difference = (parent_gas_limit // 1024) - 1
  if target_gas_limit > parent_gas_limit:
    gas_diff = target_gas_limit - parent_gas_limit
    return parent_gas_limit + min(gas_diff, max_gas_limit_difference)
  else:
    gas_diff = parent_gas_limit - target_gas_limit
    return parent_gas_limit - min(gas_diff, max_gas_limit_difference)

I haven't found where this is defined but it's based on what other clients implement (eg. prysmaticlabs/prysm#14707 and Consensys/teku#8909) and makes sense considering gas limit checks in EIP-1559.

image

@nflaig nflaig force-pushed the nflaig/check-header-gas-limit branch from 587034f to c0308f9 Compare January 7, 2025 19:34
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.76%. Comparing base (6fb5259) to head (d00450b).

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #7336   +/-   ##
=========================================
  Coverage     48.76%   48.76%           
=========================================
  Files           601      601           
  Lines         40243    40243           
  Branches       2066     2067    +1     
=========================================
+ Hits          19625    19626    +1     
+ Misses        20580    20579    -1     
  Partials         38       38           

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 95a7845 Previous: 6fb5259 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8378 ms/op 1.7558 ms/op 1.05
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 70.987 us/op 48.488 us/op 1.46
BLS verify - blst 907.98 us/op 798.75 us/op 1.14
BLS verifyMultipleSignatures 3 - blst 1.4311 ms/op 1.1707 ms/op 1.22
BLS verifyMultipleSignatures 8 - blst 1.9996 ms/op 1.6704 ms/op 1.20
BLS verifyMultipleSignatures 32 - blst 6.4220 ms/op 4.8584 ms/op 1.32
BLS verifyMultipleSignatures 64 - blst 11.175 ms/op 8.9637 ms/op 1.25
BLS verifyMultipleSignatures 128 - blst 17.936 ms/op 17.411 ms/op 1.03
BLS deserializing 10000 signatures 706.47 ms/op 685.65 ms/op 1.03
BLS deserializing 100000 signatures 7.3870 s/op 6.9563 s/op 1.06
BLS verifyMultipleSignatures - same message - 3 - blst 1.1520 ms/op 916.86 us/op 1.26
BLS verifyMultipleSignatures - same message - 8 - blst 1.3899 ms/op 999.91 us/op 1.39
BLS verifyMultipleSignatures - same message - 32 - blst 2.2297 ms/op 1.6959 ms/op 1.31
BLS verifyMultipleSignatures - same message - 64 - blst 2.9588 ms/op 2.5733 ms/op 1.15
BLS verifyMultipleSignatures - same message - 128 - blst 5.0016 ms/op 4.3497 ms/op 1.15
BLS aggregatePubkeys 32 - blst 21.393 us/op 20.025 us/op 1.07
BLS aggregatePubkeys 128 - blst 77.871 us/op 71.057 us/op 1.10
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 97.398 ms/op 63.596 ms/op 1.53
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 71.807 ms/op 57.623 ms/op 1.25
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 54.552 ms/op 42.118 ms/op 1.30
getSlashingsAndExits - default max 166.72 us/op 134.20 us/op 1.24
getSlashingsAndExits - 2k 454.73 us/op 391.36 us/op 1.16
proposeBlockBody type=full, size=empty 6.4824 ms/op 5.8430 ms/op 1.11
isKnown best case - 1 super set check 293.00 ns/op 279.00 ns/op 1.05
isKnown normal case - 2 super set checks 286.00 ns/op 268.00 ns/op 1.07
isKnown worse case - 16 super set checks 270.00 ns/op 269.00 ns/op 1.00
InMemoryCheckpointStateCache - add get delete 2.6390 us/op 2.4890 us/op 1.06
validate api signedAggregateAndProof - struct 1.7982 ms/op 1.3818 ms/op 1.30
validate gossip signedAggregateAndProof - struct 1.5748 ms/op 1.3722 ms/op 1.15
batch validate gossip attestation - vc 640000 - chunk 32 135.76 us/op 120.49 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 64 119.78 us/op 106.23 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 128 113.03 us/op 101.56 us/op 1.11
batch validate gossip attestation - vc 640000 - chunk 256 113.41 us/op 100.64 us/op 1.13
pickEth1Vote - no votes 1.1432 ms/op 1.0372 ms/op 1.10
pickEth1Vote - max votes 6.9435 ms/op 5.8242 ms/op 1.19
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.450 ms/op 16.428 ms/op 0.76
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.105 ms/op 16.496 ms/op 1.16
pickEth1Vote - Eth1Data fastSerialize value x2048 471.69 us/op 544.96 us/op 0.87
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.6360 ms/op 3.1003 ms/op 0.85
bytes32 toHexString 417.00 ns/op 443.00 ns/op 0.94
bytes32 Buffer.toString(hex) 232.00 ns/op 239.00 ns/op 0.97
bytes32 Buffer.toString(hex) from Uint8Array 354.00 ns/op 384.00 ns/op 0.92
bytes32 Buffer.toString(hex) + 0x 229.00 ns/op 245.00 ns/op 0.93
Object access 1 prop 0.14900 ns/op 0.14900 ns/op 1.00
Map access 1 prop 0.13100 ns/op 0.13100 ns/op 1.00
Object get x1000 6.1100 ns/op 5.8620 ns/op 1.04
Map get x1000 6.4740 ns/op 6.5560 ns/op 0.99
Object set x1000 32.758 ns/op 32.848 ns/op 1.00
Map set x1000 21.775 ns/op 23.751 ns/op 0.92
Return object 10000 times 0.29240 ns/op 0.29420 ns/op 0.99
Throw Error 10000 times 3.3992 us/op 3.3694 us/op 1.01
toHex 154.41 ns/op 154.77 ns/op 1.00
Buffer.from 129.70 ns/op 139.66 ns/op 0.93
shared Buffer 86.734 ns/op 87.210 ns/op 0.99
fastMsgIdFn sha256 / 200 bytes 2.1780 us/op 2.2700 us/op 0.96
fastMsgIdFn h32 xxhash / 200 bytes 227.00 ns/op 238.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 200 bytes 285.00 ns/op 276.00 ns/op 1.03
fastMsgIdFn sha256 / 1000 bytes 7.9640 us/op 7.3360 us/op 1.09
fastMsgIdFn h32 xxhash / 1000 bytes 386.00 ns/op 370.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 1000 bytes 348.00 ns/op 351.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 66.079 us/op 64.288 us/op 1.03
fastMsgIdFn h32 xxhash / 10000 bytes 1.8710 us/op 1.8860 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.2300 us/op 1.2680 us/op 0.97
send data - 1000 256B messages 12.742 ms/op 12.417 ms/op 1.03
send data - 1000 512B messages 17.256 ms/op 17.879 ms/op 0.97
send data - 1000 1024B messages 27.773 ms/op 25.535 ms/op 1.09
send data - 1000 1200B messages 26.450 ms/op 26.220 ms/op 1.01
send data - 1000 2048B messages 33.387 ms/op 30.674 ms/op 1.09
send data - 1000 4096B messages 31.910 ms/op 31.462 ms/op 1.01
send data - 1000 16384B messages 73.833 ms/op 73.304 ms/op 1.01
send data - 1000 65536B messages 207.32 ms/op 217.40 ms/op 0.95
enrSubnets - fastDeserialize 64 bits 1.2250 us/op 1.0770 us/op 1.14
enrSubnets - ssz BitVector 64 bits 425.00 ns/op 364.00 ns/op 1.17
enrSubnets - fastDeserialize 4 bits 164.00 ns/op 147.00 ns/op 1.12
enrSubnets - ssz BitVector 4 bits 420.00 ns/op 361.00 ns/op 1.16
prioritizePeers score -10:0 att 32-0.1 sync 2-0 153.81 us/op 131.85 us/op 1.17
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 164.34 us/op 154.31 us/op 1.07
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 247.37 us/op 224.22 us/op 1.10
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 422.43 us/op 400.59 us/op 1.05
prioritizePeers score 0:0 att 64-1 sync 4-1 631.59 us/op 502.77 us/op 1.26
array of 16000 items push then shift 1.6656 us/op 1.6113 us/op 1.03
LinkedList of 16000 items push then shift 7.6090 ns/op 7.0350 ns/op 1.08
array of 16000 items push then pop 125.76 ns/op 116.92 ns/op 1.08
LinkedList of 16000 items push then pop 7.4070 ns/op 7.0870 ns/op 1.05
array of 24000 items push then shift 2.4711 us/op 2.4163 us/op 1.02
LinkedList of 24000 items push then shift 7.7100 ns/op 7.0660 ns/op 1.09
array of 24000 items push then pop 168.14 ns/op 130.05 ns/op 1.29
LinkedList of 24000 items push then pop 7.2500 ns/op 6.9410 ns/op 1.04
intersect bitArray bitLen 8 6.7600 ns/op 6.3580 ns/op 1.06
intersect array and set length 8 49.373 ns/op 43.341 ns/op 1.14
intersect bitArray bitLen 128 30.772 ns/op 29.713 ns/op 1.04
intersect array and set length 128 726.96 ns/op 692.12 ns/op 1.05
bitArray.getTrueBitIndexes() bitLen 128 1.6350 us/op 1.3120 us/op 1.25
bitArray.getTrueBitIndexes() bitLen 248 2.3480 us/op 2.2680 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 512 4.5780 us/op 4.4650 us/op 1.03
Buffer.concat 32 items 853.00 ns/op 743.00 ns/op 1.15
Uint8Array.set 32 items 2.1180 us/op 1.4460 us/op 1.46
Buffer.copy 2.4730 us/op 2.3920 us/op 1.03
Uint8Array.set - with subarray 1.8600 us/op 2.2680 us/op 0.82
Uint8Array.set - without subarray 1.2550 us/op 1.4670 us/op 0.86
getUint32 - dataview 225.00 ns/op 227.00 ns/op 0.99
getUint32 - manual 141.00 ns/op 147.00 ns/op 0.96
Set add up to 64 items then delete first 2.1439 us/op 2.1278 us/op 1.01
OrderedSet add up to 64 items then delete first 3.1638 us/op 3.1377 us/op 1.01
Set add up to 64 items then delete last 2.4222 us/op 2.4004 us/op 1.01
OrderedSet add up to 64 items then delete last 3.5431 us/op 3.6470 us/op 0.97
Set add up to 64 items then delete middle 2.7623 us/op 2.3992 us/op 1.15
OrderedSet add up to 64 items then delete middle 5.4062 us/op 5.0317 us/op 1.07
Set add up to 128 items then delete first 5.0629 us/op 4.7407 us/op 1.07
OrderedSet add up to 128 items then delete first 7.8215 us/op 7.2885 us/op 1.07
Set add up to 128 items then delete last 5.0784 us/op 4.8666 us/op 1.04
OrderedSet add up to 128 items then delete last 7.3223 us/op 7.2966 us/op 1.00
Set add up to 128 items then delete middle 4.9066 us/op 4.7028 us/op 1.04
OrderedSet add up to 128 items then delete middle 14.238 us/op 13.063 us/op 1.09
Set add up to 256 items then delete first 10.523 us/op 9.3341 us/op 1.13
OrderedSet add up to 256 items then delete first 15.857 us/op 13.883 us/op 1.14
Set add up to 256 items then delete last 9.7861 us/op 9.4926 us/op 1.03
OrderedSet add up to 256 items then delete last 14.707 us/op 15.467 us/op 0.95
Set add up to 256 items then delete middle 9.6622 us/op 10.032 us/op 0.96
OrderedSet add up to 256 items then delete middle 43.362 us/op 41.588 us/op 1.04
transfer serialized Status (84 B) 2.5270 us/op 2.5820 us/op 0.98
copy serialized Status (84 B) 1.2070 us/op 1.3960 us/op 0.86
transfer serialized SignedVoluntaryExit (112 B) 2.4580 us/op 2.7030 us/op 0.91
copy serialized SignedVoluntaryExit (112 B) 1.2310 us/op 1.4410 us/op 0.85
transfer serialized ProposerSlashing (416 B) 2.5590 us/op 2.8240 us/op 0.91
copy serialized ProposerSlashing (416 B) 1.5430 us/op 1.6250 us/op 0.95
transfer serialized Attestation (485 B) 2.6880 us/op 2.7810 us/op 0.97
copy serialized Attestation (485 B) 1.9920 us/op 1.7230 us/op 1.16
transfer serialized AttesterSlashing (33232 B) 3.2450 us/op 2.8370 us/op 1.14
copy serialized AttesterSlashing (33232 B) 4.5330 us/op 5.2300 us/op 0.87
transfer serialized Small SignedBeaconBlock (128000 B) 3.4760 us/op 3.2740 us/op 1.06
copy serialized Small SignedBeaconBlock (128000 B) 13.435 us/op 15.581 us/op 0.86
transfer serialized Avg SignedBeaconBlock (200000 B) 4.3540 us/op 3.9190 us/op 1.11
copy serialized Avg SignedBeaconBlock (200000 B) 19.621 us/op 20.934 us/op 0.94
transfer serialized BlobsSidecar (524380 B) 4.1040 us/op 4.1470 us/op 0.99
copy serialized BlobsSidecar (524380 B) 83.939 us/op 87.922 us/op 0.95
transfer serialized Big SignedBeaconBlock (1000000 B) 4.1270 us/op 4.1400 us/op 1.00
copy serialized Big SignedBeaconBlock (1000000 B) 161.21 us/op 155.86 us/op 1.03
pass gossip attestations to forkchoice per slot 2.7206 ms/op 2.6829 ms/op 1.01
forkChoice updateHead vc 100000 bc 64 eq 0 457.50 us/op 455.60 us/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 3.2571 ms/op 3.5230 ms/op 0.92
forkChoice updateHead vc 1000000 bc 64 eq 0 5.8123 ms/op 4.9269 ms/op 1.18
forkChoice updateHead vc 600000 bc 320 eq 0 3.0190 ms/op 2.7926 ms/op 1.08
forkChoice updateHead vc 600000 bc 1200 eq 0 3.2914 ms/op 2.8580 ms/op 1.15
forkChoice updateHead vc 600000 bc 7200 eq 0 4.0740 ms/op 3.7517 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 1000 10.679 ms/op 10.627 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 10000 10.660 ms/op 10.736 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 14.697 ms/op 14.169 ms/op 1.04
computeDeltas 500000 validators 300 proto nodes 4.2972 ms/op 4.2186 ms/op 1.02
computeDeltas 500000 validators 1200 proto nodes 4.2793 ms/op 4.1095 ms/op 1.04
computeDeltas 500000 validators 7200 proto nodes 4.2526 ms/op 4.1234 ms/op 1.03
computeDeltas 750000 validators 300 proto nodes 6.1964 ms/op 6.0822 ms/op 1.02
computeDeltas 750000 validators 1200 proto nodes 6.1120 ms/op 6.0632 ms/op 1.01
computeDeltas 750000 validators 7200 proto nodes 6.1584 ms/op 6.0741 ms/op 1.01
computeDeltas 1400000 validators 300 proto nodes 11.660 ms/op 11.454 ms/op 1.02
computeDeltas 1400000 validators 1200 proto nodes 11.402 ms/op 11.401 ms/op 1.00
computeDeltas 1400000 validators 7200 proto nodes 11.638 ms/op 11.575 ms/op 1.01
computeDeltas 2100000 validators 300 proto nodes 17.195 ms/op 17.104 ms/op 1.01
computeDeltas 2100000 validators 1200 proto nodes 17.337 ms/op 17.128 ms/op 1.01
computeDeltas 2100000 validators 7200 proto nodes 17.346 ms/op 17.014 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei normalcase 1.8575 ms/op 2.2064 ms/op 0.84
altair processAttestation - 250000 vs - 7PWei worstcase 2.8167 ms/op 2.9692 ms/op 0.95
altair processAttestation - setStatus - 1/6 committees join 133.21 us/op 136.60 us/op 0.98
altair processAttestation - setStatus - 1/3 committees join 243.25 us/op 251.06 us/op 0.97
altair processAttestation - setStatus - 1/2 committees join 347.50 us/op 352.96 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 444.35 us/op 448.35 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 640.96 us/op 606.66 us/op 1.06
altair processAttestation - setStatus - 100% committees join 761.23 us/op 730.89 us/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 5.0240 ms/op 5.7041 ms/op 0.88
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.256 ms/op 22.714 ms/op 1.20
altair processBlock - 250000 vs - 7PWei worstcase 40.225 ms/op 33.069 ms/op 1.22
altair processBlock - 250000 vs - 7PWei worstcase hashState 74.447 ms/op 73.108 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2987 ms/op 1.7866 ms/op 1.29
phase0 processBlock - 250000 vs - 7PWei worstcase 28.581 ms/op 20.833 ms/op 1.37
altair processEth1Data - 250000 vs - 7PWei normalcase 330.95 us/op 350.35 us/op 0.94
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.050 us/op 5.7100 us/op 1.76
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 56.630 us/op 53.235 us/op 1.06
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 16.464 us/op 11.978 us/op 1.37
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.403 us/op 7.5000 us/op 1.39
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 240.85 us/op 125.58 us/op 1.92
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.0380 ms/op 1.2562 ms/op 1.62
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7738 ms/op 1.4382 ms/op 1.23
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7708 ms/op 1.4771 ms/op 1.20
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7095 ms/op 3.8955 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.8169 ms/op 1.4973 ms/op 1.21
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.2827 ms/op 4.2588 ms/op 1.01
Tree 40 250000 create 377.49 ms/op 210.29 ms/op 1.80
Tree 40 250000 get(125000) 173.70 ns/op 143.29 ns/op 1.21
Tree 40 250000 set(125000) 957.83 ns/op 714.95 ns/op 1.34
Tree 40 250000 toArray() 21.803 ms/op 18.693 ms/op 1.17
Tree 40 250000 iterate all - toArray() + loop 21.047 ms/op 19.722 ms/op 1.07
Tree 40 250000 iterate all - get(i) 61.025 ms/op 58.025 ms/op 1.05
Array 250000 create 4.1297 ms/op 2.9723 ms/op 1.39
Array 250000 clone - spread 1.7141 ms/op 1.5293 ms/op 1.12
Array 250000 get(125000) 0.48900 ns/op 0.42200 ns/op 1.16
Array 250000 set(125000) 0.49900 ns/op 0.44700 ns/op 1.12
Array 250000 iterate all - loop 95.694 us/op 83.954 us/op 1.14
phase0 afterProcessEpoch - 250000 vs - 7PWei 63.044 ms/op 53.362 ms/op 1.18
Array.fill - length 1000000 6.0940 ms/op 3.7870 ms/op 1.61
Array push - length 1000000 25.683 ms/op 17.510 ms/op 1.47
Array.get 0.31304 ns/op 0.27102 ns/op 1.16
Uint8Array.get 0.47892 ns/op 0.43483 ns/op 1.10
phase0 beforeProcessEpoch - 250000 vs - 7PWei 23.866 ms/op 15.742 ms/op 1.52
altair processEpoch - mainnet_e81889 296.64 ms/op 268.52 ms/op 1.10
mainnet_e81889 - altair beforeProcessEpoch 21.067 ms/op 17.940 ms/op 1.17
mainnet_e81889 - altair processJustificationAndFinalization 18.245 us/op 14.316 us/op 1.27
mainnet_e81889 - altair processInactivityUpdates 6.1787 ms/op 4.8943 ms/op 1.26
mainnet_e81889 - altair processRewardsAndPenalties 42.596 ms/op 42.143 ms/op 1.01
mainnet_e81889 - altair processRegistryUpdates 3.5080 us/op 2.3770 us/op 1.48
mainnet_e81889 - altair processSlashings 1.0250 us/op 405.00 ns/op 2.53
mainnet_e81889 - altair processEth1DataReset 1.7440 us/op 482.00 ns/op 3.62
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7724 ms/op 1.3734 ms/op 1.29
mainnet_e81889 - altair processSlashingsReset 9.6200 us/op 3.2640 us/op 2.95
mainnet_e81889 - altair processRandaoMixesReset 11.965 us/op 4.1680 us/op 2.87
mainnet_e81889 - altair processHistoricalRootsUpdate 1.1500 us/op 838.00 ns/op 1.37
mainnet_e81889 - altair processParticipationFlagUpdates 4.3240 us/op 2.1060 us/op 2.05
mainnet_e81889 - altair processSyncCommitteeUpdates 1.9730 us/op 617.00 ns/op 3.20
mainnet_e81889 - altair afterProcessEpoch 58.998 ms/op 50.238 ms/op 1.17
capella processEpoch - mainnet_e217614 1.3239 s/op 1.0428 s/op 1.27
mainnet_e217614 - capella beforeProcessEpoch 88.523 ms/op 68.064 ms/op 1.30
mainnet_e217614 - capella processJustificationAndFinalization 23.419 us/op 12.050 us/op 1.94
mainnet_e217614 - capella processInactivityUpdates 22.144 ms/op 16.587 ms/op 1.34
mainnet_e217614 - capella processRewardsAndPenalties 285.21 ms/op 212.93 ms/op 1.34
mainnet_e217614 - capella processRegistryUpdates 29.041 us/op 16.404 us/op 1.77
mainnet_e217614 - capella processSlashings 1.0200 us/op 525.00 ns/op 1.94
mainnet_e217614 - capella processEth1DataReset 1.3070 us/op 500.00 ns/op 2.61
mainnet_e217614 - capella processEffectiveBalanceUpdates 17.080 ms/op 11.259 ms/op 1.52
mainnet_e217614 - capella processSlashingsReset 5.7030 us/op 3.2340 us/op 1.76
mainnet_e217614 - capella processRandaoMixesReset 5.7740 us/op 4.8570 us/op 1.19
mainnet_e217614 - capella processHistoricalRootsUpdate 1.4420 us/op 539.00 ns/op 2.68
mainnet_e217614 - capella processParticipationFlagUpdates 2.2330 us/op 1.5090 us/op 1.48
mainnet_e217614 - capella afterProcessEpoch 138.95 ms/op 122.66 ms/op 1.13
phase0 processEpoch - mainnet_e58758 419.42 ms/op 321.99 ms/op 1.30
mainnet_e58758 - phase0 beforeProcessEpoch 123.27 ms/op 69.195 ms/op 1.78
mainnet_e58758 - phase0 processJustificationAndFinalization 20.663 us/op 12.358 us/op 1.67
mainnet_e58758 - phase0 processRewardsAndPenalties 25.938 ms/op 29.679 ms/op 0.87
mainnet_e58758 - phase0 processRegistryUpdates 14.989 us/op 8.1230 us/op 1.85
mainnet_e58758 - phase0 processSlashings 776.00 ns/op 521.00 ns/op 1.49
mainnet_e58758 - phase0 processEth1DataReset 1.4160 us/op 413.00 ns/op 3.43
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.5385 ms/op 1.1405 ms/op 1.35
mainnet_e58758 - phase0 processSlashingsReset 3.8040 us/op 2.2380 us/op 1.70
mainnet_e58758 - phase0 processRandaoMixesReset 6.3730 us/op 4.2270 us/op 1.51
mainnet_e58758 - phase0 processHistoricalRootsUpdate 712.00 ns/op 417.00 ns/op 1.71
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.2560 us/op 3.6480 us/op 1.44
mainnet_e58758 - phase0 afterProcessEpoch 50.292 ms/op 42.659 ms/op 1.18
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.7320 ms/op 1.3205 ms/op 1.31
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.4815 ms/op 1.8169 ms/op 1.92
altair processInactivityUpdates - 250000 normalcase 19.487 ms/op 14.734 ms/op 1.32
altair processInactivityUpdates - 250000 worstcase 21.014 ms/op 15.205 ms/op 1.38
phase0 processRegistryUpdates - 250000 normalcase 13.281 us/op 9.0000 us/op 1.48
phase0 processRegistryUpdates - 250000 badcase_full_deposits 416.88 us/op 274.25 us/op 1.52
phase0 processRegistryUpdates - 250000 worstcase 0.5 137.67 ms/op 102.01 ms/op 1.35
altair processRewardsAndPenalties - 250000 normalcase 44.521 ms/op 37.954 ms/op 1.17
altair processRewardsAndPenalties - 250000 worstcase 33.898 ms/op 38.391 ms/op 0.88
phase0 getAttestationDeltas - 250000 normalcase 12.737 ms/op 7.3314 ms/op 1.74
phase0 getAttestationDeltas - 250000 worstcase 9.1156 ms/op 6.9921 ms/op 1.30
phase0 processSlashings - 250000 worstcase 124.40 us/op 76.355 us/op 1.63
altair processSyncCommitteeUpdates - 250000 145.58 ms/op 116.53 ms/op 1.25
BeaconState.hashTreeRoot - No change 254.00 ns/op 239.00 ns/op 1.06
BeaconState.hashTreeRoot - 1 full validator 114.73 us/op 103.12 us/op 1.11
BeaconState.hashTreeRoot - 32 full validator 931.32 us/op 1.3325 ms/op 0.70
BeaconState.hashTreeRoot - 512 full validator 9.9481 ms/op 11.277 ms/op 0.88
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 134.40 us/op 124.88 us/op 1.08
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0402 ms/op 1.4028 ms/op 1.45
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.865 ms/op 20.090 ms/op 1.34
BeaconState.hashTreeRoot - 1 balances 140.90 us/op 74.347 us/op 1.90
BeaconState.hashTreeRoot - 32 balances 1.4112 ms/op 1.2161 ms/op 1.16
BeaconState.hashTreeRoot - 512 balances 9.7770 ms/op 8.5238 ms/op 1.15
BeaconState.hashTreeRoot - 250000 balances 203.03 ms/op 178.15 ms/op 1.14
aggregationBits - 2048 els - zipIndexesInBitList 38.239 us/op 22.930 us/op 1.67
byteArrayEquals 32 58.691 ns/op 53.097 ns/op 1.11
Buffer.compare 32 18.707 ns/op 16.979 ns/op 1.10
byteArrayEquals 1024 1.7376 us/op 1.5677 us/op 1.11
Buffer.compare 1024 28.059 ns/op 25.089 ns/op 1.12
byteArrayEquals 16384 28.052 us/op 24.765 us/op 1.13
Buffer.compare 16384 221.97 ns/op 189.04 ns/op 1.17
byteArrayEquals 123687377 210.28 ms/op 186.88 ms/op 1.13
Buffer.compare 123687377 8.8000 ms/op 6.0320 ms/op 1.46
byteArrayEquals 32 - diff last byte 54.540 ns/op 51.702 ns/op 1.05
Buffer.compare 32 - diff last byte 18.361 ns/op 16.800 ns/op 1.09
byteArrayEquals 1024 - diff last byte 1.6961 us/op 1.5591 us/op 1.09
Buffer.compare 1024 - diff last byte 28.346 ns/op 24.748 ns/op 1.15
byteArrayEquals 16384 - diff last byte 26.254 us/op 24.811 us/op 1.06
Buffer.compare 16384 - diff last byte 206.80 ns/op 200.52 ns/op 1.03
byteArrayEquals 123687377 - diff last byte 202.77 ms/op 189.69 ms/op 1.07
Buffer.compare 123687377 - diff last byte 8.2243 ms/op 6.0850 ms/op 1.35
byteArrayEquals 32 - random bytes 5.2920 ns/op 5.0690 ns/op 1.04
Buffer.compare 32 - random bytes 17.868 ns/op 16.894 ns/op 1.06
byteArrayEquals 1024 - random bytes 5.4230 ns/op 5.0730 ns/op 1.07
Buffer.compare 1024 - random bytes 19.846 ns/op 16.908 ns/op 1.17
byteArrayEquals 16384 - random bytes 5.3250 ns/op 5.0720 ns/op 1.05
Buffer.compare 16384 - random bytes 18.110 ns/op 16.882 ns/op 1.07
byteArrayEquals 123687377 - random bytes 8.0900 ns/op 6.2700 ns/op 1.29
Buffer.compare 123687377 - random bytes 20.070 ns/op 18.200 ns/op 1.10
regular array get 100000 times 40.999 us/op 32.763 us/op 1.25
wrappedArray get 100000 times 33.930 us/op 32.457 us/op 1.05
arrayWithProxy get 100000 times 15.175 ms/op 12.839 ms/op 1.18
ssz.Root.equals 49.769 ns/op 45.466 ns/op 1.09
byteArrayEquals 48.308 ns/op 44.912 ns/op 1.08
Buffer.compare 11.267 ns/op 10.238 ns/op 1.10
processSlot - 1 slots 14.747 us/op 12.434 us/op 1.19
processSlot - 32 slots 2.9440 ms/op 2.9540 ms/op 1.00
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.573 ms/op 37.709 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 2.1176 ms/op 2.1103 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 4.1552 ms/op 4.0741 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5000 ms/op 4.4982 ms/op 1.00
findModifiedValidators - 10000 modified validators 261.85 ms/op 241.16 ms/op 1.09
findModifiedValidators - 1000 modified validators 200.46 ms/op 180.40 ms/op 1.11
findModifiedValidators - 100 modified validators 173.03 ms/op 177.31 ms/op 0.98
findModifiedValidators - 10 modified validators 188.80 ms/op 162.32 ms/op 1.16
findModifiedValidators - 1 modified validators 159.66 ms/op 178.32 ms/op 0.90
findModifiedValidators - no difference 168.45 ms/op 165.08 ms/op 1.02
compare ViewDUs 3.2357 s/op 2.9849 s/op 1.08
compare each validator Uint8Array 1.4654 s/op 1.6662 s/op 0.88
compare ViewDU to Uint8Array 1.0923 s/op 911.90 ms/op 1.20
migrate state 1000000 validators, 24 modified, 0 new 730.02 ms/op 729.68 ms/op 1.00
migrate state 1000000 validators, 1700 modified, 1000 new 921.20 ms/op 986.01 ms/op 0.93
migrate state 1000000 validators, 3400 modified, 2000 new 1.3020 s/op 1.1609 s/op 1.12
migrate state 1500000 validators, 24 modified, 0 new 788.27 ms/op 760.84 ms/op 1.04
migrate state 1500000 validators, 1700 modified, 1000 new 1.0494 s/op 979.83 ms/op 1.07
migrate state 1500000 validators, 3400 modified, 2000 new 1.1243 s/op 1.1805 s/op 0.95
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.2900 ns/op 4.3000 ns/op 1.00
state getBlockRootAtSlot - 250000 vs - 7PWei 720.12 ns/op 653.57 ns/op 1.10
computeProposers - vc 250000 7.4127 ms/op 6.8138 ms/op 1.09
computeEpochShuffling - vc 250000 40.880 ms/op 40.920 ms/op 1.00
getNextSyncCommittee - vc 250000 123.83 ms/op 120.12 ms/op 1.03
computeSigningRoot for AttestationData 26.726 us/op 20.359 us/op 1.31
hash AttestationData serialized data then Buffer.toString(base64) 1.5382 us/op 1.5839 us/op 0.97
toHexString serialized data 871.87 ns/op 855.78 ns/op 1.02
Buffer.toString(base64) 179.81 ns/op 181.46 ns/op 0.99
nodejs block root to RootHex using toHex 152.16 ns/op 156.59 ns/op 0.97
nodejs block root to RootHex using toRootHex 92.588 ns/op 89.723 ns/op 1.03
browser block root to RootHex using the deprecated toHexString 220.97 ns/op 221.04 ns/op 1.00
browser block root to RootHex using toHex 180.50 ns/op 174.91 ns/op 1.03
browser block root to RootHex using toRootHex 161.85 ns/op 156.21 ns/op 1.04

by benchmarkbot/action

@nflaig nflaig force-pushed the nflaig/check-header-gas-limit branch from c0308f9 to d317aef Compare January 7, 2025 21:25
@nflaig nflaig marked this pull request as ready for review January 7, 2025 21:40
@nflaig nflaig requested a review from a team as a code owner January 7, 2025 21:40
gasLimit: number;
};

export class ValidatorRegistrationCache {
Copy link
Member Author

Choose a reason for hiding this comment

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

might be able to combine this with BeaconProposerCache in the future but this requires apis to be consolidated first as proposed in ethereum/beacon-APIs#435

@nflaig nflaig added this to the v1.25.0 milestone Jan 9, 2025
@nflaig nflaig requested a review from g11tech January 10, 2025 13:25
@philknows philknows modified the milestones: v1.25.0, v1.26.0 Jan 10, 2025
g11tech
g11tech previously approved these changes Jan 12, 2025
@nflaig
Copy link
Member Author

nflaig commented Jan 15, 2025

No issues so far running this branch on Holesky, it looks like builders / relays properly set the expected gas limit

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.

4 participants