Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewards tests use genesis epoch #3593

Open
michaelsproul opened this issue Feb 5, 2024 · 1 comment
Open

Rewards tests use genesis epoch #3593

michaelsproul opened this issue Feb 5, 2024 · 1 comment

Comments

@michaelsproul
Copy link
Contributor

The rewards tests use a BeaconState in epoch 0, which isn't compatible with implementations that avoid processing rewards in the genesis epoch.

The process_rewards_and_penalties function does not compute rewards in epoch 0:

def process_rewards_and_penalties(state: BeaconState) -> None:
    # No rewards are applied at the end of `GENESIS_EPOCH` because rewards are for work done in the previous epoch
    if get_current_epoch(state) == GENESIS_EPOCH:
        return
    ...

https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/altair/beacon-chain.md#rewards-and-penalties

In Lighthouse, while moving to single-pass epoch processing we no longer have code for computing individual deltas, and extract the deltas (actually the sum of all deltas) from our single-pass implementation. Single-pass epoch processing (correctly) skips rewards calculations in epoch 0.

@michaelsproul
Copy link
Contributor Author

It seems there's actually only 1 rewards test with the genesis epoch, the empty case:

Test Result
Title: altair/rewards/basic
11 tests, 0 failed, 1 skipped (known failure), 0 skipped (bls), 10 passed. (See below for errors)

-------
case () from /home/michael/Programming/lighthouse3/testing/ef_tests/consensus-spec-tests/tests/mainnet/altair/rewards/basic/pyspec_tests/empty skipped because it's a known failure

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

No branches or pull requests

1 participant