Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync master subnet-evm latest #27

Merged
merged 54 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
954fe72
- Adding missing import "encoding/json" (used in Stringer-method) (#465)
itinance Jan 31, 2023
01a16a0
fix allow list comments (#469)
ceyonur Jan 31, 2023
009c86f
add nil checks (#473)
ceyonur Feb 1, 2023
1955873
Warp backend interface and implementation (#452)
minghinmatthewlam Feb 1, 2023
5dfa34f
Add documentation section to PR template (#484)
aaronbuchwald Feb 3, 2023
7aa90d0
remove current rules (#481)
ceyonur Feb 5, 2023
7887607
add documentation guidelines (#486)
darioush Feb 6, 2023
c667f95
parseInt from ENV var (#491)
ceyonur Feb 6, 2023
50da2fd
Add generate precompile script to fix CGO flags issue (#489)
aaronbuchwald Feb 6, 2023
fe5e55c
try to fix lint job (#499)
darioush Feb 8, 2023
40c5212
build with avago v1.9.8 (#498)
cam-schultz Feb 8, 2023
0731a82
Signature Request Handler (#459)
minghinmatthewlam Feb 9, 2023
8343e42
Update codeowners (#492)
aaronbuchwald Feb 9, 2023
38ad7f5
Get signature endpoint: alternative PR with different packaging (#507)
darioush Feb 10, 2023
93c60bb
Update github actions to ignore rcs (#521)
aaronbuchwald Feb 17, 2023
d74a3f0
Remove unnecessary gasprice updater logic and tests (#514)
aaronbuchwald Feb 17, 2023
4209aa4
Bump avalanchego to v1.9.9-rc.4 (#526)
aaronbuchwald Feb 20, 2023
8040623
Bump AvalancheGo dep to v1.9.9 (#530)
aaronbuchwald Feb 21, 2023
22d56f1
Update AvalancheGo compatibility (#531)
aaronbuchwald Feb 21, 2023
9e47da2
Start v0.4.10 release cycle (#533)
aaronbuchwald Feb 21, 2023
c1115ed
Stateful Precompile Improvements (#389)
ceyonur Feb 22, 2023
4455733
fix e2e comment in readme (#540)
ceyonur Feb 23, 2023
1d7b284
fix config template for precompilegen (#538)
darioush Feb 23, 2023
83f9c0e
Update compatibility in README for v0.4.10 (#542)
aaronbuchwald Feb 23, 2023
1350d27
Bump minimum golang version to v1.20.1 (#548)
aaronbuchwald Feb 28, 2023
03c6f3b
add whitespace (#544)
ceyonur Feb 28, 2023
67a5db7
Set minimum golang version to go1.19.6 (#551)
patrick-ogrady Mar 1, 2023
e3c0cc5
add custom marshaller for GetChainConfigResponse api (#546)
ceyonur Mar 2, 2023
ed0f30a
Start coreth migration (#552)
aaronbuchwald Mar 2, 2023
9a4adac
Start release cycle v0.4.12 (#559)
aaronbuchwald Mar 7, 2023
d4e1b34
remove stderr pipelining (#562)
ceyonur Mar 7, 2023
1623a87
Add ChainConfig JSON Unmarshaller (#554)
ceyonur Mar 7, 2023
694f922
Update codeql to v2 (#566)
aaronbuchwald Mar 7, 2023
8b776d6
state modifications as network upgrade (#549)
darioush Mar 8, 2023
cda6bf5
Fix Dockerfile and add Build Image to GH Actions (#561)
aaronbuchwald Mar 9, 2023
8a28b23
add compatibility to readme (#568)
darioush Mar 9, 2023
8f8ae38
Precompile pre post handling (#524)
aaronbuchwald Mar 16, 2023
6f61b14
Warp preparation (#573)
aaronbuchwald Mar 16, 2023
7b9e010
convert from int->uint for more clarity (#575)
darioush Mar 17, 2023
0b8426d
release tickers on shutdown (#574)
darioush Mar 17, 2023
2784ae6
simplify functionSignatureRegex (#578)
darioush Mar 17, 2023
2e8dc27
Remove unused imgs from repo (#580)
aaronbuchwald Mar 17, 2023
5fe44fd
Matches go-ethereum/pull/26912/files (#582)
darioush Mar 17, 2023
eec3cd5
Add ignore unnecessary import to precompile contract template (#581)
aaronbuchwald Mar 17, 2023
2efe2bc
trie, accounts/abi: nits: adds err checks (#583)
darioush Mar 20, 2023
dbfbb98
Adds a test for PeerTracker (#576)
darioush Mar 20, 2023
6536027
Merge branch 'master' into hubble-v2
vipulsharma21 Mar 20, 2023
6e4e2da
upgrade avalanche go and add logs
vipulsharma21 Mar 21, 2023
5606bc9
update avalanche go version
vipulsharma21 Mar 22, 2023
87b0007
add gotenv and get env variables from .env file
vipulsharma21 Mar 22, 2023
ae0eea2
Revert "add gotenv and get env variables from .env file"
vipulsharma21 Mar 23, 2023
08d9910
refactoring
vipulsharma21 Mar 23, 2023
2241426
upgrade avalanche go to v1.9.14
vipulsharma21 Mar 23, 2023
d194e1e
use GRPC_ prefix in env variable to inject env variables
vipulsharma21 Mar 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VALIDATOR_PRIVATE_KEY=31b571bf6894a248831ff937bb49f7754509fe93bbd2517c9c73c4144c0e97dc
FOO=BAR
vipulsharma21 marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 4 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

# review whenever someone opens a pull request.

* @ceyonur @darioush @patrick-ogrady @aaronbuchwald
* @ceyonur @darioush @aaronbuchwald

# These owners will be the owner of the contract-examples sub-directory.

contract-examples/ @dasconnor @anusha-ctrl

# These owners will be the owner of the scripts sub-directory.
# Specific directories:

peer/ @anusha-ctrl
contract-examples/ @anusha-ctrl
scripts/ @anusha-ctrl
17 changes: 14 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,31 @@ well as our review and merge procedures quick and simple.

## Coding guidelines

Please make sure your contributions adhere to our coding guidelines:
Please make sure your contributions adhere to our coding and documentation
guidelines:

- Code must adhere to the official Go
[formatting](https://golang.org/doc/effective_go.html#formatting) guidelines
(i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
- Code must be documented adhering to the official Go
[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
- Pull requests need to be based on and opened against the `master` branch.
- Pull reuqests should include a detailed description
- Commits are required to be signed. See [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
for information on signing commits.
- Commit messages should be prefixed with the package(s) they modify.
- E.g. "eth, rpc: make trace configs optional"

## Documentation guidelines

- Code should be well commented, so it is easier to read and maintain.
Any complex sections or invariants should be documented explicitly.
- Code must be documented adhering to the official Go
[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
- Changes with user facing impact (e.g., addition or modification of flags and
options) should be accompanied by a link to a pull request to the [avalanche-docs](https://github.com/ava-labs/avalanche-docs)
repository. [example](https://github.com/ava-labs/avalanche-docs/pull/1119/files).
- Changes that modify a package significantly or add new features should
either update the existing or include a new `README.md` file in that package.

## Can I have feature X

Before you submit a feature request, please check and make sure that it isn't
Expand Down
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
## How this works

## How this was tested

## How is this documented
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build + Test + Lint

on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:

jobs:
lint_test:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: ./scripts/lint_allowed_geth_imports.sh
shell: bash
- uses: actions/setup-go@v3
with:
go-version: "1.19"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
working-directory: .
args: --timeout 3m

unit_test:
name: Golang Unit Tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.19"
- run: go mod download
shell: bash
- run: ./scripts/build.sh ./build/subnetevm
shell: bash
- run: ./scripts/build_test.sh -race
shell: bash
- run: ./scripts/coverage.sh
shell: bash

build_image:
name: Build Docker Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: echo ${{ secrets.docker_pass }} | docker login --username ${{ secrets.docker_username }} --password-stdin
shell: bash
- run: CURRENT_BRANCH=${{ github.head_ref || github.ref_name }} PUSH_DOCKER_IMAGE=true ./scripts/build_image.sh
shell: bash

e2e_test:
name: e2e tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19"
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "14.x"
- name: Yarn install
run: yarn
working-directory: ./contract-examples
- name: Install AvalancheGo Release
shell: bash
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Run E2E Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '44 11 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
queries: security-extended

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
# needs: [lint_test, unit_test, e2e_test, simulator_test]
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
path: subnet-evm
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.19"
- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Checkout osxcross
uses: actions/checkout@v2
with:
repository: tpoechtrager/osxcross
path: osxcross
- name: Build osxcross
run: |
sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
cd osxcross
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz
echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c -
UNATTENDED=1 ./build.sh
echo $PWD/target/bin >> $GITHUB_PATH
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
workdir: ./subnet-evm/
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ contract-examples/dynamic_rpc.json
plugins/evm/hubble.db

*.bin

local_status.sh
30 changes: 1 addition & 29 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ run:
linters:
disable-all: true
enable:
- deadcode
- goconst
- goimports
- gosimple
- govet
- ineffassign
- misspell
- unconvert
- varcheck
- unused
- whitespace

linters-settings:
Expand All @@ -29,30 +28,3 @@ linters-settings:
goconst:
min-len: 3 # minimum length of string constant
min-occurrences: 6 # minimum number of occurrences

issues:
exclude-rules:
- path: crypto/blake2b/
linters:
- deadcode
- path: crypto/bn256/cloudflare
linters:
- deadcode
- path: p2p/discv5/
linters:
- deadcode
- path: core/vm/instructions_test.go
linters:
- goconst
- path: cmd/faucet/
linters:
- deadcode
- path: core/types/gen_account_rlp.go
linters:
- goimports
- path: core/types/gen_header_rlp.go
linters:
- goimports
- path: core/types/gen_log_rlp.go
linters:
- goimports
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
ARG AVALANCHE_VERSION

# ============= Compilation Stage ================
FROM golang:1.18.5-buster AS builder
RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64
FROM golang:1.19.6-buster AS builder
RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64

WORKDIR /build

Expand All @@ -15,7 +15,7 @@ WORKDIR /build
COPY go.mod go.sum avalanchego* ./

# Download avalanche dependencies using go mod
RUN go mod download && go mod tidy -compat=1.18
RUN go mod download && go mod tidy -compat=1.19

# Copy the code into the container
COPY . .
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and
[v0.4.5] AvalancheGo@v1.9.4 (Protocol Version: 20)
[v0.4.6] AvalancheGo@v1.9.4 (Protocol Version: 20)
[v0.4.7] AvalancheGo@v1.9.5 (Protocol Version: 21)
[v0.4.8] AvalancheGo@v1.9.6-v1.9.7 (Protocol Version: 22)
[v0.4.8] AvalancheGo@v1.9.6-v1.9.8 (Protocol Version: 22)
[v0.4.9] AvalancheGo@v1.9.9 (Protocol Version: 23)
[v0.4.10] AvalancheGo@v1.9.9 (Protocol Version: 23)
[v0.4.11] AvalancheGo@v1.9.10 (Protocol Version: 24)
[v0.4.12] AvalancheGo@v1.9.10 (Protocol Version: 24)
```

## API
Expand Down Expand Up @@ -92,7 +96,7 @@ To support these changes, there have been a number of changes to the SubnetEVM b

### Clone Subnet-evm

First install Go 1.18.1 or later. Follow the instructions [here](https://golang.org/doc/install). You can verify by running `go version`.
First install Go 1.19.6 or later. Follow the instructions [here](https://golang.org/doc/install). You can verify by running `go version`.

Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Please read [this](https://go.dev/doc/gopath_code) for details. You can verify by running `echo $GOPATH`.

Expand Down
6 changes: 5 additions & 1 deletion accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (abi ABI) Pack(name string, args ...interface{}) ([]byte, error) {
// Returns the topics for the event including the event signature (if non-anonymous event) and
// hashes derived from indexed arguments and the packed data of non-indexed args according to
// the event ABI specification.
// The order of arguments must match the order of the event definition.
// https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#indexed-event-encoding.
// Note: PackEvent does not support array (fixed or dynamic-size) or struct types.
func (abi ABI) PackEvent(name string, args ...interface{}) ([]common.Hash, []byte, error) {
Expand Down Expand Up @@ -364,7 +365,10 @@ func UnpackRevert(data []byte) (string, error) {
if !bytes.Equal(data[:4], revertSelector) {
return "", errors.New("invalid data for unpacking")
}
typ, _ := NewType("string", "", nil)
typ, err := NewType("string", "", nil)
if err != nil {
return "", err
}
unpacked, err := (Arguments{{Type: typ}}).Unpack(data[4:])
if err != nil {
return "", err
Expand Down
Loading