Skip to content

fix lean-spec-tests-state-transition hive suite - #122

Merged
ArtiomTr merged 1 commit into
grandinetech:devnet-5from
SoarinSkySagar:st
Aug 13, 2026
Merged

fix lean-spec-tests-state-transition hive suite#122
ArtiomTr merged 1 commit into
grandinetech:devnet-5from
SoarinSkySagar:st

Conversation

@SoarinSkySagar

@SoarinSkySagar SoarinSkySagar commented Aug 5, 2026

Copy link
Copy Markdown

Brings the state-transition spec-test suite to green against the devnet-5 fixtures.

Why it was failing

  • Fixture schema drift: devnet-5 renamed the test field expect_exceptionrejection_reason, and some fixtures now omit post.slot. Our deserializer still expected the old names and a mandatory slot, so those cases failed to parse.
  • Missing edge-case invariants: new fixtures cover empty validator registries, empty aggregation bits, and attestations referencing slots beyond the chain view. The client either panicked (assert! on empty indices, out-of-bounds historical_block_hashes.get()) or failed to reject inputs the spec expects to be rejected.

How it's fixed

  • Updated TestCase/PostState to the new field names and made post.slot optional; the runner now only checks the slot when a fixture provides it.
  • Replaced panics in state transition with graceful ensure!/skip logic: reject proposer scheduling on an empty validator set, reject empty aggregation bits, and skip attestations whose source/target/head slot is past the chain view.
  • Reworked the empty-blocks rejection probe in test_driver to build and run a header through process_block_header so the invariant actually fires and surfaces as succeeded: false.
  • Realigned the fork-choice validator unit tests with the updated produce_block/build_block signatures.

@ArtiomTr ArtiomTr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, but:

  1. Please fix merge conflicts
  2. Squash your commits
  3. Provide readable PR title + description. We don't use chore:/feat:/etc. prefixes, so you can just use plain title for that.

@SoarinSkySagar SoarinSkySagar changed the title chore: fix lean-spec-tests-state-transition suite fix lean-spec-tests-state-transition hive suite Aug 10, 2026
@SoarinSkySagar

Copy link
Copy Markdown
Author

@ArtiomTr ready for review again

@ArtiomTr ArtiomTr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

perfect 👍

@ArtiomTr
ArtiomTr merged commit 575f2f6 into grandinetech:devnet-5 Aug 13, 2026
2 of 3 checks passed
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.

2 participants