8000 Fix non-deterministic test generation by anumukul · Pull Request #4641 · ethereum/consensus-specs · GitHub
[go: up one dir, main page]

Skip to content

Conversation

anumukul
Copy link
@anumukul anumukul commented Oct 7, 2025

This PR fixes non-deterministic test generation that caused different outputs when running make reftests on different systems.

Changes

  1. Proposer slashing tests: Added random.seed() calls at the start of three test functions to ensure deterministic slot selection
  2. SSZ progressive containers: Sorted the iteration over MODIFIED_PROGRESSIVE_CONTIANERS by class name to ensure consistent ordering

Fixes #4639

Add deterministic random seeding to proposer slashing tests and sort
SSZ progressive container iteration to ensure consistent test output
across different systems.

- Add random.seed() to three proposer slashing tests in gloas
- Sort MODIFIED_PROGRESSIVE_CONTIANERS iteration by class name

Fixes ethereum#4639
@jtraglia
Copy link
Member
jtraglia commented Oct 7, 2025

Hey @anumukul thanks for the PR!

(0) Could you run make lint to fix the linter?

(1) Could you include a fix for this typo I noticed? Unrelated to your fix.

MODIFIED_PROGRESSIVE_CONTIANERS: Sequence[type[View]] = {

(2) What about sanity/blocks/pyspec_tests/mix_blob_tx_and_non_blob_tx tests?

(3) Did you test these yourself? For example, from the consensus-specs directory, you can do something like:

  • make clean
  • rm -rf ../consensus-spec-tests # or move it elsewhere
  • make reftests runner=operations

And then compare the consensus-spec-tests between multiple runs.

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.

Make reftest generation reproducible
2 participants
0