@openzeppelin/miden-multisig-client 0.18.0-rc.1 → 0.18.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/multisig/authArgErrors.d.ts +15 -1
- package/dist/multisig/authArgErrors.d.ts.map +1 -1
- package/dist/multisig/authArgErrors.js +20 -0
- package/dist/multisig/authArgErrors.js.map +1 -1
- package/dist/multisig.d.ts +36 -16
- package/dist/multisig.d.ts.map +1 -1
- package/dist/multisig.js +109 -58
- package/dist/multisig.js.map +1 -1
- package/dist/prover/workflow.d.ts +7 -3
- package/dist/prover/workflow.d.ts.map +1 -1
- package/dist/prover/workflow.js +7 -5
- package/dist/prover/workflow.js.map +1 -1
- package/dist/transaction/summary.d.ts +92 -14
- package/dist/transaction/summary.d.ts.map +1 -1
- package/dist/transaction/summary.js +93 -3
- package/dist/transaction/summary.js.map +1 -1
- package/dist/transaction.d.ts +1 -1
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +1 -1
- package/dist/transaction.js.map +1 -1
- package/dist/types/proposal.d.ts +9 -8
- package/dist/types/proposal.d.ts.map +1 -1
- package/dist/types/proposal.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +3 -0
- package/src/multisig/authArgErrors.ts +28 -1
- package/src/multisig.ts +127 -65
- package/src/prover/workflow.ts +7 -10
- package/src/transaction/summary.ts +161 -16
- package/src/transaction.ts +6 -0
- package/src/types/proposal.ts +9 -8
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Miden multisig accounts store their authentication logic on-chain, but **their s
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install @openzeppelin/miden-multisig-client@0.18.0-rc.
|
|
20
|
+
npm install @openzeppelin/miden-multisig-client@0.18.0-rc.2 @miden-sdk/miden-sdk@0.17.0-rc.4
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Miden 0.17 requires a new client database: a store created under 0.16 does
|
|
@@ -275,7 +275,7 @@ The option shapes are exported as `CreateProposalOptions`,
|
|
|
275
275
|
`CreateSignerProposalOptions`, and `CreateP2idProposalOptions`.
|
|
276
276
|
|
|
277
277
|
All methods also accept `approvalExpirationDelta` (1 to 65535): the number of blocks after
|
|
278
|
-
the proposal
|
|
278
|
+
the block the proposal binds by which the transaction must be included. Past
|
|
279
279
|
that block the approvers' signatures no longer authorize it, the SDK refuses to
|
|
280
280
|
execute it, and the node rejects it as expired. The summary binds the value, so
|
|
281
281
|
the executing party cannot change it. Omitted, the approval never expires,
|
|
@@ -385,8 +385,7 @@ others; only the check itself writes `verified`, and a freshly parsed or
|
|
|
385
385
|
imported proposal is `unchecked`. `retryable: true` means the
|
|
386
386
|
re-execution hit a transient node error and the proposal may verify on
|
|
387
387
|
the next sync; `retryable: false` means it cannot be reproduced (tampered
|
|
388
|
-
metadata,
|
|
389
|
-
re-proposed. Verification is deliberately not part of `status`: a fully
|
|
388
|
+
metadata, for example) and has to be re-proposed. Verification is deliberately not part of `status`: a fully
|
|
390
389
|
signed proposal can be dead, so `'ready'` keeps meaning "threshold met"
|
|
391
390
|
and `isProposalActionable(proposal)` answers "verified and ready".
|
|
392
391
|
`signProposal` and `executeProposal` re-verify the one proposal they act
|
|
@@ -406,12 +405,23 @@ for (const p of await multisig.syncProposals()) {
|
|
|
406
405
|
}
|
|
407
406
|
```
|
|
408
407
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
408
|
+
Verification and execution run at the chain tip. Since Miden 0.17 a
|
|
409
|
+
multisig summary binds the block its auth args name (the bound block), and
|
|
410
|
+
every request the SDK builds declares that block (`withBlockNumbers`), so the
|
|
411
|
+
summary reproduces at any later tip. An execution runs at the Miden client's
|
|
412
|
+
sync height, so `syncProposals`, `signProposal`, `executeProposal`,
|
|
413
|
+
`createTransactionProposalRequest` and the custom and offline paths sync the
|
|
414
|
+
client first. Foreign accounts, the fee faucet among them, load at the tip, so
|
|
415
|
+
a proposal stays verifiable however long it waits for signatures, even after
|
|
416
|
+
the node has pruned the bound block's account state (devnet keeps about 50
|
|
417
|
+
blocks). The proposal's `chainAnchor` still names the bound block, and
|
|
418
|
+
0.18.0-rc.1 clients still re-execute at it.
|
|
419
|
+
|
|
420
|
+
`createTransactionProposalRequest(proposalId)` returns the final, fully
|
|
421
|
+
signed request for an integration that proves and submits with its own
|
|
422
|
+
pipeline. Execute it at the chain tip, without an anchor, on a client that has
|
|
423
|
+
synced recently: this call syncs first, and an execution loads the fee faucet
|
|
424
|
+
at the client's sync height, which a node serves for only about 50 blocks.
|
|
415
425
|
|
|
416
426
|
### Execute a Proposal
|
|
417
427
|
|
|
@@ -517,8 +527,7 @@ const advice = await multisig.prepareCustomExecution(proposal.id, request.serial
|
|
|
517
527
|
|
|
518
528
|
// The browser TransactionRequest is immutable, so rebuild from the same recipe
|
|
519
529
|
// (inputs + salt + bound block) with the advice, then submit. `submitTransaction`
|
|
520
|
-
//
|
|
521
|
-
// since the collected signatures only authorize the summary produced there.
|
|
530
|
+
// executes at the chain tip: the rebuilt request declares the block it binds.
|
|
522
531
|
const boundBlockNum = chainAnchorBlockNum(proposal.metadata.chainAnchor);
|
|
523
532
|
const { request: finalRequest } = await buildP2idTransactionRequest(
|
|
524
533
|
midenClient, senderId, recipientId, faucetId, amount,
|
|
@@ -531,8 +540,11 @@ Since Miden 0.17 a multisig auth procedure reads three words out of the
|
|
|
531
540
|
transaction's auth arg: the block the summary binds together with the approval
|
|
532
541
|
expiration, the salt, and the fee conversion info. The exported builders get
|
|
533
542
|
them from `client.feeAwareTransactionRequestBuilder(account, { feeConversionSalt,
|
|
534
|
-
boundBlockNum })`, which sets the commitment as the request's auth arg
|
|
535
|
-
the preimage in its advice map
|
|
543
|
+
boundBlockNum })`, which sets the commitment as the request's auth arg, puts
|
|
544
|
+
the preimage in its advice map, and declares the bound block with
|
|
545
|
+
`withBlockNumbers` so the request executes at the chain tip. A request whose
|
|
546
|
+
auth args bind a block it does not declare is refused with
|
|
547
|
+
`BoundBlockNotDeclaredError`. An integration that assembles a request itself
|
|
536
548
|
must start from that builder for a multisig account, and must not call
|
|
537
549
|
`withFeeConversionSalt` or `withAuthArg` on it: the two setters clear each other
|
|
538
550
|
and either one discards the auth args. The approval never expires unless the
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export type { RpcConfig, RpcRetryPolicy } from './rpc/config.js';
|
|
|
50
50
|
export { lookupAuthDigest } from './lookupAuth.js';
|
|
51
51
|
export { Multisig, type AccountState, type CreateProposalOptions, type CreateSignerProposalOptions, type CreateP2idProposalOptions, } from './multisig.js';
|
|
52
52
|
export { AccountInspector, type DetectedMultisigConfig, type VaultBalance } from './inspector.js';
|
|
53
|
-
export { chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, type P2idTransactionOptions, type P2ideHeightOptions, } from './transaction.js';
|
|
53
|
+
export { ChainBehindBoundBlockError, chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, executeForSummaryAtTip, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, type P2idTransactionOptions, type P2ideHeightOptions, } from './transaction.js';
|
|
54
54
|
export { computeCommitmentFromTxSummary } from './multisig/helpers.js';
|
|
55
55
|
export type { MidenClientMultisigRequestOptions, MidenClientSignatureOptions, MultisigRequestOptions, SignatureOptions, } from './transaction/options.js';
|
|
56
56
|
export { GuardianHttpClient, GuardianHttpError } from '@openzeppelin/guardian-client';
|
|
@@ -71,7 +71,7 @@ export { createMultisigAccount, validateMultisigConfig, buildMultisigStorageSlot
|
|
|
71
71
|
export { CONSUME_NOTES_METADATA_VERSION_V2, MAX_CONSUME_NOTES_METADATA_BYTES, isConsumeNotesV1, isConsumeNotesV2, isProposalActionable, type ProposalVerification, isP2idNoteVisibility, type P2idNoteVisibility, MAX_P2IDE_BLOCK_HEIGHT, parseP2ideHeight, } from './types/proposal.js';
|
|
72
72
|
export { LEGACY_CONSUME_NOTES_ENABLED, } from './multisig/config.js';
|
|
73
73
|
export { type ConsumeNotesErrorCode, NoteBindingMismatchError, UnsupportedMetadataVersionError, ConsumeNotesMetadataOversizeError, LegacyConsumeNotesNoteMissingError, ConsumeNoteNotAuthenticatedError, } from './multisig/consumeNotesErrors.js';
|
|
74
|
-
export { type AuthArgErrorCode, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
74
|
+
export { type AuthArgErrorCode, BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
75
75
|
export { noteToBase64, noteFromBase64, } from './utils/encoding.js';
|
|
76
76
|
export { PROCEDURE_ROOTS, getProcedureRoot, isProcedureName, getProcedureNames, type ProcedureName, } from './procedures.js';
|
|
77
77
|
export type { MultisigAccountState, MultisigConfig, CreateAccountResult, ProcedureThreshold, Proposal, ProposalStatus, ProposalSignatureEntry, ProposalMetadata, ProposalType, ExportedProposal, ExportedTransactionProposal, SignTransactionProposalParams, TransactionProposal, TransactionProposalSignature, TransactionProposalStatus, TransactionType, ConsumableNote, NoteAsset, FalconSignature, Signer, SignatureScheme, AuthConfig, DeltaObject, DeltaStatus, StateObject, CosignerSignature, ConfigureRequest, ConfigureResponse, DeltaProposalRequest, DeltaProposalResponse, ProposalsResponse, PubkeyResponse, SignProposalRequest, } from './types.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,EAC1B,oCAAoC,EACpC,+CAA+C,EAC/C,qCAAqC,EACrC,mCAAmC,EACnC,4CAA4C,EAC5C,2BAA2B,EAC3B,oBAAoB,EACpB,cAAc,EACd,6BAA6B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,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ export { MultisigClient, } from './client.js';
|
|
|
47
47
|
export { lookupAuthDigest } from './lookupAuth.js';
|
|
48
48
|
export { Multisig, } from './multisig.js';
|
|
49
49
|
export { AccountInspector } from './inspector.js';
|
|
50
|
-
export { chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, } from './transaction.js';
|
|
50
|
+
export { ChainBehindBoundBlockError, chainAnchorFromBase64, chainAnchorToBase64, chainAnchorBlockNum, executeForSummary, executeForSummaryAt, executeForSummaryAtTip, summaryApprovalExpirationBlockNum, summarySalt, SummaryAnchorMismatchError, buildUpdateSignersTransactionRequest, buildUpdateProcedureThresholdTransactionRequest, buildUpdateGuardianTransactionRequest, buildConsumeNotesTransactionRequest, buildConsumeNotesTransactionRequestFromNotes, buildP2idTransactionRequest, requestBoundBlockNum, requestSaltHex, MAX_APPROVAL_EXPIRATION_DELTA, parseP2idNoteType, p2idNoteTypeToMetadata, } from './transaction.js';
|
|
51
51
|
// Commitment derivation for hand-rolled export/import flows (issue #433):
|
|
52
52
|
// the proposal id is the tx summary's commitment, recomputed from the
|
|
53
53
|
// serialized summary exactly as import verification does. Returns normalized
|
|
@@ -67,7 +67,7 @@ export { createMultisigAccount, validateMultisigConfig, buildMultisigStorageSlot
|
|
|
67
67
|
export { CONSUME_NOTES_METADATA_VERSION_V2, MAX_CONSUME_NOTES_METADATA_BYTES, isConsumeNotesV1, isConsumeNotesV2, isProposalActionable, isP2idNoteVisibility, MAX_P2IDE_BLOCK_HEIGHT, parseP2ideHeight, } from './types/proposal.js';
|
|
68
68
|
export { LEGACY_CONSUME_NOTES_ENABLED, } from './multisig/config.js';
|
|
69
69
|
export { NoteBindingMismatchError, UnsupportedMetadataVersionError, ConsumeNotesMetadataOversizeError, LegacyConsumeNotesNoteMissingError, ConsumeNoteNotAuthenticatedError, } from './multisig/consumeNotesErrors.js';
|
|
70
|
-
export { MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
70
|
+
export { BoundBlockNotDeclaredError, MultisigAuthArgsMissingError, ProposalSaltMalformedError, } from './multisig/authArgErrors.js';
|
|
71
71
|
export { noteToBase64, noteFromBase64, } from './utils/encoding.js';
|
|
72
72
|
export { PROCEDURE_ROOTS, getProcedureRoot, isProcedureName, getProcedureNames, } from './procedures.js';
|
|
73
73
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EACL,cAAc,GAGf,MAAM,aAAa,CAAC;AAOrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,QAAQ,GAKT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAkD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,0BAA0B,EAC1B,oCAAoC,EACpC,+CAA+C,EAC/C,qCAAqC,EACrC,mCAAmC,EACnC,4CAA4C,EAC5C,2BAA2B,EAC3B,oBAAoB,EACpB,cAAc,EACd,6BAA6B,E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,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,iBAAiB,GAIlB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EAEpB,oBAAoB,EAEpB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,wBAAwB,EACxB,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAEL,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAElB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Stable error identifiers for auth-arg recovery failures. */
|
|
2
|
-
export type AuthArgErrorCode = 'proposal_salt_malformed' | 'multisig_auth_args_missing';
|
|
2
|
+
export type AuthArgErrorCode = 'proposal_salt_malformed' | 'multisig_auth_args_missing' | 'bound_block_not_declared';
|
|
3
3
|
/**
|
|
4
4
|
* A proposal's recorded salt is not a readable 32-byte word, so no rebuild can
|
|
5
5
|
* use it.
|
|
@@ -39,4 +39,18 @@ export declare class MultisigAuthArgsMissingError extends Error {
|
|
|
39
39
|
readonly accountId: string;
|
|
40
40
|
constructor(accountId: string);
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* A multisig request does not list the block its auth args bind among the
|
|
44
|
+
* blocks it declares through `withBlockNumbers`. A proposal executes at the
|
|
45
|
+
* chain tip, where the auth procedure can read the bound block only from the
|
|
46
|
+
* transaction's partial blockchain, so such a request fails in the VM with
|
|
47
|
+
* `failed to lookup value in Merkle store` once the chain moves past that
|
|
48
|
+
* block. `feeAwareTransactionRequestBuilder` declares it; a request whose auth
|
|
49
|
+
* args are attached by hand has to call `withBlockNumbers([boundBlockNum])`.
|
|
50
|
+
*/
|
|
51
|
+
export declare class BoundBlockNotDeclaredError extends Error {
|
|
52
|
+
readonly code: AuthArgErrorCode;
|
|
53
|
+
readonly boundBlockNum: number;
|
|
54
|
+
constructor(boundBlockNum: number);
|
|
55
|
+
}
|
|
42
56
|
//# sourceMappingURL=authArgErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authArgErrors.d.ts","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAIA,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"authArgErrors.d.ts","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAIA,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,4BAA4B,GAC5B,0BAA0B,CAAC;AA0C/B;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAA6B;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAc/F;AAED;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAgC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM;CAS9B;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAA8B;IAC7D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAEnB,aAAa,EAAE,MAAM;CASlC"}
|
|
@@ -88,4 +88,24 @@ export class MultisigAuthArgsMissingError extends Error {
|
|
|
88
88
|
this.accountId = accountId;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* A multisig request does not list the block its auth args bind among the
|
|
93
|
+
* blocks it declares through `withBlockNumbers`. A proposal executes at the
|
|
94
|
+
* chain tip, where the auth procedure can read the bound block only from the
|
|
95
|
+
* transaction's partial blockchain, so such a request fails in the VM with
|
|
96
|
+
* `failed to lookup value in Merkle store` once the chain moves past that
|
|
97
|
+
* block. `feeAwareTransactionRequestBuilder` declares it; a request whose auth
|
|
98
|
+
* args are attached by hand has to call `withBlockNumbers([boundBlockNum])`.
|
|
99
|
+
*/
|
|
100
|
+
export class BoundBlockNotDeclaredError extends Error {
|
|
101
|
+
code = 'bound_block_not_declared';
|
|
102
|
+
boundBlockNum;
|
|
103
|
+
constructor(boundBlockNum) {
|
|
104
|
+
super(`The transaction request binds block ${boundBlockNum} in its multisig auth args but does ` +
|
|
105
|
+
'not declare it, so it cannot execute at a later chain tip. Build it with ' +
|
|
106
|
+
`feeAwareTransactionRequestBuilder or add withBlockNumbers([${boundBlockNum}])`);
|
|
107
|
+
this.name = 'BoundBlockNotDeclaredError';
|
|
108
|
+
this.boundBlockNum = boundBlockNum;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
91
111
|
//# sourceMappingURL=authArgErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authArgErrors.js","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,2FAA2F;AAC3F,4EAA4E;
|
|
1
|
+
{"version":3,"file":"authArgErrors.js","sourceRoot":"","sources":["../../src/multisig/authArgErrors.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,2FAA2F;AAC3F,4EAA4E;AAQ5E,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IACzE,OAAO,QAAQ,CAAC,MAAM,GAAG,gBAAgB;QACvC,CAAC,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,QAAQ,QAAQ,CAAC,MAAM,cAAc;QACxF,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,OAAO,KAAK,GAAG,CAAC;IAC3C,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC1C,IAAI,GA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CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;CACF"}
|
package/dist/multisig.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface CreateProposalOptions {
|
|
|
40
40
|
/** Proposal nonce; defaults to `Date.now()`. */
|
|
41
41
|
nonce?: number;
|
|
42
42
|
/**
|
|
43
|
-
* Blocks after the proposal
|
|
43
|
+
* Blocks after the block the proposal binds by which the transaction must be
|
|
44
44
|
* included; past that the approvers' signatures no longer authorize it. The
|
|
45
45
|
* summary binds it, so the executing party can neither shorten nor extend it.
|
|
46
46
|
* Omitted, the approval never expires (the upstream default).
|
|
@@ -260,11 +260,12 @@ export declare class Multisig {
|
|
|
260
260
|
* Every synced proposal's metadata is checked against its signed summary
|
|
261
261
|
* and the outcome is recorded in {@link Proposal.verification}. One that
|
|
262
262
|
* fails is still cached and returned, so a single stale or corrupt
|
|
263
|
-
* proposal cannot hide the others (issue #462
|
|
264
|
-
* proposal
|
|
265
|
-
* with `retryable: true` means a transient node error
|
|
266
|
-
*
|
|
267
|
-
*
|
|
263
|
+
* proposal cannot hide the others (issue #462). Verification re-executes
|
|
264
|
+
* each proposal at the chain tip, so the Miden client is synced once first.
|
|
265
|
+
* `failed` with `retryable: true` means a transient node error or chain
|
|
266
|
+
* state this client had not caught up with, worth syncing again;
|
|
267
|
+
* `retryable: false` means the proposal cannot be reproduced and must be
|
|
268
|
+
* re-proposed. `signProposal` and `executeProposal` re-verify and
|
|
268
269
|
* refuse a failed proposal. A failed proposal still counts as reported, so
|
|
269
270
|
* it is pruned like any other once GUARDIAN stops listing it.
|
|
270
271
|
*
|
|
@@ -577,6 +578,12 @@ export declare class Multisig {
|
|
|
577
578
|
deltaHistory(options?: HistoryOptions): Promise<HistoryPage>;
|
|
578
579
|
signProposal(proposalId: string): Promise<Proposal>;
|
|
579
580
|
private getProposalForSigning;
|
|
581
|
+
/**
|
|
582
|
+
* Builds the final, fully signed request for a ready proposal, for a caller
|
|
583
|
+
* that proves and submits it with its own pipeline. The request declares the
|
|
584
|
+
* block its summary binds, so execute it at the chain tip, without an
|
|
585
|
+
* anchor, on a client synced to at least that block.
|
|
586
|
+
*/
|
|
580
587
|
createTransactionProposalRequest(proposalId: string): Promise<TransactionRequest>;
|
|
581
588
|
/**
|
|
582
589
|
* Execute a proposal that has enough signatures.
|
|
@@ -588,10 +595,23 @@ export declare class Multisig {
|
|
|
588
595
|
* Submit an integration-built transaction (advice already injected). Mirrors
|
|
589
596
|
* the Rust `submit_transaction`; used by the custom proposal producer flow
|
|
590
597
|
* after `prepareCustomExecution` rebuilds its request with the returned advice.
|
|
591
|
-
* The transaction is executed at the
|
|
592
|
-
*
|
|
598
|
+
* The transaction is executed at the chain tip, so the request has to declare
|
|
599
|
+
* the block its auth args bind (`feeAwareTransactionRequestBuilder` does).
|
|
593
600
|
*/
|
|
594
601
|
submitTransaction(proposalId: string, request: TransactionRequest): Promise<void>;
|
|
602
|
+
/**
|
|
603
|
+
* Executes `request` at the chain tip, then proves, submits and applies it,
|
|
604
|
+
* syncing first when this client is still below the block the request binds.
|
|
605
|
+
*/
|
|
606
|
+
private submitAtTip;
|
|
607
|
+
/**
|
|
608
|
+
* Brings the Miden client to the chain tip before a proposal is re-executed:
|
|
609
|
+
* an execution loads foreign accounts, the fee faucet among them, at the
|
|
610
|
+
* store's sync height, which a node prunes about 50 blocks later.
|
|
611
|
+
*/
|
|
612
|
+
private syncChain;
|
|
613
|
+
/** {@link syncToBoundBlock} with this client's RPC retry policy. */
|
|
614
|
+
private syncToBoundBlock;
|
|
595
615
|
/**
|
|
596
616
|
* Create a proposal from a producer-built transaction the SDK does not model.
|
|
597
617
|
* `transactionRequestBytes` is a serialized TransactionRequest;
|
|
@@ -615,8 +635,8 @@ export declare class Multisig {
|
|
|
615
635
|
private assembleCustomAdvice;
|
|
616
636
|
private getLocalProposal;
|
|
617
637
|
/**
|
|
618
|
-
* The returned
|
|
619
|
-
*
|
|
638
|
+
* The returned request declares the block the signed summary binds, and
|
|
639
|
+
* executes at the chain tip.
|
|
620
640
|
*/
|
|
621
641
|
private prepareProposalExecution;
|
|
622
642
|
/**
|
|
@@ -654,12 +674,6 @@ export declare class Multisig {
|
|
|
654
674
|
*/
|
|
655
675
|
private verifyProposalMetadataBinding;
|
|
656
676
|
private checkProposalMetadataBinding;
|
|
657
|
-
/**
|
|
658
|
-
* Decodes a proposal's chain anchor. Throws when absent: a proposal without
|
|
659
|
-
* an anchor was created at an unknown reference block, so its signed summary
|
|
660
|
-
* cannot be reproduced, verified, or executed. The caller owns the returned
|
|
661
|
-
* anchor and must `free()` it once done.
|
|
662
|
-
*/
|
|
663
677
|
/**
|
|
664
678
|
* Reads a proposal's salt. Throws when absent, because there is nothing to fall
|
|
665
679
|
* back to.
|
|
@@ -671,6 +685,12 @@ export declare class Multisig {
|
|
|
671
685
|
* metadata that names another salt, which the binding check reports by name.
|
|
672
686
|
*/
|
|
673
687
|
private requireProposalSaltHex;
|
|
688
|
+
/**
|
|
689
|
+
* Decodes a proposal's chain anchor, which names the block its signed summary
|
|
690
|
+
* binds. Throws when absent: every proposal carries one, so a proposal
|
|
691
|
+
* without it is malformed and is neither verified nor executed. The caller
|
|
692
|
+
* owns the returned anchor and must `free()` it once done.
|
|
693
|
+
*/
|
|
674
694
|
private requireProposalAnchor;
|
|
675
695
|
/**
|
|
676
696
|
* An expired approval aborts in the auth procedure only at execution.
|
package/dist/multisig.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multisig.d.ts","sourceRoot":"","sources":["../src/multisig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,KAAK,aAAa,EAAoB,KAAK,cAAc,EAAE,KAAK,WAAW,EAA0B,KAAK,MAAM,EAAqC,MAAM,+BAA+B,CAAC;AACvP,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,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