core/vm: move bls precompiles to correct addresses (#29445)

core: make bls precompiled contract use the correct address as in eip
pull/29499/head
cui 7 months ago committed by GitHub
parent f447de936c
commit 3caf617dcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      core/vm/contracts.go
  2. 18
      tests/fuzzers/bls12381/precompile_fuzzer.go

@ -111,15 +111,15 @@ var PrecompiledContractsCancun = map[common.Address]PrecompiledContract{
// 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{
common.BytesToAddress([]byte{10}): &bls12381G1Add{},
common.BytesToAddress([]byte{11}): &bls12381G1Mul{},
common.BytesToAddress([]byte{12}): &bls12381G1MultiExp{},
common.BytesToAddress([]byte{13}): &bls12381G2Add{},
common.BytesToAddress([]byte{14}): &bls12381G2Mul{},
common.BytesToAddress([]byte{15}): &bls12381G2MultiExp{},
common.BytesToAddress([]byte{16}): &bls12381Pairing{},
common.BytesToAddress([]byte{17}): &bls12381MapG1{},
common.BytesToAddress([]byte{18}): &bls12381MapG2{},
common.BytesToAddress([]byte{11}): &bls12381G1Add{},
common.BytesToAddress([]byte{12}): &bls12381G1Mul{},
common.BytesToAddress([]byte{13}): &bls12381G1MultiExp{},
common.BytesToAddress([]byte{14}): &bls12381G2Add{},
common.BytesToAddress([]byte{15}): &bls12381G2Mul{},
common.BytesToAddress([]byte{16}): &bls12381G2MultiExp{},
common.BytesToAddress([]byte{17}): &bls12381Pairing{},
common.BytesToAddress([]byte{18}): &bls12381MapG1{},
common.BytesToAddress([]byte{19}): &bls12381MapG2{},
}
var (

@ -25,15 +25,15 @@ import (
)
const (
blsG1Add = byte(10)
blsG1Mul = byte(11)
blsG1MultiExp = byte(12)
blsG2Add = byte(13)
blsG2Mul = byte(14)
blsG2MultiExp = byte(15)
blsPairing = byte(16)
blsMapG1 = byte(17)
blsMapG2 = byte(18)
blsG1Add = byte(11)
blsG1Mul = byte(12)
blsG1MultiExp = byte(13)
blsG2Add = byte(14)
blsG2Mul = byte(15)
blsG2MultiExp = byte(16)
blsPairing = byte(17)
blsMapG1 = byte(18)
blsMapG2 = byte(19)
)
func checkInput(id byte, inputLen int) bool {

Loading…
Cancel
Save