Skip to content

Commit 6c98da7

Browse files
authored
bump avago to v1.12.0 (#1402)
1 parent ee040d0 commit 6c98da7

File tree

5 files changed

+28
-26
lines changed

5 files changed

+28
-26
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.8
55
require (
66
github.com/VictoriaMetrics/fastcache v1.12.1
77
github.com/antithesishq/antithesis-sdk-go v0.3.8
8-
github.com/ava-labs/avalanchego v1.11.13
8+
github.com/ava-labs/avalanchego v1.12.0
99
github.com/cespare/cp v0.1.0
1010
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
1111
github.com/davecgh/go-spew v1.1.1
@@ -41,6 +41,7 @@ require (
4141
github.com/urfave/cli/v2 v2.25.7
4242
go.uber.org/goleak v1.3.0
4343
go.uber.org/mock v0.4.0
44+
go.uber.org/zap v1.26.0
4445
golang.org/x/crypto v0.26.0
4546
golang.org/x/exp v0.0.0-20231127185646-65229373498e
4647
golang.org/x/sync v0.8.0
@@ -153,7 +154,6 @@ require (
153154
go.opentelemetry.io/otel/trace v1.22.0 // indirect
154155
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
155156
go.uber.org/multierr v1.11.0 // indirect
156-
go.uber.org/zap v1.26.0 // indirect
157157
golang.org/x/net v0.28.0 // indirect
158158
golang.org/x/oauth2 v0.21.0 // indirect
159159
golang.org/x/term v0.23.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl
6060
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
6161
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
6262
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
63-
github.com/ava-labs/avalanchego v1.11.13 h1:1lcDZ9ILZgeiv7IwL4TuFTyglgZMr9QBOnpLHX+Qy5k=
64-
github.com/ava-labs/avalanchego v1.11.13/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0=
63+
github.com/ava-labs/avalanchego v1.12.0 h1:NBx0vSOY1dCT0PeJzojIhNhx0NMQNem4GgTEN+v8Sx4=
64+
github.com/ava-labs/avalanchego v1.12.0/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0=
6565
github.com/ava-labs/coreth v0.13.9-rc.1 h1:qIICpC/OZGYUP37QnLgIqqwGmxnLwLpZaUlqJNI85vU=
6666
github.com/ava-labs/coreth v0.13.9-rc.1/go.mod h1:7aMsRIo/3GBE44qWZMjnfqdqfcfZ5yShTTm2LObLaYo=
6767
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=

scripts/versions.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
# shellcheck disable=SC2034
55

66
# Don't export them as they're used in the context of other calls
7-
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.11.13'}
7+
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.12.0'}
88
GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'}
9-
10-
# This won't be used, but it's here to make code syncs easier
11-
LATEST_CORETH_VERSION='v0.13.7'

tests/antithesis/main.go

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"crypto/ecdsa"
99
"crypto/rand"
1010
"fmt"
11-
"log"
1211
"math/big"
1312
"path/filepath"
1413
"time"
@@ -18,6 +17,7 @@ import (
1817
"github.com/ethereum/go-ethereum/common"
1918
"github.com/ethereum/go-ethereum/crypto"
2019
"github.com/stretchr/testify/require"
20+
"go.uber.org/zap"
2121

2222
"github.com/ava-labs/avalanchego/ids"
2323
"github.com/ava-labs/avalanchego/tests/antithesis"
@@ -31,13 +31,15 @@ import (
3131
"github.com/ava-labs/subnet-evm/tests/utils"
3232

3333
ago_tests "github.com/ava-labs/avalanchego/tests"
34+
"github.com/ava-labs/avalanchego/utils/logging"
3435
timerpkg "github.com/ava-labs/avalanchego/utils/timer"
3536
)
3637

3738
const NumKeys = 5
3839

3940
func main() {
40-
tc := ago_tests.NewTestContext()
41+
logger := ago_tests.NewDefaultLogger("")
42+
tc := ago_tests.NewTestContext(logger)
4143
defer tc.Cleanup()
4244
require := require.New(tc)
4345

@@ -60,7 +62,9 @@ func main() {
6062
ctx := ago_tests.DefaultNotifyContext(c.Duration, tc.DeferCleanup)
6163

6264
require.Len(c.ChainIDs, 1)
63-
log.Printf("CHAIN IDS: %v", c.ChainIDs)
65+
logger.Info("Starting testing",
66+
zap.Strings("chainIDs", c.ChainIDs),
67+
)
6468
chainID, err := ids.FromString(c.ChainIDs[0])
6569
require.NoError(err, "failed to parse chainID")
6670

@@ -69,6 +73,7 @@ func main() {
6973
genesisKey := tmpnet.HardhatKey.ToECDSA()
7074
genesisWorkload := &workload{
7175
id: 0,
76+
log: ago_tests.NewDefaultLogger(fmt.Sprintf("worker %d", 0)),
7277
client: genesisClient,
7378
key: genesisKey,
7479
uris: c.URIs,
@@ -82,13 +87,14 @@ func main() {
8287
key, err := crypto.ToECDSA(crypto.Keccak256([]byte{uint8(i)}))
8388
require.NoError(err, "failed to generate key")
8489

85-
require.NoError(transferFunds(ctx, genesisClient, genesisKey, crypto.PubkeyToAddress(key.PublicKey), initialAmount))
90+
require.NoError(transferFunds(ctx, genesisClient, genesisKey, crypto.PubkeyToAddress(key.PublicKey), initialAmount, logger))
8691

8792
client, err := ethclient.Dial(getChainURI(c.URIs[i%len(c.URIs)], chainID.String()))
8893
require.NoError(err, "failed to dial chain")
8994

9095
workloads[i] = &workload{
9196
id: i,
97+
log: ago_tests.NewDefaultLogger(fmt.Sprintf("worker %d", i)),
9298
client: client,
9399
key: key,
94100
uris: c.URIs,
@@ -109,14 +115,15 @@ func main() {
109115
type workload struct {
110116
id int
111117
client ethclient.Client
118+
log logging.Logger
112119
key *ecdsa.PrivateKey
113120
uris []string
114121
}
115122

116123
func (w *workload) run(ctx context.Context) {
117124
timer := timerpkg.StoppedTimer()
118125

119-
tc := ago_tests.NewTestContext()
126+
tc := ago_tests.NewTestContext(w.log)
120127
defer tc.Cleanup()
121128
require := require.New(tc)
122129

@@ -132,12 +139,14 @@ func (w *workload) run(ctx context.Context) {
132139
for {
133140
// TODO(marun) Exercise a wider variety of transactions
134141
recipientEthAddress := crypto.PubkeyToAddress(w.key.PublicKey)
135-
err := transferFunds(ctx, w.client, w.key, recipientEthAddress, txAmount)
142+
err := transferFunds(ctx, w.client, w.key, recipientEthAddress, txAmount, w.log)
136143
if err != nil {
137144
// Log the error and continue since the problem may be
138145
// transient. require.NoError is only for errors that should stop
139146
// execution.
140-
log.Printf("failed to transfer funds: %s", err)
147+
w.log.Info("failed to transfer funds",
148+
zap.Error(err),
149+
)
141150
}
142151

143152
val, err := rand.Int(rand.Reader, big.NewInt(int64(time.Second)))
@@ -156,7 +165,7 @@ func getChainURI(nodeURI string, blockchainID string) string {
156165
return fmt.Sprintf("%s/ext/bc/%s/rpc", nodeURI, blockchainID)
157166
}
158167

159-
func transferFunds(ctx context.Context, client ethclient.Client, key *ecdsa.PrivateKey, recipientAddress common.Address, txAmount uint64) error {
168+
func transferFunds(ctx context.Context, client ethclient.Client, key *ecdsa.PrivateKey, recipientAddress common.Address, txAmount uint64, log logging.Logger) error {
160169
chainID, err := client.ChainID(ctx)
161170
if err != nil {
162171
return fmt.Errorf("failed to fetch chainID: %w", err)
@@ -188,17 +197,17 @@ func transferFunds(ctx context.Context, client ethclient.Client, key *ecdsa.Priv
188197
return fmt.Errorf("failed to format transaction: %w", err)
189198
}
190199

191-
log.Printf("sending transaction with ID %s and nonce %d\n", tx.Hash(), acceptedNonce)
200+
log.Info("sending transaction", zap.Stringer("txID", tx.Hash()), zap.Uint64("nonce", acceptedNonce))
192201
err = client.SendTransaction(ctx, tx)
193202
if err != nil {
194203
return fmt.Errorf("failed to send transaction: %w", err)
195204
}
196205

197-
log.Printf("waiting for acceptance of transaction with ID %s\n", tx.Hash())
206+
log.Info("waiting for acceptance of transaction", zap.Stringer("txID", tx.Hash()))
198207
if _, err := bind.WaitMined(ctx, client, tx); err != nil {
199208
return fmt.Errorf("failed to wait for receipt: %v", err)
200209
}
201-
log.Printf("confirmed acceptance of transaction with ID %s\n", tx.Hash())
210+
log.Info("confirmed acceptance of transaction", zap.Stringer("txID", tx.Hash()))
202211

203212
return nil
204213
}

tests/utils/subnet.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func CreateSubnetsSuite(genesisFiles map[string]string) *SubnetSuite {
6464
// each test case. Each test case has its own subnet, therefore all tests
6565
// can run in parallel without any issue.
6666
//
67-
var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
67+
_ = ginkgo.SynchronizedBeforeSuite(func() []byte {
6868
ctx, cancel := context.WithTimeout(context.Background(), BootAvalancheNodeTimeout)
6969
defer cancel()
7070

@@ -101,7 +101,7 @@ func CreateSubnetsSuite(genesisFiles map[string]string) *SubnetSuite {
101101
// SynchronizedAfterSuite() takes two functions, the first runs after each test suite is done and the second
102102
// function is executed once when all the tests are done. This function is used
103103
// to gracefully shutdown the AvalancheGo node.
104-
var _ = ginkgo.SynchronizedAfterSuite(func() {}, func() {
104+
_ = ginkgo.SynchronizedAfterSuite(func() {}, func() {
105105
require.NotNil(startCmd)
106106
require.NoError(startCmd.Stop())
107107
})
@@ -118,11 +118,7 @@ func CreateNewSubnet(ctx context.Context, genesisFilePath string) string {
118118

119119
// MakeWallet fetches the available UTXOs owned by [kc] on the network
120120
// that [LocalAPIURI] is hosting.
121-
wallet, err := wallet.MakeWallet(ctx, &wallet.WalletConfig{
122-
URI: DefaultLocalNodeURI,
123-
AVAXKeychain: kc,
124-
EthKeychain: kc,
125-
})
121+
wallet, err := wallet.MakeWallet(ctx, DefaultLocalNodeURI, kc, kc, wallet.WalletConfig{})
126122
require.NoError(err)
127123

128124
pWallet := wallet.P()

0 commit comments

Comments
 (0)