@aztec-labs/simulator 6.0.0-nightly.20260829
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 +57 -0
- package/dest/client.d.ts +6 -0
- package/dest/client.d.ts.map +1 -0
- package/dest/client.js +3 -0
- package/dest/common/errors.d.ts +51 -0
- package/dest/common/errors.d.ts.map +1 -0
- package/dest/common/errors.js +154 -0
- package/dest/common/index.d.ts +3 -0
- package/dest/common/index.d.ts.map +1 -0
- package/dest/common/index.js +2 -0
- package/dest/common/stats/index.d.ts +2 -0
- package/dest/common/stats/index.d.ts.map +1 -0
- package/dest/common/stats/index.js +1 -0
- package/dest/common/stats/stats.d.ts +4 -0
- package/dest/common/stats/stats.d.ts.map +1 -0
- package/dest/common/stats/stats.js +10 -0
- package/dest/private/acvm/acvm.d.ts +43 -0
- package/dest/private/acvm/acvm.d.ts.map +1 -0
- package/dest/private/acvm/acvm.js +65 -0
- package/dest/private/acvm/acvm_types.d.ts +10 -0
- package/dest/private/acvm/acvm_types.d.ts.map +1 -0
- package/dest/private/acvm/acvm_types.js +3 -0
- package/dest/private/acvm/deserialize.d.ts +35 -0
- package/dest/private/acvm/deserialize.d.ts.map +1 -0
- package/dest/private/acvm/deserialize.js +50 -0
- package/dest/private/acvm/index.d.ts +5 -0
- package/dest/private/acvm/index.d.ts.map +1 -0
- package/dest/private/acvm/index.js +4 -0
- package/dest/private/acvm/serialize.d.ts +41 -0
- package/dest/private/acvm/serialize.d.ts.map +1 -0
- package/dest/private/acvm/serialize.js +99 -0
- package/dest/private/acvm_native.d.ts +41 -0
- package/dest/private/acvm_native.d.ts.map +1 -0
- package/dest/private/acvm_native.js +147 -0
- package/dest/private/acvm_wasm.d.ts +16 -0
- package/dest/private/acvm_wasm.d.ts.map +1 -0
- package/dest/private/acvm_wasm.js +67 -0
- package/dest/private/acvm_wasm_with_blobs.d.ts +20 -0
- package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -0
- package/dest/private/acvm_wasm_with_blobs.js +35 -0
- package/dest/private/circuit_simulator.d.ts +35 -0
- package/dest/private/circuit_simulator.d.ts.map +1 -0
- package/dest/private/circuit_simulator.js +43 -0
- package/dest/private/factory.d.ts +12 -0
- package/dest/private/factory.d.ts.map +1 -0
- package/dest/private/factory.js +30 -0
- package/dest/public/avm/testing/account_proof_fetcher.d.ts +2 -0
- package/dest/public/avm/testing/account_proof_fetcher.d.ts.map +1 -0
- package/dest/public/avm/testing/account_proof_fetcher.js +152 -0
- package/dest/public/avm/testing/base_avm_simulation_tester.d.ts +39 -0
- package/dest/public/avm/testing/base_avm_simulation_tester.d.ts.map +1 -0
- package/dest/public/avm/testing/base_avm_simulation_tester.js +121 -0
- package/dest/public/avm/testing/utils.d.ts +32 -0
- package/dest/public/avm/testing/utils.d.ts.map +1 -0
- package/dest/public/avm/testing/utils.js +66 -0
- package/dest/public/avm_simulator.d.ts +28 -0
- package/dest/public/avm_simulator.d.ts.map +1 -0
- package/dest/public/avm_simulator.js +4 -0
- package/dest/public/avm_simulator_pool.d.ts +84 -0
- package/dest/public/avm_simulator_pool.d.ts.map +1 -0
- package/dest/public/avm_simulator_pool.js +311 -0
- package/dest/public/cdb_ipc_server.d.ts +40 -0
- package/dest/public/cdb_ipc_server.d.ts.map +1 -0
- package/dest/public/cdb_ipc_server.js +153 -0
- package/dest/public/contracts_db_checkpoint.d.ts +16 -0
- package/dest/public/contracts_db_checkpoint.d.ts.map +1 -0
- package/dest/public/contracts_db_checkpoint.js +30 -0
- package/dest/public/db_interfaces.d.ts +68 -0
- package/dest/public/db_interfaces.d.ts.map +1 -0
- package/dest/public/db_interfaces.js +3 -0
- package/dest/public/executor_metrics.d.ts +21 -0
- package/dest/public/executor_metrics.d.ts.map +1 -0
- package/dest/public/executor_metrics.js +64 -0
- package/dest/public/executor_metrics_interface.d.ts +10 -0
- package/dest/public/executor_metrics_interface.d.ts.map +1 -0
- package/dest/public/executor_metrics_interface.js +1 -0
- package/dest/public/fixtures/amm_test.d.ts +10 -0
- package/dest/public/fixtures/amm_test.d.ts.map +1 -0
- package/dest/public/fixtures/amm_test.js +213 -0
- package/dest/public/fixtures/bulk_test.d.ts +6 -0
- package/dest/public/fixtures/bulk_test.d.ts.map +1 -0
- package/dest/public/fixtures/bulk_test.js +289 -0
- package/dest/public/fixtures/custom_bytecode_tester.d.ts +34 -0
- package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -0
- package/dest/public/fixtures/custom_bytecode_tester.js +53 -0
- package/dest/public/fixtures/index.d.ts +10 -0
- package/dest/public/fixtures/index.d.ts.map +1 -0
- package/dest/public/fixtures/index.js +9 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts +30 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts.map +1 -0
- package/dest/public/fixtures/public_processor_test_env.js +73 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +77 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -0
- package/dest/public/fixtures/public_tx_simulation_tester.js +176 -0
- package/dest/public/fixtures/simple_contract_data_source.d.ts +36 -0
- package/dest/public/fixtures/simple_contract_data_source.d.ts.map +1 -0
- package/dest/public/fixtures/simple_contract_data_source.js +95 -0
- package/dest/public/fixtures/token_test.d.ts +12 -0
- package/dest/public/fixtures/token_test.d.ts.map +1 -0
- package/dest/public/fixtures/token_test.js +96 -0
- package/dest/public/fixtures/utils.d.ts +26 -0
- package/dest/public/fixtures/utils.d.ts.map +1 -0
- package/dest/public/fixtures/utils.js +170 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +65 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +181 -0
- package/dest/public/fuzzing/avm_simulator_bin.d.ts +2 -0
- package/dest/public/fuzzing/avm_simulator_bin.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_simulator_bin.js +108 -0
- package/dest/public/index.d.ts +10 -0
- package/dest/public/index.d.ts.map +1 -0
- package/dest/public/index.js +6 -0
- package/dest/public/public_db_sources.d.ts +83 -0
- package/dest/public/public_db_sources.d.ts.map +1 -0
- package/dest/public/public_db_sources.js +297 -0
- package/dest/public/public_errors.d.ts +12 -0
- package/dest/public/public_errors.d.ts.map +1 -0
- package/dest/public/public_errors.js +13 -0
- package/dest/public/public_processor/guarded_merkle_tree.d.ts +52 -0
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -0
- package/dest/public/public_processor/guarded_merkle_tree.js +116 -0
- package/dest/public/public_processor/public_processor.d.ts +71 -0
- package/dest/public/public_processor/public_processor.d.ts.map +1 -0
- package/dest/public/public_processor/public_processor.js +858 -0
- package/dest/public/public_processor/public_processor_metrics.d.ts +30 -0
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -0
- package/dest/public/public_processor/public_processor_metrics.js +116 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts +17 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.js +39 -0
- package/dest/public/public_tx_simulator/factories.d.ts +14 -0
- package/dest/public/public_tx_simulator/factories.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/factories.js +28 -0
- package/dest/public/public_tx_simulator/index.d.ts +6 -0
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/index.js +3 -0
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +53 -0
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator.js +127 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts +24 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.js +31 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +32 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.js +1 -0
- package/dest/public/side_effect_errors.d.ts +44 -0
- package/dest/public/side_effect_errors.d.ts.map +1 -0
- package/dest/public/side_effect_errors.js +75 -0
- package/dest/public/test_executor_metrics.d.ts +56 -0
- package/dest/public/test_executor_metrics.d.ts.map +1 -0
- package/dest/public/test_executor_metrics.js +305 -0
- package/dest/public/unique_class_ids.d.ts +37 -0
- package/dest/public/unique_class_ids.d.ts.map +1 -0
- package/dest/public/unique_class_ids.js +61 -0
- package/dest/public/utils.d.ts +3 -0
- package/dest/public/utils.d.ts.map +1 -0
- package/dest/public/utils.js +18 -0
- package/dest/server.d.ts +7 -0
- package/dest/server.d.ts.map +1 -0
- package/dest/server.js +5 -0
- package/package.json +109 -0
- package/src/client.ts +5 -0
- package/src/common/errors.ts +219 -0
- package/src/common/index.ts +2 -0
- package/src/common/stats/index.ts +1 -0
- package/src/common/stats/stats.ts +20 -0
- package/src/private/acvm/acvm.ts +114 -0
- package/src/private/acvm/acvm_types.ts +11 -0
- package/src/private/acvm/deserialize.ts +58 -0
- package/src/private/acvm/index.ts +4 -0
- package/src/private/acvm/serialize.ts +123 -0
- package/src/private/acvm_native.ts +200 -0
- package/src/private/acvm_wasm.ts +80 -0
- package/src/private/acvm_wasm_with_blobs.ts +55 -0
- package/src/private/circuit_simulator.ts +91 -0
- package/src/private/factory.ts +40 -0
- package/src/public/avm/testing/account_proof.json +553 -0
- package/src/public/avm/testing/account_proof_fetcher.ts +166 -0
- package/src/public/avm/testing/base_avm_simulation_tester.ts +162 -0
- package/src/public/avm/testing/utils.ts +114 -0
- package/src/public/avm_simulator.ts +29 -0
- package/src/public/avm_simulator_pool.ts +355 -0
- package/src/public/cdb_ipc_server.ts +198 -0
- package/src/public/contracts_db_checkpoint.ts +41 -0
- package/src/public/db_interfaces.ts +76 -0
- package/src/public/executor_metrics.ts +102 -0
- package/src/public/executor_metrics_interface.ts +20 -0
- package/src/public/fixtures/amm_test.ts +331 -0
- package/src/public/fixtures/bulk_test.ts +194 -0
- package/src/public/fixtures/custom_bytecode_tester.ts +83 -0
- package/src/public/fixtures/index.ts +13 -0
- package/src/public/fixtures/public_processor_test_env.ts +88 -0
- package/src/public/fixtures/public_tx_simulation_tester.ts +315 -0
- package/src/public/fixtures/simple_contract_data_source.ts +122 -0
- package/src/public/fixtures/token_test.ts +148 -0
- package/src/public/fixtures/utils.ts +269 -0
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +302 -0
- package/src/public/fuzzing/avm_simulator_bin.ts +156 -0
- package/src/public/index.ts +16 -0
- package/src/public/public_db_sources.ts +405 -0
- package/src/public/public_errors.ts +14 -0
- package/src/public/public_processor/guarded_merkle_tree.ts +161 -0
- package/src/public/public_processor/public_processor.ts +657 -0
- package/src/public/public_processor/public_processor_metrics.ts +138 -0
- package/src/public/public_tx_simulator/dumping_public_tx_simulator.ts +66 -0
- package/src/public/public_tx_simulator/factories.ts +61 -0
- package/src/public/public_tx_simulator/index.ts +8 -0
- package/src/public/public_tx_simulator/public_tx_simulator.ts +190 -0
- package/src/public/public_tx_simulator/public_tx_simulator_base.ts +37 -0
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +33 -0
- package/src/public/side_effect_errors.ts +96 -0
- package/src/public/test_executor_metrics.ts +399 -0
- package/src/public/unique_class_ids.ts +79 -0
- package/src/public/utils.ts +16 -0
- package/src/server.ts +6 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches an account proof from the Ethereum mainnet and saves it as account_proof.json.
|
|
3
|
+
* This script is not using any Aztec library code, so it's easily portable.
|
|
4
|
+
*/ import fs from 'fs';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import { createPublicClient, fromRlp, hexToBytes, http } from 'viem';
|
|
8
|
+
import { mainnet } from 'viem/chains';
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const RPC_URL = process.env.RPC_URL;
|
|
11
|
+
const ADDRESS = process.env.ADDRESS || '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
|
|
12
|
+
const BLOCK_TAG = process.env.BLOCK_NUMBER ? BigInt(process.env.BLOCK_NUMBER) : 'latest';
|
|
13
|
+
const MAX_ACCOUNT_PATH = 15;
|
|
14
|
+
function padTo(arr, len) {
|
|
15
|
+
return [
|
|
16
|
+
...arr,
|
|
17
|
+
...Array(len - arr.length).fill(0)
|
|
18
|
+
].slice(0, len);
|
|
19
|
+
}
|
|
20
|
+
function toBytes(hex) {
|
|
21
|
+
return Array.from(hexToBytes(hex));
|
|
22
|
+
}
|
|
23
|
+
function bytesToU64s(bytes) {
|
|
24
|
+
const paddedBytes = padTo(bytes, 32);
|
|
25
|
+
return Array.from({
|
|
26
|
+
length: 4
|
|
27
|
+
}, (_, i)=>{
|
|
28
|
+
let val = 0n;
|
|
29
|
+
for(let j = 0; j < 8; j++){
|
|
30
|
+
val += BigInt(paddedBytes[i * 8 + j]) << BigInt(j * 8);
|
|
31
|
+
}
|
|
32
|
+
return val.toString();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function toBytesAndLen(val) {
|
|
36
|
+
if (val === 0n || val === 0) {
|
|
37
|
+
return {
|
|
38
|
+
bytes: [
|
|
39
|
+
0
|
|
40
|
+
],
|
|
41
|
+
length: 0
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
let hex = val.toString(16);
|
|
45
|
+
if (hex.length % 2) {
|
|
46
|
+
hex = '0' + hex;
|
|
47
|
+
}
|
|
48
|
+
const bytes = toBytes(`0x${hex}`);
|
|
49
|
+
return {
|
|
50
|
+
bytes,
|
|
51
|
+
length: bytes.length
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function parseNode(rlp) {
|
|
55
|
+
// Should be safe when working with branches and extensions without embedded children.
|
|
56
|
+
const decoded = fromRlp(rlp);
|
|
57
|
+
const node = {
|
|
58
|
+
rows: Array(16).fill(0).map(()=>Array(32).fill(0)),
|
|
59
|
+
row_exist: Array(16).fill(false),
|
|
60
|
+
node_type: 0
|
|
61
|
+
};
|
|
62
|
+
if (decoded.length === 17) {
|
|
63
|
+
for(let i = 0; i < 16; i++){
|
|
64
|
+
if (decoded[i] !== '0x') {
|
|
65
|
+
node.row_exist[i] = true;
|
|
66
|
+
node.rows[i] = padTo(toBytes(decoded[i]), 32);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} else if (decoded.length === 2) {
|
|
70
|
+
const keyBytes = toBytes(decoded[0]);
|
|
71
|
+
const prefix = keyBytes[0];
|
|
72
|
+
if (prefix >> 4 >= 2) {
|
|
73
|
+
throw new Error('Unsupported: leaf node in proof path');
|
|
74
|
+
}
|
|
75
|
+
node.node_type = 1;
|
|
76
|
+
// Extension header format expected by the noir code: check out storage_proof types.nr.
|
|
77
|
+
node.rows[0][0] = prefix >> 4;
|
|
78
|
+
node.rows[0][8] = prefix & 0x0f;
|
|
79
|
+
node.rows[0][16] = keyBytes.length - 1;
|
|
80
|
+
for(let i = 1; i < keyBytes.length && i < 32; i++){
|
|
81
|
+
node.rows[1][i - 1] = keyBytes[i];
|
|
82
|
+
}
|
|
83
|
+
node.rows[2] = padTo(toBytes(decoded[1]), 32);
|
|
84
|
+
node.row_exist[0] = node.row_exist[1] = node.row_exist[2] = true;
|
|
85
|
+
}
|
|
86
|
+
return node;
|
|
87
|
+
}
|
|
88
|
+
function parseProof(proof, maxLen) {
|
|
89
|
+
const nodes = proof.slice(0, -1).slice(0, maxLen).map(parseNode);
|
|
90
|
+
while(nodes.length < maxLen){
|
|
91
|
+
nodes.push({
|
|
92
|
+
rows: Array(16).fill(0).map(()=>Array(32).fill(0)),
|
|
93
|
+
row_exist: Array(16).fill(false),
|
|
94
|
+
node_type: 0
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return nodes;
|
|
98
|
+
}
|
|
99
|
+
function nodeToLibFormat(node) {
|
|
100
|
+
return {
|
|
101
|
+
rows: node.rows.map(bytesToU64s),
|
|
102
|
+
row_exist: node.row_exist,
|
|
103
|
+
node_type: String(node.node_type)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
async function main() {
|
|
107
|
+
if (!RPC_URL) {
|
|
108
|
+
throw new Error('RPC_URL is not set');
|
|
109
|
+
}
|
|
110
|
+
console.log(`Fetching account proof for ${ADDRESS}`);
|
|
111
|
+
const client = createPublicClient({
|
|
112
|
+
chain: mainnet,
|
|
113
|
+
transport: http(RPC_URL)
|
|
114
|
+
});
|
|
115
|
+
const [blockNumber, proof, block] = await Promise.all([
|
|
116
|
+
client.getBlockNumber(),
|
|
117
|
+
client.getProof({
|
|
118
|
+
address: ADDRESS,
|
|
119
|
+
storageKeys: [],
|
|
120
|
+
blockNumber: BLOCK_TAG === 'latest' ? undefined : BLOCK_TAG
|
|
121
|
+
}),
|
|
122
|
+
client.getBlock({
|
|
123
|
+
blockNumber: BLOCK_TAG === 'latest' ? undefined : BLOCK_TAG
|
|
124
|
+
})
|
|
125
|
+
]);
|
|
126
|
+
console.log(`Block: ${blockNumber}, Account nodes: ${proof.accountProof.length}`);
|
|
127
|
+
// The -1 is because the last node in the proof is the leaf, which is excluded from path verification.
|
|
128
|
+
const accountPathLen = proof.accountProof.length - 1;
|
|
129
|
+
if (accountPathLen > MAX_ACCOUNT_PATH) {
|
|
130
|
+
throw new Error(`Account proof path length ${accountPathLen} exceeds MAX_ACCOUNT_PATH ${MAX_ACCOUNT_PATH}. Increase the limit.`);
|
|
131
|
+
}
|
|
132
|
+
const nonce = toBytesAndLen(proof.nonce);
|
|
133
|
+
const balance = toBytesAndLen(proof.balance);
|
|
134
|
+
const data = {
|
|
135
|
+
block_number: String(blockNumber),
|
|
136
|
+
node_length: String(accountPathLen),
|
|
137
|
+
root: bytesToU64s(toBytes(block.stateRoot)),
|
|
138
|
+
nodes: parseProof(proof.accountProof, MAX_ACCOUNT_PATH).map(nodeToLibFormat),
|
|
139
|
+
account: {
|
|
140
|
+
address: toBytes(ADDRESS).map(String),
|
|
141
|
+
balance: padTo(balance.bytes, 32).map(String),
|
|
142
|
+
balance_length: String(balance.length),
|
|
143
|
+
code_hash: bytesToU64s(toBytes(proof.codeHash)),
|
|
144
|
+
nonce: padTo(nonce.bytes, 8).map(String),
|
|
145
|
+
nonce_length: String(nonce.length),
|
|
146
|
+
storage_hash: bytesToU64s(toBytes(proof.storageHash))
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
fs.writeFileSync(join(__dirname, 'account_proof.json'), JSON.stringify(data, null, 2));
|
|
150
|
+
console.log('account_proof.json generated');
|
|
151
|
+
}
|
|
152
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
|
+
import type { ContractArtifact } from '@aztec-labs/stdlib/abi';
|
|
3
|
+
import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
4
|
+
import type { ContractInstanceWithAddress } from '@aztec-labs/stdlib/contract';
|
|
5
|
+
import type { MerkleTreeWriteOperations } from '@aztec-labs/stdlib/interfaces/server';
|
|
6
|
+
import type { SimpleContractDataSource } from '../../fixtures/simple_contract_data_source.js';
|
|
7
|
+
/**
|
|
8
|
+
* An abstract test class that enables tests of real apps in the AVM without requiring e2e tests.
|
|
9
|
+
* It enables this by letting us (1) perform pseudo-contract-deployments (and registrations)
|
|
10
|
+
* that trigger merkle tree operations and (2) maintain a contract data source to store
|
|
11
|
+
* and retrieve contract classes and instances.
|
|
12
|
+
*
|
|
13
|
+
* This class is meant to be extended when writing tests for a specific simulation interface.
|
|
14
|
+
* For example, has been extended for testing of the core AvmSimulator, and again for the PublicTxSimulator,
|
|
15
|
+
* both of which benefit from such pseudo-deployments by populating merkle trees and a contract data source
|
|
16
|
+
* with contract information.
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class BaseAvmSimulationTester {
|
|
19
|
+
contractDataSource: SimpleContractDataSource;
|
|
20
|
+
merkleTrees: MerkleTreeWriteOperations;
|
|
21
|
+
private initialFeePayerBalance;
|
|
22
|
+
logger: import("@aztec-labs/foundation/log").Logger;
|
|
23
|
+
constructor(contractDataSource: SimpleContractDataSource, merkleTrees: MerkleTreeWriteOperations, initialFeePayerBalance?: Fr);
|
|
24
|
+
setFeePayerBalance(feePayer: AztecAddress, balance?: Fr): Promise<void>;
|
|
25
|
+
setPublicStorage(address: AztecAddress, slot: Fr, value: Fr): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Derive the contract class and instance with some seed.
|
|
28
|
+
* Add both to the contract data source along with the contract artifact.
|
|
29
|
+
*/
|
|
30
|
+
registerAndDeployContract(constructorArgs: any[], deployer: AztecAddress, contractArtifact: ContractArtifact, skipNullifierInsertion?: boolean, seed?: number, contractClassSeed?: number, originalContractClassId?: Fr): Promise<ContractInstanceWithAddress>;
|
|
31
|
+
registerFeeJuiceContract(): Promise<ContractInstanceWithAddress>;
|
|
32
|
+
registerAuthContract(): Promise<ContractInstanceWithAddress>;
|
|
33
|
+
registerClassRegistryContract(): Promise<ContractInstanceWithAddress>;
|
|
34
|
+
registerInstanceRegistryContract(): Promise<ContractInstanceWithAddress>;
|
|
35
|
+
addContractInstance(contractInstance: ContractInstanceWithAddress, skipNullifierInsertion?: boolean): Promise<void>;
|
|
36
|
+
private insertContractAddressNullifier;
|
|
37
|
+
insertNullifier(contractThatEmitted: AztecAddress, nullifier: Fr): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZV9hdm1fc2ltdWxhdGlvbl90ZXN0ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wdWJsaWMvYXZtL3Rlc3RpbmcvYmFzZV9hdm1fc2ltdWxhdGlvbl90ZXN0ZXIudHMiXSwibmFtZ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B;IALzB,MAAM,8CAAyC;IAEtD,YACS,kBAAkB,EAAE,wBAAwB,EAC5C,WAAW,EAAE,yBAAyB,EACrC,sBAAsB,KAAmB,EAC/C;IAEE,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,KAA8B,iBAIrF;IAEK,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,iBAKhE;IAED;;;OAGG;IACG,yBAAyB,CAC7B,eAAe,EAAE,GAAG,EAAE,EACtB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,UAAQ,EAC9B,IAAI,SAAI,EACR,iBAAiB,SAAO,EACxB,uBAAuB,CAAC,EAAE,EAAE,GAC3B,OAAO,CAAC,2BAA2B,CAAC,CAgBtC;IAEK,wBAAwB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CASrE;IAEK,oBAAoB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAiBjE;IAEK,6BAA6B,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAa1E;IAEK,gCAAgC,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAa7E;IAEK,mBAAmB,CAAC,gBAAgB,EAAE,2BAA2B,EAAE,sBAAsB,UAAQ,iBAKtG;YAEa,8BAA8B;IAQtC,eAAe,CAAC,mBAAmB,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,iBAGrE;CACF"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS } from '@aztec-labs/constants';
|
|
2
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import { createLogger } from '@aztec-labs/foundation/log';
|
|
4
|
+
import { ProtocolContractAddress } from '@aztec-labs/protocol-contracts';
|
|
5
|
+
import { getCanonicalClassRegistry } from '@aztec-labs/protocol-contracts/class-registry';
|
|
6
|
+
import { computeFeePayerBalanceStorageSlot, getCanonicalFeeJuice } from '@aztec-labs/protocol-contracts/fee-juice';
|
|
7
|
+
import { getCanonicalInstanceRegistry } from '@aztec-labs/protocol-contracts/instance-registry';
|
|
8
|
+
import { getStandardAuthRegistry } from '@aztec-labs/standard-contracts/auth-registry';
|
|
9
|
+
import { PublicDataWrite } from '@aztec-labs/stdlib/avm';
|
|
10
|
+
import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
11
|
+
import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec-labs/stdlib/hash';
|
|
12
|
+
import { MerkleTreeId } from '@aztec-labs/stdlib/trees';
|
|
13
|
+
import { createContractClassAndInstance } from './utils.js';
|
|
14
|
+
/**
|
|
15
|
+
* An abstract test class that enables tests of real apps in the AVM without requiring e2e tests.
|
|
16
|
+
* It enables this by letting us (1) perform pseudo-contract-deployments (and registrations)
|
|
17
|
+
* that trigger merkle tree operations and (2) maintain a contract data source to store
|
|
18
|
+
* and retrieve contract classes and instances.
|
|
19
|
+
*
|
|
20
|
+
* This class is meant to be extended when writing tests for a specific simulation interface.
|
|
21
|
+
* For example, has been extended for testing of the core AvmSimulator, and again for the PublicTxSimulator,
|
|
22
|
+
* both of which benefit from such pseudo-deployments by populating merkle trees and a contract data source
|
|
23
|
+
* with contract information.
|
|
24
|
+
*/ export class BaseAvmSimulationTester {
|
|
25
|
+
contractDataSource;
|
|
26
|
+
merkleTrees;
|
|
27
|
+
initialFeePayerBalance;
|
|
28
|
+
logger;
|
|
29
|
+
constructor(contractDataSource, merkleTrees, initialFeePayerBalance = new Fr(10 ** 10)){
|
|
30
|
+
this.contractDataSource = contractDataSource;
|
|
31
|
+
this.merkleTrees = merkleTrees;
|
|
32
|
+
this.initialFeePayerBalance = initialFeePayerBalance;
|
|
33
|
+
this.logger = createLogger('avm-simulation-tester');
|
|
34
|
+
}
|
|
35
|
+
async setFeePayerBalance(feePayer, balance = this.initialFeePayerBalance) {
|
|
36
|
+
const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
|
|
37
|
+
const balanceSlot = await computeFeePayerBalanceStorageSlot(feePayer);
|
|
38
|
+
await this.setPublicStorage(feeJuiceAddress, balanceSlot, balance);
|
|
39
|
+
}
|
|
40
|
+
async setPublicStorage(address, slot, value) {
|
|
41
|
+
const leafSlot = await computePublicDataTreeLeafSlot(address, slot);
|
|
42
|
+
// get existing preimage
|
|
43
|
+
const publicDataWrite = new PublicDataWrite(leafSlot, value);
|
|
44
|
+
await this.merkleTrees.sequentialInsert(MerkleTreeId.PUBLIC_DATA_TREE, [
|
|
45
|
+
publicDataWrite.toBuffer()
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Derive the contract class and instance with some seed.
|
|
50
|
+
* Add both to the contract data source along with the contract artifact.
|
|
51
|
+
*/ async registerAndDeployContract(constructorArgs, deployer, contractArtifact, skipNullifierInsertion = false, seed = 0, contractClassSeed = seed, originalContractClassId) {
|
|
52
|
+
const { contractClass, contractInstance } = await createContractClassAndInstance(constructorArgs, deployer, contractArtifact, seed, contractClassSeed, originalContractClassId);
|
|
53
|
+
await this.contractDataSource.addNewContract(contractArtifact, contractClass, contractInstance);
|
|
54
|
+
if (!skipNullifierInsertion) {
|
|
55
|
+
await this.insertContractAddressNullifier(contractInstance.address);
|
|
56
|
+
}
|
|
57
|
+
return contractInstance;
|
|
58
|
+
}
|
|
59
|
+
async registerFeeJuiceContract() {
|
|
60
|
+
const feeJuice = await getCanonicalFeeJuice();
|
|
61
|
+
const feeJuiceContractClassPublic = {
|
|
62
|
+
...feeJuice.contractClass,
|
|
63
|
+
privateFunctions: [],
|
|
64
|
+
utilityFunctions: []
|
|
65
|
+
};
|
|
66
|
+
await this.contractDataSource.addNewContract(feeJuice.artifact, feeJuiceContractClassPublic, feeJuice.instance);
|
|
67
|
+
return feeJuice.instance;
|
|
68
|
+
}
|
|
69
|
+
async registerAuthContract() {
|
|
70
|
+
const authRegistry = await getStandardAuthRegistry();
|
|
71
|
+
const authRegistryContractClassPublic = {
|
|
72
|
+
...authRegistry.contractClass,
|
|
73
|
+
privateFunctions: [],
|
|
74
|
+
utilityFunctions: []
|
|
75
|
+
};
|
|
76
|
+
await this.contractDataSource.addNewContract(authRegistry.artifact, authRegistryContractClassPublic, authRegistry.instance);
|
|
77
|
+
// AuthRegistry is a standard contract (not a protocol contract), so the AVM enforces a
|
|
78
|
+
// deployment-nullifier check on every instance retrieval. Insert the nullifier here so
|
|
79
|
+
// calls to AuthRegistry don't EXCEPTIONAL_HALT during simulation.
|
|
80
|
+
await this.insertContractAddressNullifier(authRegistry.instance.address);
|
|
81
|
+
return authRegistry.instance;
|
|
82
|
+
}
|
|
83
|
+
async registerClassRegistryContract() {
|
|
84
|
+
const classRegistry = await getCanonicalClassRegistry();
|
|
85
|
+
const classRegistryContractClassPublic = {
|
|
86
|
+
...classRegistry.contractClass,
|
|
87
|
+
privateFunctions: [],
|
|
88
|
+
utilityFunctions: []
|
|
89
|
+
};
|
|
90
|
+
await this.contractDataSource.addNewContract(classRegistry.artifact, classRegistryContractClassPublic, classRegistry.instance);
|
|
91
|
+
return classRegistry.instance;
|
|
92
|
+
}
|
|
93
|
+
async registerInstanceRegistryContract() {
|
|
94
|
+
const instanceRegistry = await getCanonicalInstanceRegistry();
|
|
95
|
+
const instanceRegistryContractClassPublic = {
|
|
96
|
+
...instanceRegistry.contractClass,
|
|
97
|
+
privateFunctions: [],
|
|
98
|
+
utilityFunctions: []
|
|
99
|
+
};
|
|
100
|
+
await this.contractDataSource.addNewContract(instanceRegistry.artifact, instanceRegistryContractClassPublic, instanceRegistry.instance);
|
|
101
|
+
return instanceRegistry.instance;
|
|
102
|
+
}
|
|
103
|
+
async addContractInstance(contractInstance, skipNullifierInsertion = false) {
|
|
104
|
+
if (!skipNullifierInsertion) {
|
|
105
|
+
await this.insertContractAddressNullifier(contractInstance.address);
|
|
106
|
+
}
|
|
107
|
+
await this.contractDataSource.addContractInstance(contractInstance);
|
|
108
|
+
}
|
|
109
|
+
async insertContractAddressNullifier(contractAddress) {
|
|
110
|
+
const contractAddressNullifier = await siloNullifier(AztecAddress.fromNumberUnsafe(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS), contractAddress.toField());
|
|
111
|
+
await this.merkleTrees.sequentialInsert(MerkleTreeId.NULLIFIER_TREE, [
|
|
112
|
+
contractAddressNullifier.toBuffer()
|
|
113
|
+
]);
|
|
114
|
+
}
|
|
115
|
+
async insertNullifier(contractThatEmitted, nullifier) {
|
|
116
|
+
const siloedNullifier = await siloNullifier(contractThatEmitted, nullifier);
|
|
117
|
+
await this.merkleTrees.sequentialInsert(MerkleTreeId.NULLIFIER_TREE, [
|
|
118
|
+
siloedNullifier.toBuffer()
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import { type ContractArtifact, type FunctionAbi, type FunctionArtifact, FunctionSelector } from '@aztec-labs/stdlib/abi';
|
|
4
|
+
import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
5
|
+
import { type ContractClassPublic, type ContractInstanceWithAddress } from '@aztec-labs/stdlib/contract';
|
|
6
|
+
import type { UInt64 } from '@aztec-labs/stdlib/types';
|
|
7
|
+
export declare const PUBLIC_DISPATCH_FN_NAME = "public_dispatch";
|
|
8
|
+
export declare const DEFAULT_TIMESTAMP: UInt64;
|
|
9
|
+
export declare const DEFAULT_BLOCK_NUMBER: BlockNumber;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new object with all the same properties as the original, except for the ones in the overrides object.
|
|
12
|
+
*/
|
|
13
|
+
export declare function allSameExcept(original: any, overrides: any): any;
|
|
14
|
+
export declare function getFunctionSelector(functionName: string, contractArtifact: ContractArtifact): Promise<FunctionSelector>;
|
|
15
|
+
export declare function getContractFunctionArtifact(functionName: string, contractArtifact: ContractArtifact): FunctionArtifact | undefined;
|
|
16
|
+
export declare function getContractFunctionAbi(functionName: string, contractArtifact: ContractArtifact): FunctionAbi | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Create a contract class and instance given constructor args, artifact, etc.
|
|
19
|
+
* NOTE: This is useful for testing real-ish contract class registration and instance deployment TXs (via logs)
|
|
20
|
+
* @param constructorArgs - The constructor arguments for the contract.
|
|
21
|
+
* @param deployer - The deployer of the contract.
|
|
22
|
+
* @param contractArtifact - The contract artifact for the contract.
|
|
23
|
+
* @param seed - The seed for the contract.
|
|
24
|
+
* @param originalContractClassId - The original contract class ID (if upgraded)
|
|
25
|
+
* @returns The contract class, instance, and contract address nullifier.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createContractClassAndInstance(constructorArgs: any[], deployer: AztecAddress, contractArtifact: ContractArtifact, seed?: number, contractClassSeed?: number, originalContractClassId?: Fr): Promise<{
|
|
28
|
+
contractClass: ContractClassPublic;
|
|
29
|
+
contractInstance: ContractInstanceWithAddress;
|
|
30
|
+
contractAddressNullifier: Fr;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wdWJsaWMvYXZtL3Rlc3RpbmcvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ25FLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUN6RCxPQUFPLEVBQ0wsS0FBSyxnQkFBZ0IsRUFDckIsS0FBSyxXQUFXLEVBQ2hCLEtBQUssZ0JBQWdCLEVBQ3JCLGdCQUFnQixFQUVqQixNQUFNLHdCQUF3QixDQUFDO0FBQ2hDLE9BQU8s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AAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,GACjC,WAAW,GAAG,SAAS,CAKzB;AAED;;;;;;;;;GASG;AACH,wBAAsB,8BAA8B,CAClD,eAAe,EAAE,GAAG,EAAE,EACtB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,SAAI,EACR,iBAAiB,SAAO,EACxB,uBAAuB,CAAC,EAAE,EAAE,GAC3B,OAAO,CAAC;IACT,aAAa,EAAE,mBAAmB,CAAC;IACnC,gBAAgB,EAAE,2BAA2B,CAAC;IAC9C,wBAAwB,EAAE,EAAE,CAAC;CAC9B,CAAC,CA+BD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS } from '@aztec-labs/constants';
|
|
2
|
+
import { BlockNumber } from '@aztec-labs/foundation/branded-types';
|
|
3
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
|
+
import { FunctionSelector, getAllFunctionAbis } from '@aztec-labs/stdlib/abi';
|
|
5
|
+
import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
6
|
+
import { computeInitializationHash } from '@aztec-labs/stdlib/contract';
|
|
7
|
+
import { siloNullifier } from '@aztec-labs/stdlib/hash';
|
|
8
|
+
import { deriveKeys } from '@aztec-labs/stdlib/keys';
|
|
9
|
+
import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec-labs/stdlib/testing';
|
|
10
|
+
import { strict as assert } from 'assert';
|
|
11
|
+
import merge from 'lodash.merge';
|
|
12
|
+
export const PUBLIC_DISPATCH_FN_NAME = 'public_dispatch';
|
|
13
|
+
export const DEFAULT_TIMESTAMP = 99833n;
|
|
14
|
+
export const DEFAULT_BLOCK_NUMBER = BlockNumber(42);
|
|
15
|
+
/**
|
|
16
|
+
* Create a new object with all the same properties as the original, except for the ones in the overrides object.
|
|
17
|
+
*/ export function allSameExcept(original, overrides) {
|
|
18
|
+
return merge({}, original, overrides);
|
|
19
|
+
}
|
|
20
|
+
export function getFunctionSelector(functionName, contractArtifact) {
|
|
21
|
+
const fnArtifact = getAllFunctionAbis(contractArtifact).find((f)=>f.name === functionName);
|
|
22
|
+
assert(!!fnArtifact, `Function ${functionName} not found in ${contractArtifact.name}`);
|
|
23
|
+
const params = fnArtifact.parameters;
|
|
24
|
+
return FunctionSelector.fromNameAndParameters(fnArtifact.name, params);
|
|
25
|
+
}
|
|
26
|
+
export function getContractFunctionArtifact(functionName, contractArtifact) {
|
|
27
|
+
return contractArtifact.functions.find((f)=>f.name === functionName);
|
|
28
|
+
}
|
|
29
|
+
export function getContractFunctionAbi(functionName, contractArtifact) {
|
|
30
|
+
return contractArtifact.functions.find((f)=>f.name === functionName) ?? contractArtifact.nonDispatchPublicFunctions.find((f)=>f.name === functionName);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a contract class and instance given constructor args, artifact, etc.
|
|
34
|
+
* NOTE: This is useful for testing real-ish contract class registration and instance deployment TXs (via logs)
|
|
35
|
+
* @param constructorArgs - The constructor arguments for the contract.
|
|
36
|
+
* @param deployer - The deployer of the contract.
|
|
37
|
+
* @param contractArtifact - The contract artifact for the contract.
|
|
38
|
+
* @param seed - The seed for the contract.
|
|
39
|
+
* @param originalContractClassId - The original contract class ID (if upgraded)
|
|
40
|
+
* @returns The contract class, instance, and contract address nullifier.
|
|
41
|
+
*/ export async function createContractClassAndInstance(constructorArgs, deployer, contractArtifact, seed = 0, contractClassSeed = seed, originalContractClassId) {
|
|
42
|
+
const bytecode = getContractFunctionArtifact(PUBLIC_DISPATCH_FN_NAME, contractArtifact).bytecode;
|
|
43
|
+
const contractClass = await makeContractClassPublic(contractClassSeed, bytecode);
|
|
44
|
+
const constructorAbi = getContractFunctionAbi('constructor', contractArtifact);
|
|
45
|
+
const { publicKeys } = await deriveKeys(new Fr(seed));
|
|
46
|
+
const initializationHash = await computeInitializationHash(constructorAbi, constructorArgs);
|
|
47
|
+
const immutablesHash = new Fr(seed + 1);
|
|
48
|
+
const contractInstance = originalContractClassId === undefined ? await makeContractInstanceFromClassId(contractClass.id, seed, {
|
|
49
|
+
deployer,
|
|
50
|
+
initializationHash,
|
|
51
|
+
immutablesHash,
|
|
52
|
+
publicKeys
|
|
53
|
+
}) : await makeContractInstanceFromClassId(originalContractClassId, seed, {
|
|
54
|
+
deployer,
|
|
55
|
+
initializationHash,
|
|
56
|
+
currentClassId: contractClass.id,
|
|
57
|
+
immutablesHash,
|
|
58
|
+
publicKeys
|
|
59
|
+
});
|
|
60
|
+
const contractAddressNullifier = await siloNullifier(AztecAddress.fromNumberUnsafe(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS), contractInstance.address.toField());
|
|
61
|
+
return {
|
|
62
|
+
contractClass,
|
|
63
|
+
contractInstance,
|
|
64
|
+
contractAddressNullifier
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PublicContractsDB } from './public_db_sources.js';
|
|
2
|
+
/**
|
|
3
|
+
* Identifies the contract data a single simulation reads. The AVM's contract-data lookups during a
|
|
4
|
+
* `simulate` call are answered from `contractsDB`; `forkId` and `timestamp` scope those lookups to the
|
|
5
|
+
* world-state fork being simulated against. How this reaches the AVM (in-process call, IPC callback
|
|
6
|
+
* server, ...) is the implementation's concern — callers only supply the context.
|
|
7
|
+
*/
|
|
8
|
+
export interface AvmContractsDBContext {
|
|
9
|
+
contractsDB: PublicContractsDB;
|
|
10
|
+
forkId: number;
|
|
11
|
+
timestamp: bigint;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Something that can run AVM simulations, independent of how the work is dispatched (a single external
|
|
15
|
+
* process, a pool of them, or an in-process stub). Callers hold this and never see the underlying transport.
|
|
16
|
+
*/
|
|
17
|
+
export interface AvmSimulator {
|
|
18
|
+
/**
|
|
19
|
+
* Run a fast simulation and return the msgpack-encoded result. `context` supplies the contracts DB whose
|
|
20
|
+
* data the simulation reads. If `signal` aborts, the simulation stops at the next cancellation checkpoint.
|
|
21
|
+
*/
|
|
22
|
+
simulate(inputBuffer: Uint8Array, context: AvmContractsDBContext, signal?: AbortSignal): Promise<Uint8Array>;
|
|
23
|
+
/** Run a simulation collecting proving hints and return the msgpack-encoded result. */
|
|
24
|
+
simulateWithHints(inputBuffer: Uint8Array): Promise<Uint8Array>;
|
|
25
|
+
/** Release any resources held by the underlying implementation. */
|
|
26
|
+
destroy?(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZtX3NpbXVsYXRvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3B1YmxpYy9hdm1fc2ltdWxhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFaEU7Ozs7O0dBS0c7QUFDSCxNQUFNLFdBQVcscUJBQXFCO0lBQ3BDLFdBQVcsRUFBRSxpQkFBaUIsQ0FBQztJQUMvQixNQUFNLEVBQUUsTUFBTSxDQUFDO0lBQ2YsU0FBUyxFQUFFLE1BQU0sQ0FBQztDQUNuQjtBQUVEOzs7R0FHRztBQUNILE1BQU0sV0FBVyxZQUFZO0lBQzNCOzs7T0FHRztJQUNILFFBQVEsQ0FBQyxXQUFXLEVBQUUsVUFBVSxFQUFFLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLENBQUMsRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQzdHLHVGQUF1RjtJQUN2RixpQkFBaUIsQ0FBQyxXQUFXLEVBQUUsVUFBVSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUNoRSxtRUFBbUU7SUFDbkUsT0FBTyxDQUFDLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0NBQzNCIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avm_simulator.d.ts","sourceRoot":"","sources":["../../src/public/avm_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7G,uFAAuF;IACvF,iBAAiB,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAChE,mEAAmE;IACnE,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AvmContractsDBContext, AvmSimulator } from './avm_simulator.js';
|
|
2
|
+
export interface AvmSimulatorPoolOptions {
|
|
3
|
+
/** Maximum number of concurrent AVM processes. If not set, defaults to AVM_MAX_CONCURRENT_SIMULATIONS env var or 4. */
|
|
4
|
+
maxSize?: number;
|
|
5
|
+
/** Path to the bb-avm-sim binary. If omitted, the generated package resolves it. */
|
|
6
|
+
avmBinaryPath?: string;
|
|
7
|
+
/** IPC path for the shared WSDB server. */
|
|
8
|
+
wsdbIpcPath: string;
|
|
9
|
+
/** Optional logger function for AVM process output. */
|
|
10
|
+
logger?: (msg: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Flat delay between environmental spawn failures (default 1s). No backoff: sequencers live on
|
|
13
|
+
* ~6s slots, so sleeping longer than this after a failure costs whole blocks while the machine may
|
|
14
|
+
* have recovered — and a spawn attempt is cheap. Spawning never gives up on its own; the caller's
|
|
15
|
+
* deadline (abort signal) is the bound.
|
|
16
|
+
*/
|
|
17
|
+
spawnRetryIntervalMs?: number;
|
|
18
|
+
/** Process spawner override. Test hook; defaults to spawning a real bb-avm-sim via the generated AvmService. */
|
|
19
|
+
spawnProcess?: (options: AvmProcessSpawnOptions) => Promise<AvmProcessHandle>;
|
|
20
|
+
}
|
|
21
|
+
/** Options handed to the process spawner for each new pool slot. */
|
|
22
|
+
export interface AvmProcessSpawnOptions {
|
|
23
|
+
binaryPath?: string;
|
|
24
|
+
wsdbIpcPath: string;
|
|
25
|
+
cdbIpcPath: string;
|
|
26
|
+
logger?: (msg: string) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A handle to a single bb-avm-sim service: it runs serialized simulations and connects back to the
|
|
30
|
+
* shared CDB/WSDB servers for state, but is unaware of which fork's contract data it is reading — that is
|
|
31
|
+
* routed by the fork id baked into the input buffer. The underlying service owns its process lifecycle
|
|
32
|
+
* (including respawn-on-death), so a handle stays usable for the life of the pool.
|
|
33
|
+
*/
|
|
34
|
+
export interface AvmProcessHandle {
|
|
35
|
+
simulate(inputBuffer: Uint8Array, signal?: AbortSignal): Promise<Uint8Array>;
|
|
36
|
+
simulateWithHints(inputBuffer: Uint8Array): Promise<Uint8Array>;
|
|
37
|
+
destroy(): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The public-execution AVM backend: a lazily-grown pool of bb-avm-sim services plus the CDB server that
|
|
41
|
+
* answers those processes' contract-data callbacks. Callers hold this as an {@link AvmSimulator}; the pool,
|
|
42
|
+
* the CDB server, its IPC path, and fork-id routing are all hidden behind that interface. Each `simulate`
|
|
43
|
+
* registers the call's contracts DB on the CDB server for the duration of the simulation (keyed by fork id
|
|
44
|
+
* so concurrent simulations on different forks don't collide) and unregisters it once the call returns.
|
|
45
|
+
*
|
|
46
|
+
* Process lifecycle is invisible to callers, exactly as when the simulator ran in-process: a simulation
|
|
47
|
+
* either produces a result, fails on its own merits, or runs until the caller's deadline aborts it.
|
|
48
|
+
* Environmental trouble is absorbed here — spawn failures retry indefinitely on a backoff ladder (bounded
|
|
49
|
+
* only by the caller's abort signal), and a simulation whose process dies is re-issued on the respawned
|
|
50
|
+
* process. The one deliberate exception: an input that kills the process twice is treated as a failing
|
|
51
|
+
* transaction, so a simulator-crashing tx gets evicted instead of burning a process per block forever.
|
|
52
|
+
*/
|
|
53
|
+
export declare class AvmSimulatorPool implements AvmSimulator {
|
|
54
|
+
private options;
|
|
55
|
+
private slots;
|
|
56
|
+
private available;
|
|
57
|
+
private waiters;
|
|
58
|
+
private createdCount;
|
|
59
|
+
private destroyed;
|
|
60
|
+
private log;
|
|
61
|
+
private maxSize;
|
|
62
|
+
private cdbServer;
|
|
63
|
+
private readonly spawnRetryIntervalMs;
|
|
64
|
+
private readonly spawnProcess;
|
|
65
|
+
constructor(options: AvmSimulatorPoolOptions);
|
|
66
|
+
static spawn(options: AvmSimulatorPoolOptions): Promise<AvmSimulatorPool>;
|
|
67
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
68
|
+
simulate(inputBuffer: Uint8Array, context: AvmContractsDBContext, signal?: AbortSignal): Promise<Uint8Array>;
|
|
69
|
+
simulateWithHints(inputBuffer: Uint8Array): Promise<Uint8Array>;
|
|
70
|
+
/** Destroy all AVM services in the pool and close the CDB server. */
|
|
71
|
+
destroy(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Eagerly spawn up to `count` AVM processes (capped at maxSize) and leave them available, so the
|
|
74
|
+
* first simulate() doesn't pay process spawn/connect cost. Idempotent.
|
|
75
|
+
*/
|
|
76
|
+
prewarm(count?: number): Promise<void>;
|
|
77
|
+
private runOnPool;
|
|
78
|
+
private checkout;
|
|
79
|
+
/** Return an AVM service to the pool after use. */
|
|
80
|
+
private return;
|
|
81
|
+
private createSlot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