nimbus-eth2/beacon_chain/spec
Etan Kissling f54fa083b4
fix EIP-7044 implementation when using batch verification (#5953)
In #5120, EIP-7044 support got added to the state transition function to
force `CAPELLA_FORK_VERSION` to be used when validiting `VoluntaryExit`
messages, irrespective of their `epoch`.

In #5637, similar logic was added when batch verifying BLS signatures,
which is used during gossip validation (libp2p gossipsub, and req/resp).
However, that logic did not match the one introduced in #5120, and only
uses `CAPELLA_FORK_VERSION` when a `VoluntaryExit`'s `epoch` was set to
a value `>= CAPELLA_FORK_EPOCH`. Otherwise, `BELLATRIX_FORK_VERSION`
would still be used when validating `VoluntaryExit`, e.g., with `epoch`
set to `0`, as is the case in this Holesky block:

- https://holesky.beaconcha.in/slot/1076985#voluntary-exits

Extracting the correct logic from #5120 into a function, and reusing it
when verifying BLS signatures fixes this issue, and also leverages the
exhaustive EF test suite that covers the (correct) #5120 logic.

This fix only affects networks that have EIP-7044 applied (post-Deneb).

Without the fix, Deneb blocks with a `VoluntaryExit` with `epoch` set to
`< CAPELLA_FORK_EPOCH` incorrectly fail to validate despite being valid.

Incorrect blocks that contain a malicious `VoluntaryExit` with `epoch`
set to `< CAPELLA_FORK_EPOCH` and signed using `BELLATRIX_FORK_VERSION`
_would_ pass the BLS verification stage, but subsequently fail the state
transition logic. Such blocks would still correctly be labeled invalid.
2024-02-25 15:25:26 +01:00
..
datatypes initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
eth2_apis initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
mev add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
presets automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00
beacon_time.nim some consensus spec v1.4.0-beta.7 spec URL updates (#5945) 2024-02-22 02:42:57 +00:00
beaconstate.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
block_id.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
crypto.nim remove MIRACL Core support (#5941) 2024-02-22 16:13:31 +00:00
deposit_snapshots.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
digest.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
engine_authentication.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
english_word_list.txt Bump testutils 2020-06-01 16:58:28 +03:00
eth2_merkleization.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
eth2_ssz_serialization.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
forks.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
forks_light_client.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
helpers.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
keystore.nim automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00
light_client_sync.nim add missing `std/` prefix to more imports (#5696) 2024-01-06 07:18:28 +01:00
network.nim automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00
presets.nim add some push raises, ElectraBeaconStateNoImmutableValidators, and ELECTRA_FORK_VERSION/EPOCH (#5949) 2024-02-24 05:08:22 +00:00
signatures.nim fix EIP-7044 implementation when using batch verification (#5953) 2024-02-25 15:25:26 +01:00
signatures_batch.nim fix EIP-7044 implementation when using batch verification (#5953) 2024-02-25 15:25:26 +01:00
ssz_codec.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
state_transition.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
state_transition_block.nim fix EIP-7044 implementation when using batch verification (#5953) 2024-02-25 15:25:26 +01:00
state_transition_epoch.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
validator.nim some consensus spec v1.4.0-beta.7 spec URL updates (#5945) 2024-02-22 02:42:57 +00:00
weak_subjectivity.nim automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00