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

ACP-77: Implement SetSubnetValidatorWeightTx #3421

Merged
merged 540 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
540 commits
Select commit Hold shift + click to select a range
2e7595c
Merge branch 'implement-acp-77-add-conversion-id' into implement-acp-…
StephenButtolph Oct 19, 2024
2fb7637
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Oct 19, 2024
30d788f
merged
StephenButtolph Oct 19, 2024
e83ad9a
Merge branch 'implement-acp-77-update-convert-subnet-tx' into impleme…
StephenButtolph Oct 19, 2024
e33eff9
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Oct 19, 2024
575b36a
remove unneeded assignment
StephenButtolph Oct 19, 2024
d2d0f69
update comment
StephenButtolph Oct 19, 2024
b6b6515
update comment
StephenButtolph Oct 19, 2024
6ffcd1b
update doc
StephenButtolph Oct 19, 2024
ad00180
Address comments
StephenButtolph Oct 20, 2024
f1b07d2
nit
StephenButtolph Oct 20, 2024
7fb99c0
fix unit tests
StephenButtolph Oct 20, 2024
65b5d50
Merge branch 'implement-acp-77-add-conversion-id' into implement-acp-…
StephenButtolph Oct 20, 2024
8791e78
merged
StephenButtolph Oct 20, 2024
f31cfc6
Add SoV Excess to P-chain state
StephenButtolph Oct 20, 2024
fe9a76d
merged
StephenButtolph Oct 20, 2024
369545d
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Oct 20, 2024
69adceb
merged
StephenButtolph Oct 20, 2024
96345cb
Merge branch 'implement-acp-77-update-convert-subnet-tx' into impleme…
StephenButtolph Oct 20, 2024
e1ebce9
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Oct 20, 2024
dc90043
fix merge
StephenButtolph Oct 20, 2024
81202b5
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Oct 20, 2024
2d722fa
fix merge
StephenButtolph Oct 20, 2024
58d5b8d
Populate BLS key diffs for subnet validators
StephenButtolph Oct 21, 2024
273fbbe
Populate BLS key diffs for subnet validators
StephenButtolph Oct 21, 2024
290ef97
Update mocks
StephenButtolph Oct 22, 2024
9155e1f
Fix tests
StephenButtolph Oct 22, 2024
cadf8f7
Merge branch 'master' into populate-subnet-public-key-diffs
StephenButtolph Oct 22, 2024
803d0c4
nit
StephenButtolph Oct 22, 2024
76f4eee
Merge branch 'populate-subnet-public-key-diffs' of github.com:ava-lab…
StephenButtolph Oct 22, 2024
a2c7773
Update test and populate public keys during startup
StephenButtolph Oct 22, 2024
95c42a1
comment
StephenButtolph Oct 23, 2024
3d7bd81
Merge branch 'master' into populate-subnet-public-key-diffs
StephenButtolph Oct 23, 2024
bbc395b
merged
StephenButtolph Oct 23, 2024
3a03597
merged
StephenButtolph Oct 23, 2024
21cdc32
Update P-chain state staker tests
StephenButtolph Oct 24, 2024
845f1d2
merged
StephenButtolph Oct 24, 2024
91a7cd7
fix test
StephenButtolph Oct 24, 2024
df02f3c
Merge branch 'update-state-staker-tests' into populate-subnet-public-…
StephenButtolph Oct 24, 2024
c848fee
fix test
StephenButtolph Oct 24, 2024
79c9b40
nit
StephenButtolph Oct 24, 2024
d8819fc
Merge branch 'master' into update-state-staker-tests
StephenButtolph Oct 24, 2024
667002e
Merge branch 'update-state-staker-tests' into populate-subnet-public-…
StephenButtolph Oct 24, 2024
31be1e2
merged
StephenButtolph Oct 24, 2024
fb7f564
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Oct 24, 2024
cd317f5
Merge branch 'implement-acp-77-deactivation' into implement-acp-77-up…
StephenButtolph Oct 24, 2024
9884275
Merge branch 'implement-acp-77-update-convert-subnet-tx' into impleme…
StephenButtolph Oct 24, 2024
ed2fcfd
simplify test
StephenButtolph Oct 24, 2024
c4f5652
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Oct 24, 2024
8f0a080
merged
StephenButtolph Oct 24, 2024
d482de8
Merge branch 'populate-subnet-public-key-diffs' into implement-acp-77…
StephenButtolph Oct 24, 2024
fc27346
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Oct 24, 2024
e8b21ec
Verify no SoV + legacy overlap
StephenButtolph Oct 24, 2024
7f517c7
Fix legacy validator migration
StephenButtolph Oct 24, 2024
7d0d7e5
merged
StephenButtolph Oct 25, 2024
08bd9e3
ACP-77: Add subnetIDNodeID struct
StephenButtolph Oct 25, 2024
78c1c3d
nit
StephenButtolph Oct 26, 2024
6547c6d
Merge branch 'master' into implement-acp-77-add-subnetid-nodeid
StephenButtolph Oct 26, 2024
38ee164
Merge branch 'implement-acp-77-add-subnetid-nodeid' into implement-ac…
StephenButtolph Oct 26, 2024
d2137ef
fix merge
StephenButtolph Oct 26, 2024
5845d11
Split writeCurrentStakers into multiple functions
StephenButtolph Oct 26, 2024
6c3116a
merged
StephenButtolph Oct 27, 2024
d0d1602
reduce diff
StephenButtolph Oct 27, 2024
d397375
reduce diff
StephenButtolph Oct 27, 2024
5f8a09c
reduce diff
StephenButtolph Oct 27, 2024
3e9dc01
reduce diff
StephenButtolph Oct 27, 2024
da3a726
reduce diff
StephenButtolph Oct 27, 2024
8483ced
cleanup
StephenButtolph Oct 27, 2024
0507ce7
nit
StephenButtolph Oct 27, 2024
0022a65
Merge branch 'refactor-write-current-stakers' into implement-acp-77-s…
StephenButtolph Oct 27, 2024
8bbeee6
Add comment
StephenButtolph Oct 27, 2024
08dd776
comment
StephenButtolph Oct 27, 2024
255b0bf
nit
StephenButtolph Oct 27, 2024
3bc547d
reduce diff
StephenButtolph Oct 27, 2024
bff468d
Merge branch 'master' into refactor-write-current-stakers
StephenButtolph Oct 28, 2024
99f3c97
Merge branch 'refactor-write-current-stakers' into implement-acp-77-s…
StephenButtolph Oct 28, 2024
7cf1668
merged
StephenButtolph Oct 29, 2024
41f78f0
nit
StephenButtolph Oct 29, 2024
29cd6ba
nit
StephenButtolph Oct 29, 2024
8dfcbb1
Fix initValidatorSets
StephenButtolph Oct 29, 2024
ef29548
nit
StephenButtolph Oct 29, 2024
a77fb3c
test subnetIDNodeIDDB
StephenButtolph Oct 29, 2024
ce05dc8
fix comments
StephenButtolph Oct 29, 2024
3d04cef
nit
StephenButtolph Oct 29, 2024
dc35645
nit
StephenButtolph Oct 29, 2024
d472a9f
Reduce diff
StephenButtolph Oct 29, 2024
34ba29b
add comment
StephenButtolph Oct 29, 2024
97029aa
reduce diff
StephenButtolph Oct 30, 2024
dbeee70
Add NumSubnets to the validator manager interface
StephenButtolph Oct 30, 2024
729ded5
merged
StephenButtolph Oct 30, 2024
3621e53
add comment
StephenButtolph Oct 30, 2024
de2be9f
merged
StephenButtolph Oct 30, 2024
92a2277
Delete empty entries
StephenButtolph Oct 30, 2024
6375aa2
simplify state futher
StephenButtolph Oct 30, 2024
aedff15
nit
StephenButtolph Oct 30, 2024
1ac030a
nit
StephenButtolph Oct 30, 2024
9e0d7d5
Add caching
StephenButtolph Oct 31, 2024
9993b05
nit
StephenButtolph Oct 31, 2024
547d426
nit
StephenButtolph Oct 31, 2024
6bcc0ea
Add TODOs
StephenButtolph Oct 31, 2024
6065604
Merge branch 'master' into implement-acp-77-sov-validators-state
StephenButtolph Oct 31, 2024
a7792c7
Add config changes to readme
StephenButtolph Oct 31, 2024
39b961b
Merge branch 'implement-acp-77-sov-validators-state' of github.com:av…
StephenButtolph Oct 31, 2024
4723c46
Improve doc for PutSubnetOnlyValidator
StephenButtolph Oct 31, 2024
46c4889
Merge branch 'master' into implement-acp-77-sov-validators-state
StephenButtolph Oct 31, 2024
a576cd1
merged
StephenButtolph Oct 31, 2024
f1ca6e6
Add test that decreases weight
StephenButtolph Oct 31, 2024
71f88e8
Fix regression
StephenButtolph Oct 31, 2024
c2ffd17
nit
StephenButtolph Oct 31, 2024
2b5d7c7
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Oct 31, 2024
91a6465
nit
StephenButtolph Oct 31, 2024
07370a5
nits
StephenButtolph Oct 31, 2024
23aff43
Add additional test
StephenButtolph Oct 31, 2024
66011f0
Move caching logic
StephenButtolph Nov 1, 2024
32bba0e
Merge branch 'master' into implement-acp-77-sov-validators-state
StephenButtolph Nov 1, 2024
d183148
merged
StephenButtolph Nov 1, 2024
b1bb458
nit
StephenButtolph Nov 1, 2024
ad31107
Add weight diff helpers
StephenButtolph Nov 1, 2024
cee236e
nit
StephenButtolph Nov 1, 2024
900eba3
add -> addOrSub
StephenButtolph Nov 1, 2024
fd48bde
merged
StephenButtolph Nov 2, 2024
7cbf31b
fix merge
StephenButtolph Nov 2, 2024
33d297d
Add test
StephenButtolph Nov 2, 2024
486f732
nit
StephenButtolph Nov 2, 2024
b448a04
reduce diff
StephenButtolph Nov 2, 2024
0685531
Add tests
StephenButtolph Nov 2, 2024
bb9f853
test excess and fees
StephenButtolph Nov 2, 2024
e6e3e76
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Nov 2, 2024
3077356
merged
StephenButtolph Nov 4, 2024
69837c1
improve caching
StephenButtolph Nov 4, 2024
8611fe4
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Nov 4, 2024
a5d3930
cleanup
StephenButtolph Nov 4, 2024
d74cdff
Simplify test
StephenButtolph Nov 4, 2024
7cddfc0
reduce diff
StephenButtolph Nov 4, 2024
afc9054
nit
StephenButtolph Nov 4, 2024
3c8246e
nit
StephenButtolph Nov 4, 2024
1268ed1
nit
StephenButtolph Nov 4, 2024
f7b75bc
nits
StephenButtolph Nov 4, 2024
82a249b
nit
StephenButtolph Nov 4, 2024
d37e9f3
nit
StephenButtolph Nov 5, 2024
9dc642a
num -> net for possibly negative value
StephenButtolph Nov 5, 2024
22de2b1
Address PR comments
StephenButtolph Nov 5, 2024
cc0e0ee
add comments
StephenButtolph Nov 5, 2024
33fea00
Merge branch 'implement-acp-77-sov-validators-state' into implement-a…
StephenButtolph Nov 5, 2024
915eb71
nit
StephenButtolph Nov 5, 2024
3811423
Merge branch 'implement-acp-77-deactivation' into implement-acp-77-up…
StephenButtolph Nov 5, 2024
b0c6f0b
merged
StephenButtolph Nov 5, 2024
74edd4f
reduce diff
StephenButtolph Nov 5, 2024
7d31e7a
nit
StephenButtolph Nov 5, 2024
fca9460
nit
StephenButtolph Nov 5, 2024
158621c
nit
StephenButtolph Nov 5, 2024
4c6462c
nit
StephenButtolph Nov 5, 2024
a217d1b
nit
StephenButtolph Nov 5, 2024
3987922
nit
StephenButtolph Nov 5, 2024
56475cf
Add nodeID tests
StephenButtolph Nov 5, 2024
db85cf1
ACP-77: Refactor e2e test
StephenButtolph Nov 5, 2024
8a18b14
nit
StephenButtolph Nov 5, 2024
6dc3e84
merged
StephenButtolph Nov 5, 2024
f8552ba
reduce diff
StephenButtolph Nov 5, 2024
7e1c545
merged
StephenButtolph Nov 5, 2024
88fe959
merged
StephenButtolph Nov 5, 2024
5b08c6a
test subnet state prior to conversion
StephenButtolph Nov 6, 2024
54b24e5
Merge branch 'implement-acp-77-update-convert-subnet-tx' into impleme…
StephenButtolph Nov 6, 2024
9884a93
nits
StephenButtolph Nov 6, 2024
a7cd427
nit
StephenButtolph Nov 6, 2024
4c2605c
wip
StephenButtolph Nov 6, 2024
20bd155
merged
StephenButtolph Nov 6, 2024
acf026a
comments
StephenButtolph Nov 6, 2024
bb0a605
merged
StephenButtolph Nov 6, 2024
0bf397a
Unexport AtomicTxExecutor
StephenButtolph Nov 6, 2024
5591626
nit
StephenButtolph Nov 6, 2024
0093c70
Unexport ProposalTxExecutor
StephenButtolph Nov 6, 2024
a0e6bcd
comment new function
StephenButtolph Nov 6, 2024
5e46925
nit
StephenButtolph Nov 6, 2024
706c833
Standardize standard tx executor
StephenButtolph Nov 7, 2024
3a01924
nit
StephenButtolph Nov 7, 2024
d7e00dd
nit
StephenButtolph Nov 7, 2024
56b0049
nit
StephenButtolph Nov 7, 2024
3540203
nit
StephenButtolph Nov 7, 2024
1bf8709
nit
StephenButtolph Nov 7, 2024
018b0aa
Comment
StephenButtolph Nov 7, 2024
bd6e10b
Remove P-chain txsmock package
StephenButtolph Nov 7, 2024
24c7d4b
nit
StephenButtolph Nov 7, 2024
833c04d
merged
StephenButtolph Nov 7, 2024
70a53b3
reduce diff
StephenButtolph Nov 7, 2024
26c3549
reduce diff
StephenButtolph Nov 7, 2024
877242f
reduce diff
StephenButtolph Nov 7, 2024
5110cfa
reduce diff
StephenButtolph Nov 7, 2024
e435ed7
reduce diff
StephenButtolph Nov 7, 2024
3750b1c
reduce diff
StephenButtolph Nov 7, 2024
687398e
reduce diff
StephenButtolph Nov 7, 2024
5a08505
reduce diff
StephenButtolph Nov 7, 2024
05d24ca
reduce diff
StephenButtolph Nov 7, 2024
37bede4
reduce diff
StephenButtolph Nov 7, 2024
3098c0b
reduce diff
StephenButtolph Nov 7, 2024
240f1e8
Standardize P-Chain tx visitor order
StephenButtolph Nov 7, 2024
e0ab968
merged
StephenButtolph Nov 7, 2024
efa35a4
nit
StephenButtolph Nov 7, 2024
031b989
nit
StephenButtolph Nov 7, 2024
a3f6186
Add tx builder test
StephenButtolph Nov 7, 2024
f767800
add comments
StephenButtolph Nov 7, 2024
0901618
Merge branch 'master' into standardize-p-chain-tx-vistors
StephenButtolph Nov 7, 2024
aedd8da
Merge branch 'standardize-p-chain-tx-vistors' into standardize-p-chai…
StephenButtolph Nov 7, 2024
e64ca23
Add RegisterSubnetValidatorTx serialization and SyntacticVerify tests
StephenButtolph Nov 7, 2024
4c86649
add TODO
StephenButtolph Nov 7, 2024
987c4e2
reduce diff
StephenButtolph Nov 7, 2024
e10a311
merged
StephenButtolph Nov 7, 2024
f55e2c0
Merge branch 'standardize-p-chain-visitor-order' into implement-acp-7…
StephenButtolph Nov 7, 2024
98ffb01
remove dead code
StephenButtolph Nov 7, 2024
6b23e82
Cleanup code
StephenButtolph Nov 7, 2024
c8f5157
nit
StephenButtolph Nov 7, 2024
a741fe9
merged
StephenButtolph Nov 7, 2024
af6171a
Add execution tests
StephenButtolph Nov 8, 2024
e3f6ab3
nit
StephenButtolph Nov 8, 2024
fc9440c
nit
StephenButtolph Nov 8, 2024
f41cff6
remove usage of defer
StephenButtolph Nov 8, 2024
e2b971e
merged
StephenButtolph Nov 8, 2024
38f63f9
nit
StephenButtolph Nov 8, 2024
aa4e859
nit
StephenButtolph Nov 8, 2024
a35c877
nit
StephenButtolph Nov 8, 2024
93ffbcd
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Nov 8, 2024
28b478b
oops
StephenButtolph Nov 8, 2024
db37d00
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Nov 8, 2024
3b1d5ca
nit
StephenButtolph Nov 8, 2024
9571693
nit
StephenButtolph Nov 8, 2024
30ac509
Address PR comments
StephenButtolph Nov 8, 2024
9769f21
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Nov 8, 2024
f16cc58
Address PR comments
StephenButtolph Nov 8, 2024
2947902
comment nits
StephenButtolph Nov 8, 2024
6357f5a
improve error reporting
StephenButtolph Nov 8, 2024
eaa7ea3
nit
StephenButtolph Nov 8, 2024
e2451ab
Add SetSubnetValidatorWeightTx serialization and SyntacticVerify tests
StephenButtolph Nov 8, 2024
6d04b1f
Add SetSubnetValidatorWeightTx builder tests
StephenButtolph Nov 8, 2024
b71faf7
execution test nits
StephenButtolph Nov 8, 2024
949da1d
Merge branch 'implement-acp-77-register-subnet-validator-tx' into imp…
StephenButtolph Nov 8, 2024
fde96e7
Add SetSubnetValidatorWeightTx execution tests
StephenButtolph Nov 8, 2024
c975b67
nit
StephenButtolph Nov 8, 2024
ddd97e3
Add overflow case
StephenButtolph Nov 8, 2024
6dc9f6d
merged
StephenButtolph Nov 8, 2024
a4637e7
Refactor P-Chain configs
StephenButtolph Nov 10, 2024
e055312
Merge branch 'refactor-p-chain-configs' into implement-acp-77--set-su…
StephenButtolph Nov 11, 2024
5797442
merge
StephenButtolph Nov 11, 2024
024b042
nit renames
StephenButtolph Nov 11, 2024
33c2ac8
nit
StephenButtolph Nov 11, 2024
fa5f2cb
Merge branch 'refactor-p-chain-configs' into implement-acp-77--set-su…
StephenButtolph Nov 11, 2024
860fc32
Refactor subnet auth verification
StephenButtolph Nov 11, 2024
02fa55a
Merge branch 'refactor-subnet-auth-verification' into implement-acp-7…
StephenButtolph Nov 11, 2024
4b36d76
merged
StephenButtolph Nov 12, 2024
ee3f305
Merge branch 'refactor-subnet-auth-verification' into implement-acp-7…
StephenButtolph Nov 12, 2024
48a5ac7
Merge branch 'master' into implement-acp-77--set-subnet-validator-wei…
StephenButtolph Nov 12, 2024
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 node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ func (n *Node) initVMs() error {
// Register the VMs that Avalanche supports
err := errors.Join(
n.VMManager.RegisterFactory(context.TODO(), constants.PlatformVMID, &platformvm.Factory{
Config: platformconfig.Config{
Internal: platformconfig.Internal{
Chains: n.chainManager,
Validators: vdrs,
UptimeLockedCalculator: n.uptimeCalculator,
Expand Down
93 changes: 93 additions & 0 deletions tests/e2e/p/l1.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const (
genesisWeight = units.Schmeckle
genesisBalance = units.Avax
registerWeight = genesisWeight / 10
updatedWeight = 2 * registerWeight
registerBalance = 0

// Validator registration attempts expire 5 minutes after they are created
Expand Down Expand Up @@ -300,6 +301,7 @@ var _ = e2e.DescribePChain("[L1]", func() {
registerWeight,
)
require.NoError(err)
registerValidationID := registerSubnetValidatorMessage.ValidationID()

tc.By("registering the validator", func() {
tc.By("creating the unsigned warp message")
Expand Down Expand Up @@ -365,6 +367,97 @@ var _ = e2e.DescribePChain("[L1]", func() {
})
})

var nextNonce uint64
setWeight := func(validationID ids.ID, weight uint64) {
tc.By("creating the unsigned SubnetValidatorWeightMessage")
unsignedSubnetValidatorWeight := must[*warp.UnsignedMessage](tc)(warp.NewUnsignedMessage(
networkID,
chainID,
must[*payload.AddressedCall](tc)(payload.NewAddressedCall(
address,
must[*warpmessage.SubnetValidatorWeight](tc)(warpmessage.NewSubnetValidatorWeight(
validationID,
nextNonce,
weight,
)).Bytes(),
)).Bytes(),
))

tc.By("sending the request to sign the warp message", func() {
setSubnetValidatorWeightRequest, err := wrapWarpSignatureRequest(
unsignedSubnetValidatorWeight,
nil,
)
require.NoError(err)

require.True(genesisPeer.Send(tc.DefaultContext(), setSubnetValidatorWeightRequest))
})

tc.By("getting the signature response")
setSubnetValidatorWeightSignature, ok, err := findMessage(genesisPeerMessages, unwrapWarpSignature)
require.NoError(err)
require.True(ok)

tc.By("creating the signed warp message to increase the weight of the validator")
setSubnetValidatorWeight, err := warp.NewMessage(
unsignedSubnetValidatorWeight,
&warp.BitSetSignature{
Signers: set.NewBits(0).Bytes(), // [signers] has weight from the genesis peer
Signature: ([bls.SignatureLen]byte)(
bls.SignatureToBytes(setSubnetValidatorWeightSignature),
),
},
)
require.NoError(err)

tc.By("issuing a SetSubnetValidatorWeightTx", func() {
_, err := pWallet.IssueSetSubnetValidatorWeightTx(
setSubnetValidatorWeight.Bytes(),
)
require.NoError(err)
})

nextNonce++
}

tc.By("increasing the weight of the validator", func() {
setWeight(registerValidationID, updatedWeight)
})

tc.By("verifying the validator weight was increased", func() {
tc.By("verifying the validator set was updated", func() {
verifyValidatorSet(map[ids.NodeID]*snowvalidators.GetValidatorOutput{
subnetGenesisNode.NodeID: {
NodeID: subnetGenesisNode.NodeID,
PublicKey: genesisNodePK,
Weight: genesisWeight,
},
ids.EmptyNodeID: { // The validator is not active
marun marked this conversation as resolved.
Show resolved Hide resolved
NodeID: ids.EmptyNodeID,
Weight: updatedWeight,
},
})
})
})

tc.By("advancing the proposervm P-chain height", advanceProposerVMPChainHeight)

tc.By("removing the registered validator", func() {
setWeight(registerValidationID, 0)
})

tc.By("verifying the validator was removed", func() {
tc.By("verifying the validator set was updated", func() {
verifyValidatorSet(map[ids.NodeID]*snowvalidators.GetValidatorOutput{
subnetGenesisNode.NodeID: {
NodeID: subnetGenesisNode.NodeID,
PublicKey: genesisNodePK,
Weight: genesisWeight,
},
})
})
})

genesisPeerMessages.Close()
genesisPeer.StartClose()
require.NoError(genesisPeer.AwaitClosed(tc.DefaultContext()))
Expand Down
8 changes: 4 additions & 4 deletions vms/platformvm/block/builder/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type environment struct {
sender *enginetest.Sender

isBootstrapped *utils.Atomic[bool]
config *config.Config
config *config.Internal
clk *mockable.Clock
baseDB *versiondb.Database
ctx *snow.Context
Expand Down Expand Up @@ -167,7 +167,7 @@ func newEnvironment(t *testing.T, f upgradetest.Fork) *environment { //nolint:un
res.backend.Config.PartialSyncPrimaryNetwork,
res.sender,
registerer,
network.DefaultConfig,
config.DefaultNetwork,
)
require.NoError(err)

Expand Down Expand Up @@ -260,7 +260,7 @@ func addSubnet(t *testing.T, env *environment) {
require.NoError(env.state.Commit())
}

func defaultConfig(f upgradetest.Fork) *config.Config {
func defaultConfig(f upgradetest.Fork) *config.Internal {
upgrades := upgradetest.GetConfigWithUpgradeTime(f, time.Time{})
// This package neglects fork ordering
upgradetest.SetTimesTo(
Expand All @@ -269,7 +269,7 @@ func defaultConfig(f upgradetest.Fork) *config.Config {
genesistest.DefaultValidatorEndTime,
)

return &config.Config{
return &config.Internal{
Chains: chains.TestManager,
UptimeLockedCalculator: uptime.NewLockedCalculator(),
Validators: validators.NewManager(),
Expand Down
20 changes: 10 additions & 10 deletions vms/platformvm/block/executor/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand All @@ -73,7 +73,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -147,7 +147,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -188,7 +188,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -239,7 +239,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -351,7 +351,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: 0,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -413,7 +413,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: .8,
},
Uptimes: uptimes,
Expand Down Expand Up @@ -475,7 +475,7 @@ func TestBlockOptions(t *testing.T) {
ctx: snowtest.Context(t, snowtest.PChainID),
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UptimePercentage: .8,
},
Uptimes: uptimes,
Expand Down
6 changes: 3 additions & 3 deletions vms/platformvm/block/executor/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type environment struct {
sender *enginetest.Sender

isBootstrapped *utils.Atomic[bool]
config *config.Config
config *config.Internal
clk *mockable.Clock
baseDB *versiondb.Database
ctx *snow.Context
Expand Down Expand Up @@ -266,7 +266,7 @@ func addSubnet(t testing.TB, env *environment) {
require.NoError(env.state.Commit())
}

func defaultConfig(f upgradetest.Fork) *config.Config {
func defaultConfig(f upgradetest.Fork) *config.Internal {
upgrades := upgradetest.GetConfigWithUpgradeTime(f, time.Time{})
// This package neglects fork ordering
upgradetest.SetTimesTo(
Expand All @@ -275,7 +275,7 @@ func defaultConfig(f upgradetest.Fork) *config.Config {
genesistest.DefaultValidatorEndTime,
)

return &config.Config{
return &config.Internal{
Chains: chains.TestManager,
UptimeLockedCalculator: uptime.NewLockedCalculator(),
Validators: validators.NewManager(),
Expand Down
24 changes: 12 additions & 12 deletions vms/platformvm/block/executor/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func newTestVerifier(t testing.TB, c testVerifierConfig) *verifier {
ctx: c.Context,
},
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
CreateAssetTxFee: genesis.LocalParams.CreateAssetTxFee,
StaticFeeConfig: genesis.LocalParams.StaticFeeConfig,
DynamicFeeConfig: genesis.LocalParams.DynamicFeeConfig,
Expand Down Expand Up @@ -460,7 +460,7 @@ func TestVerifierVisitCommitBlock(t *testing.T) {
}
manager := &manager{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.ApricotPhasePost6),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -527,7 +527,7 @@ func TestVerifierVisitAbortBlock(t *testing.T) {
}
manager := &manager{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.ApricotPhasePost6),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -582,7 +582,7 @@ func TestVerifyUnverifiedParent(t *testing.T) {
}
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.ApricotPhasePost6),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -654,7 +654,7 @@ func TestBanffAbortBlockTimestampChecks(t *testing.T) {
}
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.Banff),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -754,7 +754,7 @@ func TestBanffCommitBlockTimestampChecks(t *testing.T) {
}
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.Banff),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -831,7 +831,7 @@ func TestVerifierVisitApricotStandardBlockWithProposalBlockParent(t *testing.T)
}
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.ApricotPhasePost6),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -888,7 +888,7 @@ func TestVerifierVisitBanffStandardBlockWithProposalBlockParent(t *testing.T) {
}
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.Banff),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -925,7 +925,7 @@ func TestVerifierVisitApricotCommitBlockUnexpectedParentState(t *testing.T) {
parentStatelessBlk := block.NewMockBlock(ctrl)
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.ApricotPhasePost6),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -968,7 +968,7 @@ func TestVerifierVisitBanffCommitBlockUnexpectedParentState(t *testing.T) {
timestamp := time.Unix(12345, 0)
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.Banff),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -1012,7 +1012,7 @@ func TestVerifierVisitApricotAbortBlockUnexpectedParentState(t *testing.T) {
parentStatelessBlk := block.NewMockBlock(ctrl)
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.ApricotPhasePost6),
},
Clk: &mockable.Clock{},
Expand Down Expand Up @@ -1055,7 +1055,7 @@ func TestVerifierVisitBanffAbortBlockUnexpectedParentState(t *testing.T) {
timestamp := time.Unix(12345, 0)
verifier := &verifier{
txExecutorBackend: &executor.Backend{
Config: &config.Config{
Config: &config.Internal{
UpgradeConfig: upgradetest.GetConfig(upgradetest.Banff),
},
Clk: &mockable.Clock{},
Expand Down
Loading
Loading