@aztec/ethereum 0.0.1-commit.3469e52 → 0.0.1-commit.358457c
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 +3 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +10 -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 +3 -1
- package/dest/contracts/governance.d.ts.map +1 -1
- package/dest/contracts/governance.js +14 -4
- 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 +8 -7
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +24 -8
- 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 +4 -3
- package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_aztec_l1_contracts.js +38 -22
- package/dest/deploy_l1_contract.js +3 -3
- package/dest/generated/l1-contracts-defaults.d.ts +2 -1
- package/dest/generated/l1-contracts-defaults.d.ts.map +1 -1
- package/dest/generated/l1-contracts-defaults.js +1 -0
- package/dest/l1_artifacts.d.ts +1857 -52
- 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/publisher_manager.d.ts +3 -2
- package/dest/publisher_manager.d.ts.map +1 -1
- package/dest/publisher_manager.js +2 -2
- package/dest/queries.d.ts +1 -1
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +2 -1
- 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/rollup_cheat_codes.d.ts +4 -2
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +10 -1
- package/dest/test/start_anvil.js +1 -1
- 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 +10 -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 +13 -4
- 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 +39 -17
- package/src/contracts/tally_slashing_proposer.ts +5 -1
- package/src/deploy_aztec_l1_contracts.ts +61 -29
- package/src/deploy_l1_contract.ts +3 -3
- package/src/generated/l1-contracts-defaults.ts +1 -0
- 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/publisher_manager.ts +4 -2
- package/src/queries.ts +1 -0
- package/src/test/index.ts +0 -2
- package/src/test/rollup_cheat_codes.ts +11 -2
- package/src/test/start_anvil.ts +1 -1
- 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
|
}
|
|
@@ -347,6 +360,7 @@ export function getDeployRollupForUpgradeEnvVars(args) {
|
|
|
347
360
|
AZTEC_MANA_TARGET: args.manaTarget.toString(),
|
|
348
361
|
AZTEC_EXIT_DELAY_SECONDS: args.exitDelaySeconds.toString(),
|
|
349
362
|
AZTEC_PROVING_COST_PER_MANA: args.provingCostPerMana.toString(),
|
|
363
|
+
AZTEC_INITIAL_ETH_PER_FEE_ASSET: args.initialEthPerFeeAsset.toString(),
|
|
350
364
|
AZTEC_SLASHER_FLAVOR: args.slasherFlavor,
|
|
351
365
|
AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: args.slashingRoundSizeInEpochs.toString(),
|
|
352
366
|
AZTEC_SLASHING_QUORUM: args.slashingQuorum?.toString(),
|
|
@@ -363,16 +377,15 @@ export function getDeployRollupForUpgradeEnvVars(args) {
|
|
|
363
377
|
const l1ContractsPath = prepareL1ContractsForDeployment();
|
|
364
378
|
const FORGE_SCRIPT = 'script/deploy/DeployRollupForUpgrade.s.sol';
|
|
365
379
|
await maybeForgeForceProductionBuild(l1ContractsPath, FORGE_SCRIPT, chainId);
|
|
380
|
+
const scriptPath = join(getL1ContractsPath(), 'scripts', 'forge_broadcast.js');
|
|
366
381
|
const forgeArgs = [
|
|
367
|
-
'script',
|
|
368
382
|
FORGE_SCRIPT,
|
|
369
383
|
'--sig',
|
|
370
384
|
'run()',
|
|
371
385
|
'--private-key',
|
|
372
386
|
privateKey,
|
|
373
387
|
'--rpc-url',
|
|
374
|
-
rpcUrl
|
|
375
|
-
'--broadcast'
|
|
388
|
+
rpcUrl
|
|
376
389
|
];
|
|
377
390
|
const forgeEnv = {
|
|
378
391
|
FOUNDRY_PROFILE: chainId === mainnet.id ? 'production' : undefined,
|
|
@@ -381,7 +394,10 @@ export function getDeployRollupForUpgradeEnvVars(args) {
|
|
|
381
394
|
NETWORK: getActiveNetworkName(),
|
|
382
395
|
...getDeployRollupForUpgradeEnvVars(args)
|
|
383
396
|
};
|
|
384
|
-
const result = await runProcess(
|
|
397
|
+
const result = await runProcess(process.execPath, [
|
|
398
|
+
scriptPath,
|
|
399
|
+
...forgeArgs
|
|
400
|
+
], forgeEnv, l1ContractsPath);
|
|
385
401
|
if (!result) {
|
|
386
402
|
throw new Error('Forge script did not output deployment result');
|
|
387
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,
|
|
@@ -14,6 +14,7 @@ export declare const l1ContractsDefaultEnv: {
|
|
|
14
14
|
readonly AZTEC_PROOF_SUBMISSION_EPOCHS: 1;
|
|
15
15
|
readonly AZTEC_MANA_TARGET: 100000000;
|
|
16
16
|
readonly AZTEC_PROVING_COST_PER_MANA: 100;
|
|
17
|
+
readonly AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000;
|
|
17
18
|
readonly AZTEC_SLASHER_FLAVOR: "tally";
|
|
18
19
|
readonly AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4;
|
|
19
20
|
readonly AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5;
|
|
@@ -26,4 +27,4 @@ export declare const l1ContractsDefaultEnv: {
|
|
|
26
27
|
readonly AZTEC_SLASH_AMOUNT_LARGE: 50000000000000000000;
|
|
27
28
|
readonly AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 300;
|
|
28
29
|
};
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDEtY29udHJhY3RzLWRlZmF1bHRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ2VuZXJhdGVkL2wxLWNvbnRyYWN0cy1kZWZhdWx0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSwwRUFBMEU7QUFDMUUsZUFBTyxNQUFNLHFCQUFxQjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBMkJ4QixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l1-contracts-defaults.d.ts","sourceRoot":"","sources":["../../src/generated/l1-contracts-defaults.ts"],"names":[],"mappings":"AAGA,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"l1-contracts-defaults.d.ts","sourceRoot":"","sources":["../../src/generated/l1-contracts-defaults.ts"],"names":[],"mappings":"AAGA,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,CAAC"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
|
|
16
16
|
AZTEC_MANA_TARGET: 100000000,
|
|
17
17
|
AZTEC_PROVING_COST_PER_MANA: 100,
|
|
18
|
+
AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
|
|
18
19
|
AZTEC_SLASHER_FLAVOR: 'tally',
|
|
19
20
|
AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
|
|
20
21
|
AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5,
|