Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d66f2a1
Add db helpers (#993)
StephenButtolph Nov 14, 2021
a13e677
cleanup formatting package nits (#989)
StephenButtolph Nov 14, 2021
cd4c699
Create utility func to convert HRP addresses (#986)
holisticode Nov 14, 2021
f731d35
snow/context: event dispatcher tracker for testing
gyuho Nov 12, 2021
cee2832
remove epochs from the context
StephenButtolph Nov 15, 2021
8950676
indexer: remove unused var
gyuho Nov 10, 2021
34c779a
tests: separate lint jobs (in parallel)
gyuho Nov 10, 2021
a7c20e6
vms/avm: fix nits
gyuho Nov 10, 2021
c3976d0
added support for rpcchainvm metrics (#988)
StephenButtolph Nov 16, 2021
71ad607
Multiple Atomic Transactions (#767)
obbap1 Nov 16, 2021
42d0b8c
AV-844: Refactor metrics registerer (#865)
ceyonur Nov 16, 2021
7da9258
snow/consensus/avalanche: document "VotingTest"
gyuho Nov 15, 2021
4652abb
scripts/lint.sh: addlicense for license header checks
gyuho Nov 15, 2021
3ee2087
*: update license header
gyuho Nov 17, 2021
3dcf3e1
scripts/lint.sh: ignore code with 3rd party dependencies
gyuho Nov 17, 2021
22c82a5
Update NewKeychain to allow passing in pks
aaronbuchwald Nov 17, 2021
ada6f92
added P-chain support for P<->C transfers (#998)
StephenButtolph Nov 20, 2021
994831a
AV-977: Uptime metrics (#1001)
ceyonur Nov 22, 2021
3d502d4
updated AP5 times
StephenButtolph Nov 22, 2021
70d5f9d
bumped coreth version
StephenButtolph Nov 22, 2021
30a3db8
used new avalanche byz
StephenButtolph Nov 22, 2021
6a1bb1c
*: import "io.prometheus.client" in protocol buffer (#991)
gyuho Nov 22, 2021
d6f8b75
Merge branch 'dev' into set-ap5-fuji-time
StephenButtolph Nov 22, 2021
add4a85
apply inbound connection rate-limiting by IP and port, rather than ju…
Nov 22, 2021
392747d
Merge branch 'dev' into set-ap5-fuji-time
StephenButtolph Nov 22, 2021
6a45bd6
updated release notes
StephenButtolph Nov 23, 2021
61fa6d9
Merge branch 'dev' into set-ap5-fuji-time
StephenButtolph Nov 23, 2021
3ae302d
bumped coreth version
StephenButtolph Nov 23, 2021
6719ce9
Merge branch 'set-ap5-fuji-time' of github.com:ava-labs/avalanchego-i…
StephenButtolph Nov 23, 2021
037e7e7
bumped coreth version
StephenButtolph Nov 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 2 additions & 15 deletions .github/workflows/run-tests-publish-image-basic.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
name: Basic Lint + e2e Tests + Publish Docker Image
name: e2e Tests + Publish Docker Image

on:
push:
tags-ignore:
- '*' # Ignores all tags
- "*" # Ignores all tags
branches-ignore:
- master
- dev

jobs:
run_lint:
name: lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43.0
working-directory: .
args: --timeout 10m

run_e2e_tests_plus_publish_image:
needs: run_lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
Expand Down
21 changes: 4 additions & 17 deletions .github/workflows/run-tests-publish-image-full.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
name: Full Lint + e2e Tests + Publish Docker Image
name: e2e Tests + Publish Docker Image

on:
push:
tags:
- '*' # Push events to every tag
- "*" # Push events to every tag
branches:
- master
- dev
- master
- dev

jobs:
run_lint:
name: lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43.0
working-directory: .
args: --timeout 10m

run_e2e_tests_plus_publish_image:
needs: run_lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ avalanchego_byzantine_repo="avaplatform/avalanche-byzantine"

# Define avalanche-testing and avalanche-byzantine versions to use
avalanche_testing_image="avaplatform/avalanche-testing:master"
avalanchego_byzantine_image="avaplatform/avalanche-byzantine:master"
avalanchego_byzantine_image="avaplatform/avalanche-byzantine:update-avalanchego-v1.7.0"

# Fetch the images
# If Docker Credentials are not available fail
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Full Lint
on:
push:
tags-ignore:
- "*" # Ignores all tags
branches-ignore:
- master
- dev

jobs:
run_lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43.0
working-directory: .
args: --timeout 10m --config .golangci.yml
13 changes: 11 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ linters:
- gofmt
- gofumpt
- goimports
- revive
- revive
- gosec
- gosimple
- govet
Expand All @@ -35,12 +35,21 @@ linters:
- varcheck
- unconvert
- whitespace
- staticcheck
# - lll
# - gomnd
# - goprintffuncname
# - interfacer
# - staticcheck
# - structcheck
# - typecheck
# - goerr113
# - noctx

linters-settings:
staticcheck:
go: "1.17"
# https://staticcheck.io/docs/options#checks
checks:
- "all"
- "-SA6002" # argument should be pointer-like to avoid allocation, for sync.Pool
- "-SA1019" # deprecated packages e.g., golang.org/x/crypto/ripemd160
2 changes: 1 addition & 1 deletion Dockerfile.protoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:20.04

RUN apt-get update && apt -y install bash curl unzip
RUN apt-get update && apt -y install bash curl unzip git
WORKDIR /opt
RUN \
curl -L https://golang.org/dl/go1.16.6.linux-amd64.tar.gz > golang.tar.gz && \
Expand Down
2 changes: 2 additions & 0 deletions LICENSE.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
See the file LICENSE for licensing terms.
31 changes: 31 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Release Notes

## [v1.7.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.7.0)

This upgrade adds support for issuing multiple atomic transactions into a single block and directly transferring assets between the P-chain and the C-chain.

The changes in the upgrade go into effect at 10 AM EST, November 24th 2021 on the Fuji testnet. After Fuji is updated and verified, a mainnet compatible release will be published.

**All Fuji nodes should upgrade before 10 AM EST, November 24th 2021.**

## Networking

- Added peer uptime reports as metrics.
- Removed IP rate limiting over local networks.

## PlatformVM

- Enabled `AtomicTx`s to be issued into `StandardBlock`s and deprecated `AtomicBlock`s.
- Added the ability to export/import AVAX to/from the C-chain.

## Coreth

- Enabled multiple `AtomicTx`s to be issued per block.
- Added the ability to export/import AVAX to/from the P-chain.

## RPCChainVM

- Added support for metrics to be reported by plugin VMs.

## Configs

- Removed `--snow-epoch-first-transition` and `snow-epoch-duration` as command line arguments.

## [v1.6.5](https://github.com/ava-labs/avalanchego/releases/tag/v1.6.5)

This version is backwards compatible to [v1.6.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.6.0). It is optional, but encouraged.
Expand Down
2 changes: 1 addition & 1 deletion api/admin/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package admin
Expand Down
2 changes: 1 addition & 1 deletion api/admin/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package admin
Expand Down
2 changes: 1 addition & 1 deletion api/admin/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package admin
Expand Down
2 changes: 1 addition & 1 deletion api/auth/auth.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2021, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package auth
Expand Down
2 changes: 1 addition & 1 deletion api/auth/auth_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2021, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package auth
Expand Down
2 changes: 1 addition & 1 deletion api/auth/claims.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2021, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package auth
Expand Down
2 changes: 1 addition & 1 deletion api/auth/response.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2021, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package auth
Expand Down
2 changes: 1 addition & 1 deletion api/auth/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2021, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package auth
Expand Down
2 changes: 1 addition & 1 deletion api/common_args_responses.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package api
Expand Down
2 changes: 1 addition & 1 deletion api/health/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package health
Expand Down
2 changes: 1 addition & 1 deletion api/health/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package health
Expand Down
2 changes: 1 addition & 1 deletion api/info/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package info
Expand Down
56 changes: 10 additions & 46 deletions api/info/service.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package info

import (
"errors"
"fmt"
"math"
"net/http"

"github.com/gorilla/rpc/v2"
Expand All @@ -23,7 +22,10 @@ import (
"github.com/ava-labs/avalanchego/vms"
)

var errNoChainProvided = errors.New("argument 'chain' not given")
var (
errNoChainProvided = errors.New("argument 'chain' not given")
errNotValidator = errors.New("this is not a validator node")
)

// Info is the API service for unprivileged info on a node
type Info struct {
Expand All @@ -44,7 +46,6 @@ type Parameters struct {
CreateAssetTxFee uint64
CreateSubnetTxFee uint64
CreateBlockchainTxFee uint64
UptimeRequirement float64
}

// NewService returns a new admin API service
Expand Down Expand Up @@ -248,49 +249,12 @@ type UptimeResponse struct {

func (service *Info) Uptime(_ *http.Request, _ *struct{}, reply *UptimeResponse) error {
service.log.Debug("Info: Uptime called")

myStake, _ := service.validators.GetWeight(service.NodeID)
var (
totalWeight = float64(service.validators.Weight())
totalWeightedPercent = 100 * float64(myStake)
rewardingStake = float64(myStake)
)
for _, peerInfo := range service.networking.Peers(nil) {
peerID, err := ids.ShortFromPrefixedString(peerInfo.ID, constants.NodeIDPrefix)
if err != nil {
return err
}

weight, ok := service.validators.GetWeight(peerID)
if !ok {
// this is not a validator skip it.
continue
}

peerVersion, err := service.versionParser.Parse(peerInfo.Version)
if err != nil {
return err
}

weightFloat := float64(weight)

if peerVersion.Before(version.MinUptimeVersion) {
// If the peer is running an earlier version, then ignore their
// stake
totalWeight -= weightFloat
continue
}

percent := float64(peerInfo.ObservedUptime)
totalWeightedPercent += percent * weightFloat

// if this peer thinks we're above requirement add the weight
if percent/100 >= service.UptimeRequirement {
rewardingStake += weightFloat
}
result, isValidator := service.networking.NodeUptime()
if !isValidator {
return errNotValidator
}
reply.WeightedAveragePercentage = json.Float64(math.Abs(totalWeightedPercent / totalWeight))
reply.RewardingStakePercentage = json.Float64(math.Abs(100 * rewardingStake / totalWeight))
reply.WeightedAveragePercentage = json.Float64(result.WeightedAveragePercentage)
reply.RewardingStakePercentage = json.Float64(result.RewardingStakePercentage)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion api/ipcs/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package ipcs
Expand Down
2 changes: 1 addition & 1 deletion api/ipcs/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package ipcs
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/blockchain_keystore.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/codec.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/gkeystore/keystore_client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package gkeystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/gkeystore/keystore_server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package gkeystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/keystore.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
2 changes: 1 addition & 1 deletion api/keystore/service_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
Loading