Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Jan 18, 2024
2 parents 67610a7 + 4d16cc3 commit 99dd506
Show file tree
Hide file tree
Showing 1,527 changed files with 12,186 additions and 9,595 deletions.
5 changes: 2 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
/message/ @gyuho
/network/ @danlaine @joshua-kim @StephenButtolph
/network/throttling/ @danlaine @dboehm-avalabs @StephenButtolph
/proto/ @gyuho @hexfusion
/proto/ @gyuho
/snow/ @danlaine @StephenButtolph
/snow/consensus/ @gyuho @StephenButtolph
/snow/engine/snowman/syncer/ @abi87
/snow/uptime/ @ceyonur
/utils/logging/ @ceyonur
/vms/platformvm/ @abi87 @danlaine @StephenButtolph
/vms/platformvm/ @abi87 @danlaine @dhrubabasu @StephenButtolph
/vms/proposervm/ @abi87 @StephenButtolph
/vms/rpcchainvm/ @hexfusion @StephenButtolph
/vms/registry/ @joshua-kim
/tests/ @abi87 @gyuho @marun
/x/ @danlaine @darioush @dboehm-avalabs
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
target-branch: "dev"
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,17 @@ jobs:
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh
- name: Run e2e tests
shell: bash
run: ./scripts/tests.upgrade.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v3
if: always()
with:
name: upgrade-tmpnet-data
path: ${{ env.tmpnet_data_path }}
if-no-files-found: error
# TODO: re-activate this test after there is a compatible tag to use
# - name: Run e2e tests
# shell: bash
# run: ./scripts/tests.upgrade.sh
# - name: Upload tmpnet network dir
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: upgrade-tmpnet-data
# path: ${{ env.tmpnet_data_path }}
# if-no-files-found: error
Lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
check-latest: true
- name: Run fuzz tests
shell: bash
run: ./scripts/build_fuzz.sh 30 # Run each fuzz test 30 seconds
run: ./scripts/build_fuzz.sh 180 # Run each fuzz test 180 seconds
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To start developing on AvalancheGo, you'll need a few things installed.

- Open a new GitHub pull request containing your changes.
- Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
- The PR should be opened against the `dev` branch.
- The PR should be opened against the `master` branch.
- If your PR isn't ready to be reviewed just yet, you can open it as a draft to collect early feedback on your changes.
- Once the PR is ready for review, mark it as ready-for-review and request review from one of the maintainers.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (C) 2019-2023, Ava Labs, Inc.
Copyright (C) 2019-2024, Ava Labs, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
256 changes: 255 additions & 1 deletion RELEASES.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Avalanche takes the security of the platform and of its users very seriously. We

## Reporting a Vulnerability

**Please do not file a public ticket** mentioning the vulnerability. To disclose a vulnerability submit it through our [Bug Bounty Program](https://hackenproof.com/avalanche).
**Please do not file a public ticket** mentioning the vulnerability. To disclose a vulnerability submit it through our [Bug Bounty Program](https://immunefi.com/bounty/avalanche/).

Vulnerabilities must be disclosed to us privately with reasonable time to respond, and avoid compromise of other users and accounts, or loss of funds that are not your own. We do not reward spam or social engineering vulnerabilities.

Do not test for or validate any security issues in the live Avalanche networks (Mainnet and Fuji testnet), confirm all exploits in a local private testnet.

Please refer to the [Bug Bounty Page](https://hackenproof.com/avalanche) for the most up-to-date program rules and scope.
Please refer to the [Bug Bounty Page](https://immunefi.com/bounty/avalanche/) for the most up-to-date program rules and scope.

## Supported Versions

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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

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

package admin
Expand Down Expand Up @@ -334,7 +334,7 @@ func (a *Admin) LoadVMs(r *http.Request, _ *struct{}, reply *LoadVMsReply) error
defer a.lock.Unlock()

ctx := r.Context()
loadedVMs, failedVMs, err := a.VMRegistry.ReloadWithReadLock(ctx)
loadedVMs, failedVMs, err := a.VMRegistry.Reload(ctx)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions api/admin/service_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package admin
Expand Down Expand Up @@ -64,7 +64,7 @@ func TestLoadVMsSuccess(t *testing.T) {
id2: alias2[1:],
}

resources.mockVMRegistry.EXPECT().ReloadWithReadLock(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil)
resources.mockVMRegistry.EXPECT().Reload(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil)
resources.mockVMManager.EXPECT().Aliases(id1).Times(1).Return(alias1, nil)
resources.mockVMManager.EXPECT().Aliases(id2).Times(1).Return(alias2, nil)

Expand All @@ -81,7 +81,7 @@ func TestLoadVMsReloadFails(t *testing.T) {
resources := initLoadVMsTest(t)

// Reload fails
resources.mockVMRegistry.EXPECT().ReloadWithReadLock(gomock.Any()).Times(1).Return(nil, nil, errTest)
resources.mockVMRegistry.EXPECT().Reload(gomock.Any()).Times(1).Return(nil, nil, errTest)

reply := LoadVMsReply{}
err := resources.admin.LoadVMs(&http.Request{}, nil, &reply)
Expand All @@ -103,7 +103,7 @@ func TestLoadVMsGetAliasesFails(t *testing.T) {
// every vm is at least aliased to itself.
alias1 := []string{id1.String(), "vm1-alias-1", "vm1-alias-2"}

resources.mockVMRegistry.EXPECT().ReloadWithReadLock(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil)
resources.mockVMRegistry.EXPECT().Reload(gomock.Any()).Times(1).Return(newVMs, failedVMs, nil)
resources.mockVMManager.EXPECT().Aliases(id1).Times(1).Return(alias1, nil)
resources.mockVMManager.EXPECT().Aliases(id2).Times(1).Return(nil, errTest)

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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/checker.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/health.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/health_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/metrics.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/result.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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/worker.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

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

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

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

package info
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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down
17 changes: 9 additions & 8 deletions api/keystore/codec.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore

import (
"time"

"github.com/ava-labs/avalanchego/codec"
"github.com/ava-labs/avalanchego/codec/linearcodec"
"github.com/ava-labs/avalanchego/utils/units"
)

const (
maxPackerSize = 1 * units.GiB // max size, in bytes, of something being marshalled by Marshal()
maxSliceLength = linearcodec.DefaultMaxSliceLength
CodecVersion = 0

codecVersion = 0
maxPackerSize = 1 * units.GiB // max size, in bytes, of something being marshalled by Marshal()
)

var c codec.Manager
var Codec codec.Manager

func init() {
lc := linearcodec.NewCustomMaxLength(maxSliceLength)
c = codec.NewManager(maxPackerSize)
if err := c.RegisterCodec(codecVersion, lc); err != nil {
lc := linearcodec.NewDefault(time.Time{})
Codec = codec.NewManager(maxPackerSize)
if err := Codec.RegisterCodec(CodecVersion, lc); err != nil {
panic(err)
}
}
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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, 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 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package gkeystore
Expand Down
12 changes: 6 additions & 6 deletions api/keystore/keystore.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package keystore
Expand Down Expand Up @@ -188,7 +188,7 @@ func (ks *keystore) CreateUser(username, pw string) error {
return err
}

passwordBytes, err := c.Marshal(codecVersion, passwordHash)
passwordBytes, err := Codec.Marshal(CodecVersion, passwordHash)
if err != nil {
return err
}
Expand Down Expand Up @@ -288,14 +288,14 @@ func (ks *keystore) ImportUser(username, pw string, userBytes []byte) error {
}

userData := user{}
if _, err := c.Unmarshal(userBytes, &userData); err != nil {
if _, err := Codec.Unmarshal(userBytes, &userData); err != nil {
return err
}
if !userData.Hash.Check(pw) {
return fmt.Errorf("%w: user %q", errIncorrectPassword, username)
}

usrBytes, err := c.Marshal(codecVersion, &userData.Hash)
usrBytes, err := Codec.Marshal(CodecVersion, &userData.Hash)
if err != nil {
return err
}
Expand Down Expand Up @@ -355,7 +355,7 @@ func (ks *keystore) ExportUser(username, pw string) ([]byte, error) {
}

// Return the byte representation of the user
return c.Marshal(codecVersion, &userData)
return Codec.Marshal(CodecVersion, &userData)
}

func (ks *keystore) getPassword(username string) (*password.Hash, error) {
Expand All @@ -377,6 +377,6 @@ func (ks *keystore) getPassword(username string) (*password.Hash, error) {
}

passwordHash = &password.Hash{}
_, err = c.Unmarshal(userBytes, passwordHash)
_, err = Codec.Unmarshal(userBytes, passwordHash)
return passwordHash, err
}
Loading

0 comments on commit 99dd506

Please sign in to comment.