Skip to content

Commit aff955b

Browse files
authored
new(tests): EIP-2537: Add G2 MSM test for max discount (#1038)
* new(tests): EIP-2537: Max discount G2 MSM test * docs: changelog
1 parent 518fbee commit aff955b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Test fixtures for use by clients are available for each release on the [Github r
1919
-[EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) set code of non-empty-storage account test ([#948](https://github.com/ethereum/execution-spec-tests/pull/948))
2020
-[EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Remove delegation behavior of EXTCODE* ([#984](https://github.com/ethereum/execution-spec-tests/pull/984))
2121
-[EIP-7623](https://eips.ethereum.org/EIPS/eip-7623) Increase calldata cost ([#1004](https://github.com/ethereum/execution-spec-tests/pull/1004))
22+
- ✨ Add test for [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) which uses the full discount table of G2 MSM ([#1038](https://github.com/ethereum/execution-spec-tests/pull/1038))
2223

2324
### 🛠️ Framework
2425

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g2msm.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,24 @@
2020
]
2121

2222

23-
@pytest.mark.parametrize("input_data,expected_output", vectors_from_file("multiexp_G2_bls.json"))
23+
@pytest.mark.parametrize(
24+
"input_data,expected_output",
25+
vectors_from_file("multiexp_G2_bls.json")
26+
+ [
27+
pytest.param(
28+
(Spec.P2 + Scalar(Spec.Q)) * (len(Spec.G2MSM_DISCOUNT_TABLE) - 1),
29+
Spec.INF_G2,
30+
id="max_discount",
31+
marks=pytest.mark.slow,
32+
),
33+
pytest.param(
34+
(Spec.P2 + Scalar(Spec.Q)) * len(Spec.G2MSM_DISCOUNT_TABLE),
35+
Spec.INF_G2,
36+
id="max_discount_plus_1",
37+
marks=pytest.mark.slow,
38+
),
39+
],
40+
)
2441
def test_valid(
2542
state_test: StateTestFiller,
2643
pre: Alloc,

0 commit comments

Comments
 (0)