Skip to content
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

Set subnet validator weight #2215

Closed
Closed
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.8
require (
github.com/ava-labs/apm v1.0.0
github.com/ava-labs/avalanche-network-runner v1.8.4-0.20240930181211-bfc2f5f85973
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241002224617-90256044ffad
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241002224658-b6cbfeed382d
github.com/ava-labs/awm-relayer v1.4.1-0.20240910171125-3c2ae781fb32
github.com/ava-labs/coreth v0.13.8
github.com/ava-labs/subnet-evm v0.6.10
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ github.com/ava-labs/apm v1.0.0 h1:6FwozH67hEkbWVsOXNZGexBy5KLpNeYucN9zcFUHv+Q=
github.com/ava-labs/apm v1.0.0/go.mod h1:TJL7pTlZNvQatsQPsLUtDHApEwVZ/qS7iSNtRFU83mc=
github.com/ava-labs/avalanche-network-runner v1.8.4-0.20240930181211-bfc2f5f85973 h1:rsAfxjQLCs9dyDGqUZK29fGDrW4uzLzYjQLUVMEkvdQ=
github.com/ava-labs/avalanche-network-runner v1.8.4-0.20240930181211-bfc2f5f85973/go.mod h1:T6AYu2HBw4N6oAIRJWATSLx3/uWLVVADTbfSCIcSlEY=
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241002224617-90256044ffad h1:2FArSjp+e97YEIyUhUWVxwhVOmHthcG6SByYq+C8kDQ=
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241002224617-90256044ffad/go.mod h1:qSHmog3wMVjo/ruIAQo0ppXAilyni07NIu5K88RyhWE=
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241002224658-b6cbfeed382d h1:zENrqqsYaWnPklhDbYkzOA61AlY6aHUNpSuY7BHuslE=
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20241002224658-b6cbfeed382d/go.mod h1:qSHmog3wMVjo/ruIAQo0ppXAilyni07NIu5K88RyhWE=
github.com/ava-labs/awm-relayer v1.4.1-0.20240910171125-3c2ae781fb32 h1:KcrFCyWU6A+GJ/E2fZSI6qGjU3M2NPl7QrzJ5fH3t2Q=
github.com/ava-labs/awm-relayer v1.4.1-0.20240910171125-3c2ae781fb32/go.mod h1:Pen08eCEURnN4unfkAdYEIoKo/4RujaLV6ISgRUHj5g=
github.com/ava-labs/coreth v0.13.8 h1:f14X3KgwHl9LwzfxlN6S4bbn5VA2rhEsNnHaRLSTo/8=
Expand Down
32 changes: 10 additions & 22 deletions pkg/subnet/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,19 @@ func (d *PublicDeployer) AddValidatorNonSOV(
return false, tx, remainingSubnetAuthKeys, nil
}

// type SetSubnetValidatorWeightTx struct {
// // Metadata, inputs and outputs
// BaseTx
// // AddressedCall with Payload:
// // - ValidationID (SHA256 of the AddressedCall Payload of the RegisterSubnetValidatorTx adding the validator)
// // - Nonce
// // - Weight
// Message warp.Message `json:"message"`
// }
func (d *PublicDeployer) SetSubnetValidatorWeight(
message warp.Message,
) (*txs.Tx, error) {
// create tx
//unsignedTx, err := wallet.P().Builder().NewSetSubnetValidatorWeightTx(args...)
//if err != nil {
// return nil, fmt.Errorf("error building tx: %w", err)
//}
//tx := txs.Tx{Unsigned: unsignedTx}
// sign with current wallet that contains EVM address controlling POA Validator Manager
// TODO: change code below
//if err := wallet.P().Signer().Sign(context.Background(), &tx); err != nil {
// return nil, fmt.Errorf("error signing tx: %w", err)
//}
//return &tx, nil
return nil, nil
wallet, err := d.loadCacheWallet()
if err != nil {
return nil, err
}
//create tx
tx, err := wallet.P().IssueSetSubnetValidatorWeightTx(message.Bytes())
if err != nil {
return nil, fmt.Errorf("error building tx: %w", err)
}
return tx, nil
}

func (d *PublicDeployer) RegisterSubnetValidator(
Expand Down
Loading