simplify block building#1168
Merged
Merged
Conversation
f1a3e5b to
d4fccb9
Compare
tcoratger
approved these changes
Jun 26, 2026
MegaRedHand
reviewed
Jun 26, 2026
| continue | ||
|
|
||
| # Skip votes whose source slot is not the current justified checkpoint. | ||
| if attestation_data.source.slot != current_justified_checkpoint.slot: |
Contributor
There was a problem hiding this comment.
I thought adding this would allow us to simplify the checks here. Otherwise, this just adds more code, right?
Collaborator
Author
There was a problem hiding this comment.
correct, it's just easy to reason through it this way. I intentionally did not add any test to enforce it as it is optional and up to client implementation
pablodeymo
pushed a commit
to lambdaclass/ethlambda
that referenced
this pull request
Jun 29, 2026
…gence (#480) ## What `produce_block_with_signatures` checks that a produced block's justified slot does not lag the store's justified checkpoint (leanSpec #595). When it did, the function returned `StoreError::JustifiedDivergenceNotClosed`, which aborted block production for that slot. This PR removes that error variant and replaces the hard failure with a warn-level log, then publishes the block anyway. ## Why Aborting production on this condition halts the chain rather than recovering from it. The proposer cannot re-justify the head because validators source from the store-justified checkpoint, so every subsequent proposal hits the same divergence and block production freezes indefinitely (observed as a "did not converge" stall). Publishing a block whose justified slot lags by one fork is the lesser evil: the chain keeps making progress and pool attestations get a chance to close the divergence on later slots. The divergence is now surfaced as a warning instead of silently halting the node. This mirrors the upstream spec change in leanEthereum/leanSpec#1168. ## Changes - `crates/blockchain/src/store.rs`: replace the `return Err(JustifiedDivergenceNotClosed)` with a `warn!` log; remove the now-unused `StoreError::JustifiedDivergenceNotClosed` variant. - `crates/blockchain/state_transition/src/lib.rs`: reword a test doc comment that referenced the removed error type by name. ## Testing - `cargo build -p ethlambda-blockchain` ✅ - `cargo clippy -p ethlambda-blockchain --all-targets` ✅ (no warnings) ## References - Upstream spec change: leanEthereum/leanSpec#1168
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Prefers attestations that have higher target slot, we should prioritize latest votes over stale votesnvm it is a block optimization and will need vote counting as well which will complicate the specbuild_block#716🔗 Related Issues or PRs
✅ Checklist
just check