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

Misc fix for v1.5.0-alpha.1 #3730

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion specs/_features/eip7594/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@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
)
8 changes: 5 additions & 3 deletions tests/core/pyspec/eth2spec/utils/bls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
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,
Expand Down Expand Up @@ -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

Expand Down
Loading