@aztec/end-to-end 0.0.1-commit.b8a057fa → 0.0.1-commit.be03c316
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/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +7 -5
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -1
- package/dest/automine/delivery/onchain_delivery_harness.js +22 -4
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +2 -2
- package/dest/fixtures/fixtures.d.ts +3 -2
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +5 -3
- package/dest/forward-compatibility/wallet_service.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +6 -6
- package/dest/test-wallet/test_wallet.d.ts +3 -3
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +2 -5
- package/dest/test-wallet/wallet_worker_script.js +2 -2
- package/dest/test-wallet/worker_wallet.d.ts +3 -3
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +5 -3
- package/dest/test-wallet/worker_wallet_schema.js +2 -1
- package/package.json +40 -40
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +46 -10
- package/src/bench/client_flows/client_flows_benchmark.ts +2 -2
- package/src/fixtures/e2e_prover_test.ts +6 -1
- package/src/fixtures/fixtures.ts +5 -3
- package/src/forward-compatibility/wallet_service.ts +2 -2
- package/src/spartan/setup_test_wallets.ts +12 -6
- package/src/test-wallet/test_wallet.ts +4 -7
- package/src/test-wallet/wallet_worker_script.ts +3 -3
- package/src/test-wallet/worker_wallet.ts +8 -6
- package/src/test-wallet/worker_wallet_schema.ts +1 -1
|
@@ -2,7 +2,7 @@ import type { CallIntent, IntentInnerHash } from '@aztec/aztec.js/authorization'
|
|
|
2
2
|
import type { InteractionWaitOptions, SendReturn } from '@aztec/aztec.js/contracts';
|
|
3
3
|
import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, ContractClassMetadata, ContractMetadata, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, TxSimulationResultWithAppOffset, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
|
|
4
4
|
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
5
|
-
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
+
import type { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
6
6
|
import type { PXEConfig } from '@aztec/pxe/config';
|
|
7
7
|
import type { ContractArtifact, EventMetadataDefinition, FunctionCall } from '@aztec/stdlib/abi';
|
|
8
8
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
@@ -43,11 +43,11 @@ export declare class WorkerWallet implements Wallet {
|
|
|
43
43
|
sendTx<W extends InteractionWaitOptions = undefined>(exec: ExecutionPayload, opts: SendOptions<W>): Promise<SendReturn<W>>;
|
|
44
44
|
proveTx(exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>): Promise<Tx>;
|
|
45
45
|
/** Registers an account inside the worker's TestWallet, populating its accounts map. */
|
|
46
|
-
registerAccount(secret: Fr, salt: Fr): Promise<AztecAddress>;
|
|
46
|
+
registerAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AztecAddress>;
|
|
47
47
|
createAuthWit(from: AztecAddress, messageHashOrIntent: IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
48
48
|
requestCapabilities(manifest: AppCapabilities): Promise<WalletCapabilities>;
|
|
49
49
|
batch<const T extends readonly BatchedMethod[]>(methods: T): Promise<BatchResults<T>>;
|
|
50
50
|
/** Shuts down the worker thread and closes the transport. */
|
|
51
51
|
stop(): Promise<void>;
|
|
52
52
|
}
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3Qtd2FsbGV0L3dvcmtlcl93YWxsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLGVBQWUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2pGLE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3BGLE9BQU8sS0FBSyxFQUNWLE9BQU8sRUFDUCxlQUFlLEVBQ2YsWUFBWSxFQUNaLGFBQWEsRUFDYixxQkFBcUIsRUFDckIsZ0JBQWdCLEVBQ2hCLHFCQUFxQixFQUNyQixZQUFZLEVBQ1osa0JBQWtCLEVBQ2xCLGNBQWMsRUFDZCxXQUFXLEVBQ1gsZUFBZSxFQUNmLCtCQUErQixFQUMvQixNQUFNLEVBQ04sa0JBQWtCLEVBQ25CLE1BQU0sd0JBQXdCLENBQUM7QUFDaEMsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDL0QsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBTzd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OAAO,CAAC,IAAI,CAAC,CAG1B;CACF"}
|
|
@@ -92,7 +92,9 @@ const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
|
92
92
|
async call(fn, ...args) {
|
|
93
93
|
const resultJson = await this.callRaw(fn, ...args);
|
|
94
94
|
const methodSchema = WorkerWalletSchema[fn];
|
|
95
|
-
|
|
95
|
+
// Void-returning methods (e.g. registerContract) serialize to `undefined` on the worker side, which
|
|
96
|
+
// JSON.parse cannot handle; hand it straight to the schema, whose `z.void()` output accepts undefined.
|
|
97
|
+
return getSchemaReturnType(methodSchema).parseAsync(resultJson === undefined ? undefined : JSON.parse(resultJson));
|
|
96
98
|
}
|
|
97
99
|
getChainInfo() {
|
|
98
100
|
return this.call('getChainInfo');
|
|
@@ -136,8 +138,8 @@ const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
|
136
138
|
proveTx(exec, opts) {
|
|
137
139
|
return this.call('proveTx', exec, opts);
|
|
138
140
|
}
|
|
139
|
-
/** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt) {
|
|
140
|
-
return this.call('registerAccount', secret, salt);
|
|
141
|
+
/** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt, signingKey) {
|
|
142
|
+
return this.call('registerAccount', secret, salt, signingKey);
|
|
141
143
|
}
|
|
142
144
|
createAuthWit(from, messageHashOrIntent) {
|
|
143
145
|
return this.call('createAuthWit', from, messageHashOrIntent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.be03c316",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -29,45 +29,45 @@
|
|
|
29
29
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
33
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
34
|
-
"@aztec/aztec": "0.0.1-commit.
|
|
35
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
36
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
37
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
38
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
39
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
40
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
41
|
-
"@aztec/bot": "0.0.1-commit.
|
|
42
|
-
"@aztec/cli": "0.0.1-commit.
|
|
43
|
-
"@aztec/constants": "0.0.1-commit.
|
|
44
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
45
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
46
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
47
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
48
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
49
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
50
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
51
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
52
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
53
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
54
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
55
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
56
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
57
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
58
|
-
"@aztec/prover-node": "0.0.1-commit.
|
|
59
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
60
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
61
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
62
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
63
|
-
"@aztec/standard-contracts": "0.0.1-commit.
|
|
64
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
65
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
66
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
67
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
68
|
-
"@aztec/wallet-sdk": "0.0.1-commit.
|
|
69
|
-
"@aztec/wallets": "0.0.1-commit.
|
|
70
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
32
|
+
"@aztec/accounts": "0.0.1-commit.be03c316",
|
|
33
|
+
"@aztec/archiver": "0.0.1-commit.be03c316",
|
|
34
|
+
"@aztec/aztec": "0.0.1-commit.be03c316",
|
|
35
|
+
"@aztec/aztec-node": "0.0.1-commit.be03c316",
|
|
36
|
+
"@aztec/aztec.js": "0.0.1-commit.be03c316",
|
|
37
|
+
"@aztec/bb-prover": "0.0.1-commit.be03c316",
|
|
38
|
+
"@aztec/bb.js": "0.0.1-commit.be03c316",
|
|
39
|
+
"@aztec/blob-client": "0.0.1-commit.be03c316",
|
|
40
|
+
"@aztec/blob-lib": "0.0.1-commit.be03c316",
|
|
41
|
+
"@aztec/bot": "0.0.1-commit.be03c316",
|
|
42
|
+
"@aztec/cli": "0.0.1-commit.be03c316",
|
|
43
|
+
"@aztec/constants": "0.0.1-commit.be03c316",
|
|
44
|
+
"@aztec/entrypoints": "0.0.1-commit.be03c316",
|
|
45
|
+
"@aztec/epoch-cache": "0.0.1-commit.be03c316",
|
|
46
|
+
"@aztec/ethereum": "0.0.1-commit.be03c316",
|
|
47
|
+
"@aztec/foundation": "0.0.1-commit.be03c316",
|
|
48
|
+
"@aztec/kv-store": "0.0.1-commit.be03c316",
|
|
49
|
+
"@aztec/l1-artifacts": "0.0.1-commit.be03c316",
|
|
50
|
+
"@aztec/node-keystore": "0.0.1-commit.be03c316",
|
|
51
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.be03c316",
|
|
52
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.be03c316",
|
|
53
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.be03c316",
|
|
54
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.be03c316",
|
|
55
|
+
"@aztec/p2p": "0.0.1-commit.be03c316",
|
|
56
|
+
"@aztec/protocol-contracts": "0.0.1-commit.be03c316",
|
|
57
|
+
"@aztec/prover-client": "0.0.1-commit.be03c316",
|
|
58
|
+
"@aztec/prover-node": "0.0.1-commit.be03c316",
|
|
59
|
+
"@aztec/pxe": "0.0.1-commit.be03c316",
|
|
60
|
+
"@aztec/sequencer-client": "0.0.1-commit.be03c316",
|
|
61
|
+
"@aztec/simulator": "0.0.1-commit.be03c316",
|
|
62
|
+
"@aztec/slasher": "0.0.1-commit.be03c316",
|
|
63
|
+
"@aztec/standard-contracts": "0.0.1-commit.be03c316",
|
|
64
|
+
"@aztec/stdlib": "0.0.1-commit.be03c316",
|
|
65
|
+
"@aztec/telemetry-client": "0.0.1-commit.be03c316",
|
|
66
|
+
"@aztec/validator-client": "0.0.1-commit.be03c316",
|
|
67
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.be03c316",
|
|
68
|
+
"@aztec/wallet-sdk": "0.0.1-commit.be03c316",
|
|
69
|
+
"@aztec/wallets": "0.0.1-commit.be03c316",
|
|
70
|
+
"@aztec/world-state": "0.0.1-commit.be03c316",
|
|
71
71
|
"@iarna/toml": "^2.2.5",
|
|
72
72
|
"@jest/globals": "^30.0.0",
|
|
73
73
|
"@noble/curves": "=1.0.0",
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { AztecAddress, type CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { DomainSeparator } from '@aztec/constants';
|
|
3
|
+
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
4
|
+
import { Schnorr, type SchnorrSignature } from '@aztec/foundation/crypto/schnorr';
|
|
5
|
+
import { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
6
|
+
import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
7
|
+
import type { CustomRequest } from '@aztec/pxe/config';
|
|
8
|
+
import {
|
|
9
|
+
INTERACTIVE_HANDSHAKE_REQUEST_KIND,
|
|
10
|
+
STANDARD_HANDSHAKE_REGISTRY_ADDRESS,
|
|
11
|
+
} from '@aztec/standard-contracts/handshake-registry/constants';
|
|
12
|
+
import { type PublicKeys, derivePublicKeyFromSecretKey } from '@aztec/stdlib/keys';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The decoded payload of the registry's interactive-handshake signature request. Note it never carries the sender,
|
|
16
|
+
* so the recipient authorizes the handshake without learning who initiated it.
|
|
17
|
+
*/
|
|
18
|
+
export type InteractiveHandshakeRequest = {
|
|
19
|
+
/** The account whose authorization is being requested. */
|
|
20
|
+
recipient: AztecAddress;
|
|
21
|
+
chainId: Fr;
|
|
22
|
+
version: Fr;
|
|
23
|
+
/** The x-coordinate of the handshake's ephemeral public key (its y-coordinate is positive by construction). */
|
|
24
|
+
ephPkX: Fr;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The recipient's signed authorization for an interactive handshake. Mirrors the registry contract's
|
|
29
|
+
* `RecipientSignature` struct field for field.
|
|
30
|
+
*/
|
|
31
|
+
export type RecipientSignature = {
|
|
32
|
+
/** The recipient's master public keys, bound in-circuit to the recipient's address via `partialAddress`. */
|
|
33
|
+
publicKeys: PublicKeys;
|
|
34
|
+
partialAddress: Fr;
|
|
35
|
+
/** The x-coordinate of the recipient's master message-signing public key. */
|
|
36
|
+
mspkX: Fr;
|
|
37
|
+
/** Whether that key's y-coordinate is positive, so the circuit can reconstruct the point from `mspkX`. */
|
|
38
|
+
mspkYIsPositive: boolean;
|
|
39
|
+
/** The schnorr signature over the handshake message. */
|
|
40
|
+
signature: SchnorrSignature;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Parses and validates the registry's interactive-handshake signature request.
|
|
45
|
+
*
|
|
46
|
+
* @throws If the request kind is not {@link INTERACTIVE_HANDSHAKE_REQUEST_KIND}, the issuing contract is not the
|
|
47
|
+
* standard HandshakeRegistry, or the payload does not have the expected shape.
|
|
48
|
+
*/
|
|
49
|
+
export function parseInteractiveHandshakeRequest(request: CustomRequest): InteractiveHandshakeRequest {
|
|
50
|
+
if (!request.kind.equals(INTERACTIVE_HANDSHAKE_REQUEST_KIND)) {
|
|
51
|
+
throw new Error(`Not an interactive-handshake signature request: unexpected kind ${request.kind}`);
|
|
52
|
+
}
|
|
53
|
+
if (!request.contractAddress.equals(STANDARD_HANDSHAKE_REGISTRY_ADDRESS)) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Interactive-handshake signature request issued by ${request.contractAddress}, expected the standard HandshakeRegistry at ${STANDARD_HANDSHAKE_REGISTRY_ADDRESS}`,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
if (request.payload.length !== 4) {
|
|
59
|
+
throw new Error(`Interactive-handshake signature request payload has ${request.payload.length} fields, expected 4`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const [recipient, chainId, version, ephPkX] = request.payload;
|
|
63
|
+
return { recipient: new AztecAddress(recipient), chainId, version, ephPkX };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Produces the recipient's signed authorization for an interactive handshake, signing with the master
|
|
68
|
+
* message-signing secret key.
|
|
69
|
+
*/
|
|
70
|
+
export async function signInteractiveHandshake(
|
|
71
|
+
request: InteractiveHandshakeRequest,
|
|
72
|
+
completeAddress: CompleteAddress,
|
|
73
|
+
masterMessageSigningSecretKey: GrumpkinScalar,
|
|
74
|
+
): Promise<RecipientSignature> {
|
|
75
|
+
const mspk = await derivePublicKeyFromSecretKey(masterMessageSigningSecretKey);
|
|
76
|
+
const [mspkX, mspkYIsPositive] = mspk.toXAndSign();
|
|
77
|
+
|
|
78
|
+
const message = await computeInteractiveHandshakeSignatureMessage({
|
|
79
|
+
chainId: request.chainId,
|
|
80
|
+
version: request.version,
|
|
81
|
+
registry: STANDARD_HANDSHAKE_REGISTRY_ADDRESS,
|
|
82
|
+
ephPkX: request.ephPkX,
|
|
83
|
+
});
|
|
84
|
+
const signature = await new Schnorr().constructSignature(message, masterMessageSigningSecretKey);
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
publicKeys: completeAddress.publicKeys,
|
|
88
|
+
partialAddress: completeAddress.partialAddress,
|
|
89
|
+
mspkX,
|
|
90
|
+
mspkYIsPositive,
|
|
91
|
+
signature,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Serializes a {@link RecipientSignature} to the field layout the registry's in-circuit deserialization expects. */
|
|
96
|
+
export function recipientSignatureToFields(recipientSignature: RecipientSignature): Fr[] {
|
|
97
|
+
const s = Fq.fromBuffer(recipientSignature.signature.s);
|
|
98
|
+
const e = Fq.fromBuffer(recipientSignature.signature.e);
|
|
99
|
+
return [
|
|
100
|
+
...recipientSignature.publicKeys.toFields(),
|
|
101
|
+
recipientSignature.partialAddress,
|
|
102
|
+
recipientSignature.mspkX,
|
|
103
|
+
new Fr(recipientSignature.mspkYIsPositive),
|
|
104
|
+
s.lo,
|
|
105
|
+
s.hi,
|
|
106
|
+
e.lo,
|
|
107
|
+
e.hi,
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The message an interactive-handshake authorization signs: the handshake's ephemeral key and chain context under
|
|
113
|
+
* `DomainSeparator.INTERACTIVE_HANDSHAKE_SIGNATURE`, exactly as the registry recomputes it in-circuit.
|
|
114
|
+
*/
|
|
115
|
+
function computeInteractiveHandshakeSignatureMessage(args: {
|
|
116
|
+
chainId: Fr;
|
|
117
|
+
version: Fr;
|
|
118
|
+
registry: AztecAddress;
|
|
119
|
+
ephPkX: Fr;
|
|
120
|
+
}): Promise<Fr> {
|
|
121
|
+
return poseidon2HashWithSeparator(
|
|
122
|
+
[args.chainId, args.version, args.registry, args.ephPkX],
|
|
123
|
+
DomainSeparator.INTERACTIVE_HANDSHAKE_SIGNATURE,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
2
2
|
import type { FieldLike } from '@aztec/aztec.js/abi';
|
|
3
3
|
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
4
|
-
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
+
import type { AztecAddress, CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
5
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
|
+
import type { AccountManager } from '@aztec/aztec.js/wallet';
|
|
6
7
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
7
8
|
import { type DeliveryEvent, OnchainDeliveryTestContract } from '@aztec/noir-test-contracts.js/OnchainDeliveryTest';
|
|
8
|
-
import type {
|
|
9
|
+
import type { CustomRequest, ResolveCustomRequest, ResolveTaggingSecretStrategy } from '@aztec/pxe/config';
|
|
9
10
|
import type { AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
10
11
|
|
|
11
12
|
import { jest } from '@jest/globals';
|
|
@@ -14,9 +15,13 @@ import { AUTOMINE_E2E_OPTS } from '../../fixtures/fixtures.js';
|
|
|
14
15
|
import { ensureHandshakeRegistryPublished, setup, setupPXEAndGetWallet } from '../../fixtures/setup.js';
|
|
15
16
|
import { TestWallet } from '../../test-wallet/test_wallet.js';
|
|
16
17
|
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
export type
|
|
18
|
+
// Builds the hook serving custom requests issued during the sender's simulations. Installed on the sender PXE at
|
|
19
|
+
// creation but built only once the recipient exists, since serving typically needs the recipient's wallet and keys.
|
|
20
|
+
export type CustomRequestResponder = (
|
|
21
|
+
recipient: TestWallet,
|
|
22
|
+
recipientAccount: InitialAccountData,
|
|
23
|
+
recipientCompleteAddress: CompleteAddress,
|
|
24
|
+
) => ResolveCustomRequest;
|
|
20
25
|
|
|
21
26
|
export type Mode = 'constrained' | 'unconstrained';
|
|
22
27
|
|
|
@@ -40,19 +45,22 @@ export function buildMessageDeliveryTest(opts: {
|
|
|
40
45
|
strategy: string;
|
|
41
46
|
mode: DeliveryMode;
|
|
42
47
|
// Required: every cell states its source explicitly rather than leaning on the PXE default (covered by unit tests).
|
|
43
|
-
senderHook:
|
|
48
|
+
senderHook: ResolveTaggingSecretStrategy;
|
|
44
49
|
// Recipient-side setup the source requires (e.g. registering a raw arbitrary secret); runs once after deployment.
|
|
45
50
|
recipientRegistration?: (
|
|
46
51
|
recipient: TestWallet,
|
|
47
52
|
recipientAddress: AztecAddress,
|
|
48
53
|
sender: AztecAddress,
|
|
49
54
|
) => Promise<void>;
|
|
55
|
+
// Serves the custom requests issued during the sender's simulations (e.g. the registry's interactive-handshake
|
|
56
|
+
// signature request).
|
|
57
|
+
customRequestResponder?: CustomRequestResponder;
|
|
50
58
|
// Extra `it()`s to register in this cell's suite, e.g. assertions against state a custom `senderHook` recorded.
|
|
51
59
|
// Called inside the same `describe`, after the two baseline assertions below, so it shares their `beforeAll`
|
|
52
60
|
// instead of depending on Jest's cross-`describe` execution order.
|
|
53
61
|
additionalTests?: () => void;
|
|
54
62
|
}) {
|
|
55
|
-
const { strategy, mode, senderHook, recipientRegistration, additionalTests } = opts;
|
|
63
|
+
const { strategy, mode, senderHook, recipientRegistration, customRequestResponder, additionalTests } = opts;
|
|
56
64
|
const description = `${strategy} x ${formatMode(mode)}`;
|
|
57
65
|
|
|
58
66
|
describe(description, () => {
|
|
@@ -84,11 +92,14 @@ export function buildMessageDeliveryTest(opts: {
|
|
|
84
92
|
? contractSender.methods.emit_note(recipient, value)
|
|
85
93
|
: contractSender.methods.emit_note_unconstrained(recipient, value);
|
|
86
94
|
|
|
95
|
+
let additionallyFundedAccounts: InitialAccountData[];
|
|
96
|
+
let recipientAccount: AccountManager | undefined;
|
|
97
|
+
let customRequestCount = 0;
|
|
98
|
+
|
|
87
99
|
beforeAll(async () => {
|
|
88
100
|
// The sender PXE holds the sender and carries this cell's tagging-secret-strategy hook. The recipient is funded
|
|
89
101
|
// at genesis here but created and deployed on the isolated recipient PXE below, so it carries no sender state
|
|
90
102
|
// from other cells.
|
|
91
|
-
let additionallyFundedAccounts: InitialAccountData[];
|
|
92
103
|
({
|
|
93
104
|
aztecNode,
|
|
94
105
|
additionallyFundedAccounts,
|
|
@@ -98,7 +109,26 @@ export function buildMessageDeliveryTest(opts: {
|
|
|
98
109
|
} = await setup(1, {
|
|
99
110
|
...AUTOMINE_E2E_OPTS,
|
|
100
111
|
additionallyFundedAccounts: await generateSchnorrAccounts(1, 'schnorr'),
|
|
101
|
-
pxeCreationOptions: {
|
|
112
|
+
pxeCreationOptions: {
|
|
113
|
+
hooks: {
|
|
114
|
+
resolveTaggingSecretStrategy: senderHook,
|
|
115
|
+
resolveCustomRequest: async (request: CustomRequest) => {
|
|
116
|
+
if (!customRequestResponder) {
|
|
117
|
+
throw new Error('A custom request arrived but this test cell has no customRequestResponder configured');
|
|
118
|
+
}
|
|
119
|
+
if (!recipientAccount) {
|
|
120
|
+
throw new Error('A custom request arrived before the recipient wallet was created');
|
|
121
|
+
}
|
|
122
|
+
customRequestCount++;
|
|
123
|
+
const respond = customRequestResponder(
|
|
124
|
+
walletRecipient,
|
|
125
|
+
additionallyFundedAccounts[0],
|
|
126
|
+
await recipientAccount.getCompleteAddress(),
|
|
127
|
+
);
|
|
128
|
+
return respond(request);
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
102
132
|
}));
|
|
103
133
|
|
|
104
134
|
({ wallet: walletRecipient, teardown: teardownRecipient } = await setupPXEAndGetWallet(
|
|
@@ -108,7 +138,7 @@ export function buildMessageDeliveryTest(opts: {
|
|
|
108
138
|
undefined,
|
|
109
139
|
'pxe-recipient',
|
|
110
140
|
));
|
|
111
|
-
|
|
141
|
+
recipientAccount = await walletRecipient.createSchnorrAccount(
|
|
112
142
|
additionallyFundedAccounts[0].secret,
|
|
113
143
|
additionallyFundedAccounts[0].salt,
|
|
114
144
|
additionallyFundedAccounts[0].signingKey,
|
|
@@ -172,6 +202,12 @@ export function buildMessageDeliveryTest(opts: {
|
|
|
172
202
|
expect(readNotes).toEqual(noteValues);
|
|
173
203
|
});
|
|
174
204
|
|
|
205
|
+
if (customRequestResponder) {
|
|
206
|
+
it('the custom request hook fires exactly once, on the send that bootstraps the tagging secret', () => {
|
|
207
|
+
expect(customRequestCount).toBe(1);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
175
211
|
additionalTests?.();
|
|
176
212
|
});
|
|
177
213
|
}
|
|
@@ -13,6 +13,7 @@ import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
|
13
13
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
14
14
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
15
15
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
16
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
16
17
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
17
18
|
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
18
19
|
import { TestERC20Bytecode } from '@aztec/l1-artifacts/TestERC20Bytecode';
|
|
@@ -26,7 +27,6 @@ import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
|
26
27
|
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
27
28
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
28
29
|
import { Gas, GasSettings } from '@aztec/stdlib/gas';
|
|
29
|
-
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
30
30
|
import { AppTaggingSecretKind } from '@aztec/stdlib/logs';
|
|
31
31
|
|
|
32
32
|
import {
|
|
@@ -192,7 +192,7 @@ export class ClientFlowsBenchmark {
|
|
|
192
192
|
|
|
193
193
|
let benchysPrivateSigningKey;
|
|
194
194
|
if (type === 'schnorr') {
|
|
195
|
-
benchysPrivateSigningKey =
|
|
195
|
+
benchysPrivateSigningKey = GrumpkinScalar.random();
|
|
196
196
|
return wallet.createSchnorrAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
197
197
|
} else if (type === 'ecdsar1') {
|
|
198
198
|
benchysPrivateSigningKey = randomBytes(32);
|
|
@@ -196,8 +196,13 @@ export class FullProverTest extends SingleNodeTestContext {
|
|
|
196
196
|
await provenWallet.createSchnorrInitializerlessAccount(
|
|
197
197
|
this.fundedAccounts[i].secret,
|
|
198
198
|
this.fundedAccounts[i].salt,
|
|
199
|
+
this.fundedAccounts[i].signingKey,
|
|
200
|
+
);
|
|
201
|
+
await this.wallet.createSchnorrInitializerlessAccount(
|
|
202
|
+
this.fundedAccounts[i].secret,
|
|
203
|
+
this.fundedAccounts[i].salt,
|
|
204
|
+
this.fundedAccounts[i].signingKey,
|
|
199
205
|
);
|
|
200
|
-
await this.wallet.createSchnorrInitializerlessAccount(this.fundedAccounts[i].secret, this.fundedAccounts[i].salt);
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
|
+
import { TEST_FEE_PADDING } from '@aztec/aztec/testing';
|
|
2
3
|
import type { GasFees } from '@aztec/stdlib/gas';
|
|
3
4
|
|
|
4
5
|
export const METRICS_PORT = 4318;
|
|
@@ -17,9 +18,10 @@ export const LARGE_MIN_FEE_PADDING = 15;
|
|
|
17
18
|
* price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
|
|
18
19
|
* for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
|
|
19
20
|
* Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
|
|
20
|
-
* LARGE_MIN_FEE_PADDING (15x).
|
|
21
|
+
* LARGE_MIN_FEE_PADDING (15x). Same multiplier and same class of problem as the published
|
|
22
|
+
* {@link TEST_FEE_PADDING}, re-exported under a name that captures the pipelining rationale.
|
|
21
23
|
*/
|
|
22
|
-
export const PIPELINED_FEE_PADDING =
|
|
24
|
+
export const PIPELINED_FEE_PADDING = TEST_FEE_PADDING;
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
|
|
@@ -77,7 +79,7 @@ export const AUTOMINE_E2E_OPTS = {
|
|
|
77
79
|
minTxsPerBlock: 0,
|
|
78
80
|
aztecSlotDuration: 12,
|
|
79
81
|
ethereumSlotDuration: 4,
|
|
80
|
-
walletMinFeePadding:
|
|
82
|
+
walletMinFeePadding: TEST_FEE_PADDING,
|
|
81
83
|
} as const;
|
|
82
84
|
|
|
83
85
|
/** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
|
|
@@ -33,9 +33,9 @@ async function main() {
|
|
|
33
33
|
const extraAccountSalt = Fr.ZERO;
|
|
34
34
|
const extraAccountSigningKey = GrumpkinScalar.random();
|
|
35
35
|
const extraAccountAddress = await getSchnorrAccountContractAddress(
|
|
36
|
-
extraAccountSecret,
|
|
37
|
-
extraAccountSalt,
|
|
38
36
|
extraAccountSigningKey,
|
|
37
|
+
extraAccountSalt,
|
|
38
|
+
extraAccountSecret,
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
logger.info('Starting wallet service...', { l1RpcUrls });
|
|
@@ -88,8 +88,10 @@ export async function deploySponsoredTestAccountsWithTokens(
|
|
|
88
88
|
numberOfFundedWallets = 1,
|
|
89
89
|
): Promise<TestAccounts> {
|
|
90
90
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
91
|
-
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
92
|
-
const fundedAccounts = await Promise.all(
|
|
91
|
+
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt, recipient.signingKey);
|
|
92
|
+
const fundedAccounts = await Promise.all(
|
|
93
|
+
funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt, a.signingKey)),
|
|
94
|
+
);
|
|
93
95
|
|
|
94
96
|
await registerSponsoredFPC(wallet);
|
|
95
97
|
|
|
@@ -235,8 +237,10 @@ export async function deploySponsoredTestAccounts(
|
|
|
235
237
|
opts?: { estimateGas?: boolean },
|
|
236
238
|
): Promise<TestAccountsWithoutTokens> {
|
|
237
239
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
238
|
-
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
239
|
-
const fundedAccounts = await Promise.all(
|
|
240
|
+
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt, recipient.signingKey);
|
|
241
|
+
const fundedAccounts = await Promise.all(
|
|
242
|
+
funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt, a.signingKey)),
|
|
243
|
+
);
|
|
240
244
|
|
|
241
245
|
await registerSponsoredFPC(wallet);
|
|
242
246
|
|
|
@@ -282,8 +286,10 @@ export async function deployTestAccountsWithTokens(
|
|
|
282
286
|
wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
|
|
283
287
|
|
|
284
288
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
285
|
-
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
286
|
-
const fundedAccounts = await Promise.all(
|
|
289
|
+
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt, recipient.signingKey);
|
|
290
|
+
const fundedAccounts = await Promise.all(
|
|
291
|
+
funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt, a.signingKey)),
|
|
292
|
+
);
|
|
287
293
|
|
|
288
294
|
const claims = await Promise.all(
|
|
289
295
|
fundedAccounts.map(a => bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, aztecNode, a.address, undefined, logger)),
|
|
@@ -27,7 +27,6 @@ import { PXE, type PXECreationOptions, type TaggingSecretSource, createPXE } fro
|
|
|
27
27
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
28
28
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
29
29
|
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
30
|
-
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
31
30
|
import type { NoteDao } from '@aztec/stdlib/note';
|
|
32
31
|
import {
|
|
33
32
|
type BlockHeader,
|
|
@@ -108,13 +107,11 @@ export class TestWallet extends BaseWallet {
|
|
|
108
107
|
this.nodeRef.updateTargetNode(node);
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
createSchnorrAccount(secret: Fr, salt: Fr, signingKey
|
|
112
|
-
signingKey = signingKey ?? deriveSigningKey(secret);
|
|
110
|
+
createSchnorrAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AccountManager> {
|
|
113
111
|
return this.createAccount({ secret, salt, type: 'schnorr', contract: new SchnorrAccountContract(signingKey) });
|
|
114
112
|
}
|
|
115
113
|
|
|
116
|
-
createSchnorrInitializerlessAccount(secret: Fr, salt: Fr, signingKey
|
|
117
|
-
signingKey = signingKey ?? deriveSigningKey(secret);
|
|
114
|
+
createSchnorrInitializerlessAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AccountManager> {
|
|
118
115
|
return this.createAccount({
|
|
119
116
|
secret,
|
|
120
117
|
salt,
|
|
@@ -321,7 +318,7 @@ export class TestWallet extends BaseWallet {
|
|
|
321
318
|
opts: SimulateViaEntrypointOptions,
|
|
322
319
|
): Promise<TxSimulationResultWithAppOffset> {
|
|
323
320
|
const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement, sendMessagesAs } = opts;
|
|
324
|
-
const scopes = this.scopesFrom(from, additionalScopes);
|
|
321
|
+
const scopes = this.scopesFrom(from, additionalScopes ?? [], sendMessagesAs);
|
|
325
322
|
const skipKernels = this.simulationMode !== 'full';
|
|
326
323
|
const useOverride = this.simulationMode === 'kernelless-override';
|
|
327
324
|
|
|
@@ -387,7 +384,7 @@ export class TestWallet extends BaseWallet {
|
|
|
387
384
|
});
|
|
388
385
|
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
389
386
|
const txProvingResult = await this.pxe.proveTx(txRequest, {
|
|
390
|
-
scopes: this.scopesFrom(opts.from, opts.additionalScopes),
|
|
387
|
+
scopes: this.scopesFrom(opts.from, opts.additionalScopes ?? [], opts.sendMessagesAs),
|
|
391
388
|
senderForTags: this.senderForTagsFrom(opts.from, opts.sendMessagesAs),
|
|
392
389
|
});
|
|
393
390
|
return new ProvenTx(
|
|
@@ -4,7 +4,7 @@ import type { SendOptions } from '@aztec/aztec.js/wallet';
|
|
|
4
4
|
import { BackendType, BarretenbergSync } from '@aztec/bb.js';
|
|
5
5
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
6
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
7
|
-
import type { ApiSchema, Fr } from '@aztec/foundation/schemas';
|
|
7
|
+
import type { ApiSchema, Fq, Fr } from '@aztec/foundation/schemas';
|
|
8
8
|
import { getSchemaParameters, parseWithOptionals, schemaHasMethod } from '@aztec/foundation/schemas';
|
|
9
9
|
import { NodeListener, TransportServer } from '@aztec/foundation/transport';
|
|
10
10
|
import { ExecutionPayload, Tx } from '@aztec/stdlib/tx';
|
|
@@ -39,8 +39,8 @@ try {
|
|
|
39
39
|
provenTx.publicFunctionCalldata,
|
|
40
40
|
);
|
|
41
41
|
},
|
|
42
|
-
registerAccount: async (secret: Fr, salt: Fr) => {
|
|
43
|
-
const manager = await wallet.createSchnorrAccount(secret, salt);
|
|
42
|
+
registerAccount: async (secret: Fr, salt: Fr, signingKey: Fq) => {
|
|
43
|
+
const manager = await wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
44
44
|
return manager.address;
|
|
45
45
|
},
|
|
46
46
|
};
|