@aztec/bot 0.87.8 → 0.87.9
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/config.d.ts +7 -0
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +6 -0
- package/dest/factory.js +1 -1
- package/package.json +11 -11
- package/src/config.ts +8 -0
- package/src/factory.ts +1 -1
package/dest/config.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export type BotConfig = {
|
|
|
22
22
|
l1Mnemonic: string | undefined;
|
|
23
23
|
/** The private key for the account to bridge fee juice from L1. */
|
|
24
24
|
l1PrivateKey: string | undefined;
|
|
25
|
+
/** How long to wait for L1 to L2 messages to become available on L2 */
|
|
26
|
+
l1ToL2MessageTimeoutSeconds: number;
|
|
25
27
|
/** Signing private key for the sender account. */
|
|
26
28
|
senderPrivateKey: Fr | undefined;
|
|
27
29
|
/** Optional salt to use to deploy the sender account */
|
|
@@ -68,6 +70,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
68
70
|
l1RpcUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
69
71
|
l1Mnemonic: z.ZodOptional<z.ZodString>;
|
|
70
72
|
l1PrivateKey: z.ZodOptional<z.ZodString>;
|
|
73
|
+
l1ToL2MessageTimeoutSeconds: z.ZodNumber;
|
|
71
74
|
senderPrivateKey: z.ZodOptional<ZodFor<Fr>>;
|
|
72
75
|
senderSalt: z.ZodOptional<ZodFor<Fr>>;
|
|
73
76
|
recipientEncryptionSecret: ZodFor<Fr>;
|
|
@@ -88,6 +91,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
88
91
|
stopWhenUnhealthy: z.ZodBoolean;
|
|
89
92
|
ammTxs: z.ZodDefault<z.ZodBoolean>;
|
|
90
93
|
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
l1ToL2MessageTimeoutSeconds: number;
|
|
91
95
|
recipientEncryptionSecret: Fr;
|
|
92
96
|
tokenSalt: Fr;
|
|
93
97
|
txIntervalSeconds: number;
|
|
@@ -114,6 +118,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
114
118
|
l2GasLimit?: number | undefined;
|
|
115
119
|
daGasLimit?: number | undefined;
|
|
116
120
|
}, {
|
|
121
|
+
l1ToL2MessageTimeoutSeconds: number;
|
|
117
122
|
txIntervalSeconds: number;
|
|
118
123
|
privateTransfersPerTx: number;
|
|
119
124
|
publicTransfersPerTx: number;
|
|
@@ -140,6 +145,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
140
145
|
daGasLimit?: number | undefined;
|
|
141
146
|
ammTxs?: boolean | undefined;
|
|
142
147
|
}>, {
|
|
148
|
+
l1ToL2MessageTimeoutSeconds: number;
|
|
143
149
|
recipientEncryptionSecret: Fr;
|
|
144
150
|
tokenSalt: Fr;
|
|
145
151
|
txIntervalSeconds: number;
|
|
@@ -166,6 +172,7 @@ export declare const BotConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
166
172
|
l2GasLimit: number | undefined;
|
|
167
173
|
daGasLimit: number | undefined;
|
|
168
174
|
}, {
|
|
175
|
+
l1ToL2MessageTimeoutSeconds: number;
|
|
169
176
|
txIntervalSeconds: number;
|
|
170
177
|
privateTransfersPerTx: number;
|
|
171
178
|
publicTransfersPerTx: number;
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAMxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,CAAC,EAA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eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,SAAS,CAiJ3D,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,wBAAgB,mBAAmB,IAAI,SAAS,CAE/C;AAED,wBAAgB,WAAW,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAKzD"}
|
package/dest/config.js
CHANGED
|
@@ -21,6 +21,7 @@ export const BotConfigSchema = z.object({
|
|
|
21
21
|
l1RpcUrls: z.array(z.string()).optional(),
|
|
22
22
|
l1Mnemonic: z.string().optional(),
|
|
23
23
|
l1PrivateKey: z.string().optional(),
|
|
24
|
+
l1ToL2MessageTimeoutSeconds: z.number(),
|
|
24
25
|
senderPrivateKey: schemas.Fr.optional(),
|
|
25
26
|
senderSalt: schemas.Fr.optional(),
|
|
26
27
|
recipientEncryptionSecret: schemas.Fr,
|
|
@@ -79,6 +80,11 @@ export const botConfigMappings = {
|
|
|
79
80
|
env: 'BOT_L1_PRIVATE_KEY',
|
|
80
81
|
description: 'The private key for the account to bridge fee juice from L1.'
|
|
81
82
|
},
|
|
83
|
+
l1ToL2MessageTimeoutSeconds: {
|
|
84
|
+
env: 'BOT_L1_TO_L2_TIMEOUT_SECONDS',
|
|
85
|
+
description: 'How long to wait for L1 to L2 messages to become available on L2',
|
|
86
|
+
...numberConfigHelper(60)
|
|
87
|
+
},
|
|
82
88
|
senderPrivateKey: {
|
|
83
89
|
env: 'BOT_PRIVATE_KEY',
|
|
84
90
|
description: 'Signing private key for the sender account.',
|
package/dest/factory.js
CHANGED
|
@@ -317,7 +317,7 @@ export class BotFactory {
|
|
|
317
317
|
const mintAmount = await portal.getTokenManager().getMintAmount();
|
|
318
318
|
const claim = await portal.bridgeTokensPublic(recipient, mintAmount, true);
|
|
319
319
|
const isSynced = async ()=>await this.pxe.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
|
|
320
|
-
await retryUntil(isSynced, `message ${claim.messageHash} sync`,
|
|
320
|
+
await retryUntil(isSynced, `message ${claim.messageHash} sync`, this.config.l1ToL2MessageTimeoutSeconds, 1);
|
|
321
321
|
this.log.info(`Created a claim for ${mintAmount} L1 fee juice to ${recipient}.`, claim);
|
|
322
322
|
// Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
323
323
|
await this.advanceL2Block();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/bot",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@aztec/accounts": "0.87.
|
|
54
|
-
"@aztec/aztec.js": "0.87.
|
|
55
|
-
"@aztec/entrypoints": "0.87.
|
|
56
|
-
"@aztec/ethereum": "0.87.
|
|
57
|
-
"@aztec/foundation": "0.87.
|
|
58
|
-
"@aztec/noir-contracts.js": "0.87.
|
|
59
|
-
"@aztec/noir-protocol-circuits-types": "0.87.
|
|
60
|
-
"@aztec/protocol-contracts": "0.87.
|
|
61
|
-
"@aztec/stdlib": "0.87.
|
|
62
|
-
"@aztec/telemetry-client": "0.87.
|
|
53
|
+
"@aztec/accounts": "0.87.9",
|
|
54
|
+
"@aztec/aztec.js": "0.87.9",
|
|
55
|
+
"@aztec/entrypoints": "0.87.9",
|
|
56
|
+
"@aztec/ethereum": "0.87.9",
|
|
57
|
+
"@aztec/foundation": "0.87.9",
|
|
58
|
+
"@aztec/noir-contracts.js": "0.87.9",
|
|
59
|
+
"@aztec/noir-protocol-circuits-types": "0.87.9",
|
|
60
|
+
"@aztec/protocol-contracts": "0.87.9",
|
|
61
|
+
"@aztec/stdlib": "0.87.9",
|
|
62
|
+
"@aztec/telemetry-client": "0.87.9",
|
|
63
63
|
"source-map-support": "^0.5.21",
|
|
64
64
|
"tslib": "^2.4.0",
|
|
65
65
|
"zod": "^3.23.8"
|
package/src/config.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type BotConfig = {
|
|
|
35
35
|
l1Mnemonic: string | undefined;
|
|
36
36
|
/** The private key for the account to bridge fee juice from L1. */
|
|
37
37
|
l1PrivateKey: string | undefined;
|
|
38
|
+
/** How long to wait for L1 to L2 messages to become available on L2 */
|
|
39
|
+
l1ToL2MessageTimeoutSeconds: number;
|
|
38
40
|
/** Signing private key for the sender account. */
|
|
39
41
|
senderPrivateKey: Fr | undefined;
|
|
40
42
|
/** Optional salt to use to deploy the sender account */
|
|
@@ -83,6 +85,7 @@ export const BotConfigSchema = z
|
|
|
83
85
|
l1RpcUrls: z.array(z.string()).optional(),
|
|
84
86
|
l1Mnemonic: z.string().optional(),
|
|
85
87
|
l1PrivateKey: z.string().optional(),
|
|
88
|
+
l1ToL2MessageTimeoutSeconds: z.number(),
|
|
86
89
|
senderPrivateKey: schemas.Fr.optional(),
|
|
87
90
|
senderSalt: schemas.Fr.optional(),
|
|
88
91
|
recipientEncryptionSecret: schemas.Fr,
|
|
@@ -143,6 +146,11 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
|
|
|
143
146
|
env: 'BOT_L1_PRIVATE_KEY',
|
|
144
147
|
description: 'The private key for the account to bridge fee juice from L1.',
|
|
145
148
|
},
|
|
149
|
+
l1ToL2MessageTimeoutSeconds: {
|
|
150
|
+
env: 'BOT_L1_TO_L2_TIMEOUT_SECONDS',
|
|
151
|
+
description: 'How long to wait for L1 to L2 messages to become available on L2',
|
|
152
|
+
...numberConfigHelper(60),
|
|
153
|
+
},
|
|
146
154
|
senderPrivateKey: {
|
|
147
155
|
env: 'BOT_PRIVATE_KEY',
|
|
148
156
|
description: 'Signing private key for the sender account.',
|
package/src/factory.ts
CHANGED
|
@@ -372,7 +372,7 @@ export class BotFactory {
|
|
|
372
372
|
const claim = await portal.bridgeTokensPublic(recipient, mintAmount, true /* mint */);
|
|
373
373
|
|
|
374
374
|
const isSynced = async () => await this.pxe.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
|
|
375
|
-
await retryUntil(isSynced, `message ${claim.messageHash} sync`,
|
|
375
|
+
await retryUntil(isSynced, `message ${claim.messageHash} sync`, this.config.l1ToL2MessageTimeoutSeconds, 1);
|
|
376
376
|
|
|
377
377
|
this.log.info(`Created a claim for ${mintAmount} L1 fee juice to ${recipient}.`, claim);
|
|
378
378
|
|