Skip to content

simplify block building#1168

Merged
anshalshukla merged 1 commit into
mainfrom
simplify-block-building
Jun 26, 2026
Merged

simplify block building#1168
anshalshukla merged 1 commit into
mainfrom
simplify-block-building

Conversation

@anshalshukla

@anshalshukla anshalshukla commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

🗒️ Description

🔗 Related Issues or PRs

✅ Checklist

  • Ran local quality checks to avoid unnecessary CI fails:
    just check
  • Considered adding appropriate tests for the changes.
  • Considered updating the online docs in the ./docs/ directory.

@anshalshukla anshalshukla force-pushed the simplify-block-building branch from f1a3e5b to d4fccb9 Compare June 25, 2026 12:44
continue

# Skip votes whose source slot is not the current justified checkpoint.
if attestation_data.source.slot != current_justified_checkpoint.slot:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought adding this would allow us to simplify the checks here. Otherwise, this just adds more code, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@anshalshukla anshalshukla merged commit 43246bd into main Jun 26, 2026
14 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants