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

staking_getKeys() RPC call #201

Closed
wants to merge 18 commits into from
Closed

staking_getKeys() RPC call #201

wants to merge 18 commits into from

Conversation

jakehemmerle
Copy link
Contributor

@jakehemmerle jakehemmerle commented Oct 10, 2022

Will close #197

pallets/staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/staking/src/lib.rs Outdated Show resolved Hide resolved
@jakehemmerle
Copy link
Contributor Author

After talking w @JesseAbram , we've deciding to scrap the new data structures and just go with an RPC endpoint. We will only need to search with a stash/controller account, and we will return returns the IP/threshold/ECDH key, which is used to authenticate/encrypt messages to the corrosponding threshold server.

cc @ok-john

@jakehemmerle jakehemmerle force-pushed the rpc-getkeys branch 2 times, most recently from fea0ac4 to ca88da4 Compare October 12, 2022 19:59
@jakehemmerle jakehemmerle changed the title staking_getKeys() RPC call and key association Replace jsonrpc with jsonrpsee & staking_getKeys() RPC call Oct 12, 2022
@jakehemmerle jakehemmerle self-assigned this Oct 12, 2022
@jakehemmerle jakehemmerle linked an issue Oct 12, 2022 that may be closed by this pull request
@jakehemmerle jakehemmerle changed the title Replace jsonrpc with jsonrpsee & staking_getKeys() RPC call staking_getKeys() RPC call Oct 12, 2022
/// Unique type to differentiate the threshold server's account ID from the validator's stash/controller accounts
pub type TssServerAccount<AccountId> = AccountId;
/// X25519 public key used by the client in non-interactive ECDH to authenticate/encrypt interactions with the threshold server (eg distributing threshold shares).
pub type X25519PublicKey = [u8; 32];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you switch this type to x25519-dalek::PublicKey as we discussed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After trying a bit, it appears that I'd need to implement the SCALE codec for x25519::PublicKey, so unless @JesseAbram knows a super easy way to do this or theres a major reason we can't just use [u8; 32], lets just stick with this

@jakehemmerle
Copy link
Contributor Author

This is blocked until we upgrade RPC infra, which is blocked by subxt in #207

jakehemmerle added a commit that referenced this pull request Nov 2, 2022
* PR #201 key association logic; to be reverted

* Revert "PR #201 key association logic; to be reverted"

This reverts commit 44a3ed2.

* added types and comments for readability and clarity in staking-extension

* subxt points to temp branch with updated deps

* refactored server sp_core stuff to use subxt::ext::sp_core

* updated server to use subxt 0.24.0 (from 0.20.0)

* BROKEN: updated substrate to polkadot-v0.9.30 and jakehemmerle subxt

* update Event and Call to RuntimeEvent and RuntimeCall

* fix pallet-free-tx weights

* fix pallet-transaction-pause weights

* fix pallet-staking-extension weights

* updated mock runtimes and tests

still needs updated free-tx test since FRAME tx are transactional by default

* upgraded pallet-free-tx to substrate-polkadot 0.9.30

* pallets are all updated

* entropy-runtime tests pass with runtime-benchmarks

* handled client rpc and service...?

* entropy compiles and tests

* additional refactoring

* added entropy-executor

* entropy tests pass with runtime-benchmarks

* fixed testing-utils

* thanks jesse, fixed server, everything works

* clippy pt 1

* clippy pt 2

* fixing tests

* reenable extensions

* fixed a test

* updated runtime metadata

* added babe and grandpa to rpc

* jesse rocks; fixed subxt Config

* fmt

* clippy

* taplo

* fmt and clippy

* clippy

* updated deps

* updates
JesseAbram pushed a commit that referenced this pull request Nov 8, 2022
* PR #201 key association logic; to be reverted

* Revert "PR #201 key association logic; to be reverted"

This reverts commit 44a3ed2.

* added types and comments for readability and clarity in staking-extension

* subxt points to temp branch with updated deps

* refactored server sp_core stuff to use subxt::ext::sp_core

* updated server to use subxt 0.24.0 (from 0.20.0)

* BROKEN: updated substrate to polkadot-v0.9.30 and jakehemmerle subxt

* update Event and Call to RuntimeEvent and RuntimeCall

* fix pallet-free-tx weights

* fix pallet-transaction-pause weights

* fix pallet-staking-extension weights

* updated mock runtimes and tests

still needs updated free-tx test since FRAME tx are transactional by default

* upgraded pallet-free-tx to substrate-polkadot 0.9.30

* pallets are all updated

* entropy-runtime tests pass with runtime-benchmarks

* handled client rpc and service...?

* entropy compiles and tests

* additional refactoring

* added entropy-executor

* entropy tests pass with runtime-benchmarks

* fixed testing-utils

* thanks jesse, fixed server, everything works

* clippy pt 1

* clippy pt 2

* fixing tests

* reenable extensions

* fixed a test

* updated runtime metadata

* added babe and grandpa to rpc

* jesse rocks; fixed subxt Config

* fmt

* clippy

* taplo

* fmt and clippy

* clippy

* updated deps

* updates
JesseAbram added a commit that referenced this pull request Nov 8, 2022
* remove most unwraps

* remove more unwraps

* fmt

* Upgrade Substrate to follow Polkadot releases (#207)

* PR #201 key association logic; to be reverted

* Revert "PR #201 key association logic; to be reverted"

This reverts commit 44a3ed2.

* added types and comments for readability and clarity in staking-extension

* subxt points to temp branch with updated deps

* refactored server sp_core stuff to use subxt::ext::sp_core

* updated server to use subxt 0.24.0 (from 0.20.0)

* BROKEN: updated substrate to polkadot-v0.9.30 and jakehemmerle subxt

* update Event and Call to RuntimeEvent and RuntimeCall

* fix pallet-free-tx weights

* fix pallet-transaction-pause weights

* fix pallet-staking-extension weights

* updated mock runtimes and tests

still needs updated free-tx test since FRAME tx are transactional by default

* upgraded pallet-free-tx to substrate-polkadot 0.9.30

* pallets are all updated

* entropy-runtime tests pass with runtime-benchmarks

* handled client rpc and service...?

* entropy compiles and tests

* additional refactoring

* added entropy-executor

* entropy tests pass with runtime-benchmarks

* fixed testing-utils

* thanks jesse, fixed server, everything works

* clippy pt 1

* clippy pt 2

* fixing tests

* reenable extensions

* fixed a test

* updated runtime metadata

* added babe and grandpa to rpc

* jesse rocks; fixed subxt Config

* fmt

* clippy

* taplo

* fmt and clippy

* clippy

* updated deps

* updates

* Fix CI pipeline (#223)

fix-ci-pipeline

Signed-off-by: John Sahhar <[email protected]>

Signed-off-by: John Sahhar <[email protected]>

* Add scripts for running devnet (#222)

Signed-off-by: John Sahhar <[email protected]>

* Create a recoverable signature

* remove most unwraps

* fmt

* remove mutex unwraps

* fmt

Signed-off-by: John Sahhar <[email protected]>
Co-authored-by: Jake Hemmerle <[email protected]>
Co-authored-by: ok-john <[email protected]>
Co-authored-by: Bogdan Opanchuk <[email protected]>
@jakehemmerle
Copy link
Contributor Author

Unnecessary due to #230

fjarri pushed a commit that referenced this pull request May 5, 2023
* PR #201 key association logic; to be reverted

* Revert "PR #201 key association logic; to be reverted"

This reverts commit 44a3ed2.

* added types and comments for readability and clarity in staking-extension

* subxt points to temp branch with updated deps

* refactored server sp_core stuff to use subxt::ext::sp_core

* updated server to use subxt 0.24.0 (from 0.20.0)

* BROKEN: updated substrate to polkadot-v0.9.30 and jakehemmerle subxt

* update Event and Call to RuntimeEvent and RuntimeCall

* fix pallet-free-tx weights

* fix pallet-transaction-pause weights

* fix pallet-staking-extension weights

* updated mock runtimes and tests

still needs updated free-tx test since FRAME tx are transactional by default

* upgraded pallet-free-tx to substrate-polkadot 0.9.30

* pallets are all updated

* entropy-runtime tests pass with runtime-benchmarks

* handled client rpc and service...?

* entropy compiles and tests

* additional refactoring

* added entropy-executor

* entropy tests pass with runtime-benchmarks

* fixed testing-utils

* thanks jesse, fixed server, everything works

* clippy pt 1

* clippy pt 2

* fixing tests

* reenable extensions

* fixed a test

* updated runtime metadata

* added babe and grandpa to rpc

* jesse rocks; fixed subxt Config

* fmt

* clippy

* taplo

* fmt and clippy

* clippy

* updated deps

* updates
fjarri added a commit that referenced this pull request May 5, 2023
* remove most unwraps

* remove more unwraps

* fmt

* Upgrade Substrate to follow Polkadot releases (#207)

* PR #201 key association logic; to be reverted

* Revert "PR #201 key association logic; to be reverted"

This reverts commit 44a3ed2.

* added types and comments for readability and clarity in staking-extension

* subxt points to temp branch with updated deps

* refactored server sp_core stuff to use subxt::ext::sp_core

* updated server to use subxt 0.24.0 (from 0.20.0)

* BROKEN: updated substrate to polkadot-v0.9.30 and jakehemmerle subxt

* update Event and Call to RuntimeEvent and RuntimeCall

* fix pallet-free-tx weights

* fix pallet-transaction-pause weights

* fix pallet-staking-extension weights

* updated mock runtimes and tests

still needs updated free-tx test since FRAME tx are transactional by default

* upgraded pallet-free-tx to substrate-polkadot 0.9.30

* pallets are all updated

* entropy-runtime tests pass with runtime-benchmarks

* handled client rpc and service...?

* entropy compiles and tests

* additional refactoring

* added entropy-executor

* entropy tests pass with runtime-benchmarks

* fixed testing-utils

* thanks jesse, fixed server, everything works

* clippy pt 1

* clippy pt 2

* fixing tests

* reenable extensions

* fixed a test

* updated runtime metadata

* added babe and grandpa to rpc

* jesse rocks; fixed subxt Config

* fmt

* clippy

* taplo

* fmt and clippy

* clippy

* updated deps

* updates

* Fix CI pipeline (#223)

fix-ci-pipeline

Signed-off-by: John Sahhar <[email protected]>

Signed-off-by: John Sahhar <[email protected]>

* Add scripts for running devnet (#222)

Signed-off-by: John Sahhar <[email protected]>

* Create a recoverable signature

* remove most unwraps

* fmt

* remove mutex unwraps

* fmt

Signed-off-by: John Sahhar <[email protected]>
Co-authored-by: Jake Hemmerle <[email protected]>
Co-authored-by: ok-john <[email protected]>
Co-authored-by: Bogdan Opanchuk <[email protected]>
@fjarri fjarri deleted the rpc-getkeys branch May 8, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

staking_getKeys() RPC
3 participants