From 99c44aec7e190ca4c027cb1714837bc301b2a368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ula=C5=9F=20Erdo=C4=9Fan?= Date: Thu, 30 Nov 2023 22:45:49 +0300 Subject: [PATCH] core/vm: change the implementation address to 0x0b --- core/vm/contracts.go | 12 ++++++------ core/vm/contracts_test.go | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 57f4432165..ea675a97fa 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -108,6 +108,12 @@ var PrecompiledContractsCancun = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{0x0a}): &kzgPointEvaluation{}, } +// PrecompiledContractsP256Verify contains the precompiled Ethereum +// contract specified in EIP-7212. This is exported for testing purposes. +var PrecompiledContractsP256Verify = map[common.Address]PrecompiledContract{ + common.BytesToAddress([]byte{0x0b}): &p256Verify{}, +} + // PrecompiledContractsBLS contains the set of pre-compiled Ethereum // contracts specified in EIP-2537. These are exported for testing purposes. var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ @@ -122,12 +128,6 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{18}): &bls12381MapG2{}, } -// PrecompiledContractsP256Verify contains the precompiled Ethereum -// contract specified in EIP-7212. This is exported for testing purposes. -var PrecompiledContractsP256Verify = map[common.Address]PrecompiledContract{ - common.BytesToAddress([]byte{19}): &p256Verify{}, -} - var ( PrecompiledAddressesCancun []common.Address PrecompiledAddressesBerlin []common.Address diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index fc80255598..7657b4972c 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -58,6 +58,8 @@ var allPrecompiles = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{9}): &blake2F{}, common.BytesToAddress([]byte{0x0a}): &kzgPointEvaluation{}, + common.BytesToAddress([]byte{0x0b}): &p256Verify{}, + common.BytesToAddress([]byte{0x0f, 0x0a}): &bls12381G1Add{}, common.BytesToAddress([]byte{0x0f, 0x0b}): &bls12381G1Mul{}, common.BytesToAddress([]byte{0x0f, 0x0c}): &bls12381G1MultiExp{}, @@ -67,8 +69,6 @@ var allPrecompiles = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{0x0f, 0x10}): &bls12381Pairing{}, common.BytesToAddress([]byte{0x0f, 0x11}): &bls12381MapG1{}, common.BytesToAddress([]byte{0x0f, 0x12}): &bls12381MapG2{}, - - common.BytesToAddress([]byte{19}): &p256Verify{}, } // EIP-152 test vectors @@ -405,7 +405,7 @@ func BenchmarkPrecompiledP256Verify(bench *testing.B) { Expected: "0000000000000000000000000000000000000000000000000000000000000001", Name: "p256Verify", } - benchmarkPrecompiled("13", t, bench) + benchmarkPrecompiled("0b", t, bench) } -func TestPrecompiledP256Verify(t *testing.T) { testJson("p256Verify", "13", t) } +func TestPrecompiledP256Verify(t *testing.T) { testJson("p256Verify", "0b", t) }