Skip to content

Commit

Permalink
feat(forks): Add BLS precompiles to Prague
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed May 1, 2024
1 parent 33dcfcf commit 7af9e28
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,20 @@ def solc_min_version(cls) -> Version:
Returns the minimum version of solc that supports this fork.
"""
return Version.parse("1.0.0") # set a high version; currently unknown

@classmethod
def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[int]:
"""
At Prague, pre-compile for BLS operations are added:
G1ADD = 0x0B
G1MUL = 0x0C
G1MSM = 0x0D
G2ADD = 0x0E
G2MUL = 0x0F
G2MSM = 0x10
PAIRING = 0x11
MAP_FP_TO_G1 = 0x12
MAP_FP2_TO_G2 = 0x13
"""
return list(range(0xB, 0x13 + 1)) + super(Prague, cls).precompiles(block_number, timestamp)

0 comments on commit 7af9e28

Please sign in to comment.