Skip to content

Commit

Permalink
AvalancheGo@v1.11.6 (#930)
Browse files Browse the repository at this point in the history
* update go mod

* update anr

* remove load test

* cleaning up lints

* fix pebble

* implement network/gossiper

* fix gossiper manual

* integration tests passing

* cleanup configs

* fix caps

* make go version explicit

* fix workflow file

* fix imports

* remove ips from wails
  • Loading branch information
patrick-ogrady authored May 23, 2024
1 parent fbd78a4 commit 9e63d45
Show file tree
Hide file tree
Showing 32 changed files with 545 additions and 2,248 deletions.
5 changes: 2 additions & 3 deletions .github/actions/install-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ inputs:

runs:
using: composite
steps:
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
check-latest: true
go-version: '1.21.10'
cache: ${{ inputs.cache }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
48 changes: 3 additions & 45 deletions .github/workflows/hypersdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,6 @@ jobs:
env:
MODE: 'test'

tokenvm-load-tests:
needs: [tokenvm-lint, tokenvm-unit-tests]
strategy:
matrix:
level: [v1, v2, v3] # v4 is not supported
runs-on: ubuntu-20.04-32
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: ./.github/actions/install-go
with:
cache-dependency-path: |
go.sum
examples/tokenvm/go.sum
- name: Run load tests
working-directory: ./examples/tokenvm
shell: bash
run: GOAMD64=${{ matrix.level }} scripts/tests.load.sh

tokenvm-sync-tests:
needs: [tokenvm-lint, tokenvm-unit-tests]
runs-on: ubuntu-20.04-32
Expand All @@ -181,15 +160,15 @@ jobs:
MODE: 'full-test'

token-wallet-release:
needs: [tokenvm-load-tests, tokenvm-sync-tests]
needs: [tokenvm-sync-tests]
runs-on: macos-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/token-wallet-release

tokenvm-release:
needs: [tokenvm-load-tests, tokenvm-sync-tests]
needs: [tokenvm-sync-tests]
# We build with 20.04 to maintain max compatibility: https://github.com/golang/go/issues/57328
runs-on: ubuntu-20.04-32
steps:
Expand Down Expand Up @@ -261,27 +240,6 @@ jobs:
env:
MODE: 'test'

morpheusvm-load-tests:
needs: [morpheusvm-lint, morpheusvm-unit-tests]
strategy:
matrix:
level: [v1, v2, v3] # v4 is not supported
runs-on: ubuntu-20.04-32
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: ./.github/actions/install-go
with:
cache-dependency-path: |
go.sum
examples/morpheusvm/go.sum
- name: Run load tests
working-directory: ./examples/morpheusvm
shell: bash
run: GOAMD64=${{ matrix.level }} scripts/tests.load.sh

morpheusvm-sync-tests:
needs: [morpheusvm-lint, morpheusvm-unit-tests]
runs-on: ubuntu-20.04-32
Expand All @@ -303,7 +261,7 @@ jobs:
MODE: 'full-test'

morpheusvm-release:
needs: [morpheusvm-load-tests, morpheusvm-sync-tests]
needs: [morpheusvm-sync-tests]
# We build with 20.04 to maintain max compatibility: https://github.com/golang/go/issues/57328
runs-on: ubuntu-20.04-32
steps:
Expand Down
40 changes: 17 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,9 @@ You can view what this looks like in the `tokenvm` by clicking this
type Action interface {
Object

// MaxComputeUnits is the maximum amount of compute a given [Action] could use. This is
// used to determine whether the [Action] can be included in a given block and to compute
// the required fee to execute.
//
// Developers should make every effort to bound this as tightly to the actual max so that
// users don't need to have a large balance to call an [Action] (must prepay fee before execution).
MaxComputeUnits(Rules) uint64
// ComputeUnits is the amount of compute required to call [Execute]. This is used to determine
// whether the [Action] can be included in a given block and to compute the required fee to execute.
ComputeUnits(Rules) uint64

// StateKeysMaxChunks is used to estimate the fee a transaction should pay. It includes the max
// chunks each state key could use without requiring the state keys to actually be provided (may
Expand All @@ -658,7 +654,7 @@ type Action interface {
//
// If any keys are touched during [Execute] that are not specified in [StateKeys], the transaction
// will revert and the max fee will be charged.
//
//
// If [Execute] returns an error, execution will halt and any state changes will revert.
Execute(
ctx context.Context,
Expand All @@ -667,7 +663,7 @@ type Action interface {
timestamp int64,
actor codec.Address,
actionID ids.ID,
) (computeUnits uint64, outputs [][]byte, err error)
) (outputs [][]byte, err error)
}
```

Expand All @@ -683,10 +679,14 @@ and what a more complex "fill order" `Action` looks like [here](./examples/token
```golang
type Result struct {
Success bool
Output []byte
Error []byte

Consumed Dimensions
Fee uint64
Outputs [][][]byte

// Computing [Units] requires access to [StateManager], so it is returned
// to make life easier for indexers.
Units fees.Dimensions
Fee uint64
}
```

Expand Down Expand Up @@ -745,14 +745,14 @@ type Rules interface {
GetMinBlockGap() int64 // in milliseconds
GetMinEmptyBlockGap() int64 // in milliseconds
GetValidityWindow() int64 // in milliseconds

GetMaxActionsPerTx() uint8
GetMaxOutputsPerAction() uint8

GetMinUnitPrice() Dimensions
GetUnitPriceChangeDenominator() Dimensions
GetWindowTargetUnits() Dimensions
GetMaxBlockUnits() Dimensions
GetMinUnitPrice() fees.Dimensions
GetUnitPriceChangeDenominator() fees.Dimensions
GetWindowTargetUnits() fees.Dimensions
GetMaxBlockUnits() fees.Dimensions

GetBaseComputeUnits() uint64

Expand All @@ -762,12 +762,6 @@ type Rules interface {
// * Creating a new key involves first allocating and then writing
// * Keys are only charged once per transaction (even if used multiple times), it is
// up to the controller to ensure multiple usage has some compute cost
//
// Interesting Scenarios:
// * If a key is created and then modified during a transaction, the second
// read will be a read of 0 chunks (reads are based on disk contents before exec)
// * If a key is removed and then re-created with the same value during a transaction,
// it doesn't count as a modification (returning to the current value on-disk is a no-op)
GetSponsorStateKeysMaxChunks() []uint16
GetStorageKeyReadUnits() uint64
GetStorageValueReadUnits() uint64 // per chunk
Expand Down
7 changes: 1 addition & 6 deletions chain/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ type Mempool interface {
FinishStreaming(context.Context, []*Transaction) int
}

// TODO: add fixed rules as a subset of this interface
type Rules interface {
// Should almost always be constant (unless there is a fork of
// a live network)
Expand All @@ -140,12 +141,6 @@ type Rules interface {
// * Creating a new key involves first allocating and then writing
// * Keys are only charged once per transaction (even if used multiple times), it is
// up to the controller to ensure multiple usage has some compute cost
//
// Interesting Scenarios:
// * If a key is created and then modified during a transaction, the second
// read will be a read of 0 chunks (reads are based on disk contents before exec)
// * If a key is removed and then re-created with the same value during a transaction,
// it doesn't count as a modification (returning to the current value on-disk is a no-op)
GetSponsorStateKeysMaxChunks() []uint16
GetStorageKeyReadUnits() uint64
GetStorageValueReadUnits() uint64 // per chunk
Expand Down
4 changes: 2 additions & 2 deletions crypto/bls/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ type (
)

func PublicKeyToBytes(pk *PublicKey) []byte {
return bls.PublicKeyToBytes(pk)
return bls.PublicKeyToCompressedBytes(pk)
}

func PublicKeyFromBytes(pkBytes []byte) (*PublicKey, error) {
return bls.PublicKeyFromBytes(pkBytes)
return bls.PublicKeyFromCompressedBytes(pkBytes)
}

func AggregatePublicKeys(pks []*PublicKey) (*PublicKey, error) {
Expand Down
85 changes: 47 additions & 38 deletions examples/morpheusvm/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/ava-labs/hypersdk/examples/morpheusvm

go 1.21
go 1.21.10

require (
github.com/ava-labs/avalanche-network-runner v1.7.4-rc.0
github.com/ava-labs/avalanchego v1.10.18
github.com/ava-labs/avalanchego v1.11.6
github.com/ava-labs/hypersdk v0.0.1
github.com/fatih/color v1.13.0
github.com/onsi/ginkgo/v2 v2.13.1
Expand All @@ -17,58 +17,64 @@ require (
require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/ava-labs/coreth v0.12.10-rc.5 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/ava-labs/coreth v0.13.4-rc.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230224221607-fccb83b60d5c // indirect
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 // indirect
github.com/ethereum/go-ethereum v1.12.0 // indirect
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/ethereum/go-ethereum v1.13.8 // indirect
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20230406165453-00490a63f317 // indirect
github.com/google/renameio/v2 v2.0.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/rpc v1.2.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackpal/gateway v1.0.6 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
Expand All @@ -79,10 +85,11 @@ require (
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/pointerstructure v1.2.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
Expand All @@ -96,6 +103,7 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand All @@ -110,43 +118,44 @@ require (
github.com/subosito/gotenv v1.3.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opentelemetry.io/otel v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.2 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.11.2 // indirect
go.opentelemetry.io/otel/sdk v1.11.2 // indirect
go.opentelemetry.io/otel/trace v1.11.2 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/sdk v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.17.0 // indirect
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/grpc v1.62.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ava-labs/hypersdk => ../../
Loading

0 comments on commit 9e63d45

Please sign in to comment.