@aztec/ethereum 3.0.0-canary.a9708bd → 3.0.0-devnet.3
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/client.d.ts +1 -1
- package/dest/client.d.ts.map +1 -1
- package/dest/config.d.ts +11 -6
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +124 -64
- package/dest/contracts/empire_base.d.ts +1 -1
- package/dest/contracts/empire_base.d.ts.map +1 -1
- package/dest/contracts/empire_slashing_proposer.d.ts +2 -2
- package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/empire_slashing_proposer.js +1 -1
- package/dest/contracts/fee_asset_handler.d.ts +3 -3
- package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
- package/dest/contracts/governance.js +7 -3
- package/dest/contracts/governance_proposer.d.ts +1 -2
- package/dest/contracts/governance_proposer.d.ts.map +1 -1
- package/dest/contracts/governance_proposer.js +1 -2
- package/dest/contracts/multicall.d.ts +3 -5
- package/dest/contracts/multicall.d.ts.map +1 -1
- package/dest/contracts/multicall.js +6 -4
- package/dest/contracts/rollup.d.ts +39 -19
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +84 -88
- package/dest/contracts/slasher_contract.d.ts +10 -0
- package/dest/contracts/slasher_contract.d.ts.map +1 -1
- package/dest/contracts/slasher_contract.js +18 -0
- package/dest/contracts/tally_slashing_proposer.d.ts +22 -3
- package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/tally_slashing_proposer.js +55 -5
- package/dest/deploy_l1_contracts.d.ts +22 -7
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_l1_contracts.js +555 -362
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/l1_artifacts.d.ts +8729 -6014
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_artifacts.js +10 -5
- package/dest/l1_contract_addresses.d.ts +5 -1
- package/dest/l1_contract_addresses.d.ts.map +1 -1
- package/dest/l1_contract_addresses.js +16 -26
- package/dest/l1_reader.d.ts +1 -1
- package/dest/l1_reader.d.ts.map +1 -1
- package/dest/l1_reader.js +8 -8
- package/dest/l1_tx_utils/config.d.ts +59 -0
- package/dest/l1_tx_utils/config.d.ts.map +1 -0
- package/dest/l1_tx_utils/config.js +73 -0
- package/dest/l1_tx_utils/constants.d.ts +6 -0
- package/dest/l1_tx_utils/constants.d.ts.map +1 -0
- package/dest/l1_tx_utils/constants.js +14 -0
- package/dest/l1_tx_utils/factory.d.ts +24 -0
- package/dest/l1_tx_utils/factory.d.ts.map +1 -0
- package/dest/l1_tx_utils/factory.js +12 -0
- package/dest/l1_tx_utils/index.d.ts +10 -0
- package/dest/l1_tx_utils/index.d.ts.map +1 -0
- package/dest/l1_tx_utils/index.js +10 -0
- package/dest/l1_tx_utils/interfaces.d.ts +76 -0
- package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
- package/dest/l1_tx_utils/interfaces.js +4 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +95 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_tx_utils.js +610 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +26 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +26 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +81 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +294 -0
- package/dest/l1_tx_utils/signer.d.ts +4 -0
- package/dest/l1_tx_utils/signer.d.ts.map +1 -0
- package/dest/l1_tx_utils/signer.js +16 -0
- package/dest/l1_tx_utils/types.d.ts +67 -0
- package/dest/l1_tx_utils/types.d.ts.map +1 -0
- package/dest/l1_tx_utils/types.js +26 -0
- package/dest/l1_tx_utils/utils.d.ts +4 -0
- package/dest/l1_tx_utils/utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/utils.js +14 -0
- package/dest/publisher_manager.d.ts +7 -2
- package/dest/publisher_manager.d.ts.map +1 -1
- package/dest/publisher_manager.js +36 -8
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +11 -12
- package/dest/test/chain_monitor.d.ts +11 -0
- package/dest/test/chain_monitor.d.ts.map +1 -1
- package/dest/test/chain_monitor.js +81 -12
- package/dest/test/delayed_tx_utils.d.ts +2 -2
- package/dest/test/delayed_tx_utils.d.ts.map +1 -1
- package/dest/test/delayed_tx_utils.js +2 -2
- package/dest/test/eth_cheat_codes.d.ts +32 -6
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +115 -28
- package/dest/test/rollup_cheat_codes.d.ts +11 -9
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +38 -6
- package/dest/test/upgrade_utils.d.ts.map +1 -1
- package/dest/test/upgrade_utils.js +3 -2
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +10 -161
- package/dest/zkPassportVerifierAddress.js +1 -1
- package/package.json +7 -7
- package/src/client.ts +1 -1
- package/src/config.ts +136 -68
- package/src/contracts/empire_base.ts +1 -1
- package/src/contracts/empire_slashing_proposer.ts +7 -3
- package/src/contracts/fee_asset_handler.ts +1 -1
- package/src/contracts/governance.ts +3 -3
- package/src/contracts/governance_proposer.ts +3 -4
- package/src/contracts/multicall.ts +12 -10
- package/src/contracts/rollup.ts +104 -106
- package/src/contracts/slasher_contract.ts +22 -0
- package/src/contracts/tally_slashing_proposer.ts +54 -6
- package/src/deploy_l1_contracts.ts +570 -328
- package/src/index.ts +1 -1
- package/src/l1_artifacts.ts +14 -6
- package/src/l1_contract_addresses.ts +17 -26
- package/src/l1_reader.ts +9 -9
- package/src/l1_tx_utils/README.md +177 -0
- package/src/l1_tx_utils/config.ts +140 -0
- package/src/l1_tx_utils/constants.ts +18 -0
- package/src/l1_tx_utils/factory.ts +64 -0
- package/src/l1_tx_utils/index.ts +12 -0
- package/src/l1_tx_utils/interfaces.ts +86 -0
- package/src/l1_tx_utils/l1_tx_utils.ts +718 -0
- package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +77 -0
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +372 -0
- package/src/l1_tx_utils/signer.ts +28 -0
- package/src/l1_tx_utils/types.ts +85 -0
- package/src/l1_tx_utils/utils.ts +16 -0
- package/src/publisher_manager.ts +51 -9
- package/src/queries.ts +13 -8
- package/src/test/chain_monitor.ts +89 -9
- package/src/test/delayed_tx_utils.ts +2 -2
- package/src/test/eth_cheat_codes.ts +142 -29
- package/src/test/rollup_cheat_codes.ts +54 -14
- package/src/test/upgrade_utils.ts +3 -2
- package/src/utils.ts +13 -185
- package/src/zkPassportVerifierAddress.ts +1 -1
- package/dest/l1_tx_utils.d.ts +0 -250
- package/dest/l1_tx_utils.d.ts.map +0 -1
- package/dest/l1_tx_utils.js +0 -826
- package/dest/l1_tx_utils_with_blobs.d.ts +0 -19
- package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
- package/dest/l1_tx_utils_with_blobs.js +0 -85
- package/src/l1_tx_utils.ts +0 -1105
- package/src/l1_tx_utils_with_blobs.ts +0 -144
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { Blob } from '@aztec/blob-lib';
|
|
2
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
4
|
-
import { DateProvider } from '@aztec/foundation/timer';
|
|
5
|
-
|
|
6
|
-
import { type Hex, type TransactionSerializable, formatGwei } from 'viem';
|
|
7
|
-
|
|
8
|
-
import type { EthSigner } from './eth-signer/eth-signer.js';
|
|
9
|
-
import {
|
|
10
|
-
type GasPrice,
|
|
11
|
-
L1TxUtils,
|
|
12
|
-
type L1TxUtilsConfig,
|
|
13
|
-
type SigningCallback,
|
|
14
|
-
createViemSigner,
|
|
15
|
-
} from './l1_tx_utils.js';
|
|
16
|
-
import type { ExtendedViemWalletClient, ViemClient } from './types.js';
|
|
17
|
-
|
|
18
|
-
export class L1TxUtilsWithBlobs extends L1TxUtils {
|
|
19
|
-
/**
|
|
20
|
-
* Attempts to cancel a transaction by sending a 0-value tx to self with same nonce but higher gas prices
|
|
21
|
-
* @param nonce - The nonce of the transaction to cancel
|
|
22
|
-
* @param previousGasPrice - The gas price of the previous transaction
|
|
23
|
-
* @param attempts - The number of attempts to cancel the transaction
|
|
24
|
-
* @returns The hash of the cancellation transaction
|
|
25
|
-
*/
|
|
26
|
-
override async attemptTxCancellation(
|
|
27
|
-
currentTxHash: Hex,
|
|
28
|
-
nonce: number,
|
|
29
|
-
isBlobTx = false,
|
|
30
|
-
previousGasPrice?: GasPrice,
|
|
31
|
-
attempts = 0,
|
|
32
|
-
) {
|
|
33
|
-
// Get gas price with higher priority fee for cancellation
|
|
34
|
-
const cancelGasPrice = await this.getGasPrice(
|
|
35
|
-
{
|
|
36
|
-
...this.config,
|
|
37
|
-
// Use high bump for cancellation to ensure it replaces the original tx
|
|
38
|
-
priorityFeeRetryBumpPercentage: 150, // 150% bump should be enough to replace any tx
|
|
39
|
-
},
|
|
40
|
-
isBlobTx,
|
|
41
|
-
attempts + 1,
|
|
42
|
-
previousGasPrice,
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
this.logger?.debug(`Attempting to cancel blob L1 transaction ${currentTxHash} with nonce ${nonce}`, {
|
|
46
|
-
maxFeePerGas: formatGwei(cancelGasPrice.maxFeePerGas),
|
|
47
|
-
maxPriorityFeePerGas: formatGwei(cancelGasPrice.maxPriorityFeePerGas),
|
|
48
|
-
maxFeePerBlobGas:
|
|
49
|
-
cancelGasPrice.maxFeePerBlobGas === undefined ? undefined : formatGwei(cancelGasPrice.maxFeePerBlobGas),
|
|
50
|
-
});
|
|
51
|
-
const request = {
|
|
52
|
-
to: this.getSenderAddress().toString(),
|
|
53
|
-
value: 0n,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// Send 0-value tx to self with higher gas price
|
|
57
|
-
if (!isBlobTx) {
|
|
58
|
-
const txData = {
|
|
59
|
-
...request,
|
|
60
|
-
nonce,
|
|
61
|
-
gas: 21_000n, // Standard ETH transfer gas
|
|
62
|
-
maxFeePerGas: cancelGasPrice.maxFeePerGas,
|
|
63
|
-
maxPriorityFeePerGas: cancelGasPrice.maxPriorityFeePerGas,
|
|
64
|
-
};
|
|
65
|
-
const signedRequest = await this.prepareSignedTransaction(txData);
|
|
66
|
-
const cancelTxHash = await this.client.sendRawTransaction({ serializedTransaction: signedRequest });
|
|
67
|
-
|
|
68
|
-
const receipt = await this.monitorTransaction(
|
|
69
|
-
request,
|
|
70
|
-
cancelTxHash,
|
|
71
|
-
{ gasLimit: 21_000n },
|
|
72
|
-
undefined,
|
|
73
|
-
undefined,
|
|
74
|
-
true,
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
return receipt.transactionHash;
|
|
78
|
-
} else {
|
|
79
|
-
const blobData = new Uint8Array(131072).fill(0);
|
|
80
|
-
const kzg = Blob.getViemKzgInstance();
|
|
81
|
-
const blobInputs = {
|
|
82
|
-
blobs: [blobData],
|
|
83
|
-
kzg,
|
|
84
|
-
maxFeePerBlobGas: cancelGasPrice.maxFeePerBlobGas!,
|
|
85
|
-
};
|
|
86
|
-
const txData = {
|
|
87
|
-
...request,
|
|
88
|
-
...blobInputs,
|
|
89
|
-
nonce,
|
|
90
|
-
gas: 21_000n,
|
|
91
|
-
maxFeePerGas: cancelGasPrice.maxFeePerGas,
|
|
92
|
-
maxPriorityFeePerGas: cancelGasPrice.maxPriorityFeePerGas,
|
|
93
|
-
};
|
|
94
|
-
const signedRequest = await this.prepareSignedTransaction(txData);
|
|
95
|
-
const cancelTxHash = await this.client.sendRawTransaction({ serializedTransaction: signedRequest });
|
|
96
|
-
|
|
97
|
-
this.logger?.debug(`Sent cancellation tx ${cancelTxHash} for timed out tx ${currentTxHash}`);
|
|
98
|
-
|
|
99
|
-
const receipt = await this.monitorTransaction(
|
|
100
|
-
request,
|
|
101
|
-
cancelTxHash,
|
|
102
|
-
{ gasLimit: 21_000n },
|
|
103
|
-
undefined,
|
|
104
|
-
blobInputs,
|
|
105
|
-
true,
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
return receipt.transactionHash;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function createL1TxUtilsWithBlobsFromViemWallet(
|
|
114
|
-
client: ExtendedViemWalletClient,
|
|
115
|
-
logger: Logger = createLogger('L1TxUtils'),
|
|
116
|
-
dateProvider: DateProvider = new DateProvider(),
|
|
117
|
-
config?: Partial<L1TxUtilsConfig>,
|
|
118
|
-
debugMaxGasLimit: boolean = false,
|
|
119
|
-
) {
|
|
120
|
-
return new L1TxUtilsWithBlobs(
|
|
121
|
-
client,
|
|
122
|
-
EthAddress.fromString(client.account.address),
|
|
123
|
-
createViemSigner(client),
|
|
124
|
-
logger,
|
|
125
|
-
dateProvider,
|
|
126
|
-
config,
|
|
127
|
-
debugMaxGasLimit,
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export function createL1TxUtilsWithBlobsFromEthSigner(
|
|
132
|
-
client: ViemClient,
|
|
133
|
-
signer: EthSigner,
|
|
134
|
-
logger: Logger = createLogger('L1TxUtils'),
|
|
135
|
-
dateProvider: DateProvider = new DateProvider(),
|
|
136
|
-
config?: Partial<L1TxUtilsConfig>,
|
|
137
|
-
debugMaxGasLimit: boolean = false,
|
|
138
|
-
) {
|
|
139
|
-
const callback: SigningCallback = async (transaction: TransactionSerializable, _signingAddress) => {
|
|
140
|
-
return (await signer.signTransaction(transaction)).toViemTransactionSignature();
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
return new L1TxUtilsWithBlobs(client, signer.address, callback, logger, dateProvider, config, debugMaxGasLimit);
|
|
144
|
-
}
|