@@ -63,14 +63,10 @@ pub struct Store {
6363 pub latest_new_aggregated_payloads : HashMap < SignatureKey , Vec < AggregatedSignatureProof > > ,
6464
6565 /// Attestation data indexed by hash (data_root).
66- /// Used to look up the exact attestation data that was signed,
67- /// matching ream's attestation_data_by_root_provider design .
66+ /// Used to look up the exact attestation data that was signed when
67+ /// processing aggregated payloads for safe target computation .
6868 pub attestation_data_by_root : HashMap < H256 , AttestationData > ,
6969
70- /// Signed blocks indexed by block root.
71- /// Used to serve BlocksByRoot requests to peers for checkpoint sync backfill.
72- pub signed_blocks : HashMap < H256 , SignedBlockWithAttestation > ,
73-
7470 /// Gossip attestations waiting for referenced blocks to arrive.
7571 /// Keyed by the missing block root. Drained when that block is processed.
7672 pub pending_attestations : HashMap < H256 , Vec < SignedAttestation > > ,
@@ -86,6 +82,13 @@ pub struct Store {
8682
8783const JUSTIFICATION_LOOKBACK_SLOTS : u64 = 3 ;
8884
85+ /// Number of slots before the finalized slot for which states are retained.
86+ /// States older than (finalized_slot - STATE_PRUNE_BUFFER) are pruned after
87+ /// each finalization advance. The buffer covers late-arriving blocks and rapid
88+ /// finalization jumps without risk of evicting a parent state still needed
89+ /// for an in-flight state transition.
90+ pub const STATE_PRUNE_BUFFER : u64 = 128 ;
91+
8992impl Store {
9093 pub fn produce_attestation_data ( & self , slot : Slot ) -> Result < AttestationData > {
9194 let head_checkpoint = Checkpoint {
@@ -226,7 +229,6 @@ pub fn get_forkchoice_store(
226229 latest_known_aggregated_payloads : HashMap :: new ( ) ,
227230 latest_new_aggregated_payloads : HashMap :: new ( ) ,
228231 attestation_data_by_root : HashMap :: new ( ) ,
229- signed_blocks : [ ( block_root, anchor_block) ] . into ( ) ,
230232 pending_attestations : HashMap :: new ( ) ,
231233 pending_aggregated_attestations : HashMap :: new ( ) ,
232234 pending_fetch_roots : HashSet :: new ( ) ,
0 commit comments