@aztec/aztec.js 0.78.1 → 0.80.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/account_manager/deploy_account_method.d.ts +2 -2
- package/dest/account_manager/deploy_account_method.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_method.js +14 -21
- package/dest/account_manager/index.d.ts +2 -3
- package/dest/account_manager/index.d.ts.map +1 -1
- package/dest/account_manager/index.js +1 -1
- package/dest/api/abi.d.ts +1 -1
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/abi.js +1 -1
- package/dest/api/account.d.ts +1 -1
- package/dest/api/account.d.ts.map +1 -1
- package/dest/{contract/index.d.ts → api/contract.d.ts} +9 -8
- package/dest/api/contract.d.ts.map +1 -0
- package/dest/{contract/index.js → api/contract.js} +8 -7
- package/dest/api/deployment.d.ts +1 -0
- package/dest/api/deployment.d.ts.map +1 -1
- package/dest/api/deployment.js +1 -0
- package/dest/api/ethereum.d.ts +3 -0
- package/dest/api/ethereum.d.ts.map +1 -0
- package/dest/api/ethereum.js +2 -0
- package/dest/api/{interfaces/pxe.d.ts → interfaces.d.ts} +1 -1
- package/dest/api/interfaces.d.ts.map +1 -0
- package/dest/api/rpc.d.ts +3 -0
- package/dest/api/rpc.d.ts.map +1 -0
- package/dest/api/rpc.js +2 -0
- package/dest/api/testing.d.ts +6 -0
- package/dest/api/testing.d.ts.map +1 -0
- package/dest/api/testing.js +5 -0
- package/dest/api/utils.d.ts +8 -0
- package/dest/api/utils.d.ts.map +1 -0
- package/dest/api/utils.js +6 -0
- package/dest/api/wallet.d.ts +1 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +1 -1
- package/dest/contract/base_contract_interaction.d.ts +41 -3
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +39 -1
- package/dest/contract/batch_call.d.ts +25 -6
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +62 -25
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/checker.d.ts.map +1 -1
- package/dest/contract/checker.js +2 -2
- package/dest/contract/contract.d.ts +1 -1
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract_base.d.ts +1 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +2 -2
- package/dest/contract/contract_function_interaction.d.ts +8 -6
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +33 -25
- package/dest/contract/deploy_method.d.ts +6 -5
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +26 -50
- package/dest/contract/deploy_proven_tx.d.ts +1 -1
- package/dest/contract/deploy_proven_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.d.ts +1 -1
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/protocol_contracts.d.ts +1 -1
- package/dest/contract/protocol_contracts.d.ts.map +1 -1
- package/dest/contract/proven_tx.d.ts +1 -1
- package/dest/contract/proven_tx.d.ts.map +1 -1
- package/dest/contract/unsafe_contract.d.ts +1 -1
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/entrypoint/entrypoint.d.ts +4 -0
- package/dest/entrypoint/entrypoint.d.ts.map +1 -1
- package/dest/entrypoint/entrypoint.js +16 -0
- package/dest/ethereum/l1_contracts.d.ts.map +1 -0
- package/dest/{api/ethereum → ethereum}/l1_contracts.js +1 -1
- package/dest/{api/ethereum → ethereum}/portal_manager.d.ts +1 -1
- package/dest/ethereum/portal_manager.d.ts.map +1 -0
- package/dest/{api/ethereum → ethereum}/portal_manager.js +4 -1
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +1 -1
- package/dest/index.d.ts +7 -13
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +8 -14
- package/dest/test/anvil_test_watcher.d.ts.map +1 -0
- package/dest/{api/ethereum → test}/anvil_test_watcher.js +2 -2
- package/dest/{utils/aztec_cheatcodes.d.ts → test/aztec_cheat_codes.d.ts} +1 -1
- package/dest/test/aztec_cheat_codes.d.ts.map +1 -0
- package/dest/{api → test}/cheat_codes.d.ts +2 -2
- package/dest/test/cheat_codes.d.ts.map +1 -0
- package/dest/{api → test}/cheat_codes.js +2 -2
- package/dest/{api/ethereum/cheat_codes.d.ts → test/rollup_cheat_codes.d.ts} +2 -3
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -0
- package/dest/{api/ethereum/cheat_codes.js → test/rollup_cheat_codes.js} +2 -4
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +1 -1
- package/dest/utils/fee_juice.d.ts +1 -1
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/wallet/account_wallet.js +1 -1
- package/package.json +14 -13
- package/src/account_manager/deploy_account_method.ts +12 -31
- package/src/account_manager/index.ts +1 -1
- package/src/api/abi.ts +15 -0
- package/src/api/account.ts +1 -1
- package/src/{contract/index.ts → api/contract.ts} +21 -7
- package/src/api/deployment.ts +1 -0
- package/src/api/ethereum.ts +11 -0
- package/src/api/rpc.ts +2 -0
- package/src/api/testing.ts +5 -0
- package/src/{utils/index.ts → api/utils.ts} +7 -7
- package/src/api/wallet.ts +1 -7
- package/src/contract/base_contract_interaction.ts +60 -3
- package/src/contract/batch_call.ts +63 -21
- package/src/contract/checker.ts +8 -3
- package/src/contract/contract.ts +1 -1
- package/src/contract/contract_base.ts +4 -3
- package/src/contract/contract_function_interaction.ts +35 -25
- package/src/contract/deploy_method.ts +23 -37
- package/src/contract/deploy_proven_tx.ts +1 -1
- package/src/contract/deploy_sent_tx.ts +1 -1
- package/src/contract/protocol_contracts.ts +1 -1
- package/src/contract/proven_tx.ts +1 -1
- package/src/contract/unsafe_contract.ts +1 -1
- package/src/entrypoint/entrypoint.ts +21 -0
- package/src/{api/ethereum → ethereum}/l1_contracts.ts +1 -1
- package/src/{api/ethereum → ethereum}/portal_manager.ts +4 -1
- package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
- package/src/fee/public_fee_payment_method.ts +1 -1
- package/src/index.ts +7 -27
- package/src/{api/ethereum → test}/anvil_test_watcher.ts +2 -2
- package/src/{api → test}/cheat_codes.ts +2 -2
- package/src/{api/ethereum/cheat_codes.ts → test/rollup_cheat_codes.ts} +2 -4
- package/src/utils/authwit.ts +2 -1
- package/src/utils/fee_juice.ts +1 -2
- package/src/wallet/account_wallet.ts +1 -1
- package/dest/api/cheat_codes.d.ts.map +0 -1
- package/dest/api/ethereum/anvil_test_watcher.d.ts.map +0 -1
- package/dest/api/ethereum/chain_monitor.d.ts +0 -25
- package/dest/api/ethereum/chain_monitor.d.ts.map +0 -1
- package/dest/api/ethereum/chain_monitor.js +0 -74
- package/dest/api/ethereum/cheat_codes.d.ts.map +0 -1
- package/dest/api/ethereum/index.d.ts +0 -7
- package/dest/api/ethereum/index.d.ts.map +0 -1
- package/dest/api/ethereum/index.js +0 -6
- package/dest/api/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/api/ethereum/portal_manager.d.ts.map +0 -1
- package/dest/api/interfaces/pxe.d.ts.map +0 -1
- package/dest/contract/index.d.ts.map +0 -1
- package/dest/deployment/index.d.ts +0 -2
- package/dest/deployment/index.d.ts.map +0 -1
- package/dest/deployment/index.js +0 -1
- package/dest/rpc_clients/index.d.ts +0 -3
- package/dest/rpc_clients/index.d.ts.map +0 -1
- package/dest/rpc_clients/index.js +0 -2
- package/dest/utils/aztec_cheatcodes.d.ts.map +0 -1
- package/dest/utils/index.d.ts +0 -8
- package/dest/utils/index.d.ts.map +0 -1
- package/dest/utils/index.js +0 -6
- package/src/api/ethereum/chain_monitor.ts +0 -88
- package/src/api/ethereum/index.ts +0 -19
- package/src/deployment/index.ts +0 -1
- package/src/rpc_clients/index.ts +0 -2
- /package/dest/api/{interfaces/pxe.js → interfaces.js} +0 -0
- /package/dest/{api/ethereum → ethereum}/l1_contracts.d.ts +0 -0
- /package/dest/{api/ethereum → test}/anvil_test_watcher.d.ts +0 -0
- /package/dest/{utils/aztec_cheatcodes.js → test/aztec_cheat_codes.js} +0 -0
- /package/src/api/{interfaces/pxe.ts → interfaces.ts} +0 -0
- /package/src/{utils/aztec_cheatcodes.ts → test/aztec_cheat_codes.ts} +0 -0
|
@@ -5,7 +5,10 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
5
5
|
import { Fr } from '@aztec/foundation/fields';
|
|
6
6
|
import type { Logger } from '@aztec/foundation/log';
|
|
7
7
|
import type { SiblingPath } from '@aztec/foundation/trees';
|
|
8
|
-
import { FeeJuicePortalAbi
|
|
8
|
+
import { FeeJuicePortalAbi } from '@aztec/l1-artifacts/FeeJuicePortalAbi';
|
|
9
|
+
import { OutboxAbi } from '@aztec/l1-artifacts/OutboxAbi';
|
|
10
|
+
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
11
|
+
import { TokenPortalAbi } from '@aztec/l1-artifacts/TokenPortalAbi';
|
|
9
12
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
13
|
import { computeSecretHash } from '@aztec/stdlib/hash';
|
|
11
14
|
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
@@ -3,8 +3,8 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
|
3
3
|
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
4
4
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
5
5
|
|
|
6
|
-
import type { L2AmountClaim } from '../api/ethereum/portal_manager.js';
|
|
7
6
|
import { getFeeJuice } from '../contract/protocol_contracts.js';
|
|
7
|
+
import type { L2AmountClaim } from '../ethereum/portal_manager.js';
|
|
8
8
|
import type { Wallet } from '../wallet/index.js';
|
|
9
9
|
import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js';
|
|
10
10
|
|
|
@@ -99,7 +99,7 @@ export class PublicFeePaymentMethod implements FeePaymentMethod {
|
|
|
99
99
|
);
|
|
100
100
|
|
|
101
101
|
return [
|
|
102
|
-
await setPublicAuthWitInteraction.request(),
|
|
102
|
+
...(await setPublicAuthWitInteraction.request()).calls,
|
|
103
103
|
{
|
|
104
104
|
name: 'fee_entrypoint_public',
|
|
105
105
|
to: this.paymentContract,
|
package/src/index.ts
CHANGED
|
@@ -20,32 +20,12 @@
|
|
|
20
20
|
* TODO: Ultimately reimplement this mega exporter by mega exporting a granular api (then deprecate it).
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
export { ContractDeployer } from './deployment/index.js';
|
|
24
|
-
|
|
25
|
-
export { NoteSelector } from '@aztec/stdlib/abi';
|
|
26
|
-
|
|
27
|
-
export { createCompatibleClient, createPXEClient } from './rpc_clients/index.js';
|
|
28
|
-
|
|
29
|
-
export { type DeployAccountOptions } from './account_manager/index.js';
|
|
30
|
-
|
|
31
|
-
export { AccountWallet, AccountWalletWithSecretKey, SignerlessWallet } from './wallet/index.js';
|
|
32
|
-
|
|
33
|
-
export { EthAddress } from '@aztec/foundation/eth-address';
|
|
34
|
-
|
|
35
23
|
export { Fq, Fr, Point, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
36
24
|
|
|
37
25
|
export { SiblingPath } from '@aztec/foundation/trees';
|
|
38
26
|
|
|
39
27
|
export { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
40
28
|
|
|
41
|
-
export {
|
|
42
|
-
type PartialAddress,
|
|
43
|
-
type ContractClassWithId,
|
|
44
|
-
type ContractInstanceWithAddress,
|
|
45
|
-
getContractClassFromArtifact,
|
|
46
|
-
getContractInstanceFromDeployParams,
|
|
47
|
-
type NodeInfo,
|
|
48
|
-
} from '@aztec/stdlib/contract';
|
|
49
29
|
export { MerkleTreeId, merkleTreeIds } from '@aztec/stdlib/trees';
|
|
50
30
|
export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys';
|
|
51
31
|
export { computeSecretHash } from '@aztec/stdlib/hash';
|
|
@@ -57,7 +37,6 @@ export {
|
|
|
57
37
|
} from '@aztec/stdlib/keys';
|
|
58
38
|
export { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
59
39
|
export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
|
|
60
|
-
export { FunctionCall } from '@aztec/stdlib/abi';
|
|
61
40
|
export {
|
|
62
41
|
Tx,
|
|
63
42
|
TxExecutionRequest,
|
|
@@ -80,7 +59,6 @@ export { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
|
80
59
|
// TODO: These kinds of things have no place on our public api.
|
|
81
60
|
// External devs will almost certainly have their own methods of doing these things.
|
|
82
61
|
// If we want to use them in our own "aztec.js consuming code", import them from foundation as needed.
|
|
83
|
-
export { decodeFromAbi, encodeArguments, type AbiType } from '@aztec/stdlib/abi';
|
|
84
62
|
export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
85
63
|
export { sha256, Grumpkin, Schnorr } from '@aztec/foundation/crypto';
|
|
86
64
|
export { makeFetch } from '@aztec/foundation/json-rpc/client';
|
|
@@ -97,10 +75,12 @@ export { fileURLToPath } from '@aztec/foundation/url';
|
|
|
97
75
|
export * from './api/abi.js';
|
|
98
76
|
export * from './api/account.js';
|
|
99
77
|
export * from './api/addresses.js';
|
|
100
|
-
export * from './api/
|
|
101
|
-
export * from './api/ethereum
|
|
78
|
+
export * from './api/deployment.js';
|
|
79
|
+
export * from './api/ethereum.js';
|
|
80
|
+
export * from './api/eth_address.js';
|
|
102
81
|
export * from './api/fee.js';
|
|
103
82
|
export * from './api/log.js';
|
|
104
|
-
|
|
105
|
-
export * from './
|
|
106
|
-
export * from './
|
|
83
|
+
export * from './api/contract.js';
|
|
84
|
+
export * from './api/utils.js';
|
|
85
|
+
export * from './api/rpc.js';
|
|
86
|
+
export * from './api/wallet.js';
|
|
@@ -4,11 +4,11 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
4
4
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
5
5
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
6
6
|
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
7
|
-
import { RollupAbi } from '@aztec/l1-artifacts';
|
|
7
|
+
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
8
8
|
|
|
9
9
|
import { type GetContractReturnType, getAddress, getContract } from 'viem';
|
|
10
10
|
|
|
11
|
-
import { RollupCheatCodes } from './
|
|
11
|
+
import { RollupCheatCodes } from './rollup_cheat_codes.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Represents a watcher for a rollup contract.
|
|
@@ -2,8 +2,8 @@ import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
|
|
|
2
2
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
3
|
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
|
|
5
|
-
import { AztecCheatCodes } from '
|
|
6
|
-
import { RollupCheatCodes } from './
|
|
5
|
+
import { AztecCheatCodes } from './aztec_cheat_codes.js';
|
|
6
|
+
import { RollupCheatCodes } from './rollup_cheat_codes.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A class that provides utility functions for interacting with the chain.
|
|
@@ -3,13 +3,11 @@ import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
|
|
|
3
3
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
4
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
5
|
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
-
import { RollupAbi } from '@aztec/l1-artifacts';
|
|
6
|
+
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
7
7
|
|
|
8
8
|
import { type GetContractReturnType, type Hex, createPublicClient, fallback, getContract, http, keccak256 } from 'viem';
|
|
9
9
|
import { foundry } from 'viem/chains';
|
|
10
10
|
|
|
11
|
-
export { EthCheatCodes };
|
|
12
|
-
|
|
13
11
|
/** Cheat codes for the L1 rollup contract. */
|
|
14
12
|
export class RollupCheatCodes {
|
|
15
13
|
private client: ViemPublicClient;
|
|
@@ -113,7 +111,7 @@ export class RollupCheatCodes {
|
|
|
113
111
|
blockNumber = pending;
|
|
114
112
|
}
|
|
115
113
|
if (blockNumber <= proven) {
|
|
116
|
-
this.logger.
|
|
114
|
+
this.logger.debug(`Block ${blockNumber} is already proven`);
|
|
117
115
|
return;
|
|
118
116
|
}
|
|
119
117
|
|
package/src/utils/authwit.ts
CHANGED
|
@@ -58,7 +58,8 @@ export const computeAuthWitMessageHash = async (intent: IntentInnerHash | Intent
|
|
|
58
58
|
const version = metadata.version;
|
|
59
59
|
|
|
60
60
|
if ('caller' in intent) {
|
|
61
|
-
const action =
|
|
61
|
+
const action =
|
|
62
|
+
intent.action instanceof ContractFunctionInteraction ? (await intent.action.request()).calls[0] : intent.action;
|
|
62
63
|
return computeOuterAuthWitHash(
|
|
63
64
|
action.to,
|
|
64
65
|
chainId,
|
package/src/utils/fee_juice.ts
CHANGED
|
@@ -2,8 +2,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { deriveStorageSlotInMap } from '@aztec/stdlib/hash';
|
|
5
|
-
|
|
6
|
-
import type { PXE } from '../api/interfaces/pxe.js';
|
|
5
|
+
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Returns the owner's fee juice balance.
|
|
@@ -102,7 +102,7 @@ export class AccountWallet extends BaseWallet {
|
|
|
102
102
|
}> {
|
|
103
103
|
if ('caller' in intent && 'action' in intent) {
|
|
104
104
|
const action =
|
|
105
|
-
intent.action instanceof ContractFunctionInteraction ? await intent.action.request() : intent.action;
|
|
105
|
+
intent.action instanceof ContractFunctionInteraction ? (await intent.action.request()).calls[0] : intent.action;
|
|
106
106
|
return {
|
|
107
107
|
innerHash: await computeInnerAuthWitHashFromAction(intent.caller, action),
|
|
108
108
|
consumer: action.to,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../src/api/cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,qBAAa,UAAU;IAEnB,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,gCAAgC;IACzB,KAAK,EAAE,eAAe;IAC7B,uDAAuD;IAChD,MAAM,EAAE,gBAAgB;;IAL/B,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,gCAAgC;IACzB,KAAK,EAAE,eAAe;IAC7B,uDAAuD;IAChD,MAAM,EAAE,gBAAgB;WAGpB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC;IAUrE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,GAAG,gBAAgB;CAIhH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anvil_test_watcher.d.ts","sourceRoot":"","sources":["../../../src/api/ethereum/anvil_test_watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAOhE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAezB,OAAO,CAAC,UAAU;IAGlB,OAAO,CAAC,YAAY,CAAC;IAjBvB,OAAO,CAAC,SAAS,CAAkB;IAEnC,OAAO,CAAC,MAAM,CAA4D;IAC1E,OAAO,CAAC,gBAAgB,CAAmB;IAE3C,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,qBAAqB,CAAC,CAAiB;IAC/C,OAAO,CAAC,6BAA6B,CAAC,CAAiB;IAEvD,OAAO,CAAC,MAAM,CAAiD;IAE/D,OAAO,CAAC,iBAAiB,CAAQ;gBAGvB,UAAU,EAAE,aAAa,EACjC,aAAa,EAAE,UAAU,EACzB,YAAY,EAAE,gBAAgB,EACtB,YAAY,CAAC,8BAAkB;IAezC,oBAAoB,CAAC,iBAAiB,EAAE,OAAO;IAI/C,YAAY,CAAC,SAAS,EAAE,OAAO;IAIzB,KAAK;IAwBL,IAAI;IAMJ,YAAY;IAOZ,cAAc;IAoBd,gBAAgB;CAwCvB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
-
/** Utility class that polls the chain on quick intervals and logs new L1 blocks, L2 blocks, and L2 proofs. */
|
|
3
|
-
export declare class ChainMonitor {
|
|
4
|
-
private readonly rollup;
|
|
5
|
-
private logger;
|
|
6
|
-
private readonly intervalMs;
|
|
7
|
-
private readonly l1Client;
|
|
8
|
-
private handle;
|
|
9
|
-
/** Current L1 block number */
|
|
10
|
-
l1BlockNumber: number;
|
|
11
|
-
/** Current L2 block number */
|
|
12
|
-
l2BlockNumber: number;
|
|
13
|
-
/** Current L2 proven block number */
|
|
14
|
-
l2ProvenBlockNumber: number;
|
|
15
|
-
/** L1 timestamp for the current L2 block */
|
|
16
|
-
l2BlockTimestamp: bigint;
|
|
17
|
-
/** L1 timestamp for the proven L2 block */
|
|
18
|
-
l2ProvenBlockTimestamp: bigint;
|
|
19
|
-
constructor(rollup: RollupContract, logger?: import("@aztec/foundation/log").Logger, intervalMs?: number);
|
|
20
|
-
start(): this;
|
|
21
|
-
stop(): void;
|
|
22
|
-
private safeRun;
|
|
23
|
-
run(): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=chain_monitor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain_monitor.d.ts","sourceRoot":"","sources":["../../../src/api/ethereum/chain_monitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE,8GAA8G;AAC9G,qBAAa,YAAY;IAgBrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ,CAAC,UAAU;IAjB7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAe;IACxC,OAAO,CAAC,MAAM,CAA6B;IAE3C,8BAA8B;IACvB,aAAa,EAAG,MAAM,CAAC;IAC9B,8BAA8B;IACvB,aAAa,EAAG,MAAM,CAAC;IAC9B,qCAAqC;IAC9B,mBAAmB,EAAG,MAAM,CAAC;IACpC,4CAA4C;IACrC,gBAAgB,EAAG,MAAM,CAAC;IACjC,2CAA2C;IACpC,sBAAsB,EAAG,MAAM,CAAC;gBAGpB,MAAM,EAAE,cAAc,EAC/B,MAAM,yCAA8C,EAC3C,UAAU,SAAM;IAKnC,KAAK;IAQL,IAAI;IAOJ,OAAO,CAAC,OAAO;IAMT,GAAG;CAqCV"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
-
/** Utility class that polls the chain on quick intervals and logs new L1 blocks, L2 blocks, and L2 proofs. */ export class ChainMonitor {
|
|
3
|
-
rollup;
|
|
4
|
-
logger;
|
|
5
|
-
intervalMs;
|
|
6
|
-
l1Client;
|
|
7
|
-
handle;
|
|
8
|
-
/** Current L1 block number */ l1BlockNumber;
|
|
9
|
-
/** Current L2 block number */ l2BlockNumber;
|
|
10
|
-
/** Current L2 proven block number */ l2ProvenBlockNumber;
|
|
11
|
-
/** L1 timestamp for the current L2 block */ l2BlockTimestamp;
|
|
12
|
-
/** L1 timestamp for the proven L2 block */ l2ProvenBlockTimestamp;
|
|
13
|
-
constructor(rollup, logger = createLogger('aztecjs:utils:chain_monitor'), intervalMs = 200){
|
|
14
|
-
this.rollup = rollup;
|
|
15
|
-
this.logger = logger;
|
|
16
|
-
this.intervalMs = intervalMs;
|
|
17
|
-
this.l1Client = rollup.client;
|
|
18
|
-
}
|
|
19
|
-
start() {
|
|
20
|
-
if (this.handle) {
|
|
21
|
-
throw new Error('Chain monitor already started');
|
|
22
|
-
}
|
|
23
|
-
this.handle = setInterval(this.safeRun.bind(this), this.intervalMs);
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
stop() {
|
|
27
|
-
if (this.handle) {
|
|
28
|
-
clearInterval(this.handle);
|
|
29
|
-
this.handle = undefined;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
safeRun() {
|
|
33
|
-
void this.run().catch((error)=>{
|
|
34
|
-
this.logger.error('Error in chain monitor loop', error);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async run() {
|
|
38
|
-
const newL1BlockNumber = Number(await this.l1Client.getBlockNumber({
|
|
39
|
-
cacheTime: 0
|
|
40
|
-
}));
|
|
41
|
-
if (this.l1BlockNumber === newL1BlockNumber) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
this.l1BlockNumber = newL1BlockNumber;
|
|
45
|
-
const block = await this.l1Client.getBlock({
|
|
46
|
-
blockNumber: BigInt(newL1BlockNumber),
|
|
47
|
-
includeTransactions: false
|
|
48
|
-
});
|
|
49
|
-
const timestamp = block.timestamp;
|
|
50
|
-
const timestampString = new Date(Number(timestamp) * 1000).toTimeString().split(' ')[0];
|
|
51
|
-
let msg = `L1 block ${newL1BlockNumber} mined at ${timestampString}`;
|
|
52
|
-
const newL2BlockNumber = Number(await this.rollup.getBlockNumber());
|
|
53
|
-
if (this.l2BlockNumber !== newL2BlockNumber) {
|
|
54
|
-
const epochNumber = await this.rollup.getEpochNumber(BigInt(newL2BlockNumber));
|
|
55
|
-
msg += ` with new L2 block ${newL2BlockNumber} for epoch ${epochNumber}`;
|
|
56
|
-
this.l2BlockNumber = newL2BlockNumber;
|
|
57
|
-
this.l2BlockTimestamp = timestamp;
|
|
58
|
-
}
|
|
59
|
-
const newL2ProvenBlockNumber = Number(await this.rollup.getProvenBlockNumber());
|
|
60
|
-
if (this.l2ProvenBlockNumber !== newL2ProvenBlockNumber) {
|
|
61
|
-
const epochNumber = await this.rollup.getEpochNumber(BigInt(newL2ProvenBlockNumber));
|
|
62
|
-
msg += ` with proof up to L2 block ${newL2ProvenBlockNumber} for epoch ${epochNumber}`;
|
|
63
|
-
this.l2ProvenBlockNumber = newL2ProvenBlockNumber;
|
|
64
|
-
this.l2ProvenBlockTimestamp = timestamp;
|
|
65
|
-
}
|
|
66
|
-
this.logger.info(msg, {
|
|
67
|
-
l1Timestamp: timestamp,
|
|
68
|
-
l1BlockNumber: this.l1BlockNumber,
|
|
69
|
-
l2SlotNumber: await this.rollup.getSlotNumber(),
|
|
70
|
-
l2BlockNumber: this.l2BlockNumber,
|
|
71
|
-
l2ProvenBlockNumber: this.l2ProvenBlockNumber
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../../src/api/ethereum/cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,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;IAQ1G,4CAA4C;IAC/B,oBAAoB;IAQjC;;;OAGG;IACU,sBAAsB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;IAMtE;;;OAGG;IACU,qBAAqB,CAAC,QAAQ,EAAE,MAAM;CAOpD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { L1FeeJuicePortalManager, L1ToL2TokenPortalManager, L1TokenManager, L1TokenPortalManager, type L2AmountClaim, type L2AmountClaimWithRecipient, type L2Claim, generateClaimSecret, } from './portal_manager.js';
|
|
2
|
-
export { getL1ContractAddresses } from './l1_contracts.js';
|
|
3
|
-
export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js';
|
|
4
|
-
export { ChainMonitor } from './chain_monitor.js';
|
|
5
|
-
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
6
|
-
export { deployL1Contract, deployL1Contracts, type DeployL1ContractsReturnType, } from '@aztec/ethereum/deploy-l1-contracts';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/ethereum/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,OAAO,EACZ,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,2BAA2B,GACjC,MAAM,qCAAqC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { L1FeeJuicePortalManager, L1ToL2TokenPortalManager, L1TokenManager, L1TokenPortalManager, generateClaimSecret } from './portal_manager.js';
|
|
2
|
-
export { getL1ContractAddresses } from './l1_contracts.js';
|
|
3
|
-
export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js';
|
|
4
|
-
export { ChainMonitor } from './chain_monitor.js';
|
|
5
|
-
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
6
|
-
export { deployL1Contract, deployL1Contracts } from '@aztec/ethereum/deploy-l1-contracts';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/api/ethereum/l1_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAKjF,eAAO,MAAM,sBAAsB,QAAe,MAAM,KAAG,QAAQ,mBAAmB,CAerF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"portal_manager.d.ts","sourceRoot":"","sources":["../../../src/api/ethereum/portal_manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG1E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAA8C,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK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Aa,CAAC;IAmCvG;;;;;OAKG;IACU,mBAAmB,CAC9B,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,UAAQ,GACX,OAAO,CAAC,0BAA0B,CAAC;YAiCxB,WAAW;CAO1B;AAED,yGAAyG;AACzG,qBAAa,oBAAqB,SAAQ,wBAAwB;IAChE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4D;gBAGjF,aAAa,EAAE,UAAU,EACzB,YAAY,EAAE,UAAU,EACxB,aAAa,EAAE,UAAU,EACzB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,MAAM,EAAE,MAAM;IAUhB;;;;;;;OAOG;IACU,aAAa,CACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IA6BlC;;;;;;OAMG;IACI,oBAAoB,CACzB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,YAAY,EACtB,UAAU,GAAE,UAA4B,GACvC,EAAE;CAiBN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../../src/api/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployment/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
package/dest/deployment/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './contract_deployer.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rpc_clients/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_cheatcodes.d.ts","sourceRoot":"","sources":["../../src/utils/aztec_cheatcodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,qBAAa,eAAe;IAExB;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM;;IAPb;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM,yCAAsC;IAGrD;;;;;OAKG;IACI,gBAAgB,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,EAAE,CAAC;IAK3F;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzC;;;;;OAKG;IACU,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAK1E;;;;;;OAMG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAQ1G"}
|
package/dest/utils/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { generatePublicKey } from './pub_key.js';
|
|
2
|
-
export { type AztecAddressLike, type EthAddressLike, type EventSelectorLike, type FieldLike, type FunctionSelectorLike, type U128Like, type WrappedFieldLike, } from './abi_types.js';
|
|
3
|
-
export { computeAuthWitMessageHash, computeInnerAuthWitHash, computeInnerAuthWitHashFromAction, type IntentAction, type IntentInnerHash, } from './authwit.js';
|
|
4
|
-
export { waitForPXE } from './pxe.js';
|
|
5
|
-
export { waitForNode, createAztecNodeClient, type AztecNode } from './node.js';
|
|
6
|
-
export { getFeeJuiceBalance } from './fee_juice.js';
|
|
7
|
-
export { readFieldCompressedString } from './field_compressed_string.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dest/utils/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { generatePublicKey } from './pub_key.js';
|
|
2
|
-
export { computeAuthWitMessageHash, computeInnerAuthWitHash, computeInnerAuthWitHashFromAction } from './authwit.js';
|
|
3
|
-
export { waitForPXE } from './pxe.js';
|
|
4
|
-
export { waitForNode, createAztecNodeClient } from './node.js';
|
|
5
|
-
export { getFeeJuiceBalance } from './fee_juice.js';
|
|
6
|
-
export { readFieldCompressedString } from './field_compressed_string.js';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
|
|
4
|
-
import type { PublicClient } from 'viem';
|
|
5
|
-
|
|
6
|
-
/** Utility class that polls the chain on quick intervals and logs new L1 blocks, L2 blocks, and L2 proofs. */
|
|
7
|
-
export class ChainMonitor {
|
|
8
|
-
private readonly l1Client: PublicClient;
|
|
9
|
-
private handle: NodeJS.Timeout | undefined;
|
|
10
|
-
|
|
11
|
-
/** Current L1 block number */
|
|
12
|
-
public l1BlockNumber!: number;
|
|
13
|
-
/** Current L2 block number */
|
|
14
|
-
public l2BlockNumber!: number;
|
|
15
|
-
/** Current L2 proven block number */
|
|
16
|
-
public l2ProvenBlockNumber!: number;
|
|
17
|
-
/** L1 timestamp for the current L2 block */
|
|
18
|
-
public l2BlockTimestamp!: bigint;
|
|
19
|
-
/** L1 timestamp for the proven L2 block */
|
|
20
|
-
public l2ProvenBlockTimestamp!: bigint;
|
|
21
|
-
|
|
22
|
-
constructor(
|
|
23
|
-
private readonly rollup: RollupContract,
|
|
24
|
-
private logger = createLogger('aztecjs:utils:chain_monitor'),
|
|
25
|
-
private readonly intervalMs = 200,
|
|
26
|
-
) {
|
|
27
|
-
this.l1Client = rollup.client;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
start() {
|
|
31
|
-
if (this.handle) {
|
|
32
|
-
throw new Error('Chain monitor already started');
|
|
33
|
-
}
|
|
34
|
-
this.handle = setInterval(this.safeRun.bind(this), this.intervalMs);
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
stop() {
|
|
39
|
-
if (this.handle) {
|
|
40
|
-
clearInterval(this.handle!);
|
|
41
|
-
this.handle = undefined;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
private safeRun() {
|
|
46
|
-
void this.run().catch(error => {
|
|
47
|
-
this.logger.error('Error in chain monitor loop', error);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async run() {
|
|
52
|
-
const newL1BlockNumber = Number(await this.l1Client.getBlockNumber({ cacheTime: 0 }));
|
|
53
|
-
if (this.l1BlockNumber === newL1BlockNumber) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this.l1BlockNumber = newL1BlockNumber;
|
|
57
|
-
|
|
58
|
-
const block = await this.l1Client.getBlock({ blockNumber: BigInt(newL1BlockNumber), includeTransactions: false });
|
|
59
|
-
const timestamp = block.timestamp;
|
|
60
|
-
const timestampString = new Date(Number(timestamp) * 1000).toTimeString().split(' ')[0];
|
|
61
|
-
|
|
62
|
-
let msg = `L1 block ${newL1BlockNumber} mined at ${timestampString}`;
|
|
63
|
-
|
|
64
|
-
const newL2BlockNumber = Number(await this.rollup.getBlockNumber());
|
|
65
|
-
if (this.l2BlockNumber !== newL2BlockNumber) {
|
|
66
|
-
const epochNumber = await this.rollup.getEpochNumber(BigInt(newL2BlockNumber));
|
|
67
|
-
msg += ` with new L2 block ${newL2BlockNumber} for epoch ${epochNumber}`;
|
|
68
|
-
this.l2BlockNumber = newL2BlockNumber;
|
|
69
|
-
this.l2BlockTimestamp = timestamp;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const newL2ProvenBlockNumber = Number(await this.rollup.getProvenBlockNumber());
|
|
73
|
-
if (this.l2ProvenBlockNumber !== newL2ProvenBlockNumber) {
|
|
74
|
-
const epochNumber = await this.rollup.getEpochNumber(BigInt(newL2ProvenBlockNumber));
|
|
75
|
-
msg += ` with proof up to L2 block ${newL2ProvenBlockNumber} for epoch ${epochNumber}`;
|
|
76
|
-
this.l2ProvenBlockNumber = newL2ProvenBlockNumber;
|
|
77
|
-
this.l2ProvenBlockTimestamp = timestamp;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
this.logger.info(msg, {
|
|
81
|
-
l1Timestamp: timestamp,
|
|
82
|
-
l1BlockNumber: this.l1BlockNumber,
|
|
83
|
-
l2SlotNumber: await this.rollup.getSlotNumber(),
|
|
84
|
-
l2BlockNumber: this.l2BlockNumber,
|
|
85
|
-
l2ProvenBlockNumber: this.l2ProvenBlockNumber,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
L1FeeJuicePortalManager,
|
|
3
|
-
L1ToL2TokenPortalManager,
|
|
4
|
-
L1TokenManager,
|
|
5
|
-
L1TokenPortalManager,
|
|
6
|
-
type L2AmountClaim,
|
|
7
|
-
type L2AmountClaimWithRecipient,
|
|
8
|
-
type L2Claim,
|
|
9
|
-
generateClaimSecret,
|
|
10
|
-
} from './portal_manager.js';
|
|
11
|
-
export { getL1ContractAddresses } from './l1_contracts.js';
|
|
12
|
-
export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js';
|
|
13
|
-
export { ChainMonitor } from './chain_monitor.js';
|
|
14
|
-
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
15
|
-
export {
|
|
16
|
-
deployL1Contract,
|
|
17
|
-
deployL1Contracts,
|
|
18
|
-
type DeployL1ContractsReturnType,
|
|
19
|
-
} from '@aztec/ethereum/deploy-l1-contracts';
|
package/src/deployment/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './contract_deployer.js';
|
package/src/rpc_clients/index.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|