-
Notifications
You must be signed in to change notification settings - Fork 9
feat(evm-module): Profile.recreateProfile — testnet recovery for profiles orphaned by ProfileStorage redeploy #574
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
Open
zsculac
wants to merge
8
commits into
main
Choose a base branch
from
orch/recreate-profile-recovery/0001
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c751bec
feat(evm-module): add Profile.recreateProfile for testnet recovery
423d331
test(evm-module): cover recreateProfile revert paths and guards
4afab24
test(evm-module): integration test for recreateProfile state preserva…
04b1507
docs(adr): record admin-only authorization for recreateProfile
ba54333
refactor(evm-module): recreateProfile resolves id from operational wa…
2498bca
fix(evm-module): sharding-consistency guard + regenerate ABI for recr…
dc8ff27
test(evm-module): remove unreachable NodeNameAlreadyExists recreate test
7f89bd9
fix(evm-module): recompute Ask active set on recovery + assert V10 stake
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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
45 changes: 45 additions & 0 deletions
45
packages/evm-module/docs/adr/0001-recreate-profile-admin-only.md
This file contains hidden or 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,45 @@ | ||
| # ADR 0001 — recreateProfile is admin-only | ||
|
|
||
| - Status: Accepted | ||
| - Scope: `packages/evm-module` · `Profile.recreateProfile` | ||
| - Related: PRD "Recreate Profile for an existing Identity (testnet recovery)" | ||
|
|
||
| ## Context | ||
|
|
||
| After a testnet `ProfileStorage` redeploy, some nodes have an on-chain | ||
| `Identity` but no `Profile`. `recreateProfile` re-attaches a `Profile` | ||
| to such an `Identity`, reusing the existing `identityId` so that the | ||
| surviving `identityId`-keyed staking, conviction and sharding state | ||
| stays addressable. | ||
|
|
||
| Genesis `createProfile` is whitelist-gated and called by an | ||
| **Operational** key on a brand-new identity with zero stake. `Recreate` | ||
| is different: it acts on an `identityId` that may already carry | ||
| third-party delegated stake, and it sets the initial operator fee. | ||
|
|
||
| ## Decision | ||
|
|
||
| `recreateProfile` is gated `onlyWhitelisted onlyAdmin(identityId)`. | ||
|
|
||
| - The caller must hold the supplied identity's **Admin** key. This both | ||
| authorizes the caller and proves the `Identity` exists. | ||
| - The signature takes `identityId` explicitly because Admin keys have no | ||
| reverse lookup, mirroring other admin-gated, id-parameterised profile | ||
| mutations (`updateOperatorFee`, `addOperationalWallets`). | ||
| - The existing whitelist gate is preserved. | ||
|
|
||
| ## Rationale | ||
|
|
||
| An Operational ("hot") key must not be able to set the operator fee on a | ||
| stake-bearing node. A compromised hot key could otherwise re-price the | ||
| node's operator fee against its delegators. Restricting recovery to the | ||
| Admin key removes that vector while still letting honest operators | ||
| recover their nodes with a single transaction. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Operators must control each bricked Identity's original Admin key to | ||
| recover (operationally verified, off-chain). | ||
| - If testnet whitelisting is enabled, the bricked identities' **Admin** | ||
| wallets must be whitelisted before recovery — the genesis flow | ||
| whitelisted the Operational caller instead. |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.