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 Warp message signing #3428

Merged
merged 706 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
706 commits
Select commit Hold shift + click to select a range
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
436b471
Remove unused proto field
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
d5148eb
merged
StephenButtolph Nov 8, 2024
6dc9f6d
merged
StephenButtolph Nov 8, 2024
5e49482
Merge branch 'implement-acp-77--set-subnet-validator-weight-tx' into …
StephenButtolph Nov 8, 2024
abae441
nits from PR review
StephenButtolph Nov 8, 2024
b3e1095
unexport visitor
StephenButtolph Nov 8, 2024
28e028d
merged
StephenButtolph Nov 8, 2024
5f86e1a
add tx warp verifier tests
StephenButtolph Nov 9, 2024
4c9f376
Add block warp verifier
StephenButtolph Nov 9, 2024
b44a5eb
Reduce diff
StephenButtolph Nov 9, 2024
071a4ee
Start adding signer tests
StephenButtolph Nov 9, 2024
5450210
Add more tests
StephenButtolph Nov 10, 2024
683b716
Add last warp signing test
StephenButtolph Nov 10, 2024
70799d1
Fix premature conversion validator exit signing
StephenButtolph Nov 10, 2024
2396649
Update comments
StephenButtolph Nov 10, 2024
fa6227a
Remove todo
StephenButtolph Nov 10, 2024
a60c82b
reduce diff
StephenButtolph Nov 10, 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
6756ea0
Merge branch 'implement-acp-77--set-subnet-validator-weight-tx' into …
StephenButtolph Nov 11, 2024
27aa444
merge
StephenButtolph Nov 11, 2024
22e6b6b
cleanup code
StephenButtolph Nov 11, 2024
d92a83d
fix unit tests
StephenButtolph Nov 11, 2024
8007895
nit comment
StephenButtolph Nov 11, 2024
09f16e0
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
StephenButtolph Nov 11, 2024
024b042
nit renames
StephenButtolph Nov 11, 2024
5b832d8
address testing comments
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
b413478
Merge branch 'implement-acp-77--set-subnet-validator-weight-tx' into …
StephenButtolph Nov 11, 2024
57dddad
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
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
e42e213
Merge branch 'implement-acp-77--set-subnet-validator-weight-tx' into …
StephenButtolph Nov 11, 2024
841a599
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
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
b49f7f8
Merge branch 'implement-acp-77--set-subnet-validator-weight-tx' into …
StephenButtolph Nov 12, 2024
cdabac6
Add platform.getSubnetOnlyValidator API
StephenButtolph Nov 12, 2024
a513cf1
nit cleanup test
StephenButtolph Nov 12, 2024
0b529af
wip
StephenButtolph Nov 12, 2024
4935575
nits
StephenButtolph Nov 12, 2024
fd9e198
nit
StephenButtolph Nov 12, 2024
5953b6b
nit
StephenButtolph Nov 12, 2024
963b122
Add SoV deactivation owner support to the P-chain wallet
StephenButtolph Nov 12, 2024
44d3bd5
Merge branch 'add-validation-id-to-wallet' into implement-acp-77-warp…
StephenButtolph Nov 12, 2024
8b60ddb
merged
StephenButtolph Nov 12, 2024
1427525
reduce diff
StephenButtolph Nov 12, 2024
79cd3be
fix merge
StephenButtolph Nov 12, 2024
a2da59e
merged
StephenButtolph Nov 12, 2024
c7842c0
fix merge
StephenButtolph Nov 12, 2024
26aa5a3
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
StephenButtolph Nov 12, 2024
f7c3e71
nit
StephenButtolph Nov 13, 2024
a245061
Merge branch 'add-validation-id-to-wallet' into implement-acp-77-warp…
StephenButtolph Nov 13, 2024
ef445ca
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
StephenButtolph Nov 13, 2024
039d539
Rename error to be more generic
StephenButtolph Nov 13, 2024
a14dc90
Merge branch 'rename-error' into add-get-subnet-only-validator-api
StephenButtolph Nov 13, 2024
06ce053
Merge branch 'add-get-subnet-only-validator-api' into add-validation-…
StephenButtolph Nov 13, 2024
c03ad3b
Merge branch 'add-validation-id-to-wallet' into implement-acp-77-warp…
StephenButtolph Nov 13, 2024
75f94bf
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
StephenButtolph Nov 13, 2024
e485bd0
Add concurrent reads
StephenButtolph Nov 13, 2024
54f58a8
Merge branch 'master' into add-get-subnet-only-validator-api
StephenButtolph Nov 13, 2024
8806a57
Merge branch 'master' into add-get-subnet-only-validator-api
StephenButtolph Nov 13, 2024
d9b04ba
Address PR comments
StephenButtolph Nov 13, 2024
cfc0432
Merge branch 'add-get-subnet-only-validator-api' into add-validation-…
StephenButtolph Nov 13, 2024
137ce85
Merge branch 'master' into add-validation-id-to-wallet
StephenButtolph Nov 13, 2024
2fc07b3
Merge branch 'add-validation-id-to-wallet' into implement-acp-77-warp…
StephenButtolph Nov 13, 2024
52e04ff
Merge branch 'master' into implement-acp-77-warp-verification
StephenButtolph Nov 13, 2024
7953623
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
StephenButtolph Nov 13, 2024
8afb146
Merge branch 'master' into implement-acp-77-warp-signing
StephenButtolph Nov 13, 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
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Pending Release

### APIs

- Added `platform.getSubnetOnlyValidator`

### Configs

- Added P-chain configs
Expand Down
2 changes: 2 additions & 0 deletions network/p2p/acp118/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/ava-labs/avalanchego/vms/platformvm/warp"
)

const HandlerID = p2p.SignatureRequestHandlerID
StephenButtolph marked this conversation as resolved.
Show resolved Hide resolved

var _ p2p.Handler = (*Handler)(nil)

// Verifier verifies that a warp message should be signed
Expand Down
277 changes: 277 additions & 0 deletions proto/pb/platformvm/platformvm.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions proto/platformvm/platformvm.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";

package platformvm;

option go_package = "github.com/ava-labs/avalanchego/proto/pb/platformvm";

message SubnetValidatorRegistrationJustification {
oneof preimage {
// This should be set to obtain an attestation that a validator specified in
// a ConvertSubnetTx has been removed from the validator set.
SubnetIDIndex convert_subnet_tx_data = 1;
// This should be set to a RegisterSubnetValidatorMessage to obtain an
// attestation that a validator is not currently registered and can never be
// registered. This can be because the validator was successfully added and
// then later removed, or because the validator was never added and the
// registration expired.
bytes register_subnet_validator_message = 2;
}
}

message SubnetIDIndex {
bytes subnet_id = 1;
uint32 index = 2;
}
3 changes: 3 additions & 0 deletions snow/snowtest/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func Context(tb testing.TB, chainID ids.ID) *snow.Context {
require.NoError(aliaser.Alias(CChainID, CChainID.String()))

validatorState := &validatorstest.State{
GetMinimumHeightF: func(context.Context) (uint64, error) {
return 0, nil
},
GetSubnetIDF: func(_ context.Context, chainID ids.ID) (ids.ID, error) {
subnetID, ok := map[ids.ID]ids.ID{
constants.PlatformChainID: constants.PrimaryNetworkID,
Expand Down
Loading
Loading