nimbus-eth2/beacon_chain
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
..
consensus_object_pools fix EIP-7044 implementation when using batch verification (#5953) 2024-02-25 15:25:26 +01:00
el initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
fork_choice automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00
gossip_processing initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
libnimbus_lc automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00
networking initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
rpc initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
spec fix EIP-7044 implementation when using batch verification (#5953) 2024-02-25 15:25:26 +01:00
sync add some push raises, ElectraBeaconStateNoImmutableValidators, and ELECTRA_FORK_VERSION/EPOCH (#5949) 2024-02-24 05:08:22 +00:00
validator_client initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
validators initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
.editorconfig Add .editorconfig file and remove trailing newlines 2021-09-14 12:12:49 +03:00
.gitignore
beacon_chain_db.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
beacon_chain_db_immutable.nim add some push raises, ElectraBeaconStateNoImmutableValidators, and ELECTRA_FORK_VERSION/EPOCH (#5949) 2024-02-24 05:08:22 +00:00
beacon_chain_db_light_client.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
beacon_clock.nim add metric for database checkpoint duration (#5897) 2024-02-19 11:00:11 +01:00
beacon_node.nim implement blob_sidecar Beacon API streaming (#5728) 2024-01-13 11:52:13 +02:00
beacon_node_light_client.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
beacon_node_status.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
conf.nim rm some unnecessary stew/shims/net imports to reduce deprecation warnings (#5806) 2024-01-20 16:42:19 +00:00
conf_common.nim Dissect Windows specific code from beacon node. (#5612) 2024-01-13 12:53:53 +02:00
conf_light_client.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
db_limits.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
deposits.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
era_db.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
extras.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
filepath.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
future_combinators.nim BN+LC+SN: Fix cancellation deprecate warnings. (#5455) 2023-09-22 11:06:27 +00:00
light_client.nim raises for gossip (#5808) 2024-01-22 17:34:54 +01:00
light_client_db.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
nim.cfg chronos: bump (#5684) 2024-01-05 10:08:38 +01:00
nimbus_beacon_node.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
nimbus_beacon_node.nim.cfg remove `news` leftovers (#4299) 2022-11-08 20:06:54 +00:00
nimbus_binary_common.nim Dissect Windows specific code from beacon node. (#5612) 2024-01-13 12:53:53 +02:00
nimbus_light_client.nim raises for gossip (#5808) 2024-01-22 17:34:54 +01:00
nimbus_light_client.nim.cfg remove `news` leftovers (#4299) 2022-11-08 20:06:54 +00:00
nimbus_signing_node.nim initial Electra support skeleton (#5946) 2024-02-24 13:44:15 +00:00
nimbus_signing_node.nim.cfg Revert writing backfill root to database (#3215) 2021-12-21 11:40:14 +01:00
nimbus_validator_client.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
nimbus_validator_client.nim.cfg remove `news` leftovers (#4299) 2022-11-08 20:06:54 +00:00
sszdump.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
statediff.nim Shared validator pubkey (#5883) 2024-02-21 20:06:19 +01:00
statusbar.nim verify `genesis_time` more strictly (fixes #1667) (#5694) 2024-01-06 15:26:56 +01:00
trusted_node_sync.nim automated consensus spec URL updating to v1.4.0-beta.7 (#5942) 2024-02-21 19:44:48 +00:00
version.nim Version v24.2.1 2024-02-20 05:49:56 +02:00
wallets.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00
winservice.nim add `{.push raises: [].}` to recently modified files (#5908) 2024-02-18 01:16:49 +00:00