This commit is contained in:
Hsiao-Wei Wang 2024-04-27 12:11:29 +08:00
parent b625daf421
commit a4e04ebf64
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
6 changed files with 22 additions and 17 deletions

View File

@ -52,14 +52,13 @@ DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
# Electra
ELECTRA_FORK_VERSION: 0x05000000
ELECTRA_FORK_EPOCH: 18446744073709551615
ELECTRA_FORK_EPOCH: 18446744073709551615 # temporary stub
# EIP7594
EIP7594_FORK_VERSION: 0x06000000 # temporary stub
EIP7594_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------

View File

@ -52,12 +52,12 @@ DENEB_FORK_EPOCH: 18446744073709551615
# Electra
ELECTRA_FORK_VERSION: 0x05000001
ELECTRA_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000001
WHISK_FORK_EPOCH: 18446744073709551615
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000001
WHISK_FORK_EPOCH: 18446744073709551615
# Time parameters
# ---------------------------------------------------------------

View File

@ -28,7 +28,7 @@ Warning: this configuration is not definitive.
| Name | Value |
| - | - |
| `EIP7594_FORK_VERSION` | `Version('0x05000000')` |
| `EIP7594_FORK_VERSION` | `Version('0x06000000')` |
| `EIP7594_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
## Helper functions

View File

@ -338,26 +338,30 @@ def run_randomized_non_validated_execution_fields_test(spec, state, execution_va
@with_bellatrix_and_later
@spec_state_test
def test_randomized_non_validated_execution_fields_first_payload__execution_valid(spec, state):
rng = Random(1111)
state = build_state_with_incomplete_transition(spec, state)
yield from run_randomized_non_validated_execution_fields_test(spec, state)
yield from run_randomized_non_validated_execution_fields_test(spec, state, rng=rng)
@with_bellatrix_and_later
@spec_state_test
def test_randomized_non_validated_execution_fields_regular_payload__execution_valid(spec, state):
rng = Random(2222)
state = build_state_with_complete_transition(spec, state)
yield from run_randomized_non_validated_execution_fields_test(spec, state)
yield from run_randomized_non_validated_execution_fields_test(spec, state, rng=rng)
@with_bellatrix_and_later
@spec_state_test
def test_invalid_randomized_non_validated_execution_fields_first_payload__execution_invalid(spec, state):
rng = Random(3333)
state = build_state_with_incomplete_transition(spec, state)
yield from run_randomized_non_validated_execution_fields_test(spec, state, execution_valid=False)
yield from run_randomized_non_validated_execution_fields_test(spec, state, execution_valid=False, rng=rng)
@with_bellatrix_and_later
@spec_state_test
def test_invalid_randomized_non_validated_execution_fields_regular_payload__execution_invalid(spec, state):
rng = Random(4444)
state = build_state_with_complete_transition(spec, state)
yield from run_randomized_non_validated_execution_fields_test(spec, state, execution_valid=False)
yield from run_randomized_non_validated_execution_fields_test(spec, state, execution_valid=False, rng=rng)

View File

@ -7,6 +7,6 @@ from eth2spec.test.phase0.epoch_processing.test_process_effective_balance_update
@with_electra_and_later
@spec_state_test
def test_effective_balance_hysteresis_with_compounding_credentials(spec, state):
run_test_effective_balance_hysteresis(
yield from run_test_effective_balance_hysteresis(
spec, state, with_compounding_credentials=True
)

View File

@ -11,6 +11,8 @@ from py_ecc.optimized_bls12_381 import ( # noqa: F401
pairing as py_ecc_pairing,
final_exponentiate as py_ecc_final_exponentiate,
FQ12 as py_ecc_GT,
FQ,
FQ2,
)
from py_ecc.bls.g2_primitives import ( # noqa: F401
curve_order as BLS_MODULUS,
@ -252,14 +254,14 @@ def multi_exp(points, integers):
raise Exception("Invalid point type")
result = None
if isinstance(points[0], py_ecc_G1):
if isinstance(points[0][0], FQ):
result = Z1()
elif isinstance(points[0], py_ecc_G2):
elif isinstance(points[0][0], FQ2):
result = Z2()
else:
raise Exception("Invalid point type")
for point, scalar in points.zip(integers):
for point, scalar in zip(points, integers):
result = add(result, multiply(point, scalar))
return result