-
Notifications
You must be signed in to change notification settings - Fork 9
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(pubkey): Pubkey module #342
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f3159e4
feat: pkr -> init module
DeshErBojhaa c7a0015
refactor: refactor vrf key generation function
hacheigriega 3324c5c
feat: genesis export import support
hacheigriega 47e2bfd
refactor: more robust and cleaner pkr testing and event
hacheigriega 9106ad3
feat: Add SEDA Keys
hacheigriega 9756326
refactor: rename pkr module to pubkey module
hacheigriega d65460d
refactor: make keeper pubkey collection private and add wrappers
hacheigriega 62f54a3
chore: lint
hacheigriega 1ddf2ec
fix: fixing import disappearance due to linting
hacheigriega 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
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,22 @@ | ||
syntax = "proto3"; | ||
package sedachain.pubkey.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "sedachain/pubkey/v1/pubkey.proto"; | ||
|
||
option go_package = "github.com/sedaprotocol/seda-chain/x/pubkey/types"; | ||
|
||
// GenesisState defines pubkey module's genesis state. | ||
message GenesisState { | ||
repeated ValidatorPubKeys validator_pub_keys = 1 | ||
[ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// ValidatorPubKeys defines a validator's list of registered public keys | ||
// primarily used in the x/pubkey genesis state. | ||
message ValidatorPubKeys { | ||
string validator_addr = 1 | ||
[ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ]; | ||
repeated IndexedPubKey indexed_pub_keys = 2 [ (gogoproto.nullable) = false ]; | ||
} |
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,14 @@ | ||
syntax = "proto3"; | ||
package sedachain.pubkey.v1; | ||
|
||
import "google/protobuf/any.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
|
||
option go_package = "github.com/sedaprotocol/seda-chain/x/pubkey/types"; | ||
|
||
// IndexPubKeyPair defines an index - public key pair. | ||
message IndexedPubKey { | ||
uint32 index = 1; | ||
google.protobuf.Any pub_key = 2 | ||
[ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; | ||
} |
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,32 @@ | ||
syntax = "proto3"; | ||
package sedachain.pubkey.v1; | ||
|
||
import "google/api/annotations.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "sedachain/pubkey/v1/genesis.proto"; | ||
|
||
option go_package = "github.com/sedaprotocol/seda-chain/x/pubkey/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// ValidatorKeys returns a given validator's registered keys. | ||
rpc ValidatorKeys(QueryValidatorKeysRequest) | ||
returns (QueryValidatorKeysResponse) { | ||
option (google.api.http).get = | ||
"/seda-chain/pubkey/validator_keys/{validator_addr}"; | ||
} | ||
} | ||
|
||
// QueryValidatorKeysRequest is request type for the Query/ValidatorKeys RPC | ||
// method. | ||
message QueryValidatorKeysRequest { | ||
string validator_addr = 1 | ||
[ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ]; | ||
} | ||
|
||
// QueryValidatorKeysResponse is response type for the Query/ValidatorKeys RPC | ||
// method. | ||
message QueryValidatorKeysResponse { | ||
ValidatorPubKeys validator_pub_keys = 1 [ (gogoproto.nullable) = false ]; | ||
} |
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 sedachain.pubkey.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/msg/v1/msg.proto"; | ||
import "sedachain/pubkey/v1/pubkey.proto"; | ||
|
||
option go_package = "github.com/sedaprotocol/seda-chain/x/pubkey/types"; | ||
|
||
// Msg defines the pubkey Msg service. | ||
service Msg { | ||
option (cosmos.msg.v1.service) = true; | ||
|
||
// AddKey defines a method for registering a new public key. | ||
rpc AddKey(MsgAddKey) returns (MsgAddKeyResponse); | ||
} | ||
|
||
// MsgAddKey defines a message for registering a new public key. | ||
message MsgAddKey { | ||
option (cosmos.msg.v1.signer) = "validator_addr"; | ||
|
||
string validator_addr = 1 | ||
[ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ]; | ||
repeated IndexedPubKey indexed_pub_keys = 2 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// MsgAddKeyResponse defines the Msg/MsgAddKey response type. | ||
message MsgAddKeyResponse {} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Is this standard for cosmos? I'd say it's a risk to store a private key as plain text in a file. So we should additionally have the option to do it as an ENV var.
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.
created an issue based on what we discussed: #368