Skip to content

bump to 1.9.3 #30

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

Merged
merged 3 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .github/workflows/lint_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ jobs:
go-version: 1.19
- name: Run e2e tests
shell: bash
run: scripts/run.sh 1.9.2
run: scripts/run.sh 1.9.3
env:
E2E: true
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ _See [`tests/e2e`](tests/e2e) to see how it's set up and how its client requests
```bash
# to startup a local cluster (good for development)
cd ${HOME}/go/src/github.com/ava-labs/blobvm
./scripts/run.sh 1.9.2
./scripts/run.sh 1.9.3

# to run full e2e tests and shut down cluster afterwards
cd ${HOME}/go/src/github.com/ava-labs/blobvm
E2E=true ./scripts/run.sh 1.9.2
E2E=true ./scripts/run.sh 1.9.3

# inspect cluster endpoints when ready
cat /tmp/avalanchego-v1.9.2/output.yaml
cat /tmp/avalanchego-v1.9.3/output.yaml
<<COMMENT
endpoint: /ext/bc/2VCAhX6vE3UnXC6s1CBPE6jJ4c4cHWMfPgCptuWS59pQ9vbeLM
logsDir: ...
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/ava-labs/avalanche-network-runner v1.3.1
github.com/ava-labs/avalanchego v1.9.2
github.com/ava-labs/avalanchego v1.9.3
github.com/gorilla/rpc v1.2.0
github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac
github.com/onsi/ginkgo/v2 v2.4.0
Expand All @@ -22,8 +22,8 @@ require (
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/ava-labs/avalanche-ledger-go v0.0.11 // indirect
github.com/ava-labs/coreth v0.11.2-rc.0 // indirect
github.com/ava-labs/avalanche-ledger-go v0.0.13 // indirect
github.com/ava-labs/coreth v0.11.3-rc.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.23.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
Expand All @@ -41,7 +41,7 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/decred/dcrd/lru v1.1.1 // indirect
github.com/ethereum/go-ethereum v1.10.25 // indirect
github.com/ethereum/go-ethereum v1.10.26 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand Down Expand Up @@ -122,18 +122,18 @@ require (
go.opentelemetry.io/otel/sdk v1.11.0 // indirect
go.opentelemetry.io/otel/trace v1.11.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a // indirect
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect
google.golang.org/grpc v1.51.0-dev // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/ava-labs/avalanche-ledger-go v0.0.11 h1:AZ2cKEZ1noMZPCLvjyl/33LBu2u/ESgolr661epH0Ak=
github.com/ava-labs/avalanche-ledger-go v0.0.11/go.mod h1:ZU0gQAFDbyKV2WiBxsvvuigJbKgxVjWn509ajTYozT0=
github.com/ava-labs/avalanche-ledger-go v0.0.13 h1:YTdaSuaZS/1ct1RGirBEJeo2tiSfVeJGaE12XtUSGnE=
github.com/ava-labs/avalanche-ledger-go v0.0.13/go.mod h1:LolCV2cdtkD67V/BSfy/ELUqleG1sbVyNdo5qe1u4y4=
github.com/ava-labs/avalanche-network-runner v1.3.1 h1:j8G85a0nMwaplrSlsqawQ0Of1fJM0sqXTVlXYZ09UrA=
github.com/ava-labs/avalanche-network-runner v1.3.1/go.mod h1:8vwD/JzteWwaoms1lipmM0q4jDSkury+Z4GXQvrcb/8=
github.com/ava-labs/avalanchego v1.9.2 h1:cMjFqnnePfx+Hq94j89B3EcWr3r5eORt/EnmZbBoYdc=
github.com/ava-labs/avalanchego v1.9.2/go.mod h1:ezcsL6vzAu1eL3Ws8QNobEAqadXFCheEogk1d2+bir4=
github.com/ava-labs/coreth v0.11.2-rc.0 h1:aK6Hd9I9t3FTqgofgPK5ZYFp8wfHzrUT/Aj4HtBRbTA=
github.com/ava-labs/coreth v0.11.2-rc.0/go.mod h1:gLc+jBTJXfoSyhBP6x6BU7/Tq1K4ptj5/y6T7qgmyyA=
github.com/ava-labs/avalanchego v1.9.3 h1:vEIa5R7p9P+q1Tf4DHFQppI0ELgKdv0tLVx4sMDNXZc=
github.com/ava-labs/avalanchego v1.9.3/go.mod h1:UR0FdZiS5+0fEqGk3S8zLIiQ2xdzIfTcCnndBRJQ5NA=
github.com/ava-labs/coreth v0.11.3-rc.1 h1:zHu3YUgsroWyWx95O3zFbiB+J+tZrR7Svs17nKIfndQ=
github.com/ava-labs/coreth v0.11.3-rc.1/go.mod h1:FEEvs3gUlRieoUXqoZDya9z12ppbOcEokrwcKKUkL5w=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
Expand Down Expand Up @@ -142,8 +142,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s=
github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s=
github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
Expand Down Expand Up @@ -517,8 +517,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe
go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
Expand Down Expand Up @@ -639,8 +639,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -850,8 +850,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a h1:GH6UPn3ixhWcKDhpnEC55S75cerLPdpp3hrhfKYjZgw=
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo=
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down
7 changes: 4 additions & 3 deletions timestampvm/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package timestampvm

import (
"context"
"errors"
"fmt"
"time"
Expand Down Expand Up @@ -43,7 +44,7 @@ type Block struct {
// Verify returns nil iff this block is valid.
// To be valid, it must be that:
// b.parent.Timestamp < b.Timestamp <= [local time] + 1 hour
func (b *Block) Verify() error {
func (b *Block) Verify(ctx context.Context) error {
// Get [b]'s parent
parentID := b.Parent()
parent, err := b.vm.getBlock(parentID)
Expand Down Expand Up @@ -88,7 +89,7 @@ func (b *Block) Initialize(bytes []byte, status choices.Status, vm *VM) {

// Accept sets this block's status to Accepted and sets lastAccepted to this
// block's ID and saves this info to b.vm.DB
func (b *Block) Accept() error {
func (b *Block) Accept(ctx context.Context) error {
b.SetStatus(choices.Accepted) // Change state of this block
blkID := b.ID()

Expand All @@ -111,7 +112,7 @@ func (b *Block) Accept() error {

// Reject sets this block's status to Rejected and saves the status in state
// Recall that b.vm.DB.Commit() must be called to persist to the DB
func (b *Block) Reject() error {
func (b *Block) Reject(ctx context.Context) error {
b.SetStatus(choices.Rejected) // Change state of this block
if err := b.vm.state.PutBlock(b); err != nil {
return err
Expand Down
47 changes: 25 additions & 22 deletions timestampvm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
// and a piece of data (a string)
type VM struct {
// The context of this vm
ctx *snow.Context
snowCtx *snow.Context
dbManager manager.Manager

// State of this VM
Expand Down Expand Up @@ -80,7 +80,8 @@ type VM struct {
//
// The data in the genesis block is [genesisData]
func (vm *VM) Initialize(
ctx *snow.Context,
ctx context.Context,
snowCtx *snow.Context,
dbManager manager.Manager,
genesisData []byte,
upgradeData []byte,
Expand All @@ -89,15 +90,15 @@ func (vm *VM) Initialize(
_ []*common.Fx,
_ common.AppSender,
) error {
version, err := vm.Version()
version, err := vm.Version(ctx)
if err != nil {
log.Error("error initializing Timestamp VM: %v", err)
return err
}
log.Info("Initializing Timestamp VM", "Version", version)

vm.dbManager = dbManager
vm.ctx = ctx
vm.snowCtx = snowCtx
vm.toEngine = toEngine
vm.verifiedBlocks = make(map[ids.ID]*Block)

Expand All @@ -115,12 +116,12 @@ func (vm *VM) Initialize(
return err
}

ctx.Log.Info("initializing last accepted block",
snowCtx.Log.Info("initializing last accepted block",
zap.Any("id", lastAccepted),
)

// Build off the most recently accepted block
return vm.SetPreference(lastAccepted)
return vm.SetPreference(ctx, lastAccepted)
}

// Initializes Genesis if required
Expand Down Expand Up @@ -160,7 +161,7 @@ func (vm *VM) initGenesis(genesisData []byte) error {

// Accept the genesis block
// Sets [vm.lastAccepted] and [vm.preferred]
if err := genesisBlock.Accept(); err != nil {
if err := genesisBlock.Accept(context.Background()); err != nil {
return fmt.Errorf("error accepting genesis block: %w", err)
}

Expand All @@ -176,7 +177,7 @@ func (vm *VM) initGenesis(genesisData []byte) error {
// CreateHandlers returns a map where:
// Keys: The path extension for this VM's API (empty in this case)
// Values: The handler for the API
func (vm *VM) CreateHandlers() (map[string]*common.HTTPHandler, error) {
func (vm *VM) CreateHandlers(ctx context.Context) (map[string]*common.HTTPHandler, error) {
server := rpc.NewServer()
server.RegisterCodec(json.NewCodec(), "application/json")
server.RegisterCodec(json.NewCodec(), "application/json;charset=UTF-8")
Expand All @@ -195,7 +196,7 @@ func (vm *VM) CreateHandlers() (map[string]*common.HTTPHandler, error) {
// CreateStaticHandlers returns a map where:
// Keys: The path extension for this VM's static API
// Values: The handler for that static API
func (vm *VM) CreateStaticHandlers() (map[string]*common.HTTPHandler, error) {
func (vm *VM) CreateStaticHandlers(ctx context.Context) (map[string]*common.HTTPHandler, error) {
server := rpc.NewServer()
server.RegisterCodec(json.NewCodec(), "application/json")
server.RegisterCodec(json.NewCodec(), "application/json;charset=UTF-8")
Expand All @@ -212,10 +213,10 @@ func (vm *VM) CreateStaticHandlers() (map[string]*common.HTTPHandler, error) {
}

// Health implements the common.VM interface
func (vm *VM) HealthCheck() (interface{}, error) { return nil, nil }
func (vm *VM) HealthCheck(ctx context.Context) (interface{}, error) { return nil, nil }

// BuildBlock returns a block that this vm wants to add to consensus
func (vm *VM) BuildBlock() (snowman.Block, error) {
func (vm *VM) BuildBlock(ctx context.Context) (snowman.Block, error) {
if len(vm.mempool) == 0 { // There is no block to be built
return nil, errNoPendingBlocks
}
Expand Down Expand Up @@ -244,7 +245,7 @@ func (vm *VM) BuildBlock() (snowman.Block, error) {
}

// Verifies block
if err := newBlock.Verify(); err != nil {
if err := newBlock.Verify(ctx); err != nil {
return nil, err
}
return newBlock, nil
Expand All @@ -256,12 +257,14 @@ func (vm *VM) NotifyBlockReady() {
select {
case vm.toEngine <- common.PendingTxs:
default:
vm.ctx.Log.Debug("dropping message to consensus engine")
vm.snowCtx.Log.Debug("dropping message to consensus engine")
}
}

// GetBlock implements the snowman.ChainVM interface
func (vm *VM) GetBlock(blkID ids.ID) (snowman.Block, error) { return vm.getBlock(blkID) }
func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (snowman.Block, error) {
return vm.getBlock(blkID)
}

func (vm *VM) getBlock(blkID ids.ID) (*Block, error) {
// If block is in memory, return it.
Expand All @@ -273,7 +276,7 @@ func (vm *VM) getBlock(blkID ids.ID) (*Block, error) {
}

// LastAccepted returns the block most recently accepted
func (vm *VM) LastAccepted() (ids.ID, error) { return vm.state.GetLastAccepted() }
func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error) { return vm.state.GetLastAccepted() }

// proposeBlock appends [data] to [p.mempool].
// Then it notifies the consensus engine
Expand All @@ -288,7 +291,7 @@ func (vm *VM) proposeBlock(data [DataLen]byte) {
// This function is used by the vm's state to unmarshal blocks saved in state
// and by the consensus layer when it receives the byte representation of a block
// from another node
func (vm *VM) ParseBlock(bytes []byte) (snowman.Block, error) {
func (vm *VM) ParseBlock(ctx context.Context, bytes []byte) (snowman.Block, error) {
// A new empty block
block := &Block{}

Expand Down Expand Up @@ -336,7 +339,7 @@ func (vm *VM) NewBlock(parentID ids.ID, height uint64, data [DataLen]byte, times
}

// Shutdown this vm
func (vm *VM) Shutdown() error {
func (vm *VM) Shutdown(ctx context.Context) error {
if vm.state == nil {
return nil
}
Expand All @@ -345,13 +348,13 @@ func (vm *VM) Shutdown() error {
}

// SetPreference sets the block with ID [ID] as the preferred block
func (vm *VM) SetPreference(id ids.ID) error {
func (vm *VM) SetPreference(ctx context.Context, id ids.ID) error {
vm.preferred = id
return nil
}

// SetState sets this VM state according to given snow.State
func (vm *VM) SetState(state snow.State) error {
func (vm *VM) SetState(ctx context.Context, state snow.State) error {
switch state {
// Engine reports it's bootstrapping
case snow.Bootstrapping:
Expand Down Expand Up @@ -381,15 +384,15 @@ func (vm *VM) onNormalOperationsStarted() error {
}

// Returns this VM's version
func (vm *VM) Version() (string, error) {
func (vm *VM) Version(ctx context.Context) (string, error) {
return Version.String(), nil
}

func (vm *VM) Connected(id ids.NodeID, nodeVersion *version.Application) error {
func (vm *VM) Connected(ctx context.Context, id ids.NodeID, nodeVersion *version.Application) error {
return nil // noop
}

func (vm *VM) Disconnected(id ids.NodeID) error {
func (vm *VM) Disconnected(ctx context.Context, id ids.NodeID) error {
return nil // noop
}

Expand Down
Loading