Skip to content

Commit 3b253af

Browse files
authored
bump to avalanchego v1.12.3 rc (#2617)
* bump to avago 1.12.2 * 1.12.2 * use latest sa * tidy * fix e2e * lint * fix e2e * more fixes * fix funding * fix e2e * Add signature aggregator wait for healthy (#2618) * add wait for healthy connection to subnets to sa * add signature retry * lint
1 parent 5d4805c commit 3b253af

34 files changed

Lines changed: 380 additions & 255 deletions

File tree

cmd/blockchaincmd/add_validator.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ import (
1010
"time"
1111

1212
"github.com/ava-labs/avalanche-cli/pkg/blockchain"
13-
14-
"github.com/ava-labs/avalanchego/config"
15-
"github.com/ava-labs/avalanchego/utils/units"
16-
17-
"github.com/ethereum/go-ethereum/common"
18-
1913
"github.com/ava-labs/avalanche-cli/pkg/cobrautils"
2014
"github.com/ava-labs/avalanche-cli/pkg/constants"
2115
"github.com/ava-labs/avalanche-cli/pkg/contract"
@@ -29,12 +23,16 @@ import (
2923
"github.com/ava-labs/avalanche-cli/pkg/utils"
3024
"github.com/ava-labs/avalanche-cli/pkg/ux"
3125
"github.com/ava-labs/avalanche-cli/pkg/validatormanager"
26+
sdkutils "github.com/ava-labs/avalanche-cli/sdk/utils"
3227
"github.com/ava-labs/avalanche-cli/sdk/validator"
28+
"github.com/ava-labs/avalanchego/config"
3329
"github.com/ava-labs/avalanchego/ids"
3430
avagoconstants "github.com/ava-labs/avalanchego/utils/constants"
3531
"github.com/ava-labs/avalanchego/utils/formatting/address"
3632
"github.com/ava-labs/avalanchego/utils/logging"
33+
"github.com/ava-labs/avalanchego/utils/units"
3734
warpMessage "github.com/ava-labs/avalanchego/vms/platformvm/warp/message"
35+
"github.com/ethereum/go-ethereum/common"
3836
"github.com/spf13/cobra"
3937
)
4038

@@ -177,7 +175,8 @@ func addValidator(_ *cobra.Command, args []string) error {
177175
clusterNameFlagValue = sc.Networks[network.Name()].ClusterName
178176
}
179177

180-
fee := network.GenesisParams().TxFeeConfig.StaticFeeConfig.AddSubnetValidatorFee
178+
// TODO: will estimate fee in subsecuent PR
179+
fee := uint64(0)
181180
kc, err := keychain.GetKeychainFromCmdLineFlags(
182181
app,
183182
"to pay for transaction fees on P-Chain",
@@ -501,7 +500,10 @@ func CallAddValidator(
501500
if err != nil {
502501
return err
503502
}
503+
aggregatorCtx, aggregatorCancel := sdkutils.GetTimedContext(constants.SignatureAggregatorTimeout)
504+
defer aggregatorCancel()
504505
signedMessage, validationID, err := validatormanager.InitValidatorRegistration(
506+
aggregatorCtx,
505507
app,
506508
network,
507509
rpcURL,
@@ -543,6 +545,7 @@ func CallAddValidator(
543545
}
544546

545547
if err := validatormanager.FinishValidatorRegistration(
548+
aggregatorCtx,
546549
app,
547550
network,
548551
rpcURL,

cmd/blockchaincmd/change_owner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func changeOwner(_ *cobra.Command, args []string) error {
5656
return err
5757
}
5858

59-
fee := network.GenesisParams().TxFeeConfig.StaticFeeConfig.TxFee
59+
// TODO: will estimate fee in subsecuent PR
60+
fee := uint64(0)
6061
kc, err := keychain.GetKeychainFromCmdLineFlags(
6162
app,
6263
"pay fees",

cmd/blockchaincmd/change_weight.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ func setWeight(_ *cobra.Command, args []string) error {
7272
return err
7373
}
7474

75-
fee := network.GenesisParams().TxFeeConfig.StaticFeeConfig.TxFee
75+
// TODO: will estimate fee in subsecuent PR
76+
fee := uint64(0)
7677
kc, err := keychain.GetKeychainFromCmdLineFlags(
7778
app,
7879
"to pay for transaction fees on P-Chain",

cmd/blockchaincmd/convert.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/ava-labs/avalanche-cli/pkg/ux"
2828
"github.com/ava-labs/avalanche-cli/pkg/vm"
2929
blockchainSDK "github.com/ava-labs/avalanche-cli/sdk/blockchain"
30+
sdkutils "github.com/ava-labs/avalanche-cli/sdk/utils"
3031
validatorManagerSDK "github.com/ava-labs/avalanche-cli/sdk/validatormanager"
3132
"github.com/ava-labs/avalanchego/api/info"
3233
"github.com/ava-labs/avalanchego/config"
@@ -330,9 +331,12 @@ func InitializeValidatorManager(blockchainName,
330331
if err != nil {
331332
return tracked, err
332333
}
334+
aggregatorCtx, aggregatorCancel := sdkutils.GetTimedContext(constants.SignatureAggregatorTimeout)
335+
defer aggregatorCancel()
333336
if pos {
334337
ux.Logger.PrintToUser("Initializing Native Token Proof of Stake Validator Manager contract on blockchain %s ...", blockchainName)
335338
if err := subnetSDK.InitializeProofOfStake(
339+
aggregatorCtx,
336340
network,
337341
genesisPrivateKey,
338342
extraAggregatorPeers,
@@ -355,6 +359,7 @@ func InitializeValidatorManager(blockchainName,
355359
} else {
356360
ux.Logger.PrintToUser("Initializing Proof of Authority Validator Manager contract on blockchain %s ...", blockchainName)
357361
if err := subnetSDK.InitializeProofOfAuthority(
362+
aggregatorCtx,
358363
network,
359364
genesisPrivateKey,
360365
extraAggregatorPeers,

cmd/blockchaincmd/deploy.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,10 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
552552
}
553553
}
554554

555+
// TODO: will estimate fee in subsecuent PR
556+
// !subnetonly: add blockchain fee
557+
// createSubnet: add subnet fee
555558
fee := uint64(0)
556-
if !subnetOnly {
557-
fee += network.GenesisParams().TxFeeConfig.StaticFeeConfig.CreateBlockchainTxFee
558-
}
559-
if createSubnet {
560-
fee += network.GenesisParams().TxFeeConfig.StaticFeeConfig.CreateSubnetTxFee
561-
}
562559

563560
kc, err := keychain.GetKeychainFromCmdLineFlags(
564561
app,

cmd/blockchaincmd/prompt_genesis_input.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func generateNewNodeAndBLS() (string, string, string, error) {
105105
if err != nil {
106106
return "", "", "", err
107107
}
108-
blsSignerKey, err := bls.NewSecretKey()
108+
blsSignerKey, err := bls.NewSigner()
109109
if err != nil {
110110
return "", "", "", err
111111
}

cmd/blockchaincmd/remove_validator.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/ava-labs/avalanche-cli/pkg/utils"
2727
"github.com/ava-labs/avalanche-cli/pkg/ux"
2828
"github.com/ava-labs/avalanche-cli/pkg/validatormanager"
29+
sdkutils "github.com/ava-labs/avalanche-cli/sdk/utils"
2930
validatormanagerSDK "github.com/ava-labs/avalanche-cli/sdk/validatormanager"
3031
"github.com/ava-labs/avalanchego/genesis"
3132
"github.com/ava-labs/avalanchego/ids"
@@ -98,7 +99,8 @@ func removeValidator(_ *cobra.Command, args []string) error {
9899
if network.ClusterName != "" {
99100
network = models.ConvertClusterToNetwork(network)
100101
}
101-
fee := network.GenesisParams().TxFeeConfig.StaticFeeConfig.TxFee
102+
// TODO: will estimate fee in subsecuent PR
103+
fee := uint64(0)
102104
kc, err := keychain.GetKeychainFromCmdLineFlags(
103105
app,
104106
"to pay for transaction fees on P-Chain",
@@ -287,8 +289,11 @@ func removeValidatorSOV(
287289
signedMessage *warp.Message
288290
validationID ids.ID
289291
)
292+
aggregatorCtx, aggregatorCancel := sdkutils.GetTimedContext(constants.SignatureAggregatorTimeout)
293+
defer aggregatorCancel()
290294
// try to remove the validator. If err is "delegator ineligible for rewards" confirm with user and force remove
291295
signedMessage, validationID, err = validatormanager.InitValidatorRemoval(
296+
aggregatorCtx,
292297
app,
293298
network,
294299
rpcURL,
@@ -313,6 +318,7 @@ func removeValidatorSOV(
313318
return fmt.Errorf("validator %s is not eligible for rewards. Use --force flag to force removal", nodeID)
314319
}
315320
signedMessage, validationID, err = validatormanager.InitValidatorRemoval(
321+
aggregatorCtx,
316322
app,
317323
network,
318324
rpcURL,
@@ -351,6 +357,7 @@ func removeValidatorSOV(
351357
}
352358

353359
if err := validatormanager.FinishValidatorRemoval(
360+
aggregatorCtx,
354361
app,
355362
network,
356363
rpcURL,

cmd/blockchaincmd/validators.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func printPublicValidators(subnetID ids.ID, network models.Network) error {
8888
}
8989

9090
func printValidatorsFromList(validators []platformvm.ClientPermissionlessValidator) error {
91-
header := []string{"NodeID", "Stake Amount", "Delegator Weight", "Start Time", "End Time", "Type"}
91+
header := []string{"NodeID", "Weight", "Delegator Weight", "Start Time", "End Time", "Type"}
9292
table := tablewriter.NewWriter(os.Stdout)
9393
table.SetHeader(header)
9494
table.SetRowLine(true)

cmd/contractcmd/init_validator_manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/ava-labs/avalanche-cli/pkg/ux"
2020
"github.com/ava-labs/avalanche-cli/pkg/validatormanager"
2121
blockchainSDK "github.com/ava-labs/avalanche-cli/sdk/blockchain"
22+
sdkutils "github.com/ava-labs/avalanche-cli/sdk/utils"
2223
validatorManagerSDK "github.com/ava-labs/avalanche-cli/sdk/validatormanager"
2324
"github.com/ava-labs/avalanchego/ids"
2425
"github.com/ava-labs/avalanchego/utils/logging"
@@ -194,10 +195,13 @@ func initValidatorManager(_ *cobra.Command, args []string) error {
194195
OwnerAddress: &ownerAddress,
195196
RPC: validatorManagerFlags.rpcEndpoint,
196197
}
198+
aggregatorCtx, aggregatorCancel := sdkutils.GetTimedContext(constants.SignatureAggregatorTimeout)
199+
defer aggregatorCancel()
197200
switch {
198201
case sc.PoA(): // PoA
199202
ux.Logger.PrintToUser(logging.Yellow.Wrap("Initializing Proof of Authority Validator Manager contract on blockchain %s"), blockchainName)
200203
if err := validatormanager.SetupPoA(
204+
aggregatorCtx,
201205
subnetSDK,
202206
network,
203207
privateKey,
@@ -215,6 +219,7 @@ func initValidatorManager(_ *cobra.Command, args []string) error {
215219
initPOSManagerFlags.rewardCalculatorAddress = validatorManagerSDK.RewardCalculatorAddress
216220
}
217221
if err := validatormanager.SetupPoS(
222+
aggregatorCtx,
218223
subnetSDK,
219224
network,
220225
privateKey,

cmd/keycmd/transfer.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/ava-labs/avalanchego/vms/secp256k1fx"
3333
"github.com/ava-labs/avalanchego/wallet/subnet/primary"
3434
"github.com/ava-labs/avalanchego/wallet/subnet/primary/common"
35-
"github.com/ava-labs/coreth/plugin/evm"
35+
"github.com/ava-labs/coreth/plugin/evm/atomic"
3636
goethereumcommon "github.com/ethereum/go-ethereum/common"
3737
"github.com/spf13/cobra"
3838
)
@@ -593,12 +593,7 @@ func pToPSend(
593593
return err
594594
}
595595
pContext := wallet.P().Builder().Context()
596-
var pFeeCalculator avagofee.Calculator
597-
if pContext.GasPrice != 0 {
598-
pFeeCalculator = avagofee.NewDynamicCalculator(pContext.ComplexityWeights, pContext.GasPrice)
599-
} else {
600-
pFeeCalculator = avagofee.NewStaticCalculator(pContext.StaticFeeConfig)
601-
}
596+
pFeeCalculator := avagofee.NewDynamicCalculator(pContext.ComplexityWeights, pContext.GasPrice)
602597
txFee, err := pFeeCalculator.CalculateFee(unsignedTx)
603598
if err != nil {
604599
return err
@@ -809,7 +804,7 @@ func importIntoC(
809804
if err != nil {
810805
return fmt.Errorf("error building tx: %w", err)
811806
}
812-
tx := evm.Tx{UnsignedAtomicTx: unsignedTx}
807+
tx := atomic.Tx{UnsignedAtomicTx: unsignedTx}
813808
if err := wallet.C().Signer().SignAtomic(context.Background(), &tx); err != nil {
814809
return fmt.Errorf("error signing tx: %w", err)
815810
}
@@ -918,7 +913,7 @@ func exportFromC(
918913
if err != nil {
919914
return fmt.Errorf("error building tx: %w", err)
920915
}
921-
tx := evm.Tx{UnsignedAtomicTx: unsignedTx}
916+
tx := atomic.Tx{UnsignedAtomicTx: unsignedTx}
922917
if err := wallet.C().Signer().SignAtomic(context.Background(), &tx); err != nil {
923918
return fmt.Errorf("error signing tx: %w", err)
924919
}

0 commit comments

Comments
 (0)