Skip to content

Commit

Permalink
Merge pull request #767 from cffls/jerryc/v0.3.5
Browse files Browse the repository at this point in the history
v0.3.5
  • Loading branch information
cffls authored Mar 6, 2023
2 parents 4561012 + 318b7fa commit 7db8c14
Show file tree
Hide file tree
Showing 20 changed files with 125 additions and 124 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.19.x

- name: Install dependencies on Linux
if: runner.os == 'Linux'
Expand All @@ -51,10 +51,9 @@ jobs:
- name: Build
run: make all

# # TODO: fix LINT not working with go 1.20.x
# - name: Lint
# if: runner.os == 'Linux'
# run: make lint
- name: Lint
if: runner.os == 'Linux'
run: make lint

- name: Test
run: make test
Expand Down Expand Up @@ -99,7 +98,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.18.x

- name: Checkout matic-cli
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.20
go-version: 1.19
- name: Adding TAG to ENV
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.20.x
go-version: 1.19.x

- name: Prepare
id: prepare
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file configures github.com/golangci/golangci-lint.

run:
go: '1.20'
go: '1.18'
timeout: 20m
tests: true
# default is true. Enables skipping of directories:
Expand Down Expand Up @@ -185,4 +185,4 @@ issues:
max-issues-per-linter: 0
max-same-issues: 0
#new: true
new-from-rev: origin/master
new-from-rev: origin/master
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- stage: lint
os: linux
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- lint
git:
Expand All @@ -31,7 +31,7 @@ jobs:
os: linux
arch: amd64
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- docker
services:
Expand All @@ -48,7 +48,7 @@ jobs:
os: linux
arch: arm64
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- docker
services:
Expand All @@ -65,7 +65,7 @@ jobs:
if: type = push
os: linux
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- ubuntu-ppa
- GO111MODULE=on
Expand All @@ -90,7 +90,7 @@ jobs:
os: linux
dist: bionic
sudo: required
go: 1.20.x
go: 1.18.x
env:
- azure-linux
- GO111MODULE=on
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
- sdkmanager "platform-tools" "platforms;android-15" "platforms;android-19" "platforms;android-24" "ndk-bundle"

# Install Go to allow building with
- curl https://dl.google.com/go/go1.20.linux-amd64.tar.gz | tar -xz
- curl https://dl.google.com/go/go1.18.linux-amd64.tar.gz | tar -xz
- export PATH=`pwd`/go/bin:$PATH
- export GOROOT=`pwd`/go
- export GOPATH=$HOME/go
Expand All @@ -162,7 +162,7 @@ jobs:
- stage: build
if: type = push
os: osx
go: 1.20.x
go: 1.18.x
env:
- azure-osx
- azure-ios
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
os: linux
arch: amd64
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- GO111MODULE=on
script:
Expand All @@ -205,7 +205,7 @@ jobs:
os: linux
arch: arm64
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- GO111MODULE=on
script:
Expand All @@ -225,7 +225,7 @@ jobs:
if: type = cron
os: linux
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- azure-purge
- GO111MODULE=on
Expand All @@ -239,7 +239,7 @@ jobs:
if: type = cron
os: linux
dist: bionic
go: 1.20.x
go: 1.18.x
env:
- GO111MODULE=on
script:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alltools
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Geth in a stock Go builder container
FROM golang:1.20-alpine as builder
FROM golang:1.18.1-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ geth-windows-amd64:
@ls -ld $(GOBIN)/geth-windows-* | grep amd64

PACKAGE_NAME := github.com/maticnetwork/bor
GOLANG_CROSS_VERSION ?= v1.20.1
GOLANG_CROSS_VERSION ?= v1.19.1

.PHONY: release-dry-run
release-dry-run:
Expand Down
23 changes: 12 additions & 11 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ Usage: go run build/ci.go <command> <command flags/arguments>
Available commands are:
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
test [ -coverage ] [ packages... ] -- runs the tests
lint -- runs certain pre-selected linters
archive [ -arch architecture ] [ -type zip|tar ] [ -signer key-envvar ] [ -signify key-envvar ] [ -upload dest ] -- archives build artifacts
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
aar [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an Android archive
xcode [ -local ] [ -sign key-id ] [-deploy repo] [ -upload dest ] -- creates an iOS XCode framework
purge [ -store blobstore ] [ -days threshold ] -- purges old archives from the blobstore
For all commands, -n prevents execution of external programs (dry run mode).
*/
package main

Expand Down Expand Up @@ -147,7 +148,7 @@ var (
// This is the version of go that will be downloaded by
//
// go run ci.go install -dlgo
dlgoVersion = "1.20.1"
dlgoVersion = "1.18"
)

var GOBIN, _ = filepath.Abs(filepath.Join("build", "bin"))
Expand Down
28 changes: 19 additions & 9 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/ethereum/go-ethereum/crypto/bn256"
"github.com/ethereum/go-ethereum/params"

//lint:ignore SA1019 Needed for precompile
big2 "github.com/holiman/big"
"golang.org/x/crypto/ripemd160"
)

Expand Down Expand Up @@ -266,9 +266,10 @@ var (
// modexpMultComplexity implements bigModexp multComplexity formula, as defined in EIP-198
//
// def mult_complexity(x):
// if x <= 64: return x ** 2
// elif x <= 1024: return x ** 2 // 4 + 96 * x - 3072
// else: return x ** 2 // 16 + 480 * x - 199680
//
// if x <= 64: return x ** 2
// elif x <= 1024: return x ** 2 // 4 + 96 * x - 3072
// else: return x ** 2 // 16 + 480 * x - 199680
//
// where is x is max(length_of_MODULUS, length_of_BASE)
func modexpMultComplexity(x *big.Int) *big.Int {
Expand Down Expand Up @@ -379,15 +380,24 @@ func (c *bigModExp) Run(input []byte) ([]byte, error) {
}
// Retrieve the operands and execute the exponentiation
var (
base = new(big.Int).SetBytes(getData(input, 0, baseLen))
exp = new(big.Int).SetBytes(getData(input, baseLen, expLen))
mod = new(big.Int).SetBytes(getData(input, baseLen+expLen, modLen))
base = new(big2.Int).SetBytes(getData(input, 0, baseLen))
exp = new(big2.Int).SetBytes(getData(input, baseLen, expLen))
mod = new(big2.Int).SetBytes(getData(input, baseLen+expLen, modLen))
v []byte
)
if mod.BitLen() == 0 {

switch {
case mod.BitLen() == 0:
// Modulo 0 is undefined, return zero
return common.LeftPadBytes([]byte{}, int(modLen)), nil
case base.BitLen() == 1: // a bit length of 1 means it's 1 (or -1).
//If base == 1, then we can just return base % mod (if mod >= 1, which it is)
v = base.Mod(base, mod).Bytes()
default:
v = base.Exp(base, exp, mod).Bytes()
}
return common.LeftPadBytes(base.Exp(base, exp, mod).Bytes(), int(modLen)), nil

return common.LeftPadBytes(v, int(modLen)), nil
}

// newCurvePoint unmarshals a binary blob into a bn256 elliptic curve point,
Expand Down
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ethereum/go-ethereum

go 1.20
go 1.19

require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0
Expand Down Expand Up @@ -71,7 +71,7 @@ require (
go.uber.org/goleak v1.1.12
golang.org/x/crypto v0.0.0-20220507011949-2cf3adece122
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43
golang.org/x/text v0.3.7
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
golang.org/x/tools v0.1.12
Expand All @@ -85,7 +85,10 @@ require (
pgregory.net/rapid v0.4.8
)

require github.com/gammazero/deque v0.2.1 // indirect
require (
github.com/gammazero/deque v0.2.1 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl/v2 v2.10.1 h1:h4Xx4fsrRE26ohAk/1iGF/JBqRQbyUqu5Lvj60U54ys=
github.com/hashicorp/hcl/v2 v2.10.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw=
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
Expand Down Expand Up @@ -660,6 +662,8 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 h1:OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4=
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
Expand Down
Loading

0 comments on commit 7db8c14

Please sign in to comment.