Skip to content

Commit 3c23c20

Browse files
committed
Upgrade to Avalanche v1.10.0
1 parent 10e9520 commit 3c23c20

File tree

1,758 files changed

+106204
-54056
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,758 files changed

+106204
-54056
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# go-flare
22

3-
go-flare is a modified version of [avalanchego@v1.9.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.9.0) and [coreth@v0.11.0](https://github.com/ava-labs/coreth/releases/tag/v0.11.0), incorporating specific features for Flare and Songbird networks. These features include prioritized contract handling and the invocation of the daemon contract.
4-
5-
All nodes should upgrade to the version 1.9.1 **before the following dates**:
6-
- Coston2 network: November 26, 2024 at 12:00:00 UTC
7-
- Flare network: December 17, 2024 at 12:00:00 UTC
8-
- Coston network: January 7, 2025 at 12:00:00 UTC
9-
- Songbird network: January 28, 2025 at 12:00:00 UTC
3+
go-flare is a modified version of [avalanchego@v1.10.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0) and [coreth@v0.12.0](https://github.com/ava-labs/coreth/releases/tag/v0.12.0), incorporating specific features for Flare and Songbird networks. These features include prioritized contract handling and the invocation of the daemon contract.
104

115
## System Requirements
126
- go version 1.21.8

avalanchego/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ tests/e2e/e2e.test
6060
tests/upgrade/upgrade.test
6161

6262
vendor
63+
64+
**/testdata

avalanchego/.golangci.yml

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ run:
44
# skip auto-generated files.
55
skip-files:
66
- ".*\\.pb\\.go$"
7+
- ".*mock.*"
78

89
issues:
910
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
@@ -15,6 +16,7 @@ linters:
1516
disable-all: true
1617
enable:
1718
- asciicheck
19+
- bodyclose
1820
- depguard
1921
- errcheck
2022
- exportloopref
@@ -23,35 +25,79 @@ linters:
2325
- gofmt
2426
- gofumpt
2527
- goimports
26-
- revive
28+
- goprintffuncname
2729
- gosec
2830
- gosimple
2931
- govet
3032
- ineffassign
3133
- misspell
3234
- nakedret
35+
- noctx
3336
- nolintlint
3437
- prealloc
38+
- revive
39+
- staticcheck
3540
- stylecheck
41+
- typecheck
3642
- unconvert
3743
- unparam
3844
- unused
39-
- unconvert
4045
- whitespace
41-
- staticcheck
42-
# - bodyclose
43-
# - structcheck
44-
# - lll
45-
# - gomnd
46-
# - goprintffuncname
47-
# - interfacer
48-
# - typecheck
46+
# - errorlint (TODO: re-enable in go1.20 migration)
4947
# - goerr113
50-
# - noctx
48+
# - gomnd
49+
# - lll
5150

5251
linters-settings:
52+
errorlint:
53+
# Check for plain type assertions and type switches.
54+
asserts: false
55+
# Check for plain error comparisons.
56+
comparison: false
57+
revive:
58+
rules:
59+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
60+
- name: bool-literal-in-expr
61+
disabled: false
62+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return
63+
- name: early-return
64+
disabled: false
65+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
66+
- name: empty-lines
67+
disabled: false
68+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format
69+
- name: string-format
70+
disabled: false
71+
arguments:
72+
- ["fmt.Errorf[0]", "/.*%.*/", "no format directive, use errors.New instead"]
73+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
74+
- name: struct-tag
75+
disabled: false
76+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming
77+
- name: unexported-naming
78+
disabled: false
79+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
80+
- name: unhandled-error
81+
disabled: false
82+
arguments:
83+
- "fmt\\.Fprint"
84+
- "fmt\\.Fprintf"
85+
- "fmt\\.Print"
86+
- "fmt\\.Printf"
87+
- "fmt\\.Println"
88+
- "math/rand\\.Read"
89+
- "strings\\.Builder\\.WriteString"
90+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
91+
- name: unused-parameter
92+
disabled: false
93+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
94+
- name: unused-receiver
95+
disabled: false
96+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
97+
- name: useless-break
98+
disabled: false
5399
staticcheck:
54-
go: "1.18"
100+
go: "1.19"
55101
# https://staticcheck.io/docs/options#checks
56102
checks:
57103
- "all"
@@ -65,4 +111,5 @@ linters-settings:
65111
list-type: blacklist
66112
packages-with-error-message:
67113
- io/ioutil: 'io/ioutil is deprecated. Use package io or os instead.'
114+
- github.com/stretchr/testify/assert: 'github.com/stretchr/testify/require should be used instead.'
68115
include-go-root: true

avalanchego/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# README.md
66
# go.mod
77
# ============= Compilation Stage ================
8-
FROM golang:1.18.5-buster AS builder
9-
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
8+
FROM golang:1.19.6-buster AS builder
9+
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
1010

1111
WORKDIR /build
1212
# Copy and download avalanche dependencies using go mod
@@ -17,7 +17,7 @@ RUN go mod download
1717
# Copy the code into the container
1818
COPY . .
1919

20-
# Build avalanchego and plugins
20+
# Build avalanchego
2121
RUN ./scripts/build.sh
2222

2323
# ============= Cleanup Stage ================

avalanchego/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2020, Ava Labs, Inc.
3+
Copyright (C) 2019-2023, Ava Labs, Inc.
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

avalanchego/LICENSE.header

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved.
2-
See the file LICENSE for licensing terms.
1+
Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
2+
See the file LICENSE for licensing terms.

avalanchego/README.md

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ The minimum recommended hardware specification for nodes connected to Mainnet is
1717
- CPU: Equivalent of 8 AWS vCPU
1818
- RAM: 16 GiB
1919
- Storage: 1 TiB
20-
- OS: Ubuntu 20.04 or macOS >= 12
20+
- OS: Ubuntu 20.04/22.04 or macOS >= 12
2121
- Network: Reliable IPv4 or IPv6 network connection, with an open public port.
2222

2323
If you plan to build AvalancheGo from source, you will also need the following software:
2424

25-
- [Go](https://golang.org/doc/install) version >= 1.18.1
25+
- [Go](https://golang.org/doc/install) version >= 1.19.6
2626
- [gcc](https://gcc.gnu.org/)
2727
- g++
2828

29-
### Native Install
29+
### Building From Source
30+
31+
#### Clone The Repository
3032

3133
Clone the AvalancheGo repository:
3234

@@ -35,17 +37,17 @@ git clone git@github.com:ava-labs/avalanchego.git
3537
cd avalanchego
3638
```
3739

38-
This will clone and checkout to `master` branch.
40+
This will clone and checkout the `master` branch.
3941

40-
#### Building the Avalanche Executable
42+
#### Building AvalancheGo
4143

42-
Build Avalanche by running the build script:
44+
Build AvalancheGo by running the build script:
4345

4446
```sh
4547
./scripts/build.sh
4648
```
4749

48-
The output of the script will be the Avalanche binary named `avalanchego`. It is located in the build directory:
50+
The `avalanchego` binary is now in the `build` directory. To run:
4951

5052
```sh
5153
./build/avalanchego
@@ -57,20 +59,20 @@ Install AvalancheGo using an `apt` repository.
5759

5860
#### Adding the APT Repository
5961

60-
If you have already added the APT repository, you do not need to add it again.
62+
If you already have the APT repository added, you do not need to add it again.
6163

62-
To add the repository on Ubuntu 20.04 (Focal), run:
64+
To add the repository on Ubuntu, run:
6365

6466
```sh
6567
sudo su -
66-
wget -O - https://downloads.avax.network/avalanchego.gpg.key | apt-key add -
67-
echo "deb https://downloads.avax.network/apt focal main" > /etc/apt/sources.list.d/avalanche.list
68+
wget -qO - https://downloads.avax.network/avalanchego.gpg.key | tee /etc/apt/trusted.gpg.d/avalanchego.asc
69+
source /etc/os-release && echo "deb https://downloads.avax.network/apt $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/avalanche.list
6870
exit
6971
```
7072

7173
#### Installing the Latest Version
7274

73-
After adding the APT repository, install avalanchego by running:
75+
After adding the APT repository, install `avalanchego` by running:
7476

7577
```sh
7678
sudo apt update
@@ -85,9 +87,9 @@ The Avalanche binary to be executed is named `avalanchego`.
8587

8688
### Docker Install
8789

88-
Make sure docker is installed on the machine - so commands like `docker run` etc. are available.
90+
Make sure Docker is installed on the machine - so commands like `docker run` etc. are available.
8991

90-
Building the docker image of latest avalanchego branch can be done by running:
92+
Building the Docker image of latest `avalanchego` branch can be done by running:
9193

9294
```sh
9395
./scripts/build_image.sh
@@ -99,7 +101,7 @@ To check the built image, run:
99101
docker image ls
100102
```
101103

102-
The image should be tagged as `avaplatform/avalanchego:xxxxxxxx`, where `xxxxxxxx` is the shortened commit of the Avalanche source it was built from. To run the avalanche node, run:
104+
The image should be tagged as `avaplatform/avalanchego:xxxxxxxx`, where `xxxxxxxx` is the shortened commit of the Avalanche source it was built from. To run the Avalanche node, run:
103105

104106
```sh
105107
docker run -ti -p 9650:9650 -p 9651:9651 avaplatform/avalanchego:xxxxxxxx /avalanchego/build/avalanchego
@@ -133,7 +135,7 @@ See [this tutorial.](https://docs.avax.network/build/tutorials/platform/create-a
133135

134136
## Bootstrapping
135137

136-
A node needs to catch up to the latest network state before it can participate in consensus and serve API calls. This process, called bootstrapping, currently takes several days for a new node connected to Mainnet.
138+
A node needs to catch up to the latest network state before it can participate in consensus and serve API calls. This process (called bootstrapping) currently takes several days for a new node connected to Mainnet.
137139

138140
A node will not [report healthy](https://docs.avax.network/build/avalanchego-apis/health) until it is done bootstrapping.
139141

@@ -143,15 +145,15 @@ The bottleneck during bootstrapping is typically database IO. Using a more power
143145

144146
## Generating Code
145147

146-
Avalanchego uses multiple tools to generate efficient and boilerplate code.
148+
AvalancheGo uses multiple tools to generate efficient and boilerplate code.
147149

148150
### Running protobuf codegen
149151

150152
To regenerate the protobuf go code, run `scripts/protobuf_codegen.sh` from the root of the repo.
151153

152154
This should only be necessary when upgrading protobuf versions or modifying .proto definition files.
153155

154-
To use this script, you must have [buf](https://docs.buf.build/installation) (v1.7.0), protoc-gen-go (v1.28.0) and protoc-gen-go-grpc (v1.2.0) installed.
156+
To use this script, you must have [buf](https://docs.buf.build/installation) (v1.11.0), protoc-gen-go (v1.28.0) and protoc-gen-go-grpc (v1.2.0) installed.
155157

156158
To install the buf dependencies:
157159

@@ -186,17 +188,28 @@ docker run -t -i -v $(pwd):/opt/avalanche -w/opt/avalanche avalanche:protobuf_co
186188

187189
### Running mock codegen
188190

189-
Going forward, AvalancheGo will use [gomock](https://github.com/golang/mock) for mocking in unit tests.
191+
To regenerate the [gomock](https://github.com/golang/mock) code, run `scripts/mock.gen.sh` from the root of the repo.
190192

191-
Example usage:
193+
This should only be necessary when modifying exported interfaces or after modifying `scripts/mock.mockgen.txt`.
192194

193-
```sh
194-
mockgen -destination vms/platformvm/state/mock_diff.go -package state github.com/ava-labs/avalanchego/vms/platformvm/state Diff
195-
```
195+
## Versioning
196+
197+
### Version Semantics
198+
199+
AvalancheGo is first and foremost a client for the Avalanche network. The versioning of AvalancheGo follows that of the Avalanche network.
200+
201+
- `v0.x.x` indicates a development network version.
202+
- `v1.x.x` indicates a production network version.
203+
- `vx.[Upgrade].x` indicates the number of network upgrades that have occurred.
204+
- `vx.x.[Patch]` indicates the number of client upgrades that have occurred since the last network upgrade.
205+
206+
### Library Compatibility Guarantees
207+
208+
Because AvalancheGo's version denotes the network version, it is expected that interfaces exported by AvalancheGo's packages may change in `Patch` version updates.
196209

197-
This makes a mock implementation of the `Diff` interface from `github.com/ava-labs/avalanchego/vms/platformvm/state`and puts it at `vms/platformvm/state/mock_diff.go`. The struct implementing the mock will be in the `state` package.
210+
### API Compatibility Guarantees
198211

199-
See `gomock` documentation for more information.
212+
APIs exposed when running AvalancheGo will maintain backwards compatibility, unless the functionality is explicitly deprecated and announced when removed.
200213

201214
## Supported Platforms
202215

@@ -232,4 +245,4 @@ To officially support a new platform, one must satisfy the following requirement
232245

233246
**We and our community welcome responsible disclosures.**
234247

235-
If you've discovered a security vulnerability, please report it via our [bug bounty program](https://hackenproof.com/avalanche/). Valid reports will be eligible for a reward (terms and conditions apply).
248+
Please refer to our [Security Policy](SECURITY.md) and [Security Advisories](https://github.com/ava-labs/avalanchego/security/advisories).

0 commit comments

Comments
 (0)