You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
32 Slots here in cache still seems appropriate given their relative value beyond that, but we should increase the cache limit to cater for storing more attestations.
Signed-off-by: Paul Harris <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -17,5 +17,6 @@ the [releases page](https://github.com/Consensys/teku/releases).
17
17
- If the EL supports the `engine_getClientVersionV1` Engine API method, the default graffiti (when no graffiti has been configured by the validator) will include EL as well as CL version information. For more details, please see https://github.com/ethereum/execution-apis/pull/517.
18
18
-`—p2p-private-key-file` command line option supports reading a binary private key file.
19
19
- Updated libp2p seen cache configuration to reflect EIP-7045 spec changes. This reduces CPU and network bandwidth consumption.
20
+
- Increased the attestation cache capacity to allow teku a bigger pool of attestations when block building.
Copy file name to clipboardExpand all lines: ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java
+13-11
Original file line number
Diff line number
Diff line change
@@ -55,20 +55,22 @@ public class AggregatingAttestationPool implements SlotEventsChannel {
55
55
staticfinallongATTESTATION_RETENTION_SLOTS = 32;
56
56
57
57
/**
58
-
* Default maximum number of attestations to store in the pool. Even with 400,000 validators we'd
59
-
* expect just 12,500 attestations per slot. It's very unlikely we'll be able to include more than
60
-
* a few slots worth of attestations into any block we produce so may as well prune them.
58
+
* Default maximum number of attestations to store in the pool.
61
59
*
62
-
* <p>In fact even with perfect aggregation, there are 64 committees per slot and a maximum of 128
63
-
* attestations per block, so we can only possibly include 2 full slots worth of attestations. If
64
-
* the prior slots weren't entirely missed the majority of attestations should have been included
65
-
* in those blocks, and we'll have room to store older attestations to fill any space we have
66
-
* remaining.
60
+
* <p>With 1.2 million active validators, we'd expect around 37_500 attestations per slot; so 3
61
+
* slots worth of attestations is almost 120_000.
67
62
*
68
-
* <p>A limit of 40,000 attestations is enough for 3 slots worth at 400,000 validators which gives
69
-
* a sane upper limit while still being above the typical 10-20k pool size seen on MainNet.
63
+
* <p>128 attestations perfectly packed at a 1.2 million validator set would be 1_200_000 / 32 /
64
+
* 64 bits, about 584 bits per aggregate. 128 of those is 74752 attestations if perfectly packed.
65
+
* Technically if we did have to cache 2 full slots of information, that would be roughly 150k
66
+
* cache size.
67
+
*
68
+
* <p>Because the real world exists, it's fair to expect that it's not all perfect, and 120k
69
+
* should be an adequately large cache to store current attestations plus some old ones that may
70
+
* not have been included so that we have plenty to choose if block building based on an expected
0 commit comments