@aztec/bot 0.0.0-test.1 → 0.0.1-commit.0b941701

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.
Files changed (49) hide show
  1. package/dest/amm_bot.d.ts +32 -0
  2. package/dest/amm_bot.d.ts.map +1 -0
  3. package/dest/amm_bot.js +101 -0
  4. package/dest/base_bot.d.ts +21 -0
  5. package/dest/base_bot.d.ts.map +1 -0
  6. package/dest/base_bot.js +80 -0
  7. package/dest/bot.d.ts +13 -18
  8. package/dest/bot.d.ts.map +1 -1
  9. package/dest/bot.js +27 -86
  10. package/dest/config.d.ts +84 -60
  11. package/dest/config.d.ts.map +1 -1
  12. package/dest/config.js +59 -36
  13. package/dest/factory.d.ts +30 -31
  14. package/dest/factory.d.ts.map +1 -1
  15. package/dest/factory.js +318 -139
  16. package/dest/index.d.ts +4 -2
  17. package/dest/index.d.ts.map +1 -1
  18. package/dest/index.js +3 -1
  19. package/dest/interface.d.ts +12 -1
  20. package/dest/interface.d.ts.map +1 -1
  21. package/dest/interface.js +5 -0
  22. package/dest/rpc.d.ts +1 -7
  23. package/dest/rpc.d.ts.map +1 -1
  24. package/dest/rpc.js +0 -11
  25. package/dest/runner.d.ts +15 -11
  26. package/dest/runner.d.ts.map +1 -1
  27. package/dest/runner.js +441 -51
  28. package/dest/store/bot_store.d.ts +44 -0
  29. package/dest/store/bot_store.d.ts.map +1 -0
  30. package/dest/store/bot_store.js +107 -0
  31. package/dest/store/index.d.ts +2 -0
  32. package/dest/store/index.d.ts.map +1 -0
  33. package/dest/store/index.js +1 -0
  34. package/dest/utils.d.ts +8 -5
  35. package/dest/utils.d.ts.map +1 -1
  36. package/dest/utils.js +14 -5
  37. package/package.json +27 -23
  38. package/src/amm_bot.ts +124 -0
  39. package/src/base_bot.ts +92 -0
  40. package/src/bot.ts +53 -103
  41. package/src/config.ts +98 -68
  42. package/src/factory.ts +378 -154
  43. package/src/index.ts +3 -1
  44. package/src/interface.ts +9 -0
  45. package/src/rpc.ts +0 -13
  46. package/src/runner.ts +38 -21
  47. package/src/store/bot_store.ts +141 -0
  48. package/src/store/index.ts +1 -0
  49. package/src/utils.ts +17 -6
package/src/bot.ts CHANGED
@@ -1,40 +1,47 @@
1
- import {
2
- type AztecAddress,
3
- BatchCall,
4
- FeeJuicePaymentMethod,
5
- type SendMethodOptions,
6
- type Wallet,
7
- createLogger,
8
- } from '@aztec/aztec.js';
9
- import { timesParallel } from '@aztec/foundation/collection';
10
- import type { EasyPrivateTokenContract } from '@aztec/noir-contracts.js/EasyPrivateToken';
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { BatchCall, NO_WAIT } from '@aztec/aztec.js/contracts';
3
+ import { TxHash } from '@aztec/aztec.js/tx';
4
+ import { times } from '@aztec/foundation/collection';
5
+ import type { PrivateTokenContract } from '@aztec/noir-contracts.js/PrivateToken';
11
6
  import type { TokenContract } from '@aztec/noir-contracts.js/Token';
12
- import type { FunctionCall } from '@aztec/stdlib/abi';
13
- import { Gas } from '@aztec/stdlib/gas';
14
- import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
7
+ import type { AztecNode, AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
8
+ import type { TestWallet } from '@aztec/test-wallet/server';
15
9
 
10
+ import { BaseBot } from './base_bot.js';
16
11
  import type { BotConfig } from './config.js';
17
12
  import { BotFactory } from './factory.js';
13
+ import type { BotStore } from './store/index.js';
18
14
  import { getBalances, getPrivateBalance, isStandardTokenContract } from './utils.js';
19
15
 
20
16
  const TRANSFER_AMOUNT = 1;
21
17
 
22
- export class Bot {
23
- private log = createLogger('bot');
24
-
25
- private attempts: number = 0;
26
- private successes: number = 0;
27
-
18
+ export class Bot extends BaseBot {
28
19
  protected constructor(
29
- public readonly wallet: Wallet,
30
- public readonly token: TokenContract | EasyPrivateTokenContract,
20
+ node: AztecNode,
21
+ wallet: TestWallet,
22
+ defaultAccountAddress: AztecAddress,
23
+ public readonly token: TokenContract | PrivateTokenContract,
31
24
  public readonly recipient: AztecAddress,
32
- public config: BotConfig,
33
- ) {}
25
+ config: BotConfig,
26
+ ) {
27
+ super(node, wallet, defaultAccountAddress, config);
28
+ }
34
29
 
35
- static async create(config: BotConfig, dependencies: { pxe?: PXE; node?: AztecNode } = {}): Promise<Bot> {
36
- const { wallet, token, recipient } = await new BotFactory(config, dependencies).setup();
37
- return new Bot(wallet, token, recipient, config);
30
+ static async create(
31
+ config: BotConfig,
32
+ wallet: TestWallet,
33
+ aztecNode: AztecNode,
34
+ aztecNodeAdmin: AztecNodeAdmin | undefined,
35
+ store: BotStore,
36
+ ): Promise<Bot> {
37
+ const { defaultAccountAddress, token, recipient } = await new BotFactory(
38
+ config,
39
+ wallet,
40
+ store,
41
+ aztecNode,
42
+ aztecNodeAdmin,
43
+ ).setup();
44
+ return new Bot(aztecNode, wallet, defaultAccountAddress, token, recipient, config);
38
45
  }
39
46
 
40
47
  public updateConfig(config: Partial<BotConfig>) {
@@ -42,110 +49,53 @@ export class Bot {
42
49
  this.config = { ...this.config, ...config };
43
50
  }
44
51
 
45
- public async run() {
46
- this.attempts++;
47
- const logCtx = { runId: Date.now() * 1000 + Math.floor(Math.random() * 1000) };
48
- const { privateTransfersPerTx, publicTransfersPerTx, feePaymentMethod, followChain, txMinedWaitSeconds } =
49
- this.config;
52
+ protected async createAndSendTx(logCtx: object): Promise<TxHash> {
53
+ const { privateTransfersPerTx, publicTransfersPerTx, feePaymentMethod } = this.config;
50
54
  const { token, recipient, wallet } = this;
51
- const sender = wallet.getAddress();
52
55
 
53
56
  this.log.verbose(
54
57
  `Preparing tx with ${feePaymentMethod} fee with ${privateTransfersPerTx} private and ${publicTransfersPerTx} public transfers`,
55
58
  logCtx,
56
59
  );
57
60
 
58
- const calls: FunctionCall[] = [];
59
- if (isStandardTokenContract(token)) {
60
- calls.push(
61
- ...(await timesParallel(privateTransfersPerTx, () =>
62
- token.methods.transfer(recipient, TRANSFER_AMOUNT).request(),
63
- )),
64
- );
65
- calls.push(
66
- ...(await timesParallel(publicTransfersPerTx, () =>
67
- token.methods.transfer_in_public(sender, recipient, TRANSFER_AMOUNT, 0).request(),
68
- )),
69
- );
70
- } else {
71
- calls.push(
72
- ...(await timesParallel(privateTransfersPerTx, () =>
73
- token.methods.transfer(TRANSFER_AMOUNT, sender, recipient).request(),
74
- )),
75
- );
76
- }
61
+ const calls = isStandardTokenContract(token)
62
+ ? [
63
+ times(privateTransfersPerTx, () => token.methods.transfer(recipient, TRANSFER_AMOUNT)),
64
+ times(publicTransfersPerTx, () =>
65
+ token.methods.transfer_in_public(this.defaultAccountAddress, recipient, TRANSFER_AMOUNT, 0),
66
+ ),
67
+ ].flat()
68
+ : times(privateTransfersPerTx, () =>
69
+ token.methods.transfer(TRANSFER_AMOUNT, this.defaultAccountAddress, recipient),
70
+ );
77
71
 
78
- const opts = this.getSendMethodOpts();
79
72
  const batch = new BatchCall(wallet, calls);
73
+ const opts = await this.getSendMethodOpts(batch);
80
74
 
81
75
  this.log.verbose(`Simulating transaction with ${calls.length}`, logCtx);
82
- await batch.simulate();
83
-
84
- this.log.verbose(`Proving transaction`, logCtx);
85
- const provenTx = await batch.prove(opts);
86
-
87
- this.log.verbose(`Sending tx`, logCtx);
88
- const tx = provenTx.send();
89
-
90
- const txHash = await tx.getTxHash();
91
-
92
- if (followChain === 'NONE') {
93
- this.log.info(`Transaction ${txHash} sent, not waiting for it to be mined`);
94
- return;
95
- }
76
+ await batch.simulate({ from: this.defaultAccountAddress });
96
77
 
97
- this.log.verbose(
98
- `Awaiting tx ${txHash} to be on the ${followChain} chain (timeout ${txMinedWaitSeconds}s)`,
99
- logCtx,
100
- );
101
- const receipt = await tx.wait({
102
- timeout: txMinedWaitSeconds,
103
- provenTimeout: txMinedWaitSeconds,
104
- proven: followChain === 'PROVEN',
105
- });
106
- this.log.info(
107
- `Tx #${this.attempts} ${receipt.txHash} successfully mined in block ${receipt.blockNumber} (stats: ${this.successes}/${this.attempts} success)`,
108
- logCtx,
109
- );
110
- this.successes++;
78
+ this.log.verbose(`Sending transaction`, logCtx);
79
+ return batch.send({ ...opts, wait: NO_WAIT });
111
80
  }
112
81
 
113
82
  public async getBalances() {
114
83
  if (isStandardTokenContract(this.token)) {
115
84
  return {
116
- sender: await getBalances(this.token, this.wallet.getAddress()),
117
- recipient: await getBalances(this.token, this.recipient),
85
+ sender: await getBalances(this.token, this.defaultAccountAddress),
86
+ recipient: await getBalances(this.token, this.recipient, this.defaultAccountAddress),
118
87
  };
119
88
  } else {
120
89
  return {
121
90
  sender: {
122
- privateBalance: await getPrivateBalance(this.token, this.wallet.getAddress()),
91
+ privateBalance: await getPrivateBalance(this.token, this.defaultAccountAddress),
123
92
  publicBalance: 0n,
124
93
  },
125
94
  recipient: {
126
- privateBalance: await getPrivateBalance(this.token, this.recipient),
95
+ privateBalance: await getPrivateBalance(this.token, this.recipient, this.defaultAccountAddress),
127
96
  publicBalance: 0n,
128
97
  },
129
98
  };
130
99
  }
131
100
  }
132
-
133
- private getSendMethodOpts(): SendMethodOptions {
134
- const sender = this.wallet.getAddress();
135
- const { l2GasLimit, daGasLimit, skipPublicSimulation } = this.config;
136
- const paymentMethod = new FeeJuicePaymentMethod(sender);
137
-
138
- let gasSettings, estimateGas;
139
- if (l2GasLimit !== undefined && l2GasLimit > 0 && daGasLimit !== undefined && daGasLimit > 0) {
140
- gasSettings = { gasLimits: Gas.from({ l2Gas: l2GasLimit, daGas: daGasLimit }) };
141
- estimateGas = false;
142
- this.log.verbose(`Using gas limits ${l2GasLimit} L2 gas ${daGasLimit} DA gas`);
143
- } else {
144
- estimateGas = true;
145
- this.log.verbose(`Estimating gas for transaction`);
146
- }
147
- const baseFeePadding = 2; // Send 3x the current base fee
148
- this.log.verbose(skipPublicSimulation ? `Skipping public simulation` : `Simulating public transfers`);
149
- return { fee: { estimateGas, paymentMethod, gasSettings, baseFeePadding }, skipPublicSimulation };
150
- }
151
101
  }
package/src/config.ts CHANGED
@@ -1,15 +1,20 @@
1
1
  import {
2
2
  type ConfigMappingsType,
3
+ SecretValue,
3
4
  booleanConfigHelper,
4
5
  getConfigFromMappings,
5
6
  getDefaultConfig,
6
7
  numberConfigHelper,
7
8
  optionalNumberConfigHelper,
9
+ pickConfigMappings,
10
+ secretFrConfigHelper,
11
+ secretStringConfigHelper,
8
12
  } from '@aztec/foundation/config';
9
- import { Fr } from '@aztec/foundation/fields';
13
+ import { Fr } from '@aztec/foundation/curves/bn254';
14
+ import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
10
15
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
11
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
12
- import { type ZodFor, schemas } from '@aztec/stdlib/schemas';
16
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
17
+ import { schemas, zodFor } from '@aztec/stdlib/schemas';
13
18
  import type { ComponentsVersions } from '@aztec/stdlib/versioning';
14
19
 
15
20
  import { z } from 'zod';
@@ -19,25 +24,27 @@ type BotFollowChain = (typeof BotFollowChain)[number];
19
24
 
20
25
  export enum SupportedTokenContracts {
21
26
  TokenContract = 'TokenContract',
22
- EasyPrivateTokenContract = 'EasyPrivateTokenContract',
27
+ PrivateTokenContract = 'PrivateTokenContract',
23
28
  }
24
29
 
25
30
  export type BotConfig = {
26
31
  /** The URL to the Aztec node to check for tx pool status. */
27
32
  nodeUrl: string | undefined;
28
- /** URL to the PXE for sending txs, or undefined if an in-proc PXE is used. */
29
- pxeUrl: string | undefined;
33
+ /** The URL to the Aztec node admin API to force-flush txs if configured. */
34
+ nodeAdminUrl: string | undefined;
30
35
  /** Url of the ethereum host. */
31
36
  l1RpcUrls: string[] | undefined;
32
37
  /** The mnemonic for the account to bridge fee juice from L1. */
33
- l1Mnemonic: string | undefined;
38
+ l1Mnemonic: SecretValue<string> | undefined;
34
39
  /** The private key for the account to bridge fee juice from L1. */
35
- l1PrivateKey: string | undefined;
40
+ l1PrivateKey: SecretValue<string> | undefined;
41
+ /** How long to wait for L1 to L2 messages to become available on L2 */
42
+ l1ToL2MessageTimeoutSeconds: number;
36
43
  /** Signing private key for the sender account. */
37
- senderPrivateKey: Fr | undefined;
38
- /** Encryption secret for a recipient account. */
39
- recipientEncryptionSecret: Fr;
40
- /** Salt for the token contract deployment. */
44
+ senderPrivateKey: SecretValue<Fr> | undefined;
45
+ /** Optional salt to use to instantiate the sender account */
46
+ senderSalt: Fr | undefined;
47
+ /** Salt for the token contract instantiation. */
41
48
  tokenSalt: Fr;
42
49
  /** Every how many seconds should a new tx be sent. */
43
50
  txIntervalSeconds: number;
@@ -47,6 +54,8 @@ export type BotConfig = {
47
54
  publicTransfersPerTx: number;
48
55
  /** How to handle fee payments. */
49
56
  feePaymentMethod: 'fee_juice';
57
+ /** 'How much is the bot willing to overpay vs. the current min fee' */
58
+ minFeePadding: number;
50
59
  /** True to not automatically setup or start the bot on initialization. */
51
60
  noStart: boolean;
52
61
  /** How long to wait for a tx to be mined before reporting an error. */
@@ -57,8 +66,6 @@ export type BotConfig = {
57
66
  maxPendingTxs: number;
58
67
  /** Whether to flush after sending each 'setup' transaction */
59
68
  flushSetupTransactions: boolean;
60
- /** Whether to skip public simulation of txs before sending them. */
61
- skipPublicSimulation: boolean;
62
69
  /** L2 gas limit for the tx (empty to have the bot trigger an estimate gas). */
63
70
  l2GasLimit: number | undefined;
64
71
  /** DA gas limit for the tx (empty to have the bot trigger an estimate gas). */
@@ -69,54 +76,65 @@ export type BotConfig = {
69
76
  maxConsecutiveErrors: number;
70
77
  /** Stops the bot if service becomes unhealthy */
71
78
  stopWhenUnhealthy: boolean;
72
- };
79
+ /** Deploy an AMM contract and do swaps instead of transfers */
80
+ ammTxs: boolean;
81
+ } & Pick<DataStoreConfig, 'dataDirectory' | 'dataStoreMapSizeKb'>;
73
82
 
74
- export const BotConfigSchema = z
75
- .object({
76
- nodeUrl: z.string().optional(),
77
- pxeUrl: z.string().optional(),
78
- l1RpcUrls: z.array(z.string()).optional(),
79
- l1Mnemonic: z.string().optional(),
80
- l1PrivateKey: z.string().optional(),
81
- senderPrivateKey: schemas.Fr.optional(),
82
- recipientEncryptionSecret: schemas.Fr,
83
- tokenSalt: schemas.Fr,
84
- txIntervalSeconds: z.number(),
85
- privateTransfersPerTx: z.number().int().nonnegative(),
86
- publicTransfersPerTx: z.number().int().nonnegative(),
87
- feePaymentMethod: z.literal('fee_juice'),
88
- noStart: z.boolean(),
89
- txMinedWaitSeconds: z.number(),
90
- followChain: z.enum(BotFollowChain),
91
- maxPendingTxs: z.number().int().nonnegative(),
92
- flushSetupTransactions: z.boolean(),
93
- skipPublicSimulation: z.boolean(),
94
- l2GasLimit: z.number().int().nonnegative().optional(),
95
- daGasLimit: z.number().int().nonnegative().optional(),
96
- contract: z.nativeEnum(SupportedTokenContracts),
97
- maxConsecutiveErrors: z.number().int().nonnegative(),
98
- stopWhenUnhealthy: z.boolean(),
99
- })
100
- .transform(config => ({
101
- nodeUrl: undefined,
102
- pxeUrl: undefined,
103
- l1RpcUrls: undefined,
104
- l1Mnemonic: undefined,
105
- l1PrivateKey: undefined,
106
- senderPrivateKey: undefined,
107
- l2GasLimit: undefined,
108
- daGasLimit: undefined,
109
- ...config,
110
- })) satisfies ZodFor<BotConfig>;
83
+ export const BotConfigSchema = zodFor<BotConfig>()(
84
+ z
85
+ .object({
86
+ nodeUrl: z.string().optional(),
87
+ nodeAdminUrl: z.string().optional(),
88
+ l1RpcUrls: z.array(z.string()).optional(),
89
+ l1Mnemonic: schemas.SecretValue(z.string()).optional(),
90
+ l1PrivateKey: schemas.SecretValue(z.string()).optional(),
91
+ l1ToL2MessageTimeoutSeconds: z.number(),
92
+ senderPrivateKey: schemas.SecretValue(schemas.Fr).optional(),
93
+ senderSalt: schemas.Fr.optional(),
94
+ tokenSalt: schemas.Fr,
95
+ txIntervalSeconds: z.number(),
96
+ privateTransfersPerTx: z.number().int().nonnegative(),
97
+ publicTransfersPerTx: z.number().int().nonnegative(),
98
+ feePaymentMethod: z.literal('fee_juice'),
99
+ minFeePadding: z.number().int().nonnegative(),
100
+ noStart: z.boolean(),
101
+ txMinedWaitSeconds: z.number(),
102
+ followChain: z.enum(BotFollowChain),
103
+ maxPendingTxs: z.number().int().nonnegative(),
104
+ flushSetupTransactions: z.boolean(),
105
+ l2GasLimit: z.number().int().nonnegative().optional(),
106
+ daGasLimit: z.number().int().nonnegative().optional(),
107
+ contract: z.nativeEnum(SupportedTokenContracts),
108
+ maxConsecutiveErrors: z.number().int().nonnegative(),
109
+ stopWhenUnhealthy: z.boolean(),
110
+ ammTxs: z.boolean().default(false),
111
+ dataDirectory: z.string().optional(),
112
+ dataStoreMapSizeKb: z.number().optional(),
113
+ })
114
+ .transform(config => ({
115
+ nodeUrl: undefined,
116
+ nodeAdminUrl: undefined,
117
+ l1RpcUrls: undefined,
118
+ senderSalt: undefined,
119
+ l2GasLimit: undefined,
120
+ daGasLimit: undefined,
121
+ l1Mnemonic: undefined,
122
+ l1PrivateKey: undefined,
123
+ senderPrivateKey: undefined,
124
+ dataDirectory: undefined,
125
+ dataStoreMapSizeKb: 1_024 * 1_024,
126
+ ...config,
127
+ })),
128
+ );
111
129
 
112
130
  export const botConfigMappings: ConfigMappingsType<BotConfig> = {
113
131
  nodeUrl: {
114
132
  env: 'AZTEC_NODE_URL',
115
133
  description: 'The URL to the Aztec node to check for tx pool status.',
116
134
  },
117
- pxeUrl: {
118
- env: 'BOT_PXE_URL',
119
- description: 'URL to the PXE for sending txs, or undefined if an in-proc PXE is used.',
135
+ nodeAdminUrl: {
136
+ env: 'AZTEC_NODE_ADMIN_URL',
137
+ description: 'The URL to the Aztec node admin API to force-flush txs if configured.',
120
138
  },
121
139
  l1RpcUrls: {
122
140
  env: 'ETHEREUM_HOSTS',
@@ -126,25 +144,31 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
126
144
  l1Mnemonic: {
127
145
  env: 'BOT_L1_MNEMONIC',
128
146
  description: 'The mnemonic for the account to bridge fee juice from L1.',
147
+ ...secretStringConfigHelper(),
129
148
  },
130
149
  l1PrivateKey: {
131
150
  env: 'BOT_L1_PRIVATE_KEY',
132
151
  description: 'The private key for the account to bridge fee juice from L1.',
152
+ ...secretStringConfigHelper(),
153
+ },
154
+ l1ToL2MessageTimeoutSeconds: {
155
+ env: 'BOT_L1_TO_L2_TIMEOUT_SECONDS',
156
+ description: 'How long to wait for L1 to L2 messages to become available on L2',
157
+ ...numberConfigHelper(3600),
133
158
  },
134
159
  senderPrivateKey: {
135
160
  env: 'BOT_PRIVATE_KEY',
136
161
  description: 'Signing private key for the sender account.',
137
- parseEnv: (val: string) => (val ? Fr.fromHexString(val) : undefined),
162
+ ...secretFrConfigHelper(),
138
163
  },
139
- recipientEncryptionSecret: {
140
- env: 'BOT_RECIPIENT_ENCRYPTION_SECRET',
141
- description: 'Encryption secret for a recipient account.',
142
- parseEnv: (val: string) => Fr.fromHexString(val),
143
- defaultValue: Fr.fromHexString('0xcafecafe'),
164
+ senderSalt: {
165
+ env: 'BOT_ACCOUNT_SALT',
166
+ description: 'The salt to use to deploy the sender account.',
167
+ parseEnv: (val: string) => (val ? Fr.fromHexString(val) : undefined),
144
168
  },
145
169
  tokenSalt: {
146
170
  env: 'BOT_TOKEN_SALT',
147
- description: 'Salt for the token contract deployment.',
171
+ description: 'The salt to use to deploy the token contract.',
148
172
  parseEnv: (val: string) => Fr.fromHexString(val),
149
173
  defaultValue: Fr.fromHexString('1'),
150
174
  },
@@ -169,6 +193,11 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
169
193
  parseEnv: val => (val as 'fee_juice') || undefined,
170
194
  defaultValue: 'fee_juice',
171
195
  },
196
+ minFeePadding: {
197
+ env: 'BOT_MIN_FEE_PADDING',
198
+ description: 'How much is the bot willing to overpay vs. the current base fee',
199
+ ...numberConfigHelper(3),
200
+ },
172
201
  noStart: {
173
202
  env: 'BOT_NO_START',
174
203
  description: 'True to not automatically setup or start the bot on initialization.',
@@ -200,11 +229,6 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
200
229
  description: 'Make a request for the sequencer to build a block after each setup transaction.',
201
230
  ...booleanConfigHelper(false),
202
231
  },
203
- skipPublicSimulation: {
204
- env: 'BOT_SKIP_PUBLIC_SIMULATION',
205
- description: 'Whether to skip public simulation of txs before sending them.',
206
- ...booleanConfigHelper(false),
207
- },
208
232
  l2GasLimit: {
209
233
  env: 'BOT_L2_GAS_LIMIT',
210
234
  description: 'L2 gas limit for the tx (empty to have the bot trigger an estimate gas).',
@@ -240,6 +264,12 @@ export const botConfigMappings: ConfigMappingsType<BotConfig> = {
240
264
  description: 'Stops the bot if service becomes unhealthy',
241
265
  ...booleanConfigHelper(false),
242
266
  },
267
+ ammTxs: {
268
+ env: 'BOT_AMM_TXS',
269
+ description: 'Deploy an AMM and send swaps to it',
270
+ ...booleanConfigHelper(false),
271
+ },
272
+ ...pickConfigMappings(dataConfigMappings, ['dataStoreMapSizeKb', 'dataDirectory']),
243
273
  };
244
274
 
245
275
  export function getBotConfigFromEnv(): BotConfig {
@@ -252,7 +282,7 @@ export function getBotDefaultConfig(): BotConfig {
252
282
 
253
283
  export function getVersions(): Partial<ComponentsVersions> {
254
284
  return {
255
- l2ProtocolContractsTreeRoot: protocolContractTreeRoot.toString(),
285
+ l2ProtocolContractsHash: protocolContractsHash.toString(),
256
286
  l2CircuitsVkTreeRoot: getVKTreeRoot().toString(),
257
287
  };
258
288
  }