Skip to content

Commit 998a226

Browse files
committed
fix doc
1 parent f14833d commit 998a226

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • src/lean_spec/subspecs/forkchoice

src/lean_spec/subspecs/forkchoice/store.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -943,26 +943,31 @@ def produce_block_with_signatures(
943943
Raises:
944944
AssertionError: If validator lacks proposer authorization for slot.
945945
"""
946-
# Get parent block and state
946+
# Get parent block and state to build upon
947947
store, head_root = self.get_proposal_head(slot)
948948
head_state = store.states[head_root]
949949

950-
# Validate proposer authorization
950+
# Validate proposer authorization for this slo
951951
num_validators = Uint64(head_state.validators.count)
952952
assert is_proposer(validator_index, slot, num_validators), (
953953
f"Validator {validator_index} is not the proposer for slot {slot}"
954954
)
955955

956-
# Fixed-point attestation collection
956+
# Initialize empty attestation set for iterative collection
957957
attestations: list[Attestation] = []
958958
signatures: list[Signature] = []
959959

960+
# Iteratively collect valid attestations using fixed-point algorithm
961+
#
962+
# Continue until no new attestations can be added to the block.
963+
# This ensures we include the maximal valid attestation set.
960964
while True:
961965
# Compute post-state to check attestation validity (inline, no hash_tree_root)
962966
temp_block = Block(
963967
slot=slot,
964968
proposer_index=validator_index,
965969
parent_root=head_root,
970+
# Temporary; updated after state computation
966971
state_root=Bytes32.zero(),
967972
body=BlockBody(attestations=Attestations(data=attestations)),
968973
)

0 commit comments

Comments
 (0)