mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-12 10:36:32 +00:00
Electra introduces two changes that affect light client data handling: 1. The `ExecutionPayloadHeader` is extended with new fields. This is handled similarly as before with the Deneb fork. 2. The `BeaconState` generalized indices change due to lack of EIP-6493. This is handled by making the generalized index be fork dependent via a helper function that computes it dynamically. Furthermore, the case where pre-Electra light client data is consumed by an Electra based `LightClientStore` requires normalizing the shorter proof of the pre-Electra data to fit into the Electra data structure by prepending a zero hash.
29 lines
919 B
Python
29 lines
919 B
Python
from eth2spec.test.helpers.constants import ALTAIR, BELLATRIX, CAPELLA, DENEB, ELECTRA
|
|
from eth2spec.gen_helpers.gen_from_tests.gen import combine_mods, run_state_test_generators
|
|
|
|
|
|
if __name__ == "__main__":
|
|
altair_mods = {key: 'eth2spec.test.altair.light_client.test_' + key for key in [
|
|
'single_merkle_proof',
|
|
'sync',
|
|
'update_ranking',
|
|
]}
|
|
bellatrix_mods = altair_mods
|
|
|
|
_new_capella_mods = {key: 'eth2spec.test.capella.light_client.test_' + key for key in [
|
|
'single_merkle_proof',
|
|
]}
|
|
capella_mods = combine_mods(_new_capella_mods, bellatrix_mods)
|
|
deneb_mods = capella_mods
|
|
electra_mods = deneb_mods
|
|
|
|
all_mods = {
|
|
ALTAIR: altair_mods,
|
|
BELLATRIX: bellatrix_mods,
|
|
CAPELLA: capella_mods,
|
|
DENEB: deneb_mods,
|
|
ELECTRA: electra_mods,
|
|
}
|
|
|
|
run_state_test_generators(runner_name="light_client", all_mods=all_mods)
|