Skip to content

Commit

Permalink
core/vm: move bls precompiles to correct addresses (ethereum#29445)
Browse files Browse the repository at this point in the history
core: make bls precompiled contract use the correct address as in eip
  • Loading branch information
cuiweixie authored and jorgemmsilva committed Jun 17, 2024
1 parent b69c4a8 commit 77c43b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
18 changes: 9 additions & 9 deletions tests/fuzzers/bls12381/precompile_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 77c43b5

Please sign in to comment.