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

feat: consensus key rotation of validator #15165

Closed
wants to merge 149 commits into from
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
51ee0ca
proto
atheeshp Feb 24, 2023
6853635
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Feb 27, 2023
7cbfc43
proto changes
atheeshp Feb 27, 2023
cbd0343
`proto-gen`
atheeshp Feb 27, 2023
f783c0d
proto
atheeshp Feb 27, 2023
4ecaa6c
proto-gen
atheeshp Feb 27, 2023
e14d855
proto
atheeshp Feb 27, 2023
4ee3770
make proto-gen
atheeshp Feb 27, 2023
f960a1e
proto
atheeshp Feb 27, 2023
2d85e5a
proto-gen
atheeshp Feb 27, 2023
243f7cb
added `RotateConsPubKey` in msg_server
atheeshp Feb 27, 2023
5ab4556
migrate the consensus key work
atheeshp Feb 27, 2023
d93b13e
TODO
atheeshp Feb 27, 2023
01456da
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Feb 27, 2023
0074287
add tests
atheeshp Mar 2, 2023
a1f364d
fix lint
atheeshp Mar 2, 2023
f93c237
lint
atheeshp Mar 2, 2023
5131524
error handling
atheeshp Mar 2, 2023
7882464
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 2, 2023
d1c49d5
fix non determinism
atheeshp Mar 2, 2023
359a55b
fix tests
atheeshp Mar 2, 2023
b62b194
fix tests
atheeshp Mar 2, 2023
b990ab5
fix tests
atheeshp Mar 2, 2023
76f0d9f
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 2, 2023
a112e00
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 8, 2023
36099de
fix tests
atheeshp Mar 8, 2023
2598341
fix tests
atheeshp Mar 8, 2023
9d47d8a
fix tests
atheeshp Mar 9, 2023
d15dd71
add simulation tests
atheeshp Mar 9, 2023
b242665
fix sims
atheeshp Mar 9, 2023
64d634b
Merge branch 'main' into ap/cons_pubkey
atheeshp Mar 9, 2023
e1e507b
proto
atheeshp Mar 10, 2023
b6b6128
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp Mar 10, 2023
d73f91c
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 10, 2023
48de656
proto-gen
atheeshp Mar 10, 2023
772278e
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 10, 2023
7ce91d2
fix: address failing test (#15390)
kocubinski Mar 16, 2023
431d0cf
Merge branch 'main' into ap/cons_pubkey
atheeshp Mar 16, 2023
4ac89bc
Update x/staking/keeper/msg_server.go
atheeshp Mar 16, 2023
e517e1d
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp Mar 16, 2023
b84a993
proto
atheeshp Mar 16, 2023
07a4fb7
proto-gen
atheeshp Mar 16, 2023
9385cd0
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 16, 2023
ef3081a
fix failing tests
atheeshp Mar 16, 2023
ad3ceee
fix CLI
atheeshp Mar 16, 2023
4036593
fix test
atheeshp Mar 16, 2023
9bf7633
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 21, 2023
34d2829
proto
atheeshp Mar 27, 2023
fdc081c
proto-gen
atheeshp Mar 27, 2023
acae606
implement waiting period for rotations after limit
atheeshp Mar 27, 2023
7104bad
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 28, 2023
f9b1404
add tests
atheeshp Mar 29, 2023
814312d
proto
atheeshp Mar 29, 2023
76741c4
proto-gen
atheeshp Mar 29, 2023
f01faf6
update rotation history obj
atheeshp Mar 29, 2023
31fe9fc
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 29, 2023
930fb5c
imports
atheeshp Mar 29, 2023
da317a6
fix tests
atheeshp Mar 29, 2023
48697d2
fix tests
atheeshp Mar 30, 2023
60053b7
remove old signing info
atheeshp Mar 30, 2023
a97735e
update changelog
atheeshp Mar 30, 2023
81484b6
docs
atheeshp Mar 31, 2023
50896db
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Mar 31, 2023
5d6bc6a
update params
atheeshp Apr 5, 2023
fedd4a5
Update x/staking/keeper/cons_pubkey.go
atheeshp Apr 5, 2023
da67ade
Update x/staking/README.md
atheeshp Apr 5, 2023
268af80
Update x/staking/README.md
atheeshp Apr 5, 2023
a7909d3
Update x/staking/keeper/msg_server.go
atheeshp Apr 5, 2023
9c31343
Update x/staking/keeper/msg_server.go
atheeshp Apr 5, 2023
b9cec9d
Update x/staking/keeper/msg_server.go
atheeshp Apr 5, 2023
b3ceb38
review changes
atheeshp Apr 5, 2023
f1c1795
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp Apr 5, 2023
9d1432e
Update x/staking/README.md
atheeshp Apr 5, 2023
747b0f0
review changes
atheeshp Apr 5, 2023
1560edd
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp Apr 5, 2023
d021191
proto-gen
atheeshp Apr 5, 2023
cc93ef6
uint32 change
atheeshp Apr 5, 2023
9bca695
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Apr 5, 2023
fc86b55
fix tests
atheeshp Apr 5, 2023
c787ba1
fix tests
atheeshp Apr 5, 2023
2af2d2c
add tests
atheeshp May 5, 2023
cf3e9f6
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 5, 2023
13ed78f
conflicts
atheeshp May 5, 2023
a8840d3
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 5, 2023
903d1fa
proto-gen
atheeshp May 5, 2023
4376c1d
go mod tidy
atheeshp May 5, 2023
4d0dc8a
tests
atheeshp May 5, 2023
1ae1793
try fixing sims
atheeshp May 8, 2023
77ad07a
logs
atheeshp May 8, 2023
1027a86
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 8, 2023
62fbed4
fix tests
atheeshp May 8, 2023
8b2ec86
fix tests
atheeshp May 9, 2023
40f5f27
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 9, 2023
d9ba01f
fix sims
atheeshp May 9, 2023
2f1e8c5
fix tests
atheeshp May 9, 2023
6226dbc
fix lint
atheeshp May 10, 2023
85a48a8
fix test
atheeshp May 10, 2023
ca6ced3
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 10, 2023
c39d4bf
fix tests
atheeshp May 10, 2023
c4101c5
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 10, 2023
6d84ed1
revert tests
atheeshp May 10, 2023
3ce1f9c
Merge branch 'main' into ap/cons_pubkey
atheeshp May 10, 2023
e5cb0fa
try fixing sims
atheeshp May 10, 2023
1625c05
Merge branch 'main' into ap/cons_pubkey
atheeshp May 11, 2023
5a8b595
fix lint
atheeshp May 11, 2023
c6de673
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp May 11, 2023
f29cbfb
fix test
atheeshp May 11, 2023
c2f6a04
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 15, 2023
2f41525
update tests
atheeshp May 15, 2023
93e86b9
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 15, 2023
022c893
fix failing test
atheeshp May 15, 2023
34ecfb0
lint
atheeshp May 15, 2023
dcd8da9
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 16, 2023
0efa8c1
try fixing failing sim
atheeshp May 16, 2023
686b7bd
review changes
atheeshp May 17, 2023
170193b
proto
atheeshp May 17, 2023
490edf3
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 17, 2023
225909e
proto-gen
atheeshp May 17, 2023
5141aee
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp May 17, 2023
5f8eccf
review changes
atheeshp May 17, 2023
556f0cc
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 17, 2023
aaeb807
fix sims
atheeshp May 17, 2023
cb63940
fix sim
atheeshp May 17, 2023
a929179
fix failing test
atheeshp May 17, 2023
312e200
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 18, 2023
03ea64b
fix conflicts
atheeshp May 18, 2023
098fe05
lint
atheeshp May 18, 2023
4cded71
fix sims
atheeshp May 18, 2023
2e9a242
update sim
atheeshp May 18, 2023
6412f8b
fix sim tests
atheeshp May 22, 2023
bb906b0
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 22, 2023
8c79adc
fix keys
atheeshp May 23, 2023
aaf9731
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 23, 2023
c522de6
fix tests
atheeshp May 23, 2023
56c1048
fix failing tests
atheeshp May 24, 2023
17cc1de
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 26, 2023
3ff4c17
proto-gen
atheeshp May 26, 2023
383461b
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp May 29, 2023
aa74774
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp May 29, 2023
425b8b6
proto
atheeshp May 29, 2023
7bf26a9
proto
atheeshp May 29, 2023
a0e1ba1
make proto-gen
atheeshp May 29, 2023
243d002
fix test
atheeshp May 29, 2023
0f82de5
Merge branch 'ap/cons_pubkey' of github.com:cosmos/cosmos-sdk into ap…
atheeshp May 29, 2023
da1ac9d
review changes
atheeshp May 29, 2023
2e9c544
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Jun 5, 2023
0e3b518
resolve conflicts
atheeshp Jun 5, 2023
6602b69
Merge branch 'main' of github.com:cosmos/cosmos-sdk into ap/cons_pubkey
atheeshp Jun 6, 2023
40f951b
review change
atheeshp Jun 6, 2023
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
1,428 changes: 1,156 additions & 272 deletions api/cosmos/staking/v1beta1/staking.pulsar.go

Large diffs are not rendered by default.

1,098 changes: 1,041 additions & 57 deletions api/cosmos/staking/v1beta1/tx.pulsar.go

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions api/cosmos/staking/v1beta1/tx_grpc.pb.go

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

425 changes: 215 additions & 210 deletions api/cosmos/tx/v1beta1/service.pulsar.go

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions proto/cosmos/staking/v1beta1/staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ message Params {
(amino.dont_omitempty) = true,
(cosmos_proto.scalar) = "cosmos.Dec"
];
// max_cons_pubkey_rotations is maximum number of consensus pubkey rotations
tac0turtle marked this conversation as resolved.
Show resolved Hide resolved
uint64 max_cons_pubkey_rotations = 7;
// cons_pubkey_rotation_fee is fee to be spent when rotating validator's consensus pubkey
cosmos.base.v1beta1.Coin cons_pubkey_rotation_fee = 8 [(gogoproto.nullable) = false];
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
}

// DelegationResponse is equivalent to Delegation except that it contains a
Expand Down Expand Up @@ -392,3 +396,24 @@ enum Infraction {
message ValidatorUpdates {
repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// ConsPubKeyRotationHistory contains a validator's consensus public key rotation history.
message ConsPubKeyRotationHistory {
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// operator_address defines the address of the validator's operator; bech encoded in JSON.
string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""];
// old_cons_pubkey is the old consensus public key of the validator, as a Protobuf Any.
google.protobuf.Any old_cons_pubkey = 2 [
(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey",
(gogoproto.moretags) = "yaml:\"old_consensus_pubkey\""
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
];
// new_cons_pubkey is the new consensus public key of the validator, as a Protobuf Any.
google.protobuf.Any new_cons_pubkey = 3 [
(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey",
(gogoproto.moretags) = "yaml:\"new_consensus_pubkey\""
];
// height defines the block height at which the rotation event occured.
uint64 height = 4;
}
25 changes: 25 additions & 0 deletions proto/cosmos/staking/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ service Msg {
// parameters.
// Since: cosmos-sdk 0.47
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);

// RotateConsPubKey defines an operation for rotating the consensus keys
// of a validator.
// Since: cosmos-sdk 0.48
rpc RotateConsPubKey(MsgRotateConsPubKey) returns (MsgRotateConsPubKeyResponse);
}

// MsgCreateValidator defines a SDK message for creating a new validator.
Expand Down Expand Up @@ -204,3 +209,23 @@ message MsgUpdateParams {
//
// Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {};

// MsgRotateConsPubKey is the Msg/RotateConsPubKey request type.
//
// Since: cosmos-sdk 0.48
message MsgRotateConsPubKey {
option (cosmos.msg.v1.signer) = "validator_address";
option (amino.name) = "cosmos-sdk/MsgRotateConsPubKey";

option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;

string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
google.protobuf.Any new_pubkey = 3 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
}

// MsgRotateConsPubKeyResponse defines the response structure for executing a
// MsgRotateConsPubKey message.
//
// Since: cosmos-sdk 0.48
message MsgRotateConsPubKeyResponse {}
Loading