Skip to content

Add Gloas fork choice test for new validator deposit#4960

Open
unnawut wants to merge 16 commits intoethereum:masterfrom
unnawut:gloas-deposit-with-reorg
Open

Add Gloas fork choice test for new validator deposit#4960
unnawut wants to merge 16 commits intoethereum:masterfrom
unnawut:gloas-deposit-with-reorg

Conversation

@unnawut
Copy link
Copy Markdown

@unnawut unnawut commented Mar 3, 2026

Description

Attempting to resolve the TODO in electra's test_new_validator_deposit_with_multiple_epoch_transitions

  • Add test_new_validator_deposit_with_multiple_epoch_transitions() for Gloas, covering deposit processing through fork choice with reorgs, basically the same goal as Electra's test case but with support for execution payload commit & reveal
    • Added as a separate test rather than updating Electra's because it requires multiple branching: creating the execution requests with the deposit request, not having the deposit request in the block body, creating and applying the execution payload envelope. I think this way is more readable but tbh I'm not sure what's the best practice for this. Happy to change though.
  • Move prepare_execution_payload_envelope() from the test case file to the helper file because it's now being used by both test_process_execution_payload.py and test_deposit_with_reorg.py
    • Again I'm not too familiar with the best practices in this repo. Happy to move it back but the import will be a bit counterintuitive to import function from another test case
  • Update test/helpers/execution_payload.py:
    • Add reveal_payload_to_state() that prepares and processes the execution payload envelope
  • Update test/helpers/attestations.py:
    • state_transition_with_full_block() accepts envelopes where if provided, it'll perform reveal_payload_to_state() after state transition
  • Update test/helpers/fork_choice.py:
    • tick_and_add_block() accepts optional envelope and triggers on_execution_payload() if envelope provided
    • apply_next_slots_with_attestations() accepts with_payload_reveal so it knows to check store.payload_states if the flag is present

Checklist

  • Run make lint
  • Run make test fork=gloas k=test_new_validator_deposit_with_multiple_epoch_transitions
  • Run make reftests fork=gloas runner=fork_choice

@github-actions github-actions bot added the testing CI, actions, tests, testing infra label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing CI, actions, tests, testing infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants