Skip to content

Commit 43246bd

Browse files
authored
simplify block building (leanEthereum#1168)
1 parent af6f482 commit 43246bd

2 files changed

Lines changed: 4 additions & 17 deletions

File tree

src/lean_spec/spec/forks/lstar/block_production.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def build_block(
148148
if attestation_data.head.root not in known_block_roots:
149149
continue
150150

151+
# Skip votes whose source slot is not the current justified checkpoint.
152+
if attestation_data.source.slot != current_justified_checkpoint.slot:
153+
continue
154+
151155
# Reject votes that do not match this chain.
152156
#
153157
# This also rejects any checkpoint past the chain view.

src/lean_spec/spec/forks/lstar/validator_duties.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,6 @@ def produce_block_with_signatures(
170170
aggregated_payloads=store.latest_known_aggregated_payloads,
171171
)
172172

173-
# Invariant: the produced block must close any justified divergence.
174-
#
175-
# The store may have advanced its justified checkpoint from attestations
176-
# on a minority fork that the head state never processed. The fixed-point
177-
# loop above must incorporate those attestations from the pool, advancing
178-
# the block's justified checkpoint to at least match the store.
179-
#
180-
# Without this, other nodes processing the block would never see the
181-
# justification advance, degrading consensus liveness: only nodes that
182-
# happened to receive the minority fork would know justification moved.
183-
block_justified = final_post_state.latest_justified.slot
184-
store_justified = store.latest_justified.slot
185-
assert block_justified >= store_justified, (
186-
f"Produced block justified={block_justified} < store justified="
187-
f"{store_justified}. Fixed-point attestation loop did not converge."
188-
)
189-
190173
# Compute block hash for storage.
191174
block_hash = hash_tree_root(final_block)
192175

0 commit comments

Comments
 (0)