Skip to content

Commit

Permalink
New on-chain registration flow (#955)
Browse files Browse the repository at this point in the history
* Trial of using types and derivation code

* Move new registration code to its own extrinsic

This way we can introduce it without breaking everything just yet

* Use my branch of Synedrion

* Sketch out using the account ID as derivation path

* Basic test setup

* Use a `CountedStorageMap` for `Registered` struct

This lets us use the count as the derivation path for now.

* Add some error handling

* Tidy genesis build

* Add registration struct for new flow

This lets us change the mapping so that instead of being indexed by verifying key we're not indexing
by the signature request account.

* Use updated `RegisteredInfo` struct in tests

* Test flow and validate verifying key

* Encode the signature request account in place

* Update some of the variable names

* Revert registration struct to be indexed by verifying key

The notion of the signature_request_account is meant to be ephemeral, so we don't really need to
have registration know anything about this beyond the initial extrinsic.

* Initialize `RegisteredOnChain` during genesis builds

* Remove check that a `signature_request_account` can only register once

* Insert verifying key into `ModifiableKeys` storage struct

* Remove `dbg!` statement

* Add test to check that a signature request account can register multiple times

* Add benchmark for new registration extrisic

* Add comments around registration flow

* Use `no_std` compatible version of Synedrion

* Use `core` and `alloc` data structures in pallet

* Use remote Synedrion reference

* Make derivation path in benchmarks generic instead of hardcoded

* Use benchmark results for new extrinsic

* Rename extrinsic to `register_on_chain`

* Use `no_std` functions for benches

* Add entry to `CHANGELOG`

* Add a few tests for failure conditions

* Fix breaking changes from #974

* Bump Synedrion to latest `master`

* Add issue number to `TODO` comment
  • Loading branch information
HCastano authored Aug 6, 2024
1 parent 747939e commit 381b310
Show file tree
Hide file tree
Showing 8 changed files with 676 additions and 120 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ At the moment this project **does not** adhere to
- Jumpstart network ([#918](https://github.com/entropyxyz/entropy-core/pull/918))
- Add Signer groups and rotation ([#938](https://github.com/entropyxyz/entropy-core/pull/938))
- Split jumpstart and register flows ([#952](https://github.com/entropyxyz/entropy-core/pull/952))
- New on-chain registration flow ([#955](https://github.com/entropyxyz/entropy-core/pull/955))
- Reshare confirmation ([#965](https://github.com/entropyxyz/entropy-core/pull/965))
- Set inital signers ([#971](https://github.com/entropyxyz/entropy-core/pull/971))
- Add parent key threshold dynamically ([#974](https://github.com/entropyxyz/entropy-core/pull/974))
Expand Down
106 changes: 84 additions & 22 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion pallets/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ publish =false
targets=['x86_64-unknown-linux-gnu']

[dependencies]
bip32 ={ version="0.5.2", default-features=false, features=["alloc"] }
codec ={ package="parity-scale-codec", version="3.6.3", default-features=false, features=["derive"] }
scale-info={ version="2.11", default-features=false, features=["derive"] }
log ={ version="0.4.22", default-features=false }
scale-info={ version="2.11", default-features=false, features=["derive"] }
synedrion ={ git="https://github.com/entropyxyz/synedrion/", rev="1d210d149dfeb0dca1dd41d7fac4d0bf03c686fa", default-features=false }

frame-benchmarking={ version="29.0.0", default-features=false, optional=true }
frame-support ={ version="29.0.0", default-features=false }
Expand Down
Loading

0 comments on commit 381b310

Please sign in to comment.