From 6964f688a3d93ca058f6ae300e789c0490ebb9f3 Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Wed, 17 Jun 2026 16:08:18 +0200 Subject: [PATCH] refactor(fork-choice): make internal attestation-extraction helper private The attestation-extraction helper sits in the same private LMD-GHOST pipeline as its siblings, which are underscore-prefixed, yet it was public despite having no callers outside its own module. Rename it to match its siblings. Pure rename, behavior identical. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/lean_spec/spec/forks/lstar/fork_choice.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lean_spec/spec/forks/lstar/fork_choice.py b/src/lean_spec/spec/forks/lstar/fork_choice.py index dcb0a68a6..ae47586e5 100644 --- a/src/lean_spec/spec/forks/lstar/fork_choice.py +++ b/src/lean_spec/spec/forks/lstar/fork_choice.py @@ -631,7 +631,7 @@ def on_block( return store - def extract_attestations_from_aggregated_payloads( + def _extract_attestations_from_aggregated_payloads( self, aggregated_payloads: dict[AttestationData, set[SingleMessageAggregate]], latest_finalized_slot: Slot, @@ -722,7 +722,7 @@ def compute_block_weights(self, store: LstarStore) -> dict[Bytes32, int]: Each block root mapped to its accumulated vote weight. """ # Reduce the counted pool to each validator's latest still-relevant vote. - latest_votes = self.extract_attestations_from_aggregated_payloads( + latest_votes = self._extract_attestations_from_aggregated_payloads( store.latest_known_aggregated_payloads, store.latest_finalized.slot, ) @@ -809,7 +809,7 @@ def update_head(self, store: LstarStore) -> LstarStore: The store with its head set to the chosen block. """ # Reduce the counted pool to each validator's latest still-relevant vote. - latest_votes = self.extract_attestations_from_aggregated_payloads( + latest_votes = self._extract_attestations_from_aggregated_payloads( store.latest_known_aggregated_payloads, store.latest_finalized.slot, ) @@ -896,7 +896,7 @@ def update_safe_target(self, store: LstarStore) -> LstarStore: min_target_score = math.ceil(num_validators * 2 / 3) # Reduce the pending pool to each validator's latest still-relevant vote. - latest_votes = self.extract_attestations_from_aggregated_payloads( + latest_votes = self._extract_attestations_from_aggregated_payloads( store.latest_new_aggregated_payloads, store.latest_finalized.slot, )