Skip to content

Commit

Permalink
new(tests): EIP-2537: Add G2 MSM test for max discount (#1038)
Browse files Browse the repository at this point in the history
* new(tests): EIP-2537: Max discount G2 MSM test

* docs: changelog
  • Loading branch information
marioevz authored Jan 10, 2025
1 parent 518fbee commit aff955b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Test fixtures for use by clients are available for each release on the [Github r
-[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))
-[EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Remove delegation behavior of EXTCODE* ([#984](https://github.com/ethereum/execution-spec-tests/pull/984))
-[EIP-7623](https://eips.ethereum.org/EIPS/eip-7623) Increase calldata cost ([#1004](https://github.com/ethereum/execution-spec-tests/pull/1004))
- ✨ 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))

### 🛠️ Framework

Expand Down
19 changes: 18 additions & 1 deletion tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g2msm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@
]


@pytest.mark.parametrize("input_data,expected_output", vectors_from_file("multiexp_G2_bls.json"))
@pytest.mark.parametrize(
"input_data,expected_output",
vectors_from_file("multiexp_G2_bls.json")
+ [
pytest.param(
(Spec.P2 + Scalar(Spec.Q)) * (len(Spec.G2MSM_DISCOUNT_TABLE) - 1),
Spec.INF_G2,
id="max_discount",
marks=pytest.mark.slow,
),
pytest.param(
(Spec.P2 + Scalar(Spec.Q)) * len(Spec.G2MSM_DISCOUNT_TABLE),
Spec.INF_G2,
id="max_discount_plus_1",
marks=pytest.mark.slow,
),
],
)
def test_valid(
state_test: StateTestFiller,
pre: Alloc,
Expand Down

0 comments on commit aff955b

Please sign in to comment.