@aztec/end-to-end 0.0.1-commit.b33fc05d0 → 0.0.1-commit.b3d3157a
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/README.md +27 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +17 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +27 -38
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +2 -0
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +5 -4
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +14 -5
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +15 -4
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +39 -7
- package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +25 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +86 -13
- package/dest/e2e_fees/fees_test.d.ts +5 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +32 -6
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +2 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +4 -3
- package/dest/e2e_p2p/p2p_network.d.ts +10 -9
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +46 -27
- package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +29 -13
- package/dest/e2e_p2p/shared.d.ts +23 -14
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +62 -57
- package/dest/e2e_token_contract/token_contract_test.d.ts +3 -3
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +4 -2
- package/dest/fixtures/authwit_proxy.d.ts +1 -1
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +6 -5
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +9 -13
- package/dest/fixtures/fixtures.d.ts +70 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +65 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +2 -2
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +1 -1
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +44 -11
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +157 -28
- package/dest/fixtures/setup_p2p_test.d.ts +10 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +8 -8
- package/dest/fixtures/token_utils.d.ts +1 -1
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +2 -5
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/shared/cross_chain_test_harness.d.ts +4 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +9 -5
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +17 -8
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +50 -32
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +24 -12
- package/dest/simulators/token_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +72 -48
- package/dest/spartan/tx_metrics.d.ts +18 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +73 -20
- package/dest/spartan/utils/config.d.ts +9 -35
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +2 -2
- package/dest/test-wallet/test_wallet.d.ts +25 -23
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +146 -87
- package/dest/test-wallet/utils.d.ts +3 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +2 -7
- package/dest/test-wallet/wallet_worker_script.js +7 -2
- package/dest/test-wallet/worker_wallet.d.ts +5 -4
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +6 -2
- package/dest/test-wallet/worker_wallet_schema.d.ts +110 -224
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +14 -2
- package/package.json +46 -42
- package/src/bench/client_flows/benchmark.ts +19 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +64 -53
- package/src/bench/utils.ts +2 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +24 -10
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +49 -11
- package/src/e2e_deploy_contract/deploy_test.ts +3 -2
- package/src/e2e_epochs/epochs_test.ts +98 -11
- package/src/e2e_fees/fees_test.ts +37 -4
- package/src/e2e_nested_contract/nested_contract_test.ts +3 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -3
- package/src/e2e_p2p/p2p_network.ts +57 -39
- package/src/e2e_p2p/reqresp/utils.ts +30 -12
- package/src/e2e_p2p/shared.ts +60 -71
- package/src/e2e_token_contract/token_contract_test.ts +12 -2
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +15 -18
- package/src/fixtures/fixtures.ts +83 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +186 -33
- package/src/fixtures/setup_p2p_test.ts +13 -9
- package/src/fixtures/token_utils.ts +1 -4
- package/src/fixtures/utils.ts +2 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +104 -0
- package/src/guides/up_quick_start.sh +0 -2
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/shared/cross_chain_test_harness.ts +14 -4
- package/src/shared/gas_portal_test_harness.ts +20 -10
- package/src/shared/uniswap_l1_l2.ts +84 -40
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +28 -12
- package/src/simulators/token_simulator.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +69 -43
- package/src/spartan/tx_metrics.ts +81 -23
- package/src/spartan/utils/nodes.ts +2 -2
- package/src/test-wallet/test_wallet.ts +174 -104
- package/src/test-wallet/utils.ts +3 -7
- package/src/test-wallet/wallet_worker_script.ts +5 -2
- package/src/test-wallet/worker_wallet.ts +10 -5
- package/src/test-wallet/worker_wallet_schema.ts +2 -2
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -7,6 +7,7 @@ import { pluralize } from '@aztec/foundation/string';
|
|
|
7
7
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
8
8
|
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
9
9
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
10
|
+
import { SchnorrHardcodedKeyAccountContract } from '../fixtures/schnorr_hardcoded_account_contract.js';
|
|
10
11
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
11
12
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
12
13
|
import { proveInteraction } from '../test-wallet/utils.js';
|
|
@@ -30,13 +31,21 @@ export const submitComplexTxsTo = async (logger, from, spamContract, numTxs, opt
|
|
|
30
31
|
export const submitTransactions = async (logger, node, numTxs, fundedAccount)=>{
|
|
31
32
|
const rpcConfig = getRpcConfig();
|
|
32
33
|
rpcConfig.proverEnabled = false;
|
|
33
|
-
const wallet = await TestWallet.create(node,
|
|
34
|
+
const wallet = await TestWallet.create(node, // Use checkpointed chain tip to avoid anchoring on provisional blocks that the archiver can prune
|
|
35
|
+
// when their slot ends without a checkpoint landing on L1.
|
|
36
|
+
{
|
|
34
37
|
...getPXEConfig(),
|
|
35
|
-
proverEnabled: false
|
|
38
|
+
proverEnabled: false,
|
|
39
|
+
syncChainTip: 'checkpointed'
|
|
36
40
|
}, {
|
|
37
41
|
loggerActorLabel: 'pxe-tx'
|
|
38
42
|
});
|
|
39
|
-
const
|
|
43
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
44
|
+
const fundedAccountManager = await wallet.createAccount({
|
|
45
|
+
secret: fundedAccount.secret,
|
|
46
|
+
salt: fundedAccount.salt,
|
|
47
|
+
contract
|
|
48
|
+
});
|
|
40
49
|
return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
|
|
41
50
|
};
|
|
42
51
|
export async function prepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
@@ -44,11 +53,17 @@ export async function prepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
|
44
53
|
rpcConfig.proverEnabled = false;
|
|
45
54
|
const wallet = await TestWallet.create(node, {
|
|
46
55
|
...getPXEConfig(),
|
|
47
|
-
proverEnabled: false
|
|
56
|
+
proverEnabled: false,
|
|
57
|
+
syncChainTip: 'checkpointed'
|
|
48
58
|
}, {
|
|
49
59
|
loggerActorLabel: 'pxe-tx'
|
|
50
60
|
});
|
|
51
|
-
const
|
|
61
|
+
const accountContract = new SchnorrHardcodedKeyAccountContract();
|
|
62
|
+
const fundedAccountManager = await wallet.createAccount({
|
|
63
|
+
secret: fundedAccount.secret,
|
|
64
|
+
salt: fundedAccount.salt,
|
|
65
|
+
contract: accountContract
|
|
66
|
+
});
|
|
52
67
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
53
68
|
salt: Fr.random()
|
|
54
69
|
});
|
|
@@ -68,24 +83,12 @@ export function awaitProposalExecution(slashingProposer, timeoutSeconds, logger)
|
|
|
68
83
|
logger.warn(`Timed out waiting for proposal execution`);
|
|
69
84
|
reject(new Error(`Timeout waiting for proposal execution after ${timeoutSeconds}s`));
|
|
70
85
|
}, timeoutSeconds * 1000);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
logger.warn(`Proposal ${args.payload} from round ${args.round} executed`);
|
|
74
|
-
clearTimeout(timeout);
|
|
75
|
-
unwatch();
|
|
76
|
-
resolve(args.round);
|
|
77
|
-
});
|
|
78
|
-
} else if (slashingProposer.type === 'tally') {
|
|
79
|
-
const unwatch = slashingProposer.listenToRoundExecuted((args)=>{
|
|
80
|
-
logger.warn(`Slash from round ${args.round} executed`);
|
|
81
|
-
clearTimeout(timeout);
|
|
82
|
-
unwatch();
|
|
83
|
-
resolve(args.round);
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
+
const unwatch = slashingProposer.listenToRoundExecuted((args)=>{
|
|
87
|
+
logger.warn(`Slash from round ${args.round} executed`);
|
|
86
88
|
clearTimeout(timeout);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
unwatch();
|
|
90
|
+
resolve(args.round);
|
|
91
|
+
});
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
export async function awaitCommitteeExists({ rollup, logger }) {
|
|
@@ -101,28 +104,41 @@ export async function awaitCommitteeExists({ rollup, logger }) {
|
|
|
101
104
|
return committee.map((c)=>c.toString());
|
|
102
105
|
}
|
|
103
106
|
/**
|
|
104
|
-
* Advance epochs until we find one where the target proposer is selected for at least
|
|
105
|
-
* then stop one epoch before it. This leaves time for the caller to
|
|
106
|
-
* warping to the target epoch, avoiding the race where the target epoch
|
|
107
|
-
* are ready.
|
|
107
|
+
* Advance epochs until we find one where the target proposer is selected for a slot at least
|
|
108
|
+
* `warmupSlots` into the epoch, then stop one epoch before it. This leaves time for the caller to
|
|
109
|
+
* start sequencers before warping to the target epoch, avoiding the race where the target epoch
|
|
110
|
+
* passes before sequencers are ready.
|
|
108
111
|
*
|
|
109
|
-
*
|
|
110
|
-
|
|
112
|
+
* The first `warmupSlots` slots of the epoch are skipped on purpose. Callers warp to one slot
|
|
113
|
+
* before the target epoch and, under proposer pipelining, the proposer begins building one slot
|
|
114
|
+
* before its proposal slot. If the proposer were in the first slot of the epoch, that build would
|
|
115
|
+
* begin at the exact instant of the warp, leaving the freshly-started sequencer no warm-up margin;
|
|
116
|
+
* it then serializes its (often AVM-heavy) proposal past the slot boundary and honest receivers
|
|
117
|
+
* reject it as late. Picking a slot at least `warmupSlots` into the epoch guarantees that many full
|
|
118
|
+
* slots of wall-clock between the warp and the start of the proposer's build.
|
|
119
|
+
*
|
|
120
|
+
* Returns the target epoch and the concrete target slot so the caller can warp to it after starting
|
|
121
|
+
* sequencers.
|
|
122
|
+
*/ export async function advanceToEpochBeforeProposer({ epochCache, cheatCodes, targetProposer, logger, maxAttempts = 20, warmupSlots = 1 }) {
|
|
111
123
|
const { epochDuration } = await cheatCodes.getConfig();
|
|
112
124
|
for(let attempt = 0; attempt < maxAttempts; attempt++){
|
|
113
125
|
const currentEpoch = await cheatCodes.getEpoch();
|
|
114
126
|
// Check the NEXT epoch's slots so we stay one epoch before the target,
|
|
115
127
|
// giving the caller time to start sequencers before the target epoch arrives.
|
|
116
128
|
const nextEpoch = Number(currentEpoch) + 1;
|
|
117
|
-
const
|
|
118
|
-
|
|
129
|
+
const epochStartSlot = nextEpoch * Number(epochDuration);
|
|
130
|
+
// Skip the first `warmupSlots` slots so the caller keeps a warm-up margin after warping to one
|
|
131
|
+
// slot before the epoch (see the doc comment above).
|
|
132
|
+
const startSlot = epochStartSlot + warmupSlots;
|
|
133
|
+
const endSlot = epochStartSlot + Number(epochDuration);
|
|
119
134
|
logger.info(`Checking next epoch ${nextEpoch} (slots ${startSlot}-${endSlot - 1}) for proposer ${targetProposer} (current epoch: ${currentEpoch})`);
|
|
120
135
|
for(let s = startSlot; s < endSlot; s++){
|
|
121
136
|
const proposer = await epochCache.getProposerAttesterAddressInSlot(SlotNumber(s));
|
|
122
137
|
if (proposer && proposer.equals(targetProposer)) {
|
|
123
138
|
logger.warn(`Found target proposer ${targetProposer} in slot ${s} of epoch ${nextEpoch}. Staying at epoch ${currentEpoch} to allow sequencer startup.`);
|
|
124
139
|
return {
|
|
125
|
-
targetEpoch: EpochNumber(nextEpoch)
|
|
140
|
+
targetEpoch: EpochNumber(nextEpoch),
|
|
141
|
+
targetSlot: SlotNumber(s)
|
|
126
142
|
};
|
|
127
143
|
}
|
|
128
144
|
}
|
|
@@ -151,42 +167,31 @@ export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSiz
|
|
|
151
167
|
/**
|
|
152
168
|
* Await the committee to be slashed out of the validator set.
|
|
153
169
|
* Currently assumes that the committee is the same size as the validator set.
|
|
154
|
-
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee,
|
|
170
|
+
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashingProposer, slashingRoundSize, aztecSlotDuration, aztecEpochDuration, logger, offenseEpoch }) {
|
|
155
171
|
if (!slashingProposer) {
|
|
156
172
|
throw new Error('No slashing proposer configured. Cannot test slashing.');
|
|
157
173
|
}
|
|
158
174
|
await cheatCodes.debugRollup();
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// The uniqueness check is needed since a validator may be slashed more than once on the same round (eg because they let two epochs be pruned)
|
|
170
|
-
expect(unique(slashPayloadEvents[0].slashes.map((slash)=>slash.validator.toString()))).toHaveLength(committee.length);
|
|
171
|
-
} else {
|
|
172
|
-
// Use the slash offset to ensure we are in the right epoch for tally
|
|
173
|
-
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
174
|
-
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
175
|
-
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
176
|
-
const firstEpochInOffenseRound = offenseEpoch - offenseEpoch % slashingRoundSizeInEpochs;
|
|
177
|
-
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
178
|
-
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
179
|
-
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), {
|
|
180
|
-
offset: -aztecSlotDuration / 2
|
|
181
|
-
});
|
|
182
|
-
}
|
|
175
|
+
// Use the slash offset to ensure we are in the right epoch for tally
|
|
176
|
+
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
177
|
+
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
178
|
+
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
179
|
+
const firstEpochInOffenseRound = offenseEpoch - offenseEpoch % slashingRoundSizeInEpochs;
|
|
180
|
+
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
181
|
+
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
182
|
+
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), {
|
|
183
|
+
offset: -aztecSlotDuration / 2
|
|
184
|
+
});
|
|
183
185
|
const attestersPre = await rollup.getAttesters();
|
|
184
186
|
expect(attestersPre.length).toBe(committee.length);
|
|
185
187
|
for (const attester of attestersPre){
|
|
186
188
|
const attesterInfo = await rollup.getAttesterView(attester);
|
|
187
189
|
expect(attesterInfo.status).toEqual(1); // Validating
|
|
188
190
|
}
|
|
189
|
-
|
|
191
|
+
// Allow up to four round-lengths so that under proposer pipelining, where individual rounds
|
|
192
|
+
// sometimes fail to gather quorum because parts of the committee miss votes due to chain-state
|
|
193
|
+
// races, we still see a later round execute the slash.
|
|
194
|
+
const timeout = slashingRoundSize * 4 * aztecSlotDuration + 30;
|
|
190
195
|
logger.info(`Waiting for slash to be executed (timeout ${timeout}s)`);
|
|
191
196
|
await awaitProposalExecution(slashingProposer, timeout, logger);
|
|
192
197
|
// The attesters should still form the committee but they should be reduced to the "living" status
|
|
@@ -4,7 +4,7 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
5
|
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
6
6
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
7
|
-
import { type EndToEndContext } from '../fixtures/setup.js';
|
|
7
|
+
import { type EndToEndContext, type SetupOptions } from '../fixtures/setup.js';
|
|
8
8
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
9
9
|
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
10
10
|
export declare class TokenContractTest {
|
|
@@ -37,8 +37,8 @@ export declare class TokenContractTest {
|
|
|
37
37
|
*/
|
|
38
38
|
applyMintSnapshot(): void;
|
|
39
39
|
private applyBaseSetup;
|
|
40
|
-
setup(): Promise<void>;
|
|
40
|
+
setup(opts?: Partial<SetupOptions>): Promise<void>;
|
|
41
41
|
teardown(): Promise<void>;
|
|
42
42
|
private applyMint;
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5fY29udHJhY3RfdGVzdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsi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UFDO0lBQ3BDLFlBQVksRUFBRyxvQkFBb0IsQ0FBQztJQUNwQyxNQUFNLEVBQUcsVUFBVSxDQUFDO0lBQ3BCLFlBQVksRUFBRyxZQUFZLENBQUM7SUFDNUIsZUFBZSxFQUFHLFlBQVksQ0FBQztJQUMvQixlQUFlLEVBQUcsWUFBWSxDQUFDO0lBRS9CLE9BQU8sQ0FBQyxvQkFBb0IsQ0FBUztJQUNyQyxPQUFPLENBQUMsZUFBZSxDQUFTO0lBRWhDLFlBQVksUUFBUSxFQUFFLE1BQU0sRUFHM0I7SUFFRDs7O09BR0c7SUFDSCxrQkFBa0IsU0FFakI7SUFFRDs7O09BR0c7SUFDSCxpQkFBaUIsU0FFaEI7WUFLYSxjQUFjO0lBeUR0QixLQUFLLENBQUMsSUFBSSxHQUFFLE9BQU8sQ0FBQyxZQUFZLENBQU0saUJBZTNDO0lBRUssUUFBUSxrQkFFYjtZQUVhLFNBQVM7Q0ErQnhCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAItF,OAAO,
|
|
1
|
+
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EA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 import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
|
3
3
|
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
4
4
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
5
5
|
import { jest } from '@jest/globals';
|
|
6
|
-
import { deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
6
|
+
import { deployAccounts, ensureAuthRegistryPublished, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
7
7
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
8
8
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
9
9
|
const { METRICS_PORT: metricsPort } = process.env;
|
|
@@ -55,6 +55,7 @@ export class TokenContractTest {
|
|
|
55
55
|
this.wallet = this.context.wallet;
|
|
56
56
|
[this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map((acc)=>acc.address);
|
|
57
57
|
this.logger.info('Applying base setup - deploying token contract');
|
|
58
|
+
await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
|
|
58
59
|
this.logger.verbose(`Public deploy accounts...`);
|
|
59
60
|
await publicDeployAccounts(this.wallet, [
|
|
60
61
|
this.adminAddress,
|
|
@@ -86,8 +87,9 @@ export class TokenContractTest {
|
|
|
86
87
|
from: this.adminAddress
|
|
87
88
|
})).result).toBe(this.adminAddress.toBigInt());
|
|
88
89
|
}
|
|
89
|
-
async setup() {
|
|
90
|
+
async setup(opts = {}) {
|
|
90
91
|
this.context = await setup(0, {
|
|
92
|
+
...opts,
|
|
91
93
|
metricsPort: this.metricsPort,
|
|
92
94
|
fundSponsoredFPC: true,
|
|
93
95
|
skipAccountDeployment: true
|
|
@@ -12,4 +12,4 @@ export declare function sendThroughAuthwitProxy(proxy: GenericProxyContract, act
|
|
|
12
12
|
* while the actual tx sender retains their keys in scope.
|
|
13
13
|
*/
|
|
14
14
|
export declare function simulateThroughAuthwitProxy(proxy: GenericProxyContract, action: ContractFunctionInteraction, options: SimulateInteractionOptions): Promise<import("@aztec/aztec.js/contracts").SimulationResult>;
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aHdpdF9wcm94eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL2F1dGh3aXRfcHJveHkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQ1YsMkJBQTJCLEVBQzNCLHNCQUFzQixFQUN0QiwwQkFBMEIsRUFDM0IsTUFBTSwyQkFBMkIsQ0FBQztBQUNuQyxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDRDQUE0QyxDQUFDO0FBc0J2Rjs7OztHQUlHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUMzQyxLQUFLLEVBQUUsb0JBQW9CLEVBQzNCLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsT0FBTyxFQUFFLHNCQUFzQix3R0FJaEM7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQXNCLDJCQUEyQixDQUMvQyxLQUFLLEVBQUUsb0JBQW9CLEVBQzNCLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsT0FBTyxFQUFFLDBCQUEwQixpRUFJcEMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authwit_proxy.d.ts","sourceRoot":"","sources":["../../src/fixtures/authwit_proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"authwit_proxy.d.ts","sourceRoot":"","sources":["../../src/fixtures/authwit_proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAsBvF;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,2BAA2B,EACnC,OAAO,EAAE,sBAAsB,wGAIhC;AAED;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,2BAA2B,EACnC,OAAO,EAAE,0BAA0B,iEAIpC"}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
return proxy.methods.forward_private_3(call.to, call.selector, call.args);
|
|
10
10
|
} else if (argCount === 4) {
|
|
11
11
|
return proxy.methods.forward_private_4(call.to, call.selector, call.args);
|
|
12
|
+
} else if (argCount === 5) {
|
|
13
|
+
return proxy.methods.forward_private_5(call.to, call.selector, call.args);
|
|
14
|
+
} else if (argCount === 6) {
|
|
15
|
+
return proxy.methods.forward_private_6(call.to, call.selector, call.args);
|
|
12
16
|
}
|
|
13
17
|
throw new Error(`No forward_private_${argCount} method on proxy`);
|
|
14
18
|
}
|
|
@@ -3,14 +3,14 @@ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
|
3
3
|
import { type Logger } from '@aztec/aztec.js/log';
|
|
4
4
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
5
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
6
|
-
import {
|
|
6
|
+
import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
7
7
|
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
8
8
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
9
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
10
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
11
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
12
12
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
13
|
-
import { type EndToEndContext } from './setup.js';
|
|
13
|
+
import { type EndToEndContext, type SetupOptions } from './setup.js';
|
|
14
14
|
/**
|
|
15
15
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
16
16
|
* However, we then setup a second PXE with a full prover instance.
|
|
@@ -35,7 +35,8 @@ export declare class FullProverTest {
|
|
|
35
35
|
private provenComponents;
|
|
36
36
|
private bbConfigCleanup?;
|
|
37
37
|
private acvmConfigCleanup?;
|
|
38
|
-
|
|
38
|
+
/** Returns the proof verifier from the prover node (for test assertions). */
|
|
39
|
+
get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined;
|
|
39
40
|
provenAsset: TokenContract;
|
|
40
41
|
context: EndToEndContext;
|
|
41
42
|
private proverAztecNode;
|
|
@@ -47,9 +48,9 @@ export declare class FullProverTest {
|
|
|
47
48
|
private realProofs;
|
|
48
49
|
constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs?: boolean);
|
|
49
50
|
private applyBaseSetup;
|
|
50
|
-
setup(): Promise<this>;
|
|
51
|
+
setup(opts?: Partial<SetupOptions>): Promise<this>;
|
|
51
52
|
private mintFeeJuice;
|
|
52
53
|
teardown(): Promise<void>;
|
|
53
54
|
private applyMint;
|
|
54
55
|
}
|
|
55
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZTJlX3Byb3Zlcl90ZXN0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZml4dHVyZXMvZTJlX3Byb3Zlcl90ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0F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0FBQyxZQUFZLENBQU0saUJBd0kzQztZQUVhLFlBQVk7SUFTcEIsUUFBUSxrQkFjYjtZQUVhLFNBQVM7Q0FzQ3hCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAIlG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMtE,OAAO,EAAE,cAAc,EAAE,MA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AAK,CAAC,IAAI,GAAE,OAAO,CAAC,YAAY,CAAM,iBAwI3C;YAEa,YAAY;IASpB,QAAQ,kBAcb;YAEa,SAAS;CAsCxB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
3
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
4
|
-
import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
5
4
|
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
6
5
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
7
6
|
import { SecretValue } from '@aztec/foundation/config';
|
|
@@ -37,7 +36,9 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
37
36
|
provenComponents = [];
|
|
38
37
|
bbConfigCleanup;
|
|
39
38
|
acvmConfigCleanup;
|
|
40
|
-
circuitProofVerifier
|
|
39
|
+
/** Returns the proof verifier from the prover node (for test assertions). */ get circuitProofVerifier() {
|
|
40
|
+
return this.proverAztecNode?.getProofVerifier();
|
|
41
|
+
}
|
|
41
42
|
provenAsset;
|
|
42
43
|
context;
|
|
43
44
|
proverAztecNode;
|
|
@@ -67,11 +68,8 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
67
68
|
this.logger.info('Applying base setup: publicly deploying accounts');
|
|
68
69
|
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
69
70
|
this.logger.info('Applying base setup: deploying token contract');
|
|
70
|
-
const {
|
|
71
|
-
from: this.accounts[0]
|
|
72
|
-
wait: {
|
|
73
|
-
returnReceipt: true
|
|
74
|
-
}
|
|
71
|
+
const { contract: asset, instance } = await TokenContract.deploy(this.wallet, this.accounts[0], FullProverTest.TOKEN_NAME, FullProverTest.TOKEN_SYMBOL, FullProverTest.TOKEN_DECIMALS).send({
|
|
72
|
+
from: this.accounts[0]
|
|
75
73
|
});
|
|
76
74
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
77
75
|
this.fakeProofsAsset = asset;
|
|
@@ -82,9 +80,10 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
82
80
|
from: this.accounts[0]
|
|
83
81
|
})).result).toBe(this.accounts[0].toBigInt());
|
|
84
82
|
}
|
|
85
|
-
async setup() {
|
|
83
|
+
async setup(opts = {}) {
|
|
86
84
|
this.logger.info('Setting up subsystems from fresh');
|
|
87
85
|
this.context = await setup(0, {
|
|
86
|
+
...opts,
|
|
88
87
|
startProverNode: true,
|
|
89
88
|
coinbase: this.coinbase,
|
|
90
89
|
fundSponsoredFPC: true,
|
|
@@ -120,8 +119,6 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
120
119
|
await Barretenberg.initSingleton({
|
|
121
120
|
backend: BackendType.NativeUnixSocket
|
|
122
121
|
});
|
|
123
|
-
const verifier = await BBCircuitVerifier.new(bbConfig);
|
|
124
|
-
this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
|
|
125
122
|
this.logger.debug(`Configuring the node for real proofs...`);
|
|
126
123
|
await this.aztecNodeAdmin.setConfig({
|
|
127
124
|
realProofs: true,
|
|
@@ -129,7 +126,6 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
129
126
|
});
|
|
130
127
|
} else {
|
|
131
128
|
this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
|
|
132
|
-
this.circuitProofVerifier = new TestCircuitVerifier();
|
|
133
129
|
await this.aztecNodeAdmin.setConfig({
|
|
134
130
|
minTxsPerBlock: this.minNumberOfTxsPerBlock
|
|
135
131
|
});
|
|
@@ -168,7 +164,7 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
168
164
|
await this.mintFeeJuice(proverNodeSenderAddress);
|
|
169
165
|
this.logger.verbose('Starting prover node');
|
|
170
166
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
171
|
-
const {
|
|
167
|
+
const { genesis } = await getGenesisValues(this.context.initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress), undefined, undefined, this.context.genesis.genesisTimestamp);
|
|
172
168
|
const proverNodeConfig = {
|
|
173
169
|
...config,
|
|
174
170
|
enableProverNode: true,
|
|
@@ -200,7 +196,7 @@ import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicD
|
|
|
200
196
|
]
|
|
201
197
|
}
|
|
202
198
|
}, {
|
|
203
|
-
|
|
199
|
+
genesis
|
|
204
200
|
});
|
|
205
201
|
this.logger.warn(`Proofs are now enabled`, {
|
|
206
202
|
realProofs: this.realProofs
|
|
@@ -1,4 +1,73 @@
|
|
|
1
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
|
+
import type { GasFees } from '@aztec/stdlib/gas';
|
|
1
3
|
export declare const METRICS_PORT = 4318;
|
|
4
|
+
/** Default fee padding applied to predicted min fees in e2e tests. */
|
|
5
|
+
export declare const DEFAULT_MIN_FEE_PADDING = 5;
|
|
6
|
+
/**
|
|
7
|
+
* Large fee padding for txs that may be mined significantly later than when they were created,
|
|
8
|
+
* such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
|
|
9
|
+
*/
|
|
10
|
+
export declare const LARGE_MIN_FEE_PADDING = 15;
|
|
11
|
+
/**
|
|
12
|
+
* Fee padding used by tests running under proposer pipelining. Under pipelining the fee-asset
|
|
13
|
+
* price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
|
|
14
|
+
* for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
|
|
15
|
+
* Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
|
|
16
|
+
* LARGE_MIN_FEE_PADDING (15x).
|
|
17
|
+
*/
|
|
18
|
+
export declare const PIPELINED_FEE_PADDING = 30;
|
|
19
|
+
/**
|
|
20
|
+
* Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
|
|
21
|
+
*
|
|
22
|
+
* await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
|
|
23
|
+
*
|
|
24
|
+
* The preset sets:
|
|
25
|
+
* - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
|
|
26
|
+
* avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
|
|
27
|
+
* - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
|
|
28
|
+
* (otherwise the chain stalls on alternating slots).
|
|
29
|
+
* - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
|
|
30
|
+
* default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
|
|
31
|
+
* - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PIPELINING_SETUP_OPTS: {
|
|
34
|
+
readonly inboxLag: 2;
|
|
35
|
+
readonly minTxsPerBlock: 0;
|
|
36
|
+
readonly aztecSlotDuration: 12;
|
|
37
|
+
readonly ethereumSlotDuration: 4;
|
|
38
|
+
readonly walletMinFeePadding: 30;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Setup option preset that opts a test into the deterministic AutomineSequencer path.
|
|
42
|
+
* Use only for single-sequencer tests that don't exercise block-building or consensus
|
|
43
|
+
* (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `e2e_p2p/*`,
|
|
44
|
+
* `e2e_epochs/*`, `e2e_slashing/*`, `e2e_block_building`, or any multi-validator suite.
|
|
45
|
+
*
|
|
46
|
+
* await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
|
|
47
|
+
*
|
|
48
|
+
* The preset:
|
|
49
|
+
* - Swaps the production Sequencer for an AutomineSequencer that builds one block per
|
|
50
|
+
* submitted tx, publishes synchronously to L1, and owns all time control through a
|
|
51
|
+
* serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
|
|
52
|
+
* - Disables the validator client and AnvilTestWatcher (the AutomineSequencer needs
|
|
53
|
+
* neither).
|
|
54
|
+
* - Uses `inboxLag: 1` (synchronous) since the AutomineSequencer publishes one block per tx.
|
|
55
|
+
* - Switches anvil into automine mode at setup time (no interval mining); each L1 tx
|
|
56
|
+
* mines an L1 block immediately.
|
|
57
|
+
*
|
|
58
|
+
* Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const AUTOMINE_E2E_OPTS: {
|
|
61
|
+
readonly useAutomineSequencer: true;
|
|
62
|
+
readonly disableAnvilTestWatcher: true;
|
|
63
|
+
readonly inboxLag: 1;
|
|
64
|
+
readonly minTxsPerBlock: 0;
|
|
65
|
+
readonly aztecSlotDuration: 12;
|
|
66
|
+
readonly ethereumSlotDuration: 4;
|
|
67
|
+
readonly walletMinFeePadding: 30;
|
|
68
|
+
};
|
|
69
|
+
/** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
|
|
70
|
+
export declare function getPaddedMaxFeesPerGas(node: AztecNode, padding?: number): Promise<GasFees>;
|
|
2
71
|
export declare const shouldCollectMetrics: () => 4318 | undefined;
|
|
3
72
|
/** Returns the boot node UDP port from environment variable or default value. */
|
|
4
73
|
export declare function getBootNodeUdpPort(): number;
|
|
@@ -16,4 +85,4 @@ export declare const DUPLICATE_NULLIFIER_ERROR: RegExp;
|
|
|
16
85
|
export declare const NO_L1_TO_L2_MSG_ERROR: RegExp;
|
|
17
86
|
export declare const STATIC_CALL_STATE_MODIFICATION_ERROR: RegExp;
|
|
18
87
|
export declare const STATIC_CONTEXT_ASSERTION_ERROR: RegExp;
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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AA+E,CAAC;AAElH,eAAO,MAAM,yBAAyB,QAAgC,CAAC;AACvE,eAAO,MAAM,qBAAqB,QACwE,CAAC;AAC3G,eAAO,MAAM,oCAAoC,QAA0C,CAAC;AAC5F,eAAO,MAAM,8BAA8B,QAAkE,CAAC"}
|
|
@@ -1,4 +1,69 @@
|
|
|
1
1
|
export const METRICS_PORT = 4318;
|
|
2
|
+
/** Default fee padding applied to predicted min fees in e2e tests. */ export const DEFAULT_MIN_FEE_PADDING = 5;
|
|
3
|
+
/**
|
|
4
|
+
* Large fee padding for txs that may be mined significantly later than when they were created,
|
|
5
|
+
* such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
|
|
6
|
+
*/ export const LARGE_MIN_FEE_PADDING = 15;
|
|
7
|
+
/**
|
|
8
|
+
* Fee padding used by tests running under proposer pipelining. Under pipelining the fee-asset
|
|
9
|
+
* price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
|
|
10
|
+
* for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
|
|
11
|
+
* Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
|
|
12
|
+
* LARGE_MIN_FEE_PADDING (15x).
|
|
13
|
+
*/ export const PIPELINED_FEE_PADDING = 30;
|
|
14
|
+
/**
|
|
15
|
+
* Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
|
|
16
|
+
*
|
|
17
|
+
* await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
|
|
18
|
+
*
|
|
19
|
+
* The preset sets:
|
|
20
|
+
* - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
|
|
21
|
+
* avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
|
|
22
|
+
* - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
|
|
23
|
+
* (otherwise the chain stalls on alternating slots).
|
|
24
|
+
* - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
|
|
25
|
+
* default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
|
|
26
|
+
* - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
|
|
27
|
+
*/ export const PIPELINING_SETUP_OPTS = {
|
|
28
|
+
inboxLag: 2,
|
|
29
|
+
minTxsPerBlock: 0,
|
|
30
|
+
aztecSlotDuration: 12,
|
|
31
|
+
ethereumSlotDuration: 4,
|
|
32
|
+
walletMinFeePadding: PIPELINED_FEE_PADDING
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Setup option preset that opts a test into the deterministic AutomineSequencer path.
|
|
36
|
+
* Use only for single-sequencer tests that don't exercise block-building or consensus
|
|
37
|
+
* (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `e2e_p2p/*`,
|
|
38
|
+
* `e2e_epochs/*`, `e2e_slashing/*`, `e2e_block_building`, or any multi-validator suite.
|
|
39
|
+
*
|
|
40
|
+
* await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
|
|
41
|
+
*
|
|
42
|
+
* The preset:
|
|
43
|
+
* - Swaps the production Sequencer for an AutomineSequencer that builds one block per
|
|
44
|
+
* submitted tx, publishes synchronously to L1, and owns all time control through a
|
|
45
|
+
* serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
|
|
46
|
+
* - Disables the validator client and AnvilTestWatcher (the AutomineSequencer needs
|
|
47
|
+
* neither).
|
|
48
|
+
* - Uses `inboxLag: 1` (synchronous) since the AutomineSequencer publishes one block per tx.
|
|
49
|
+
* - Switches anvil into automine mode at setup time (no interval mining); each L1 tx
|
|
50
|
+
* mines an L1 block immediately.
|
|
51
|
+
*
|
|
52
|
+
* Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
|
|
53
|
+
*/ export const AUTOMINE_E2E_OPTS = {
|
|
54
|
+
useAutomineSequencer: true,
|
|
55
|
+
disableAnvilTestWatcher: true,
|
|
56
|
+
inboxLag: 1,
|
|
57
|
+
minTxsPerBlock: 0,
|
|
58
|
+
aztecSlotDuration: 12,
|
|
59
|
+
ethereumSlotDuration: 4,
|
|
60
|
+
walletMinFeePadding: PIPELINED_FEE_PADDING
|
|
61
|
+
};
|
|
62
|
+
/** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */ export async function getPaddedMaxFeesPerGas(node, padding = DEFAULT_MIN_FEE_PADDING) {
|
|
63
|
+
const predicted = await node.getPredictedMinFees();
|
|
64
|
+
const worstCase = predicted.length > 0 ? predicted.reduce((worst, fees)=>fees.feePerL2Gas > worst.feePerL2Gas ? fees : worst) : await node.getCurrentMinFees();
|
|
65
|
+
return worstCase.mul(1 + padding);
|
|
66
|
+
}
|
|
2
67
|
export const shouldCollectMetrics = ()=>{
|
|
3
68
|
if (process.env.COLLECT_METRICS) {
|
|
4
69
|
return METRICS_PORT;
|
|
@@ -3,4 +3,4 @@ import type { BBConfig } from '@aztec/bb-prover';
|
|
|
3
3
|
export declare const getBBConfig: (logger: Logger) => Promise<(BBConfig & {
|
|
4
4
|
cleanup: () => Promise<void>;
|
|
5
5
|
}) | undefined>;
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2JiX2NvbmZpZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL2dldF9iYl9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbEQsT0FBTyxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFvQmpELGVBQU8sTUFBTSxXQUFXOztlQXNDdkIsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_bb_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_bb_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"get_bb_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_bb_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAoBjD,eAAO,MAAM,WAAW;;eAsCvB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
-
const { BB_RELEASE_DIR = 'barretenberg/cpp/build/bin', BB_BINARY_PATH, BB_SKIP_CLEANUP = '', TEMP_DIR = tmpdir(), BB_WORKING_DIRECTORY = '', BB_NUM_IVC_VERIFIERS = '
|
|
6
|
+
const { BB_RELEASE_DIR = 'barretenberg/cpp/build/bin', BB_BINARY_PATH, BB_SKIP_CLEANUP = '', TEMP_DIR = tmpdir(), BB_WORKING_DIRECTORY = '', BB_NUM_IVC_VERIFIERS = '8', BB_IVC_CONCURRENCY = '1', BB_CHONK_VERIFY_MAX_BATCH = '16', BB_CHONK_VERIFY_BATCH_CONCURRENCY = '6' } = process.env;
|
|
7
7
|
export const getBBConfig = async (logger)=>{
|
|
8
8
|
try {
|
|
9
9
|
const bbBinaryPath = BB_BINARY_PATH ?? path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb-avm');
|
|
@@ -24,15 +24,15 @@ export const getBBConfig = async (logger)=>{
|
|
|
24
24
|
'true'
|
|
25
25
|
].includes(BB_SKIP_CLEANUP);
|
|
26
26
|
const cleanup = bbSkipCleanup ? ()=>Promise.resolve() : ()=>tryRmDir(directoryToCleanup);
|
|
27
|
-
const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
|
|
28
|
-
const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
|
|
29
27
|
return {
|
|
30
28
|
bbSkipCleanup,
|
|
31
29
|
bbBinaryPath,
|
|
32
30
|
bbWorkingDirectory,
|
|
33
31
|
cleanup,
|
|
34
|
-
numConcurrentIVCVerifiers:
|
|
35
|
-
bbIVCConcurrency:
|
|
32
|
+
numConcurrentIVCVerifiers: Number(BB_NUM_IVC_VERIFIERS),
|
|
33
|
+
bbIVCConcurrency: Number(BB_IVC_CONCURRENCY),
|
|
34
|
+
bbChonkVerifyMaxBatch: Number(BB_CHONK_VERIFY_MAX_BATCH),
|
|
35
|
+
bbChonkVerifyConcurrency: Number(BB_CHONK_VERIFY_BATCH_CONCURRENCY)
|
|
36
36
|
};
|
|
37
37
|
} catch (err) {
|
|
38
38
|
logger.error(`Native BB not available, error: ${err}`);
|