@aztec/ethereum 3.0.0-nightly.20251002 → 3.0.0-nightly.20251004
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/config.js +1 -1
- package/dest/contracts/multicall.d.ts +2 -2
- package/dest/contracts/multicall.d.ts.map +1 -1
- package/dest/contracts/rollup.d.ts +1 -1
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +2 -3
- package/dest/deploy_l1_contracts.d.ts +2 -2
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/l1_artifacts.d.ts +10 -24
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_tx_utils/config.d.ts +10 -7
- package/dest/l1_tx_utils/config.d.ts.map +1 -1
- package/dest/l1_tx_utils/config.js +12 -6
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +16 -4
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/l1_tx_utils.js +259 -129
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +2 -2
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +10 -20
- package/dest/l1_tx_utils/types.d.ts +11 -2
- package/dest/l1_tx_utils/types.d.ts.map +1 -1
- package/dest/l1_tx_utils/types.js +17 -0
- package/dest/publisher_manager.d.ts.map +1 -1
- package/dest/publisher_manager.js +16 -6
- package/dest/test/eth_cheat_codes.d.ts +18 -1
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +101 -22
- package/package.json +5 -5
- package/src/config.ts +1 -1
- package/src/contracts/multicall.ts +3 -6
- package/src/contracts/rollup.ts +3 -4
- package/src/deploy_l1_contracts.ts +2 -2
- package/src/l1_tx_utils/README.md +177 -0
- package/src/l1_tx_utils/config.ts +24 -13
- package/src/l1_tx_utils/l1_tx_utils.ts +282 -158
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +23 -19
- package/src/l1_tx_utils/types.ts +20 -2
- package/src/publisher_manager.ts +24 -5
- package/src/test/eth_cheat_codes.ts +120 -20
|
@@ -30,7 +30,7 @@ export const l1TxUtilsConfigMappings = {
|
|
|
30
30
|
env: 'L1_FIXED_PRIORITY_FEE_PER_GAS',
|
|
31
31
|
...numberConfigHelper(0)
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
maxSpeedUpAttempts: {
|
|
34
34
|
description: 'Maximum number of speed-up attempts',
|
|
35
35
|
env: 'L1_TX_MONITOR_MAX_ATTEMPTS',
|
|
36
36
|
...numberConfigHelper(3)
|
|
@@ -50,17 +50,23 @@ export const l1TxUtilsConfigMappings = {
|
|
|
50
50
|
env: 'L1_TX_MONITOR_TX_TIMEOUT_MS',
|
|
51
51
|
...numberConfigHelper(120_000)
|
|
52
52
|
},
|
|
53
|
-
txPropagationMaxQueryAttempts: {
|
|
54
|
-
description: 'How many attempts will be done to get a tx after it was sent',
|
|
55
|
-
env: 'L1_TX_PROPAGATION_MAX_QUERY_ATTEMPTS',
|
|
56
|
-
...numberConfigHelper(3)
|
|
57
|
-
},
|
|
58
53
|
cancelTxOnTimeout: {
|
|
59
54
|
description: "Whether to attempt to cancel a tx if it's not mined after txTimeoutMs",
|
|
60
55
|
env: 'L1_TX_MONITOR_CANCEL_TX_ON_TIMEOUT',
|
|
61
56
|
...booleanConfigHelper(true)
|
|
57
|
+
},
|
|
58
|
+
txCancellationFinalTimeoutMs: {
|
|
59
|
+
description: 'How long to wait for a cancellation tx after its last attempt before giving up',
|
|
60
|
+
env: 'L1_TX_MONITOR_TX_CANCELLATION_TIMEOUT_MS',
|
|
61
|
+
...numberConfigHelper(24 * 12 * 1000)
|
|
62
|
+
},
|
|
63
|
+
txUnseenConsideredDroppedMs: {
|
|
64
|
+
description: 'How long a tx nonce can be unseen in the mempool before considering it dropped',
|
|
65
|
+
env: 'L1_TX_MONITOR_TX_UNSEEN_CONSIDERED_DROPPED_MS',
|
|
66
|
+
...numberConfigHelper(6 * 12 * 1000)
|
|
62
67
|
}
|
|
63
68
|
};
|
|
69
|
+
// We abuse the fact that all mappings above have a non null default value and force-type this to Required
|
|
64
70
|
export const defaultL1TxUtilsConfig = getDefaultConfig(l1TxUtilsConfigMappings);
|
|
65
71
|
export function getL1TxUtilsConfigEnvVars() {
|
|
66
72
|
return getConfigFromMappings(l1TxUtilsConfigMappings);
|
|
@@ -5,7 +5,7 @@ import { type Abi, type BlockOverrides, type Hex, type NonceManager, type Prepar
|
|
|
5
5
|
import type { ViemClient } from '../types.js';
|
|
6
6
|
import { type L1TxUtilsConfig } from './config.js';
|
|
7
7
|
import { ReadOnlyL1TxUtils } from './readonly_l1_tx_utils.js';
|
|
8
|
-
import { type L1BlobInputs, type
|
|
8
|
+
import { type L1BlobInputs, type L1TxConfig, type L1TxRequest, type L1TxState, type SigningCallback, TxUtilsState } from './types.js';
|
|
9
9
|
export declare class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
10
10
|
client: ViemClient;
|
|
11
11
|
address: EthAddress;
|
|
@@ -28,22 +28,32 @@ export declare class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
28
28
|
* @param gasConfig - Optional gas configuration
|
|
29
29
|
* @returns The transaction hash and parameters used
|
|
30
30
|
*/
|
|
31
|
-
sendTransaction(request: L1TxRequest, gasConfigOverrides?:
|
|
31
|
+
sendTransaction(request: L1TxRequest, gasConfigOverrides?: L1TxConfig, blobInputs?: L1BlobInputs, stateChange?: TxUtilsState): Promise<{
|
|
32
32
|
txHash: Hex;
|
|
33
33
|
state: L1TxState;
|
|
34
34
|
}>;
|
|
35
35
|
private tryGetTxReceipt;
|
|
36
|
+
/**
|
|
37
|
+
* Returns whether a given tx should be considered as timed out and no longer monitored.
|
|
38
|
+
* Relies on the txTimeout setting for user txs, and on the txCancellationTimeout for cancel txs.
|
|
39
|
+
* @remarks We check against the latestBlockTimestamp as opposed to the current time to avoid a race condition where
|
|
40
|
+
* the tx is mined in a block with the same timestamp as txTimeoutAt, but our execution node has not yet processed it,
|
|
41
|
+
* or the loop here has not yet checked the tx before that timeout.
|
|
42
|
+
*/
|
|
43
|
+
private isTxTimedOut;
|
|
36
44
|
/**
|
|
37
45
|
* Monitors a transaction until completion, handling speed-ups if needed
|
|
38
46
|
*/
|
|
39
47
|
protected monitorTransaction(state: L1TxState): Promise<TransactionReceipt>;
|
|
48
|
+
/** Returns when all monitor loops have stopped. */
|
|
49
|
+
waitMonitoringStopped(timeoutSeconds?: number): Promise<void>;
|
|
40
50
|
/**
|
|
41
51
|
* Sends a transaction and monitors it until completion
|
|
42
52
|
* @param request - The transaction request (to, data, value)
|
|
43
53
|
* @param gasConfig - Optional gas configuration
|
|
44
54
|
* @returns The receipt of the successful transaction
|
|
45
55
|
*/
|
|
46
|
-
sendAndMonitorTransaction(request: L1TxRequest, gasConfig?:
|
|
56
|
+
sendAndMonitorTransaction(request: L1TxRequest, gasConfig?: L1TxConfig, blobInputs?: L1BlobInputs): Promise<{
|
|
47
57
|
receipt: TransactionReceipt;
|
|
48
58
|
state: L1TxState;
|
|
49
59
|
}>;
|
|
@@ -59,9 +69,11 @@ export declare class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
59
69
|
}>;
|
|
60
70
|
/**
|
|
61
71
|
* Attempts to cancel a transaction by sending a 0-value tx to self with same nonce but higher gas prices
|
|
72
|
+
* Only sends the cancellation if the original tx is still pending, not if it was dropped
|
|
62
73
|
* @returns The hash of the cancellation transaction
|
|
63
74
|
*/
|
|
64
|
-
protected attemptTxCancellation(state: L1TxState
|
|
75
|
+
protected attemptTxCancellation(state: L1TxState): Promise<void>;
|
|
76
|
+
private getL1Timestamp;
|
|
65
77
|
/** Makes empty blob inputs for the cancellation tx. To be overridden in L1TxUtilsWithBlobs. */
|
|
66
78
|
protected makeEmptyBlobInputs(_maxFeePerBlobGas: bigint): Required<L1BlobInputs>;
|
|
67
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l1_tx_utils.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/l1_tx_utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,OAAO,EACL,KAAK,GAAG,EACR,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"l1_tx_utils.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/l1_tx_utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,OAAO,EACL,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,gCAAgC,EACrC,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAKxB,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,aAAa,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EAEpB,YAAY,EAEb,MAAM,YAAY,CAAC;AAIpB,qBAAa,SAAU,SAAQ,iBAAiB;IAK5B,MAAM,EAAE,UAAU;IAC3B,OAAO,EAAE,UAAU;IAC1B,SAAS,CAAC,MAAM,EAAE,eAAe;cACd,MAAM,EAAE,MAAM;IAPnC,SAAS,CAAC,YAAY,EAAE,YAAY,CA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