Skip to content

Commit b80f05b

Browse files
authored
core/vm: use golang native big.Int (ethereum#26834)
reverts ethereum#26021, to use the upstream bigint instead.
1 parent e14043d commit b80f05b

File tree

7 files changed

+4
-193
lines changed

7 files changed

+4
-193
lines changed

common/math/modexp_test.go

-53
This file was deleted.

core/vm/contracts.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/ethereum/go-ethereum/crypto/bls12381"
3030
"github.com/ethereum/go-ethereum/crypto/bn256"
3131
"github.com/ethereum/go-ethereum/params"
32-
big2 "github.com/holiman/big"
3332
"golang.org/x/crypto/ripemd160"
3433
)
3534

@@ -378,9 +377,9 @@ func (c *bigModExp) Run(input []byte) ([]byte, error) {
378377
}
379378
// Retrieve the operands and execute the exponentiation
380379
var (
381-
base = new(big2.Int).SetBytes(getData(input, 0, baseLen))
382-
exp = new(big2.Int).SetBytes(getData(input, baseLen, expLen))
383-
mod = new(big2.Int).SetBytes(getData(input, baseLen+expLen, modLen))
380+
base = new(big.Int).SetBytes(getData(input, 0, baseLen))
381+
exp = new(big.Int).SetBytes(getData(input, baseLen, expLen))
382+
mod = new(big.Int).SetBytes(getData(input, baseLen+expLen, modLen))
384383
v []byte
385384
)
386385
switch {

go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ require (
3535
github.com/gorilla/websocket v1.4.2
3636
github.com/graph-gophers/graphql-go v1.3.0
3737
github.com/hashicorp/go-bexpr v0.1.10
38-
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e
3938
github.com/holiman/bloomfilter/v2 v2.0.3
4039
github.com/holiman/uint256 v1.2.0
4140
github.com/huin/goupnp v1.0.3
@@ -45,6 +44,7 @@ require (
4544
github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e
4645
github.com/julienschmidt/httprouter v1.3.0
4746
github.com/karalabe/usb v0.0.2
47+
github.com/kylelemons/godebug v1.1.0
4848
github.com/mattn/go-colorable v0.1.13
4949
github.com/mattn/go-isatty v0.0.16
5050
github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416
@@ -98,7 +98,6 @@ require (
9898
github.com/klauspost/compress v1.15.15 // indirect
9999
github.com/kr/pretty v0.3.1 // indirect
100100
github.com/kr/text v0.2.0 // indirect
101-
github.com/kylelemons/godebug v1.1.0 // indirect
102101
github.com/mattn/go-runewidth v0.0.9 // indirect
103102
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
104103
github.com/mitchellh/mapstructure v1.4.1 // indirect

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09
293293
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
294294
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
295295
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
296-
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw=
297-
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU=
298296
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
299297
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
300298
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=

oss-fuzz.sh

-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,5 @@ compile_fuzzer tests/fuzzers/snap FuzzSRange fuzz_storage_range
125125
compile_fuzzer tests/fuzzers/snap FuzzByteCodes fuzz_byte_codes
126126
compile_fuzzer tests/fuzzers/snap FuzzTrieNodes fuzz_trie_nodes
127127

128-
compile_fuzzer tests/fuzzers/modexp Fuzz fuzzModexp
129-
130128
#TODO: move this to tests/fuzzers, if possible
131129
compile_fuzzer crypto/blake2b Fuzz fuzzBlake2b

tests/fuzzers/modexp/debug/main.go

-40
This file was deleted.

tests/fuzzers/modexp/modexp-fuzzer.go

-90
This file was deleted.

0 commit comments

Comments
 (0)