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

Remote Key Manager API(web3signer) #10302

Merged
merged 78 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
3bd159a
removing flag requirement, can run web3signer without predefined pub…
james-prysm Mar 2, 2022
c9c5fe0
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 8, 2022
01de403
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 21, 2022
e237df7
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 21, 2022
73f2793
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 23, 2022
f35a35c
placeholders for remote-keymanager-api
james-prysm Mar 3, 2022
5c0c44d
adding proto and accountschangedfeed
james-prysm Mar 23, 2022
031d590
updating generated code
james-prysm Mar 23, 2022
b1392b5
fix imports
james-prysm Mar 23, 2022
a857328
fixing interface
james-prysm Mar 23, 2022
924b14a
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 23, 2022
24c8629
adding work in progress apimiddleware code
james-prysm Mar 23, 2022
c03b3ea
started implementing functions for remote keymanager api
james-prysm Mar 23, 2022
71dac89
fixing generted code from proto
james-prysm Mar 23, 2022
5276364
fixing protos
james-prysm Mar 23, 2022
e93835d
fixing import format
james-prysm Mar 23, 2022
e3a795a
fixing proto generation again , didn't fix the first time
james-prysm Mar 23, 2022
43dd405
fixing imports again
james-prysm Mar 23, 2022
423fbf9
continuing on implementing functions
james-prysm Mar 23, 2022
7a3ce6d
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 23, 2022
c2d7414
implementing add function
james-prysm Mar 24, 2022
360bd0d
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 24, 2022
47d5471
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 24, 2022
8fec645
implementing delete API function
james-prysm Mar 24, 2022
d2fd2a5
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 24, 2022
65283cb
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 28, 2022
f120500
handling errors for API
james-prysm Mar 28, 2022
1f50cdd
removing unusedcode and fixing format
james-prysm Mar 28, 2022
a429761
fixing bazel
james-prysm Mar 28, 2022
2d591f4
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 28, 2022
b57a7a8
wip enable --web when running web3signer
james-prysm Mar 28, 2022
ecbb7ee
fixing wallet check for web3signer
james-prysm Mar 29, 2022
4cabdb0
fixing apis
james-prysm Mar 30, 2022
7532a6f
adding list remote keys unit test
james-prysm Mar 30, 2022
03fa25e
import remote keys test
james-prysm Mar 30, 2022
c978c89
delete pubkeys tests
james-prysm Mar 30, 2022
2be01e9
Merge branch 'develop' into remote-keymanager-api
james-prysm Mar 30, 2022
21ca459
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 5, 2022
8abd868
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 5, 2022
a69135b
moving location of tests
james-prysm Mar 31, 2022
ca047bd
adding unit tests
james-prysm Apr 5, 2022
9d30fb9
adding placeholder functions
james-prysm Apr 5, 2022
e08480c
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 6, 2022
dbefe0f
adding more unit tests
james-prysm Apr 7, 2022
a96e4db
fixing bazel
james-prysm Apr 7, 2022
cd4fca2
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 7, 2022
077a2d0
fixing build
james-prysm Apr 7, 2022
65cd4e5
fixing already slice issue with unit test
james-prysm Apr 7, 2022
dee08ed
fixing linting
james-prysm Apr 7, 2022
15c4e22
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 7, 2022
da1b266
Update validator/client/validator.go
james-prysm Apr 7, 2022
180d99a
Update validator/keymanager/types.go
james-prysm Apr 7, 2022
a5bd21f
Update validator/node/node.go
james-prysm Apr 7, 2022
431fd2f
Update validator/keymanager/types.go
james-prysm Apr 7, 2022
d492320
Update validator/client/validator.go
james-prysm Apr 7, 2022
af48fa3
adding comment on proto based on review
james-prysm Apr 7, 2022
c952a16
Update validator/keymanager/remote-web3signer/keymanager.go
james-prysm Apr 8, 2022
5165f82
Update validator/keymanager/remote-web3signer/keymanager.go
james-prysm Apr 8, 2022
58efca7
Update validator/rpc/standard_api.go
james-prysm Apr 8, 2022
1fd32fe
Update validator/rpc/standard_api.go
james-prysm Apr 8, 2022
ab2d0cc
Update validator/rpc/standard_api.go
james-prysm Apr 8, 2022
ddbef6c
Update validator/rpc/standard_api.go
james-prysm Apr 8, 2022
34b7fca
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 8, 2022
1d988ac
adding generated code based on review
james-prysm Apr 8, 2022
04d321b
updating based on feedback
james-prysm Apr 8, 2022
bd08f6b
fixing imports
james-prysm Apr 8, 2022
d831f14
fixing formatting
james-prysm Apr 8, 2022
20f4418
Update validator/rpc/standard_api.go
james-prysm Apr 8, 2022
88c76be
fixing event call
james-prysm Apr 8, 2022
652afbf
Merge branch 'remote-keymanager-api' of https://github.com/prysmaticl…
james-prysm Apr 8, 2022
5178c97
fixing dependency
james-prysm Apr 8, 2022
8db0af2
updating bazel
james-prysm Apr 8, 2022
1b77a58
Update validator/rpc/standard_api.go
james-prysm Apr 11, 2022
abddb2c
Update validator/rpc/standard_api.go
james-prysm Apr 11, 2022
720c9ba
Update validator/rpc/standard_api.go
james-prysm Apr 11, 2022
e11c56d
Update validator/rpc/standard_api.go
james-prysm Apr 11, 2022
afd1af9
addressing comment from review
james-prysm Apr 11, 2022
64f6cfb
Merge branch 'develop' into remote-keymanager-api
james-prysm Apr 11, 2022
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,170 changes: 1,031 additions & 139 deletions proto/eth/service/key_management.pb.go

Large diffs are not rendered by default.

227 changes: 227 additions & 0 deletions proto/eth/service/key_management.pb.gw.go

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

73 changes: 73 additions & 0 deletions proto/eth/service/key_management.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,27 @@ service KeyManagement {
body: "*"
};
}


rpc ListRemoteKeys(google.protobuf.Empty) returns (ListRemoteKeysResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/remotekeys"
};
}

rpc ImportRemoteKeys(ImportRemoteKeysRequest) returns (ImportRemoteKeysResponse) {
option (google.api.http) = {
post: "/internal/eth/v1/remotekeys",
body: "*"
};
}

rpc DeleteRemoteKeys(DeleteRemoteKeysRequest) returns (DeleteRemoteKeysResponse) {
option (google.api.http) = {
delete: "/internal/eth/v1/remotekeys",
body: "*"
};
}
}

message ListKeystoresResponse {
Expand Down Expand Up @@ -133,3 +154,55 @@ message DeletedKeystoreStatus {
Status status = 1;
string message = 2;
}


message ListRemoteKeysResponse {
message Keystore {
bytes pubkey = 1;
string url = 2;
bool readonly = 3;
}
repeated Keystore data = 1;
}

message ImportRemoteKeysRequest {
message Keystore {
bytes pubkey = 1;
string url = 2;
}
repeated Keystore remote_keys = 1;
}

message ImportRemoteKeysResponse {
repeated ImportedRemoteKeysStatus data = 1;
}

message DeleteRemoteKeysRequest {
repeated bytes pubkeys = 1;
}

message DeleteRemoteKeysResponse {
repeated DeletedRemoteKeysStatus data = 1;
}

message ImportedRemoteKeysStatus {
enum Status {
UNKNOWN = 0;
IMPORTED = 1;
DUPLICATE = 2;
ERROR = 3;
}
Status status = 1;
string message = 2;
}

message DeletedRemoteKeysStatus {
enum Status {
NOT_FOUND = 0;
DELETED = 1;
ERROR = 3; // skips 2 to match Delete KeyStore status which has error = 3.
}
Status status = 1;
string message = 2;
}

6 changes: 3 additions & 3 deletions validator/client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type ValidatorService struct {
db db.Database
grpcHeaders []string
graffiti []byte
web3SignerConfig *remote_web3signer.SetupConfig
Web3SignerConfig *remote_web3signer.SetupConfig
feeRecipientConfig *validator_service_config.FeeRecipientConfig
}

Expand Down Expand Up @@ -122,7 +122,7 @@ func NewValidatorService(ctx context.Context, cfg *Config) (*ValidatorService, e
interopKeysConfig: cfg.InteropKeysConfig,
graffitiStruct: cfg.GraffitiStruct,
logDutyCountDown: cfg.LogDutyCountDown,
web3SignerConfig: cfg.Web3SignerConfig,
Web3SignerConfig: cfg.Web3SignerConfig,
feeRecipientConfig: cfg.FeeRecipientConfig,
}, nil
}
Expand Down Expand Up @@ -204,7 +204,7 @@ func (v *ValidatorService) Start() {
graffitiOrderedIndex: graffitiOrderedIndex,
eipImportBlacklistedPublicKeys: slashablePublicKeys,
logDutyCountDown: v.logDutyCountDown,
Web3SignerConfig: v.web3SignerConfig,
Web3SignerConfig: v.Web3SignerConfig,
feeRecipientConfig: v.feeRecipientConfig,
walletIntializedChannel: make(chan *wallet.Wallet, 1),
}
Expand Down
1 change: 1 addition & 0 deletions validator/client/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (v *validator) WaitForKeymanagerInitialization(ctx context.Context) error {
}

if v.useWeb && v.wallet == nil {
log.Info("Waiting for keymanager to initialize validator client with web UI")
// if wallet is not set, wait for it to be set through the UI
km, err := waitForWebWalletInitialization(ctx, v.walletInitializedFeed, v.walletIntializedChannel)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions validator/keymanager/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ go_test(
"//validator/keymanager/derived:go_default_library",
"//validator/keymanager/local:go_default_library",
"//validator/keymanager/remote:go_default_library",
"//validator/keymanager/remote-web3signer:go_default_library",
],
)
Loading