-
Notifications
You must be signed in to change notification settings - Fork 119
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
Key assignment #515
Merged
Merged
Key assignment #515
Changes from 26 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
f83c731
add MsgAssignConsumerKey
mpoke 084ef62
add MsgAssignConsumerKey
mpoke ebd0398
fix package name
mpoke 020f285
add keys
mpoke 75bf2a1
add keeper methods for key assignment
mpoke ac30f74
handle MsgAssignConsumerKey
mpoke 6707ac9
map addresses in slash requests
mpoke 26ff35a
prune old consumer addresses
mpoke 6974766
move AssignConsumerKey logic to keeper
mpoke 35bb100
update consumer initial valset
mpoke 09fd054
add ApplyKeyAssignmentToValUpdates
mpoke 098a4e6
fix client creation
mpoke f8cd226
do not check init valset on consumer
mpoke 533c6cf
clean state on val removal
mpoke 3091bd1
fix TestAssignConsensusKeyForConsumerChain
mpoke b85e87c
delete on val removal
mpoke 595c3eb
remove reverse mapping on val removal
mpoke 1c2e696
remove pending key assignment in EndBlock
mpoke f5be337
add query endpoints
jtremback 40b3bc9
Refactor AssignConsumerKey for clarity (IMO)
jtremback 19cc625
finish key assignment genesis code- untested
jtremback 3270302
FIxed mocks compile issue - not sure if it works right though.
jtremback 87fff1b
add test for init and export genesis
jtremback d7f3be4
set after get in AssignConsumerKey
mpoke 4a4dce2
enable AssignConsumerKey to be called twice
mpoke a621b9b
remove key assignment on chain removal
mpoke cf1bc61
apply some review comments
mpoke 86c5979
fix bug: two validator with same consumer key
mpoke c050cc8
rename key: ConsumerValidatorsByVscIDBytePrefix -> ConsumerAddrsToPru…
mpoke 605d562
PendingKeyAssignment -> KeyAssignmentReplacements
mpoke 0c9f620
msg.ProviderAddr is a validator addr
mpoke f0ae261
fix: key assignment genesis tests (#517)
sainoe d64f7a6
add key assignment CRUD operations unit tests (#516)
MSalopek 9e84264
improve KeyAssignmentReplacement set and get
mpoke 5872f93
remove ApplyKeyAssignmentToInitialValset (redundant)
mpoke c396b3f
add invariant to docstring of AppendConsumerAddrsToPrune
mpoke e772dfb
fix address conversion
mpoke 7fbbc76
Merge branch 'main' into marius/key-assignment
mpoke 6d8cd10
adding e2e tests
mpoke aca9578
fix linter
mpoke 8641273
add queries; setup integration tests (#519)
MSalopek eb7ff69
Adds some very basic random testing and unit tests (#522)
danwt 5820c66
Enable key assignment testing for all e2e tests (#524)
mpoke 7616700
Merge branch 'main' into marius/key-assignment
jtremback a1f592a
Merge branch 'main' into marius/key-assignment
danwt 0568ce8
adding ADR
mpoke 561c567
Merge branch 'marius/key-assignment' of github.com:cosmos/interchain-…
mpoke 0d3123f
move handler.go outside client/
mpoke 1bec53f
replace [][]byte with AddressList
mpoke 23d4b54
remove IterateAllConsumerAddrsToPrune; not needed
mpoke 0c29fb4
apply review suggestions
mpoke bb4e1ea
fix merge conflicts
mpoke 637fc55
fix linter
mpoke ca05578
Danwt/key assignment slash test (#545)
danwt f1f5ed4
Merge branch 'main' into marius/key-assignment
danwt 0fe2305
Fixes #503 prevents two key assignment key overlap security issues (#…
danwt a519d12
Bump AssignConsumerKey comment
a833334
Merge branch 'main' into marius/key-assignment
danwt da08407
improve comments for iterators
mpoke ab43903
Masa/key assignment integration tests amend (#548)
MSalopek f87973d
remove node_modules
mpoke 26ddbf6
fix comment
mpoke 6e0ca7f
fix merge conflicts
mpoke 530cdcb
Merge branch 'main' into marius/key-assignment
mpoke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
syntax = "proto3"; | ||
package interchain_security.ccv.provider.v1; | ||
|
||
option go_package = "github.com/cosmos/interchain-security/x/ccv/provider/types"; | ||
|
||
import "google/api/annotations.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "google/protobuf/any.proto"; | ||
|
||
// Msg defines the Msg service. | ||
service Msg { | ||
rpc AssignConsumerKey(MsgAssignConsumerKey) returns (MsgAssignConsumerKeyResponse); | ||
} | ||
|
||
message MsgAssignConsumerKey { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
// The chain id of the consumer chain to assign a consensus public key to | ||
string chain_id = 1; | ||
// The validator address on the provider | ||
string provider_addr = 2 | ||
[ (gogoproto.moretags) = "yaml:\"address\"" ]; | ||
// The consensus public key to use on the consumer | ||
google.protobuf.Any consumer_key = 3 | ||
[ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; | ||
} | ||
|
||
message MsgAssignConsumerKeyResponse {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cli | ||
|
||
import ( | ||
flag "github.com/spf13/pflag" | ||
) | ||
|
||
const ( | ||
FlagConsumerChainId = "validator" | ||
FlagAddressValidator = "validator" | ||
FlagConsumerPubKey = "pubkey" | ||
FlagNodeID = "node-id" | ||
FlagIP = "ip" | ||
) | ||
|
||
// common flagsets to add to various functions | ||
var ( | ||
fsValidator = flag.NewFlagSet("", flag.ContinueOnError) | ||
) | ||
|
||
func init() { | ||
fsValidator.String(FlagAddressValidator, "", "The Bech32 address of the validator") | ||
} | ||
|
||
// FlagSetPublicKey Returns the flagset for Public Key related operations. | ||
func FlagSetPublicKey() *flag.FlagSet { | ||
fs := flag.NewFlagSet("", flag.ContinueOnError) | ||
fs.String(FlagConsumerPubKey, "", "The Protobuf JSON encoded public key to use for the consumer chain") | ||
return fs | ||
} | ||
|
||
// FlagSetPublicKey Returns the flagset for Public Key related operations. | ||
func FlagSetConsumerChainId() *flag.FlagSet { | ||
fs := flag.NewFlagSet("", flag.ContinueOnError) | ||
fs.String(FlagConsumerChainId, "", "The chainId of the consumer chain") | ||
return fs | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why the whole function was removed.
Does it make sense to maybe check if the client consensus state does indeed exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is something that should be addressed by validation.