Repository navigation
fix(abstract-utxo): add PoX-5 lockup validator to descriptor policy - #9964
Closed
ralph-bitgo[bot] wants to merge 1 commit into
Closed
ralph-bitgo[bot] wants to merge 1 commit into
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
A custodial PoX-5 staking wallet's descriptor group (external, internal and the pox5-lockup descriptor) cannot pass descriptor policy validation: the template validators only know the 2-of-3 templates and throw while probing the lockup descriptor instead of failing closed. This blocks offline vault explanation and signing of custodial PoX-5 late exits (WAL-2156). - add getValidatorPox5Lockup: accepts a PoX-5 staking descriptor group — at least one canonical lockup (parsePox5LockupDescriptor) whose staker keys match the wallet key triple, with the remaining descriptors matching the wallet templates. Malformed, foreign-key and non-canonical lockups are rejected. - add the PoX-5 group alternative to getPolicyForEnv (prod/adminProd). - make template validators return false for descriptors they cannot parse instead of throwing, so some([...]) falls through to the next validator. Ticket: WAL-2156 Session-Id: 0b46844d-1e64-4dae-af4a-42bb86eedda7 Task-Id: c6ecab00-ae0e-49dc-a2c0-a08cfb1522ec
Contributor
10 tasks done
Contributor
|
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Summary: add a PoX-5 lockup descriptor validator to the
@bitgo/abstract-utxodescriptor policy and make the template validators fail closed instead of throwing.Motivation and context: the offline vault descriptor policy only knows the 2-of-3 templates, and its template validators throw while probing a descriptor they cannot parse. A custodial PoX-5 staking wallet's descriptor group (named
external,internaland the canonicalpox5-lockup-u<unlockHeight>-<hash>) therefore fails policy validation before any explanation or signature is produced — which is why the Offline Vault Console cannot explain or co-sign a custodial PoX-5 late exit and custodial unstake validation is blocked (WAL-2156; WAL-2144 matrix, SI-1191 unstake rollout).What changed:
getValidatorPox5Lockup(templateNames): accepts a PoX-5 staking descriptor group — at least one canonical lockup (pox5.parsePox5LockupDescriptorfrom@bitgo/utxo-descriptors, already a dependency) whose staker keys match the wallet key triple, with the remaining descriptors matching the wallet templates (e.g. the wallet'sexternal/internaldescriptors). Malformed, foreign-key and non-canonical lockups are rejected.getPolicyForEnv(prod/adminProd) gains the same PoX-5 group alternative.falsefor descriptors they cannot parse instead of throwing, sosome([...])falls through to the next validator.Issue Number
WAL-2156
Type of change
How Has This Been Tested?
@bitgo/abstract-utxounit tests:mocha --recursive test/unit/— 1660 passing on this branch.PoX-5 lockup descriptor policyunit tests: wallet descriptors mixed with a canonical lockup accepted by the PoX-5 validator and bygetPolicyForEnv('prod'); negatives for foreign staker keys, malformed (multi(3, ...)) and non-canonical (wsh(pk(...))) lockups, and groups without a lockup; template validators returnfalseinstead of throwing on the lockup descriptor.assertDescriptorPolicytests unchanged — mixed template groups are still rejected.Checklist:
Stack
This PR is part 1 of 2 in a stack. Review and merge in order:
master) ← you are hereWAL-2156-pox5-offlinevault-late-exit-pt1)