@aztec/txe 0.86.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/oracle/txe_oracle.d.ts +11 -6
- package/dest/oracle/txe_oracle.d.ts.map +1 -1
- package/dest/oracle/txe_oracle.js +209 -38
- package/dest/state_machine/archiver.d.ts +53 -0
- package/dest/state_machine/archiver.d.ts.map +1 -0
- package/dest/state_machine/archiver.js +100 -0
- package/dest/state_machine/dummy_p2p_client.d.ts +48 -0
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -0
- package/dest/state_machine/dummy_p2p_client.js +122 -0
- package/dest/state_machine/global_variable_builder.d.ts +23 -0
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -0
- package/dest/state_machine/global_variable_builder.js +29 -0
- package/dest/state_machine/index.d.ts +16 -0
- package/dest/state_machine/index.d.ts.map +1 -0
- package/dest/state_machine/index.js +48 -0
- package/dest/state_machine/synchronizer.d.ts +32 -0
- package/dest/state_machine/synchronizer.d.ts.map +1 -0
- package/dest/state_machine/synchronizer.js +58 -0
- package/dest/txe_service/txe_service.d.ts +12 -3
- package/dest/txe_service/txe_service.d.ts.map +1 -1
- package/dest/txe_service/txe_service.js +221 -37
- package/dest/util/encoding.d.ts +11 -4
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/encoding.js +38 -2
- package/package.json +18 -15
- package/src/oracle/txe_oracle.ts +387 -40
- package/src/state_machine/archiver.ts +132 -0
- package/src/state_machine/dummy_p2p_client.ts +167 -0
- package/src/state_machine/global_variable_builder.ts +55 -0
- package/src/state_machine/index.ts +71 -0
- package/src/state_machine/synchronizer.ts +87 -0
- package/src/txe_service/txe_service.ts +427 -31
- package/src/util/encoding.ts +51 -2
- package/dest/node/txe_node.d.ts +0 -320
- package/dest/node/txe_node.d.ts.map +0 -1
- package/dest/node/txe_node.js +0 -481
- package/src/node/txe_node.ts +0 -703
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ArchiverStoreHelper, KVArchiverDataStore } from '@aztec/archiver';
|
|
2
|
+
// We are extending the ArchiverDataStoreHelper here because it provides most of the endpoints needed by the
|
|
3
|
+
// node for reading from and writing to state, without needing any of the extra overhead that the Archiver itself
|
|
4
|
+
// requires (i.e. an L1 client)
|
|
5
|
+
export class TXEArchiver extends ArchiverStoreHelper {
|
|
6
|
+
constructor(db){
|
|
7
|
+
super(new KVArchiverDataStore(db, 9999));
|
|
8
|
+
}
|
|
9
|
+
async addBlocks(blocks) {
|
|
10
|
+
const opResults = await Promise.all([
|
|
11
|
+
this.store.addLogs(blocks.map((block)=>block.block)),
|
|
12
|
+
this.store.addBlocks(blocks)
|
|
13
|
+
]);
|
|
14
|
+
return opResults.every(Boolean);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Gets the number of the latest L2 block processed by the block source implementation.
|
|
18
|
+
* @returns The number of the latest L2 block processed by the block source implementation.
|
|
19
|
+
*/ getBlockNumber() {
|
|
20
|
+
return this.store.getSynchedL2BlockNumber();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets the number of the latest L2 block proven seen by the block source implementation.
|
|
24
|
+
* @returns The number of the latest L2 block proven seen by the block source implementation.
|
|
25
|
+
*/ getProvenBlockNumber() {
|
|
26
|
+
return this.store.getSynchedL2BlockNumber();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets a published l2 block. If a negative number is passed, the block returned is the most recent.
|
|
30
|
+
* @param number - The block number to return (inclusive).
|
|
31
|
+
* @returns The requested L2 block.
|
|
32
|
+
*/ async getPublishedBlock(number) {
|
|
33
|
+
// If the number provided is -ve, then return the latest block.
|
|
34
|
+
if (number < 0) {
|
|
35
|
+
number = await this.store.getSynchedL2BlockNumber();
|
|
36
|
+
}
|
|
37
|
+
if (number == 0) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const blocks = await this.store.getPublishedBlocks(number, 1);
|
|
41
|
+
return blocks.length === 0 ? undefined : blocks[0];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Gets an l2 block. If a negative number is passed, the block returned is the most recent.
|
|
45
|
+
* @param number - The block number to return (inclusive).
|
|
46
|
+
* @returns The requested L2 block.
|
|
47
|
+
*/ getBlock(number) {
|
|
48
|
+
return this.getPublishedBlock(number).then((block)=>block?.block);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gets an l2 block header.
|
|
52
|
+
* @param number - The block number to return or 'latest' for the most recent one.
|
|
53
|
+
* @returns The requested L2 block header.
|
|
54
|
+
*/ async getBlockHeader(number) {
|
|
55
|
+
if (number === 'latest') {
|
|
56
|
+
number = await this.store.getSynchedL2BlockNumber();
|
|
57
|
+
}
|
|
58
|
+
if (number === 0) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const headers = await this.store.getBlockHeaders(number, 1);
|
|
62
|
+
return headers.length === 0 ? undefined : headers[0];
|
|
63
|
+
}
|
|
64
|
+
getBlocks(from, limit, _proven) {
|
|
65
|
+
return this.getPublishedBlocks(from, limit).then((blocks)=>blocks.map((b)=>b.block));
|
|
66
|
+
}
|
|
67
|
+
getL2SlotNumber() {
|
|
68
|
+
throw new Error('TXE Archiver does not implement "getL2SlotNumber"');
|
|
69
|
+
}
|
|
70
|
+
getL2EpochNumber() {
|
|
71
|
+
throw new Error('TXE Archiver does not implement "getL2EpochNumber"');
|
|
72
|
+
}
|
|
73
|
+
getBlocksForEpoch(_epochNumber) {
|
|
74
|
+
throw new Error('TXE Archiver does not implement "getBlocksForEpoch"');
|
|
75
|
+
}
|
|
76
|
+
getBlockHeadersForEpoch(_epochNumber) {
|
|
77
|
+
throw new Error('TXE Archiver does not implement "getBlockHeadersForEpoch"');
|
|
78
|
+
}
|
|
79
|
+
isEpochComplete(_epochNumber) {
|
|
80
|
+
throw new Error('TXE Archiver does not implement "isEpochComplete"');
|
|
81
|
+
}
|
|
82
|
+
getL2Tips() {
|
|
83
|
+
throw new Error('TXE Archiver does not implement "getL2Tips"');
|
|
84
|
+
}
|
|
85
|
+
getL1Constants() {
|
|
86
|
+
throw new Error('TXE Archiver does not implement "getL2Constants"');
|
|
87
|
+
}
|
|
88
|
+
syncImmediate() {
|
|
89
|
+
throw new Error('TXE Archiver does not implement "syncImmediate"');
|
|
90
|
+
}
|
|
91
|
+
getContract(_address, _blockNumber) {
|
|
92
|
+
throw new Error('TXE Archiver does not implement "getContract"');
|
|
93
|
+
}
|
|
94
|
+
getRollupAddress() {
|
|
95
|
+
throw new Error('TXE Archiver does not implement "getRollupAddress"');
|
|
96
|
+
}
|
|
97
|
+
getRegistryAddress() {
|
|
98
|
+
throw new Error('TXE Archiver does not implement "getRegistryAddress"');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ENR, P2P, P2PConfig, P2PSyncState } from '@aztec/p2p';
|
|
2
|
+
import type { L2BlockStreamEvent, L2Tips } from '@aztec/stdlib/block';
|
|
3
|
+
import type { PeerInfo } from '@aztec/stdlib/interfaces/server';
|
|
4
|
+
import type { BlockAttestation, BlockProposal } from '@aztec/stdlib/p2p';
|
|
5
|
+
import type { Tx, TxHash } from '@aztec/stdlib/tx';
|
|
6
|
+
export declare class DummyP2P implements P2P {
|
|
7
|
+
validate(_txs: Tx[]): Promise<void>;
|
|
8
|
+
clear(): Promise<void>;
|
|
9
|
+
getPendingTxs(): Promise<Tx[]>;
|
|
10
|
+
getEncodedEnr(): Promise<string | undefined>;
|
|
11
|
+
getPeers(_includePending?: boolean): Promise<PeerInfo[]>;
|
|
12
|
+
broadcastProposal(_proposal: BlockProposal): Promise<void>;
|
|
13
|
+
registerBlockProposalHandler(_handler: (block: BlockProposal) => Promise<BlockAttestation | undefined>): void;
|
|
14
|
+
requestTxs(_txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
|
|
15
|
+
requestTxByHash(_txHash: TxHash): Promise<Tx | undefined>;
|
|
16
|
+
sendTx(_tx: Tx): Promise<void>;
|
|
17
|
+
deleteTxs(_txHashes: TxHash[]): Promise<void>;
|
|
18
|
+
getTxByHashFromPool(_txHash: TxHash): Promise<Tx | undefined>;
|
|
19
|
+
getTxByHash(_txHash: TxHash): Promise<Tx | undefined>;
|
|
20
|
+
getArchivedTxByHash(_txHash: TxHash): Promise<Tx | undefined>;
|
|
21
|
+
getTxStatus(_txHash: TxHash): Promise<'pending' | 'mined' | undefined>;
|
|
22
|
+
iteratePendingTxs(): AsyncIterableIterator<Tx>;
|
|
23
|
+
getPendingTxCount(): Promise<number>;
|
|
24
|
+
start(): Promise<void>;
|
|
25
|
+
stop(): Promise<void>;
|
|
26
|
+
isReady(): boolean;
|
|
27
|
+
getStatus(): Promise<P2PSyncState>;
|
|
28
|
+
getEnr(): ENR | undefined;
|
|
29
|
+
isP2PClient(): true;
|
|
30
|
+
getTxsByHash(_txHashes: TxHash[]): Promise<Tx[]>;
|
|
31
|
+
getAttestationsForSlot(_slot: bigint, _proposalId?: string): Promise<BlockAttestation[]>;
|
|
32
|
+
addAttestation(_attestation: BlockAttestation): Promise<void>;
|
|
33
|
+
getL2BlockHash(_number: number): Promise<string | undefined>;
|
|
34
|
+
updateP2PConfig(_config: Partial<P2PConfig>): Promise<void>;
|
|
35
|
+
getL2Tips(): Promise<L2Tips>;
|
|
36
|
+
handleBlockStreamEvent(_event: L2BlockStreamEvent): Promise<void>;
|
|
37
|
+
sync(): void;
|
|
38
|
+
requestTxsByHash(_txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
|
|
39
|
+
getTxs(_filter: 'all' | 'pending' | 'mined'): Promise<Tx[]>;
|
|
40
|
+
getTxsByHashFromPool(_txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
|
|
41
|
+
hasTxsInPool(_txHashes: TxHash[]): Promise<boolean[]>;
|
|
42
|
+
addTxs(_txs: Tx[]): Promise<void>;
|
|
43
|
+
getSyncedLatestBlockNum(): Promise<number>;
|
|
44
|
+
getSyncedProvenBlockNum(): Promise<number>;
|
|
45
|
+
getSyncedLatestSlot(): Promise<bigint>;
|
|
46
|
+
markTxsAsNonEvictable(_: TxHash[]): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=dummy_p2p_client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dummy_p2p_client.d.ts","sourceRoot":"","sources":["../../src/state_machine/dummy_p2p_client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEnD,qBAAa,QAAS,YAAW,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,aAAa,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAI9B,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI5C,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIxD,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1D,4BAA4B,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,GAAG,IAAI;IAI7G,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CA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,CAAC;IAI5D,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,IAAI;IAIJ,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;IAIlE,MAAM,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,EAAE,CAAC;IAI3D,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;IAItE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIrD,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1C,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1C,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI7C,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlD"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export class DummyP2P {
|
|
2
|
+
validate(_txs) {
|
|
3
|
+
return Promise.resolve();
|
|
4
|
+
}
|
|
5
|
+
clear() {
|
|
6
|
+
throw new Error('DummyP2P does not implement "clear".');
|
|
7
|
+
}
|
|
8
|
+
getPendingTxs() {
|
|
9
|
+
throw new Error('DummyP2P does not implement "getPendingTxs"');
|
|
10
|
+
}
|
|
11
|
+
getEncodedEnr() {
|
|
12
|
+
throw new Error('DummyP2P does not implement "getEncodedEnr"');
|
|
13
|
+
}
|
|
14
|
+
getPeers(_includePending) {
|
|
15
|
+
throw new Error('DummyP2P does not implement "getPeers"');
|
|
16
|
+
}
|
|
17
|
+
broadcastProposal(_proposal) {
|
|
18
|
+
throw new Error('DummyP2P does not implement "broadcastProposal"');
|
|
19
|
+
}
|
|
20
|
+
registerBlockProposalHandler(_handler) {
|
|
21
|
+
throw new Error('DummyP2P does not implement "registerBlockProposalHandler"');
|
|
22
|
+
}
|
|
23
|
+
requestTxs(_txHashes) {
|
|
24
|
+
throw new Error('DummyP2P does not implement "requestTxs"');
|
|
25
|
+
}
|
|
26
|
+
requestTxByHash(_txHash) {
|
|
27
|
+
throw new Error('DummyP2P does not implement "requestTxByHash"');
|
|
28
|
+
}
|
|
29
|
+
sendTx(_tx) {
|
|
30
|
+
throw new Error('DummyP2P does not implement "sendTx"');
|
|
31
|
+
}
|
|
32
|
+
deleteTxs(_txHashes) {
|
|
33
|
+
throw new Error('DummyP2P does not implement "deleteTxs"');
|
|
34
|
+
}
|
|
35
|
+
getTxByHashFromPool(_txHash) {
|
|
36
|
+
throw new Error('DummyP2P does not implement "getTxByHashFromPool"');
|
|
37
|
+
}
|
|
38
|
+
getTxByHash(_txHash) {
|
|
39
|
+
throw new Error('DummyP2P does not implement "getTxByHash"');
|
|
40
|
+
}
|
|
41
|
+
getArchivedTxByHash(_txHash) {
|
|
42
|
+
throw new Error('DummyP2P does not implement "getArchivedTxByHash"');
|
|
43
|
+
}
|
|
44
|
+
getTxStatus(_txHash) {
|
|
45
|
+
throw new Error('DummyP2P does not implement "getTxStatus"');
|
|
46
|
+
}
|
|
47
|
+
iteratePendingTxs() {
|
|
48
|
+
throw new Error('DummyP2P does not implement "iteratePendingTxs"');
|
|
49
|
+
}
|
|
50
|
+
getPendingTxCount() {
|
|
51
|
+
throw new Error('DummyP2P does not implement "getPendingTxCount"');
|
|
52
|
+
}
|
|
53
|
+
start() {
|
|
54
|
+
throw new Error('DummyP2P does not implement "start"');
|
|
55
|
+
}
|
|
56
|
+
stop() {
|
|
57
|
+
throw new Error('DummyP2P does not implement "stop"');
|
|
58
|
+
}
|
|
59
|
+
isReady() {
|
|
60
|
+
throw new Error('DummyP2P does not implement "isReady"');
|
|
61
|
+
}
|
|
62
|
+
getStatus() {
|
|
63
|
+
throw new Error('DummyP2P does not implement "getStatus"');
|
|
64
|
+
}
|
|
65
|
+
getEnr() {
|
|
66
|
+
throw new Error('DummyP2P does not implement "getEnr"');
|
|
67
|
+
}
|
|
68
|
+
isP2PClient() {
|
|
69
|
+
throw new Error('DummyP2P does not implement "isP2PClient"');
|
|
70
|
+
}
|
|
71
|
+
getTxsByHash(_txHashes) {
|
|
72
|
+
throw new Error('DummyP2P does not implement "getTxsByHash"');
|
|
73
|
+
}
|
|
74
|
+
getAttestationsForSlot(_slot, _proposalId) {
|
|
75
|
+
throw new Error('DummyP2P does not implement "getAttestationForSlot"');
|
|
76
|
+
}
|
|
77
|
+
addAttestation(_attestation) {
|
|
78
|
+
throw new Error('DummyP2P does not implement "addAttestation"');
|
|
79
|
+
}
|
|
80
|
+
getL2BlockHash(_number) {
|
|
81
|
+
throw new Error('DummyP2P does not implement "getL2BlockHash"');
|
|
82
|
+
}
|
|
83
|
+
updateP2PConfig(_config) {
|
|
84
|
+
throw new Error('DummyP2P does not implement "updateP2PConfig"');
|
|
85
|
+
}
|
|
86
|
+
getL2Tips() {
|
|
87
|
+
throw new Error('DummyP2P does not implement "getL2Tips"');
|
|
88
|
+
}
|
|
89
|
+
handleBlockStreamEvent(_event) {
|
|
90
|
+
throw new Error('DummyP2P does not implement "handleBlockStreamEvent"');
|
|
91
|
+
}
|
|
92
|
+
sync() {
|
|
93
|
+
throw new Error('DummyP2P does not implement "sync"');
|
|
94
|
+
}
|
|
95
|
+
requestTxsByHash(_txHashes) {
|
|
96
|
+
throw new Error('DummyP2P does not implement "requestTxsByHash"');
|
|
97
|
+
}
|
|
98
|
+
getTxs(_filter) {
|
|
99
|
+
throw new Error('DummyP2P does not implement "getTxs"');
|
|
100
|
+
}
|
|
101
|
+
getTxsByHashFromPool(_txHashes) {
|
|
102
|
+
throw new Error('DummyP2P does not implement "getTxsByHashFromPool"');
|
|
103
|
+
}
|
|
104
|
+
hasTxsInPool(_txHashes) {
|
|
105
|
+
throw new Error('DummyP2P does not implement "hasTxsInPool"');
|
|
106
|
+
}
|
|
107
|
+
addTxs(_txs) {
|
|
108
|
+
throw new Error('DummyP2P does not implement "addTxs"');
|
|
109
|
+
}
|
|
110
|
+
getSyncedLatestBlockNum() {
|
|
111
|
+
throw new Error('DummyP2P does not implement "getSyncedLatestBlockNum"');
|
|
112
|
+
}
|
|
113
|
+
getSyncedProvenBlockNum() {
|
|
114
|
+
throw new Error('DummyP2P does not implement "getSyncedProvenBlockNum"');
|
|
115
|
+
}
|
|
116
|
+
getSyncedLatestSlot() {
|
|
117
|
+
throw new Error('DummyP2P does not implement "getSyncedLatestSlot"');
|
|
118
|
+
}
|
|
119
|
+
markTxsAsNonEvictable(_) {
|
|
120
|
+
throw new Error('DummyP2P does not implement "markTxsAsNonEvictable".');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { GasFees } from '@aztec/stdlib/gas';
|
|
5
|
+
import { type GlobalVariableBuilder, GlobalVariables } from '@aztec/stdlib/tx';
|
|
6
|
+
export declare class TXEGlobalVariablesBuilder implements GlobalVariableBuilder {
|
|
7
|
+
private timestamp;
|
|
8
|
+
private slotNumber;
|
|
9
|
+
private version;
|
|
10
|
+
private chainId;
|
|
11
|
+
constructor();
|
|
12
|
+
getCurrentBaseFees(): Promise<GasFees>;
|
|
13
|
+
/**
|
|
14
|
+
* Simple builder of global variables that use the minimum time possible.
|
|
15
|
+
* @param blockNumber - The block number to build global variables for.
|
|
16
|
+
* @param coinbase - The address to receive block reward.
|
|
17
|
+
* @param feeRecipient - The address to receive fees.
|
|
18
|
+
* @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
|
|
19
|
+
* @returns The global variables for the given block number.
|
|
20
|
+
*/
|
|
21
|
+
buildGlobalVariables(blockNumber: Fr, coinbase: EthAddress, feeRecipient: AztecAddress, slotNumber?: bigint): Promise<GlobalVariables>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=global_variable_builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global_variable_builder.d.ts","sourceRoot":"","sources":["../../src/state_machine/global_variable_builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE/E,qBAAa,yBAA0B,YAAW,qBAAqB;IACrE,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAM;IAGxB,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAAa;;IAIrB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAI7C;;;;;;;OAOG;IACI,oBAAoB,CACzB,WAAW,EAAE,EAAE,EACf,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,EAC1B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC;CAqB5B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { GasFees } from '@aztec/stdlib/gas';
|
|
3
|
+
import { GlobalVariables } from '@aztec/stdlib/tx';
|
|
4
|
+
export class TXEGlobalVariablesBuilder {
|
|
5
|
+
timestamp = new Fr(1);
|
|
6
|
+
slotNumber = 1n;
|
|
7
|
+
// The version and chainId should match the one on txe_oracle
|
|
8
|
+
version = new Fr(1);
|
|
9
|
+
chainId = new Fr(1);
|
|
10
|
+
constructor(){}
|
|
11
|
+
getCurrentBaseFees() {
|
|
12
|
+
return Promise.resolve(new GasFees(Fr.ZERO, Fr.ZERO));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Simple builder of global variables that use the minimum time possible.
|
|
16
|
+
* @param blockNumber - The block number to build global variables for.
|
|
17
|
+
* @param coinbase - The address to receive block reward.
|
|
18
|
+
* @param feeRecipient - The address to receive fees.
|
|
19
|
+
* @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
|
|
20
|
+
* @returns The global variables for the given block number.
|
|
21
|
+
*/ buildGlobalVariables(blockNumber, coinbase, feeRecipient, slotNumber) {
|
|
22
|
+
const gasFees = new GasFees(Fr.ZERO, Fr.ZERO);
|
|
23
|
+
slotNumber ??= this.slotNumber;
|
|
24
|
+
const globalVariables = new GlobalVariables(this.chainId, this.version, blockNumber, Fr.fromString(slotNumber.toString()), this.timestamp, coinbase, feeRecipient, gasFees);
|
|
25
|
+
this.slotNumber++;
|
|
26
|
+
this.timestamp = this.timestamp.add(new Fr(1));
|
|
27
|
+
return Promise.resolve(globalVariables);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
+
import { SyncDataProvider } from '@aztec/pxe/server';
|
|
3
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
|
+
import { TXEArchiver } from './archiver.js';
|
|
6
|
+
import { TXESynchronizer } from './synchronizer.js';
|
|
7
|
+
export declare class TXEStateMachine {
|
|
8
|
+
node: AztecNode;
|
|
9
|
+
synchronizer: TXESynchronizer;
|
|
10
|
+
archiver: TXEArchiver;
|
|
11
|
+
syncDataProvider: SyncDataProvider;
|
|
12
|
+
constructor(node: AztecNode, synchronizer: TXESynchronizer, archiver: TXEArchiver, syncDataProvider: SyncDataProvider);
|
|
13
|
+
static create(db: AztecAsyncKVStore): Promise<TXEStateMachine>;
|
|
14
|
+
handleL2Block(block: L2Block): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state_machine/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,eAAe;IAEjB,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,WAAW;IACrB,gBAAgB,EAAE,gBAAgB;gBAHlC,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,eAAe,EAC7B,QAAQ,EAAE,WAAW,EACrB,gBAAgB,EAAE,gBAAgB;WAGvB,MAAM,CAAC,EAAE,EAAE,iBAAiB;IA+BnC,aAAa,CAAC,KAAK,EAAE,OAAO;CAiB1C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
+
import { TestCircuitVerifier } from '@aztec/bb-prover/test';
|
|
3
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
+
import { SyncDataProvider } from '@aztec/pxe/server';
|
|
5
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
6
|
+
import { TXEArchiver } from './archiver.js';
|
|
7
|
+
import { DummyP2P } from './dummy_p2p_client.js';
|
|
8
|
+
import { TXEGlobalVariablesBuilder } from './global_variable_builder.js';
|
|
9
|
+
import { TXESynchronizer } from './synchronizer.js';
|
|
10
|
+
export class TXEStateMachine {
|
|
11
|
+
node;
|
|
12
|
+
synchronizer;
|
|
13
|
+
archiver;
|
|
14
|
+
syncDataProvider;
|
|
15
|
+
constructor(node, synchronizer, archiver, syncDataProvider){
|
|
16
|
+
this.node = node;
|
|
17
|
+
this.synchronizer = synchronizer;
|
|
18
|
+
this.archiver = archiver;
|
|
19
|
+
this.syncDataProvider = syncDataProvider;
|
|
20
|
+
}
|
|
21
|
+
static async create(db) {
|
|
22
|
+
const archiver = new TXEArchiver(db);
|
|
23
|
+
const synchronizer = await TXESynchronizer.create();
|
|
24
|
+
const syncDataProvider = new SyncDataProvider(db);
|
|
25
|
+
const aztecNodeConfig = {};
|
|
26
|
+
const log = createLogger('txe_node');
|
|
27
|
+
const node = new AztecNodeService(aztecNodeConfig, new DummyP2P(), archiver, archiver, archiver, archiver, synchronizer, undefined, undefined, // version and chainId should match the ones in txe oracle
|
|
28
|
+
1, 1, new TXEGlobalVariablesBuilder(), getPackageVersion() ?? '', new TestCircuitVerifier(), undefined, log);
|
|
29
|
+
return new this(node, synchronizer, archiver, syncDataProvider);
|
|
30
|
+
}
|
|
31
|
+
async handleL2Block(block) {
|
|
32
|
+
await Promise.all([
|
|
33
|
+
this.synchronizer.handleL2Block(block),
|
|
34
|
+
this.archiver.addBlocks([
|
|
35
|
+
{
|
|
36
|
+
block,
|
|
37
|
+
l1: {
|
|
38
|
+
blockHash: block.header.globalVariables.blockNumber.toNumber().toString(),
|
|
39
|
+
blockNumber: block.header.globalVariables.blockNumber.toBigInt(),
|
|
40
|
+
timestamp: block.header.globalVariables.blockNumber.toBigInt()
|
|
41
|
+
},
|
|
42
|
+
signatures: []
|
|
43
|
+
}
|
|
44
|
+
]),
|
|
45
|
+
this.syncDataProvider.setHeader(block.header)
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
2
|
+
import type { MerkleTreeReadOperations, MerkleTreeWriteOperations, SnapshotDataKeys, WorldStateSynchronizer, WorldStateSynchronizerStatus } from '@aztec/stdlib/interfaces/server';
|
|
3
|
+
import { NativeWorldStateService } from '@aztec/world-state/native';
|
|
4
|
+
export declare class TXESynchronizer implements WorldStateSynchronizer {
|
|
5
|
+
nativeWorldStateService: NativeWorldStateService;
|
|
6
|
+
private blockNumber;
|
|
7
|
+
constructor(nativeWorldStateService: NativeWorldStateService);
|
|
8
|
+
static create(): Promise<TXESynchronizer>;
|
|
9
|
+
handleL2Block(block: L2Block): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Forces an immediate sync to an optionally provided minimum block number
|
|
12
|
+
* @param targetBlockNumber - The target block number that we must sync to. Will download unproven blocks if needed to reach it.
|
|
13
|
+
* @param skipThrowIfTargetNotReached - Whether to skip throwing if the target block number is not reached.
|
|
14
|
+
* @returns A promise that resolves with the block number the world state was synced to
|
|
15
|
+
*/
|
|
16
|
+
syncImmediate(_minBlockNumber?: number, _skipThrowIfTargetNotReached?: boolean): Promise<number>;
|
|
17
|
+
/** Returns an instance of MerkleTreeAdminOperations that will not include uncommitted data. */
|
|
18
|
+
getCommitted(): MerkleTreeReadOperations;
|
|
19
|
+
/** Forks the world state at the given block number, defaulting to the latest one. */
|
|
20
|
+
fork(block?: number): Promise<MerkleTreeWriteOperations>;
|
|
21
|
+
/** Gets a handle that allows reading the state as it was at the given block number. */
|
|
22
|
+
getSnapshot(blockNumber: number): MerkleTreeReadOperations;
|
|
23
|
+
/** Backups the db to the target path. */
|
|
24
|
+
backupTo(dstPath: string, compact?: boolean): Promise<Record<Exclude<SnapshotDataKeys, 'archiver'>, string>>;
|
|
25
|
+
start(): Promise<void>;
|
|
26
|
+
status(): Promise<WorldStateSynchronizerStatus>;
|
|
27
|
+
stop(): Promise<void>;
|
|
28
|
+
stopSync(): Promise<void>;
|
|
29
|
+
resumeSync(): void;
|
|
30
|
+
clear(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=synchronizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synchronizer.d.ts","sourceRoot":"","sources":["../../src/state_machine/synchronizer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,qBAAa,eAAgB,YAAW,sBAAsB;IAIzC,uBAAuB,EAAE,uBAAuB;IAFnE,OAAO,CAAC,WAAW,CAAK;gBAEL,uBAAuB,EAAE,uBAAuB;WAEtD,MAAM;IAMN,aAAa,CAAC,KAAK,EAAE,OAAO;IASzC;;;;;OAKG;IACI,aAAa,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,4BAA4B,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvG,+FAA+F;IACxF,YAAY,IAAI,wBAAwB;IAI/C,qFAAqF;IAC9E,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAI/D,uFAAuF;IAChF,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB;IAIjE,yCAAyC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IAI5G,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,MAAM,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAI/C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,UAAU,IAAI,IAAI;IAIlB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { NativeWorldStateService } from '@aztec/world-state/native';
|
|
4
|
+
export class TXESynchronizer {
|
|
5
|
+
nativeWorldStateService;
|
|
6
|
+
// This works when set to 1 as well.
|
|
7
|
+
blockNumber;
|
|
8
|
+
constructor(nativeWorldStateService){
|
|
9
|
+
this.nativeWorldStateService = nativeWorldStateService;
|
|
10
|
+
this.blockNumber = 0;
|
|
11
|
+
}
|
|
12
|
+
static async create() {
|
|
13
|
+
const nativeWorldStateService = await NativeWorldStateService.tmp();
|
|
14
|
+
return new this(nativeWorldStateService);
|
|
15
|
+
}
|
|
16
|
+
async handleL2Block(block) {
|
|
17
|
+
await this.nativeWorldStateService.handleL2BlockAndMessages(block, Array(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP).fill(0).map(Fr.zero));
|
|
18
|
+
this.blockNumber = block.header.globalVariables.blockNumber.toNumber();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Forces an immediate sync to an optionally provided minimum block number
|
|
22
|
+
* @param targetBlockNumber - The target block number that we must sync to. Will download unproven blocks if needed to reach it.
|
|
23
|
+
* @param skipThrowIfTargetNotReached - Whether to skip throwing if the target block number is not reached.
|
|
24
|
+
* @returns A promise that resolves with the block number the world state was synced to
|
|
25
|
+
*/ syncImmediate(_minBlockNumber, _skipThrowIfTargetNotReached) {
|
|
26
|
+
return Promise.resolve(this.blockNumber);
|
|
27
|
+
}
|
|
28
|
+
/** Returns an instance of MerkleTreeAdminOperations that will not include uncommitted data. */ getCommitted() {
|
|
29
|
+
return this.nativeWorldStateService.getCommitted();
|
|
30
|
+
}
|
|
31
|
+
/** Forks the world state at the given block number, defaulting to the latest one. */ fork(block) {
|
|
32
|
+
return this.nativeWorldStateService.fork(block);
|
|
33
|
+
}
|
|
34
|
+
/** Gets a handle that allows reading the state as it was at the given block number. */ getSnapshot(blockNumber) {
|
|
35
|
+
return this.nativeWorldStateService.getSnapshot(blockNumber);
|
|
36
|
+
}
|
|
37
|
+
/** Backups the db to the target path. */ backupTo(dstPath, compact) {
|
|
38
|
+
return this.nativeWorldStateService.backupTo(dstPath, compact);
|
|
39
|
+
}
|
|
40
|
+
start() {
|
|
41
|
+
throw new Error('TXE Synchronizer does not implement "start"');
|
|
42
|
+
}
|
|
43
|
+
status() {
|
|
44
|
+
throw new Error('TXE Synchronizer does not implement "status"');
|
|
45
|
+
}
|
|
46
|
+
stop() {
|
|
47
|
+
throw new Error('TXE Synchronizer does not implement "stop"');
|
|
48
|
+
}
|
|
49
|
+
stopSync() {
|
|
50
|
+
throw new Error('TXE Synchronizer does not implement "stopSync"');
|
|
51
|
+
}
|
|
52
|
+
resumeSync() {
|
|
53
|
+
throw new Error('TXE Synchronizer does not implement "resumeSync"');
|
|
54
|
+
}
|
|
55
|
+
clear() {
|
|
56
|
+
throw new Error('TXE Synchronizer does not implement "clear"');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -7,6 +7,7 @@ import { type ForeignCallArray, type ForeignCallSingle } from '../util/encoding.
|
|
|
7
7
|
export declare class TXEService {
|
|
8
8
|
private logger;
|
|
9
9
|
private typedOracle;
|
|
10
|
+
oraclesEnabled: boolean;
|
|
10
11
|
constructor(logger: Logger, typedOracle: TypedOracle);
|
|
11
12
|
static init(logger: Logger, protocolContracts: ProtocolContract[]): Promise<TXEService>;
|
|
12
13
|
getPrivateContextInputs(blockNumber: ForeignCallSingle): Promise<{
|
|
@@ -72,7 +73,7 @@ export declare class TXEService {
|
|
|
72
73
|
getPublicDataWitness(blockNumber: ForeignCallSingle, leafSlot: ForeignCallSingle): Promise<{
|
|
73
74
|
values: (string | ForeignCallArray)[];
|
|
74
75
|
}>;
|
|
75
|
-
getNotes(storageSlot: ForeignCallSingle, numSelects: ForeignCallSingle, selectByIndexes: ForeignCallArray, selectByOffsets: ForeignCallArray, selectByLengths: ForeignCallArray, selectValues: ForeignCallArray, selectComparators: ForeignCallArray, sortByIndexes: ForeignCallArray, sortByOffsets: ForeignCallArray, sortByLengths: ForeignCallArray, sortOrder: ForeignCallArray, limit: ForeignCallSingle, offset: ForeignCallSingle, status: ForeignCallSingle,
|
|
76
|
+
getNotes(storageSlot: ForeignCallSingle, numSelects: ForeignCallSingle, selectByIndexes: ForeignCallArray, selectByOffsets: ForeignCallArray, selectByLengths: ForeignCallArray, selectValues: ForeignCallArray, selectComparators: ForeignCallArray, sortByIndexes: ForeignCallArray, sortByOffsets: ForeignCallArray, sortByLengths: ForeignCallArray, sortOrder: ForeignCallArray, limit: ForeignCallSingle, offset: ForeignCallSingle, status: ForeignCallSingle, maxNotes: ForeignCallSingle, packedRetrievedNoteLength: ForeignCallSingle): Promise<{
|
|
76
77
|
values: (string | ForeignCallArray)[];
|
|
77
78
|
}>;
|
|
78
79
|
notifyCreatedNote(storageSlot: ForeignCallSingle, noteTypeId: ForeignCallSingle, note: ForeignCallArray, noteHash: ForeignCallSingle, counter: ForeignCallSingle): {
|
|
@@ -111,9 +112,9 @@ export declare class TXEService {
|
|
|
111
112
|
notifySetPublicTeardownFunctionCall(targetContractAddress: ForeignCallSingle, calldataHash: ForeignCallSingle, sideEffectCounter: ForeignCallSingle, isStaticCall: ForeignCallSingle): Promise<{
|
|
112
113
|
values: (string | ForeignCallArray)[];
|
|
113
114
|
}>;
|
|
114
|
-
notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: ForeignCallSingle): {
|
|
115
|
+
notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: ForeignCallSingle): Promise<{
|
|
115
116
|
values: (string | ForeignCallArray)[];
|
|
116
|
-
}
|
|
117
|
+
}>;
|
|
117
118
|
getChainId(): Promise<{
|
|
118
119
|
values: (string | ForeignCallArray)[];
|
|
119
120
|
}>;
|
|
@@ -222,5 +223,13 @@ export declare class TXEService {
|
|
|
222
223
|
avmOpcodeSuccessCopy(): {
|
|
223
224
|
values: (string | ForeignCallArray)[];
|
|
224
225
|
};
|
|
226
|
+
privateCallNewFlow(from: ForeignCallSingle, targetContractAddress: ForeignCallSingle, functionSelector: ForeignCallSingle, _argsLength: ForeignCallSingle, args: ForeignCallArray, argsHash: ForeignCallSingle, isStaticCall: ForeignCallSingle): Promise<{
|
|
227
|
+
values: (string | ForeignCallArray)[];
|
|
228
|
+
}>;
|
|
229
|
+
disableOracles(): void;
|
|
230
|
+
enableOracles(): void;
|
|
231
|
+
simulateUtilityFunction(targetContractAddress: ForeignCallSingle, functionSelector: ForeignCallSingle, argsHash: ForeignCallSingle): Promise<{
|
|
232
|
+
values: (string | ForeignCallArray)[];
|
|
233
|
+
}>;
|
|
225
234
|
}
|
|
226
235
|
//# sourceMappingURL=txe_service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txe_service.d.ts","sourceRoot":"","sources":["../../src/txe_service/txe_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,2BAA2B,EAAqB,MAAM,iBAAiB,CAAC;AAEtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,KAAK,gBAAgB,EAAiD,MAAM,mBAAmB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