@aztec/ethereum 0.0.1-commit.03f7ef2 → 0.0.1-commit.1142ef1
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 +4 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +6 -0
- package/dest/contracts/fee_asset_handler.d.ts +6 -5
- package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
- package/dest/contracts/fee_asset_handler.js +9 -9
- package/dest/contracts/governance_proposer.js +382 -8
- package/dest/contracts/inbox.d.ts +5 -1
- package/dest/contracts/inbox.d.ts.map +1 -1
- package/dest/contracts/inbox.js +4 -0
- 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/outbox.d.ts +41 -0
- package/dest/contracts/outbox.d.ts.map +1 -0
- package/dest/contracts/outbox.js +86 -0
- package/dest/contracts/rollup.d.ts +128 -95
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +602 -127
- package/dest/deploy_aztec_l1_contracts.d.ts +12 -2
- package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_aztec_l1_contracts.js +61 -11
- package/dest/l1_artifacts.d.ts +3550 -1102
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_tx_utils/fee-strategies/index.d.ts +3 -2
- package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -1
- package/dest/l1_tx_utils/fee-strategies/index.js +2 -1
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +2 -12
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -1
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +35 -17
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +2 -11
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -1
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +36 -18
- package/dest/l1_tx_utils/fee-strategies/types.d.ts +14 -27
- package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -1
- package/dest/l1_tx_utils/fee-strategies/types.js +0 -21
- package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +2 -2
- package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -1
- package/dest/l1_tx_utils/l1_fee_analyzer.js +3 -3
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +1 -5
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +14 -51
- package/dest/queries.d.ts +1 -1
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +8 -3
- package/dest/test/chain_monitor.js +1 -2
- package/dest/test/rollup_cheat_codes.d.ts +2 -1
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +9 -1
- package/package.json +5 -5
- package/src/config.ts +8 -0
- package/src/contracts/fee_asset_handler.ts +8 -7
- package/src/contracts/inbox.ts +5 -0
- package/src/contracts/index.ts +1 -0
- package/src/contracts/outbox.ts +98 -0
- package/src/contracts/rollup.ts +240 -92
- package/src/deploy_aztec_l1_contracts.ts +62 -13
- package/src/l1_tx_utils/fee-strategies/index.ts +1 -1
- package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +45 -41
- package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +48 -44
- package/src/l1_tx_utils/fee-strategies/types.ts +14 -46
- package/src/l1_tx_utils/l1_fee_analyzer.ts +2 -3
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +20 -59
- package/src/queries.ts +8 -2
- package/src/test/chain_monitor.ts +1 -1
- package/src/test/rollup_cheat_codes.ts +10 -1
package/src/queries.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
3
3
|
import type { L1ContractsConfig } from './config.js';
|
|
4
4
|
import { ReadOnlyGovernanceContract } from './contracts/governance.js';
|
|
5
5
|
import { GovernanceProposerContract } from './contracts/governance_proposer.js';
|
|
6
|
+
import { InboxContract } from './contracts/inbox.js';
|
|
6
7
|
import { RollupContract } from './contracts/rollup.js';
|
|
7
8
|
import type { ViemPublicClient } from './types.js';
|
|
8
9
|
|
|
@@ -25,6 +26,8 @@ export async function getL1ContractsConfig(
|
|
|
25
26
|
const rollup = new RollupContract(publicClient, rollupAddress.toString());
|
|
26
27
|
const slasherProposer = await rollup.getSlashingProposer();
|
|
27
28
|
const slasher = await rollup.getSlasherContract();
|
|
29
|
+
const rollupAddresses = await rollup.getRollupAddresses();
|
|
30
|
+
const inboxContract = new InboxContract(publicClient, rollupAddresses.inboxAddress.toString());
|
|
28
31
|
|
|
29
32
|
const [
|
|
30
33
|
l1StartBlock,
|
|
@@ -35,6 +38,7 @@ export async function getL1ContractsConfig(
|
|
|
35
38
|
aztecTargetCommitteeSize,
|
|
36
39
|
lagInEpochsForValidatorSet,
|
|
37
40
|
lagInEpochsForRandao,
|
|
41
|
+
inboxLag,
|
|
38
42
|
activationThreshold,
|
|
39
43
|
ejectionThreshold,
|
|
40
44
|
localEjectionThreshold,
|
|
@@ -62,6 +66,7 @@ export async function getL1ContractsConfig(
|
|
|
62
66
|
rollup.getTargetCommitteeSize(),
|
|
63
67
|
rollup.getLagInEpochsForValidatorSet(),
|
|
64
68
|
rollup.getLagInEpochsForRandao(),
|
|
69
|
+
inboxContract.getLag(),
|
|
65
70
|
rollup.getActivationThreshold(),
|
|
66
71
|
rollup.getEjectionThreshold(),
|
|
67
72
|
rollup.getLocalEjectionThreshold(),
|
|
@@ -91,13 +96,14 @@ export async function getL1ContractsConfig(
|
|
|
91
96
|
aztecTargetCommitteeSize: Number(aztecTargetCommitteeSize),
|
|
92
97
|
lagInEpochsForValidatorSet: Number(lagInEpochsForValidatorSet),
|
|
93
98
|
lagInEpochsForRandao: Number(lagInEpochsForRandao),
|
|
99
|
+
inboxLag: Number(inboxLag),
|
|
94
100
|
governanceProposerQuorum: Number(governanceProposerQuorum),
|
|
95
101
|
governanceProposerRoundSize: Number(governanceProposerRoundSize),
|
|
96
102
|
activationThreshold,
|
|
97
103
|
ejectionThreshold,
|
|
98
104
|
localEjectionThreshold,
|
|
99
105
|
slashingQuorum: Number(slashingQuorum),
|
|
100
|
-
slashingRoundSizeInEpochs: Number(slashingRoundSize / aztecEpochDuration),
|
|
106
|
+
slashingRoundSizeInEpochs: Number(Number(slashingRoundSize) / aztecEpochDuration),
|
|
101
107
|
slashingLifetimeInRounds: Number(slashingLifetimeInRounds),
|
|
102
108
|
slashingExecutionDelayInRounds: Number(slashingExecutionDelayInRounds),
|
|
103
109
|
slashingVetoer,
|
|
@@ -105,7 +111,7 @@ export async function getL1ContractsConfig(
|
|
|
105
111
|
manaTarget,
|
|
106
112
|
provingCostPerMana: provingCostPerMana,
|
|
107
113
|
rollupVersion: Number(rollupVersion),
|
|
108
|
-
genesisArchiveTreeRoot,
|
|
114
|
+
genesisArchiveTreeRoot: genesisArchiveTreeRoot.toString(),
|
|
109
115
|
exitDelaySeconds: Number(exitDelay),
|
|
110
116
|
slasherFlavor: slasherProposer?.type ?? 'tally',
|
|
111
117
|
slashingOffsetInRounds: Number(slashingOffsetInRounds),
|
|
@@ -156,7 +156,7 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
|
|
|
156
156
|
let committee: EthAddress[] | undefined;
|
|
157
157
|
if (l2Epoch !== this.l2EpochNumber) {
|
|
158
158
|
this.l2EpochNumber = l2Epoch;
|
|
159
|
-
committee =
|
|
159
|
+
committee = await this.rollup.getCurrentEpochCommittee();
|
|
160
160
|
this.emit('l2-epoch', { l2EpochNumber: l2Epoch, timestamp, committee });
|
|
161
161
|
msg += ` starting new epoch ${this.l2EpochNumber} `;
|
|
162
162
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
1
|
+
import { OutboxContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
2
2
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
3
|
import type { ViemPublicClient } from '@aztec/ethereum/types';
|
|
4
4
|
import { CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
@@ -250,6 +250,15 @@ export class RollupCheatCodes {
|
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
public insertOutbox(epoch: EpochNumber, outHash: bigint) {
|
|
254
|
+
return this.ethCheatCodes.execWithPausedAnvil(async () => {
|
|
255
|
+
const outboxAddress = await this.rollup.read.getOutbox();
|
|
256
|
+
const epochRootSlot = OutboxContract.getEpochRootStorageSlot(epoch);
|
|
257
|
+
await this.ethCheatCodes.store(EthAddress.fromString(outboxAddress), epochRootSlot, outHash);
|
|
258
|
+
this.logger.warn(`Advanced outbox to epoch ${epoch} with out hash ${outHash}`);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
253
262
|
/**
|
|
254
263
|
* Executes an action impersonated as the owner of the Rollup contract.
|
|
255
264
|
* @param action - The action to execute
|