@aztec/ethereum 0.0.1-commit.c80b6263 → 0.0.1-commit.cf93bcc56
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 +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +5 -3
- package/dest/contracts/empire_base.d.ts +3 -1
- package/dest/contracts/empire_base.d.ts.map +1 -1
- package/dest/contracts/empire_slashing_proposer.d.ts +3 -1
- package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/empire_slashing_proposer.js +22 -15
- package/dest/contracts/fee_asset_handler.d.ts +1 -1
- package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
- package/dest/contracts/fee_asset_handler.js +2 -0
- package/dest/contracts/fee_asset_price_oracle.d.ts +101 -0
- package/dest/contracts/fee_asset_price_oracle.d.ts.map +1 -0
- package/dest/contracts/fee_asset_price_oracle.js +651 -0
- package/dest/contracts/governance.d.ts +1 -1
- package/dest/contracts/governance.d.ts.map +1 -1
- package/dest/contracts/governance.js +5 -3
- package/dest/contracts/governance_proposer.d.ts +3 -1
- package/dest/contracts/governance_proposer.d.ts.map +1 -1
- package/dest/contracts/governance_proposer.js +13 -1
- package/dest/contracts/index.d.ts +2 -1
- package/dest/contracts/index.d.ts.map +1 -1
- package/dest/contracts/index.js +1 -0
- package/dest/contracts/multicall.d.ts +1 -1
- package/dest/contracts/multicall.d.ts.map +1 -1
- package/dest/contracts/multicall.js +2 -1
- package/dest/contracts/rollup.d.ts +2 -1
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +9 -3
- package/dest/contracts/tally_slashing_proposer.d.ts +1 -1
- package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/tally_slashing_proposer.js +8 -1
- package/dest/deploy_aztec_l1_contracts.d.ts +2 -3
- package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_aztec_l1_contracts.js +37 -22
- package/dest/deploy_l1_contract.js +3 -3
- package/dest/l1_artifacts.d.ts +1051 -42
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_tx_utils/config.d.ts +7 -1
- package/dest/l1_tx_utils/config.d.ts.map +1 -1
- package/dest/l1_tx_utils/config.js +14 -1
- package/dest/l1_tx_utils/constants.d.ts +1 -1
- package/dest/l1_tx_utils/constants.js +2 -2
- package/dest/l1_tx_utils/factory.d.ts +18 -10
- package/dest/l1_tx_utils/factory.d.ts.map +1 -1
- package/dest/l1_tx_utils/factory.js +17 -7
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +1 -1
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +1 -1
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +15 -15
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +9 -15
- package/dest/l1_tx_utils/index-blobs.d.ts +3 -3
- package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -1
- package/dest/l1_tx_utils/index-blobs.js +2 -2
- package/dest/l1_tx_utils/index.d.ts +2 -1
- package/dest/l1_tx_utils/index.d.ts.map +1 -1
- package/dest/l1_tx_utils/index.js +1 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +15 -5
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/l1_tx_utils.js +47 -13
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +3 -3
- package/dest/l1_tx_utils/tx_delayer.d.ts +56 -0
- package/dest/l1_tx_utils/tx_delayer.d.ts.map +1 -0
- package/dest/{test → l1_tx_utils}/tx_delayer.js +62 -34
- package/dest/test/index.d.ts +1 -3
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +0 -2
- package/dest/test/upgrade_utils.js +2 -2
- package/dest/utils.d.ts +2 -1
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +46 -0
- package/package.json +5 -5
- package/src/config.ts +3 -2
- package/src/contracts/empire_base.ts +2 -0
- package/src/contracts/empire_slashing_proposer.ts +22 -27
- package/src/contracts/fee_asset_handler.ts +2 -0
- package/src/contracts/fee_asset_price_oracle.ts +280 -0
- package/src/contracts/governance.ts +5 -3
- package/src/contracts/governance_proposer.ts +10 -1
- package/src/contracts/index.ts +1 -0
- package/src/contracts/multicall.ts +5 -2
- package/src/contracts/rollup.ts +15 -7
- package/src/contracts/tally_slashing_proposer.ts +5 -1
- package/src/deploy_aztec_l1_contracts.ts +60 -29
- package/src/deploy_l1_contract.ts +3 -3
- package/src/l1_tx_utils/config.ts +20 -0
- package/src/l1_tx_utils/constants.ts +2 -2
- package/src/l1_tx_utils/factory.ts +31 -31
- package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +1 -1
- package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +1 -1
- package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +43 -54
- package/src/l1_tx_utils/index-blobs.ts +2 -2
- package/src/l1_tx_utils/index.ts +1 -0
- package/src/l1_tx_utils/l1_tx_utils.ts +52 -17
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +3 -3
- package/src/{test → l1_tx_utils}/tx_delayer.ts +78 -50
- package/src/test/index.ts +0 -2
- package/src/test/upgrade_utils.ts +2 -2
- package/src/utils.ts +53 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +0 -26
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +0 -1
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +0 -26
- package/dest/test/delayed_tx_utils.d.ts +0 -13
- package/dest/test/delayed_tx_utils.d.ts.map +0 -1
- package/dest/test/delayed_tx_utils.js +0 -28
- package/dest/test/tx_delayer.d.ts +0 -36
- package/dest/test/tx_delayer.d.ts.map +0 -1
- package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +0 -77
- package/src/test/delayed_tx_utils.ts +0 -52
|
@@ -11,7 +11,7 @@ import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, write
|
|
|
11
11
|
import { tmpdir } from 'os';
|
|
12
12
|
import { dirname, join, resolve } from 'path';
|
|
13
13
|
import readline from 'readline';
|
|
14
|
-
import {
|
|
14
|
+
import { mainnet, sepolia } from 'viem/chains';
|
|
15
15
|
import { createEthereumChain, isAnvilTestChain } from './chain.js';
|
|
16
16
|
import { createExtendedL1Client } from './client.js';
|
|
17
17
|
import { deployMulticall3 } from './contracts/multicall.js';
|
|
@@ -19,9 +19,9 @@ import { RollupContract } from './contracts/rollup.js';
|
|
|
19
19
|
const logger = createLogger('ethereum:deploy_aztec_l1_contracts');
|
|
20
20
|
const JSON_DEPLOY_RESULT_PREFIX = 'JSON DEPLOY RESULT:';
|
|
21
21
|
/**
|
|
22
|
-
* Runs a process
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Runs a process and parses JSON deploy results from stdout.
|
|
23
|
+
* Lines starting with JSON_DEPLOY_RESULT_PREFIX are parsed and returned.
|
|
24
|
+
* All other stdout goes to logger.info, stderr goes to logger.warn.
|
|
25
25
|
*/ function runProcess(command, args, env, cwd) {
|
|
26
26
|
const { promise, resolve, reject } = promiseWithResolvers();
|
|
27
27
|
const proc = spawn(command, args, {
|
|
@@ -37,27 +37,42 @@ const JSON_DEPLOY_RESULT_PREFIX = 'JSON DEPLOY RESULT:';
|
|
|
37
37
|
]
|
|
38
38
|
});
|
|
39
39
|
let result;
|
|
40
|
+
let parseError;
|
|
41
|
+
let settled = false;
|
|
40
42
|
readline.createInterface({
|
|
41
43
|
input: proc.stdout
|
|
42
44
|
}).on('line', (line)=>{
|
|
43
45
|
const trimmedLine = line.trim();
|
|
44
46
|
if (trimmedLine.startsWith(JSON_DEPLOY_RESULT_PREFIX)) {
|
|
45
47
|
const jsonStr = trimmedLine.slice(JSON_DEPLOY_RESULT_PREFIX.length).trim();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
try {
|
|
49
|
+
result = JSON.parse(jsonStr);
|
|
50
|
+
} catch {
|
|
51
|
+
parseError = new Error(`Failed to parse deploy result JSON: ${jsonStr.slice(0, 200)}`);
|
|
52
|
+
}
|
|
48
53
|
} else {
|
|
49
54
|
logger.info(line);
|
|
50
55
|
}
|
|
51
56
|
});
|
|
52
57
|
readline.createInterface({
|
|
53
58
|
input: proc.stderr
|
|
54
|
-
}).on('line', logger.
|
|
59
|
+
}).on('line', logger.warn.bind(logger));
|
|
55
60
|
proc.on('error', (error)=>{
|
|
61
|
+
if (settled) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
settled = true;
|
|
56
65
|
reject(new Error(`Failed to spawn ${command}: ${error.message}`));
|
|
57
66
|
});
|
|
58
67
|
proc.on('close', (code)=>{
|
|
68
|
+
if (settled) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
settled = true;
|
|
59
72
|
if (code !== 0) {
|
|
60
|
-
reject(new Error(`${command} exited with code ${code}
|
|
73
|
+
reject(new Error(`${command} exited with code ${code}`));
|
|
74
|
+
} else if (parseError) {
|
|
75
|
+
reject(parseError);
|
|
61
76
|
} else {
|
|
62
77
|
resolve(result);
|
|
63
78
|
}
|
|
@@ -137,6 +152,9 @@ function cleanupDeployDir() {
|
|
|
137
152
|
const foundryTomlPath = join(basePath, 'foundry.toml');
|
|
138
153
|
let foundryToml = readFileSync(foundryTomlPath, 'utf-8');
|
|
139
154
|
const solcPathMatch = foundryToml.match(/solc\s*=\s*"\.\/solc-([^"]+)"/);
|
|
155
|
+
// Did we find a hardcoded solc path that we need to make absolute?
|
|
156
|
+
// This code path happens in CI currently as we bundle solc there to avoid race conditions when
|
|
157
|
+
// downloading solc.
|
|
140
158
|
if (solcPathMatch) {
|
|
141
159
|
const solcVersion = solcPathMatch[1];
|
|
142
160
|
const absoluteSolcPath = join(basePath, `solc-${solcVersion}`);
|
|
@@ -225,11 +243,8 @@ function cleanupDeployDir() {
|
|
|
225
243
|
if (isVerifiableChain && !process.env.ETHERSCAN_API_KEY) {
|
|
226
244
|
logger.warn(`Deploying to chain ${chainId} (${chainId === mainnet.id ? 'mainnet' : 'sepolia'}) without ETHERSCAN_API_KEY. ` + `Contracts will NOT be verified on Etherscan. Set ETHERSCAN_API_KEY environment variable to enable verification.`);
|
|
227
245
|
}
|
|
228
|
-
|
|
229
|
-
const MAGIC_ANVIL_BATCH_SIZE = 8;
|
|
230
|
-
// Anvil seems to stall with unbounded batch size. Otherwise no max batch size is desirable.
|
|
246
|
+
const scriptPath = join(getL1ContractsPath(), 'scripts', 'forge_broadcast.js');
|
|
231
247
|
const forgeArgs = [
|
|
232
|
-
'script',
|
|
233
248
|
FORGE_SCRIPT,
|
|
234
249
|
'--sig',
|
|
235
250
|
'run()',
|
|
@@ -237,11 +252,6 @@ function cleanupDeployDir() {
|
|
|
237
252
|
privateKey,
|
|
238
253
|
'--rpc-url',
|
|
239
254
|
rpcUrl,
|
|
240
|
-
'--broadcast',
|
|
241
|
-
...chainId === foundry.id ? [
|
|
242
|
-
'--batch-size',
|
|
243
|
-
MAGIC_ANVIL_BATCH_SIZE.toString()
|
|
244
|
-
] : [],
|
|
245
255
|
...shouldVerify ? [
|
|
246
256
|
'--verify'
|
|
247
257
|
] : []
|
|
@@ -252,7 +262,10 @@ function cleanupDeployDir() {
|
|
|
252
262
|
FOUNDRY_PROFILE: chainId === mainnet.id ? 'production' : undefined,
|
|
253
263
|
...getDeployAztecL1ContractsEnvVars(args)
|
|
254
264
|
};
|
|
255
|
-
const result = await runProcess(
|
|
265
|
+
const result = await runProcess(process.execPath, [
|
|
266
|
+
scriptPath,
|
|
267
|
+
...forgeArgs
|
|
268
|
+
], forgeEnv, l1ContractsPath);
|
|
256
269
|
if (!result) {
|
|
257
270
|
throw new Error('Forge script did not output deployment result');
|
|
258
271
|
}
|
|
@@ -364,16 +377,15 @@ export function getDeployRollupForUpgradeEnvVars(args) {
|
|
|
364
377
|
const l1ContractsPath = prepareL1ContractsForDeployment();
|
|
365
378
|
const FORGE_SCRIPT = 'script/deploy/DeployRollupForUpgrade.s.sol';
|
|
366
379
|
await maybeForgeForceProductionBuild(l1ContractsPath, FORGE_SCRIPT, chainId);
|
|
380
|
+
const scriptPath = join(getL1ContractsPath(), 'scripts', 'forge_broadcast.js');
|
|
367
381
|
const forgeArgs = [
|
|
368
|
-
'script',
|
|
369
382
|
FORGE_SCRIPT,
|
|
370
383
|
'--sig',
|
|
371
384
|
'run()',
|
|
372
385
|
'--private-key',
|
|
373
386
|
privateKey,
|
|
374
387
|
'--rpc-url',
|
|
375
|
-
rpcUrl
|
|
376
|
-
'--broadcast'
|
|
388
|
+
rpcUrl
|
|
377
389
|
];
|
|
378
390
|
const forgeEnv = {
|
|
379
391
|
FOUNDRY_PROFILE: chainId === mainnet.id ? 'production' : undefined,
|
|
@@ -382,7 +394,10 @@ export function getDeployRollupForUpgradeEnvVars(args) {
|
|
|
382
394
|
NETWORK: getActiveNetworkName(),
|
|
383
395
|
...getDeployRollupForUpgradeEnvVars(args)
|
|
384
396
|
};
|
|
385
|
-
const result = await runProcess(
|
|
397
|
+
const result = await runProcess(process.execPath, [
|
|
398
|
+
scriptPath,
|
|
399
|
+
...forgeArgs
|
|
400
|
+
], forgeEnv, l1ContractsPath);
|
|
386
401
|
if (!result) {
|
|
387
402
|
throw new Error('Forge script did not output deployment result');
|
|
388
403
|
}
|
|
@@ -5,7 +5,7 @@ import { concatHex, encodeAbiParameters, encodeDeployData, getContractAddress, n
|
|
|
5
5
|
import { DEPLOYER_ADDRESS } from './deploy_aztec_l1_contracts.js';
|
|
6
6
|
import { RegisterNewRollupVersionPayloadArtifact } from './l1_artifacts.js';
|
|
7
7
|
import { getL1TxUtilsConfigEnvVars } from './l1_tx_utils/config.js';
|
|
8
|
-
import {
|
|
8
|
+
import { createL1TxUtils } from './l1_tx_utils/factory.js';
|
|
9
9
|
import { formatViemError } from './utils.js';
|
|
10
10
|
export class L1Deployer {
|
|
11
11
|
client;
|
|
@@ -28,7 +28,7 @@ export class L1Deployer {
|
|
|
28
28
|
this.salt = maybeSalt ? padHex(numberToHex(maybeSalt), {
|
|
29
29
|
size: 32
|
|
30
30
|
}) : undefined;
|
|
31
|
-
this.l1TxUtils =
|
|
31
|
+
this.l1TxUtils = createL1TxUtils(this.client, {
|
|
32
32
|
logger: this.logger,
|
|
33
33
|
dateProvider
|
|
34
34
|
}, {
|
|
@@ -130,7 +130,7 @@ export class L1Deployer {
|
|
|
130
130
|
let { l1TxUtils } = opts;
|
|
131
131
|
if (!l1TxUtils) {
|
|
132
132
|
const config = getL1TxUtilsConfigEnvVars();
|
|
133
|
-
l1TxUtils =
|
|
133
|
+
l1TxUtils = createL1TxUtils(extendedClient, {
|
|
134
134
|
logger
|
|
135
135
|
}, {
|
|
136
136
|
...config,
|