@aztec-labs/ethereum 6.0.0-rc.3 → 6.0.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/blob_tx.d.ts +24 -0
- package/dest/blob_tx.d.ts.map +1 -0
- package/dest/blob_tx.js +94 -0
- package/dest/bn254/hash_to_point.d.ts +32 -0
- package/dest/bn254/hash_to_point.d.ts.map +1 -0
- package/dest/bn254/hash_to_point.js +80 -0
- package/dest/bn254/index.d.ts +3 -0
- package/dest/bn254/index.d.ts.map +1 -0
- package/dest/bn254/index.js +2 -0
- package/dest/bn254/proof_of_possession_gas.d.ts +29 -0
- package/dest/bn254/proof_of_possession_gas.d.ts.map +1 -0
- package/dest/bn254/proof_of_possession_gas.js +24 -0
- package/dest/client.d.ts +1 -1
- package/dest/client.d.ts.map +1 -1
- package/dest/client.js +5 -3
- package/dest/contracts/errors.d.ts +10 -3
- package/dest/contracts/errors.d.ts.map +1 -1
- package/dest/contracts/errors.js +10 -4
- package/dest/contracts/inbox.d.ts +1 -1
- package/dest/contracts/inbox.d.ts.map +1 -1
- package/dest/contracts/inbox.js +2 -0
- package/dest/contracts/log.d.ts +7 -1
- package/dest/contracts/log.d.ts.map +1 -1
- package/dest/contracts/log.js +6 -0
- package/dest/contracts/rollup.d.ts +32 -4
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +63 -7
- package/dest/deploy_aztec_l1_contracts.d.ts +16 -1
- package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_aztec_l1_contracts.js +201 -65
- package/dest/foundry_binary.d.ts +1 -1
- package/dest/foundry_binary.d.ts.map +1 -1
- package/dest/foundry_binary.js +2 -1
- package/dest/l1_tx_utils/amsterdam.d.ts +1 -1
- package/dest/l1_tx_utils/amsterdam.d.ts.map +1 -1
- package/dest/l1_tx_utils/amsterdam.js +4 -1
- package/dest/l1_tx_utils/constants.d.ts +2 -1
- package/dest/l1_tx_utils/constants.d.ts.map +1 -1
- package/dest/l1_tx_utils/constants.js +3 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +1 -1
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -1
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +6 -1
- package/dest/l1_tx_utils/index.d.ts +2 -1
- package/dest/l1_tx_utils/index.d.ts.map +1 -1
- package/dest/l1_tx_utils/index.js +1 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +21 -1
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/l1_tx_utils.js +71 -5
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +8 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +1 -1
- package/dest/l1_tx_utils/send_cost.d.ts +15 -0
- package/dest/l1_tx_utils/send_cost.d.ts.map +1 -0
- package/dest/l1_tx_utils/send_cost.js +10 -0
- package/dest/l1_tx_utils/signer.d.ts +2 -2
- package/dest/l1_tx_utils/signer.d.ts.map +1 -1
- package/dest/l1_tx_utils/signer.js +2 -2
- package/dest/l1_tx_utils/tx_delayer.d.ts +1 -1
- package/dest/l1_tx_utils/tx_delayer.d.ts.map +1 -1
- package/dest/l1_tx_utils/tx_delayer.js +8 -26
- package/dest/publisher_manager.d.ts +127 -13
- package/dest/publisher_manager.d.ts.map +1 -1
- package/dest/publisher_manager.js +320 -79
- package/dest/test/anvil_hardfork.d.ts +42 -0
- package/dest/test/anvil_hardfork.d.ts.map +1 -0
- package/dest/test/anvil_hardfork.js +107 -0
- package/dest/test/eth_cheat_codes.d.ts +30 -5
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +283 -101
- package/dest/test/index.d.ts +3 -1
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +2 -0
- package/dest/test/l1_hardfork.d.ts +43 -0
- package/dest/test/l1_hardfork.d.ts.map +1 -0
- package/dest/test/l1_hardfork.js +51 -0
- package/dest/test/recording_rpc_server.d.ts +1 -1
- package/dest/test/recording_rpc_server.d.ts.map +1 -1
- package/dest/test/recording_rpc_server.js +1 -0
- package/dest/test/rollup_cheat_codes.d.ts +1 -1
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +7 -7
- package/dest/test/start_anvil.d.ts +14 -2
- package/dest/test/start_anvil.d.ts.map +1 -1
- package/dest/test/start_anvil.js +28 -11
- package/package.json +13 -11
- package/src/blob_tx.ts +118 -0
- package/src/bn254/hash_to_point.ts +95 -0
- package/src/bn254/index.ts +2 -0
- package/src/bn254/proof_of_possession_gas.ts +54 -0
- package/src/client.ts +6 -3
- package/src/contracts/errors.ts +12 -4
- package/src/contracts/inbox.ts +4 -0
- package/src/contracts/log.ts +12 -0
- package/src/contracts/rollup.ts +63 -6
- package/src/deploy_aztec_l1_contracts.ts +238 -63
- package/src/foundry_binary.ts +2 -1
- package/src/l1_tx_utils/amsterdam.ts +4 -1
- package/src/l1_tx_utils/constants.ts +4 -0
- package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +11 -1
- package/src/l1_tx_utils/index.ts +1 -0
- package/src/l1_tx_utils/l1_tx_utils.ts +72 -5
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +1 -1
- package/src/l1_tx_utils/send_cost.ts +21 -0
- package/src/l1_tx_utils/signer.ts +3 -2
- package/src/l1_tx_utils/tx_delayer.ts +8 -37
- package/src/publisher_manager.ts +458 -83
- package/src/test/anvil_hardfork.ts +95 -0
- package/src/test/eth_cheat_codes.ts +306 -81
- package/src/test/fixtures/sepolia_blob_tx.json +10 -0
- package/src/test/index.ts +2 -0
- package/src/test/l1_hardfork.ts +71 -0
- package/src/test/recording_rpc_server.ts +1 -0
- package/src/test/rollup_cheat_codes.ts +9 -9
- package/src/test/start_anvil.ts +41 -13
|
@@ -7,12 +7,14 @@ import { Semaphore } from '@aztec-labs/foundation/queue';
|
|
|
7
7
|
import { makeBackoff, retry, retryUntil } from '@aztec-labs/foundation/retry';
|
|
8
8
|
import { sleep } from '@aztec-labs/foundation/sleep';
|
|
9
9
|
import { DateProvider } from '@aztec-labs/foundation/timer';
|
|
10
|
+
import { getErrorCause } from '@aztec-labs/foundation/types';
|
|
10
11
|
import pickBy from 'lodash.pickby';
|
|
11
|
-
import {
|
|
12
|
+
import { InsufficientFundsError, formatGwei } from 'viem';
|
|
13
|
+
import { serializeSignedTransaction } from '../blob_tx.js';
|
|
12
14
|
import { formatViemError } from '../utils.js';
|
|
13
15
|
import { l1TxUtilsConfigMappings } from './config.js';
|
|
14
|
-
import { MAX_L1_TX_LIMIT } from './constants.js';
|
|
15
|
-
import { ReadOnlyL1TxUtils } from './readonly_l1_tx_utils.js';
|
|
16
|
+
import { INSUFFICIENT_FUNDS_BACKOFF_MS, MAX_L1_TX_LIMIT } from './constants.js';
|
|
17
|
+
import { ReadOnlyL1TxUtils, isInsufficientFundsRpcError } from './readonly_l1_tx_utils.js';
|
|
16
18
|
import { createDelayer, wrapClientWithDelayer } from './tx_delayer.js';
|
|
17
19
|
import { DroppedTransactionError, L1TxTimeoutError, TerminalTxUtilsState, TxUtilsState, UnknownMinedTxError } from './types.js';
|
|
18
20
|
import { summarizeTransactionReceipt } from './utils.js';
|
|
@@ -37,6 +39,10 @@ export class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
37
39
|
/** Mutex to prevent concurrent sendTransaction calls from racing on the same nonce. */ sendMutex;
|
|
38
40
|
/** Tx delayer for testing. Only set when enableDelayer config is true. */ delayer;
|
|
39
41
|
/** KZG instance for blob operations. */ kzg;
|
|
42
|
+
/**
|
|
43
|
+
* Sender balance and time when a send was last rejected for insufficient funds. Cleared once the balance rises above
|
|
44
|
+
* the recorded one or the backoff expires.
|
|
45
|
+
*/ insufficientFunds;
|
|
40
46
|
constructor(client, address, signer, logger = createLogger('ethereum:publisher'), dateProvider = new DateProvider(), config, debugMaxGasLimit = false, store, metrics, kzg, delayer){
|
|
41
47
|
super(client, logger, dateProvider, config, debugMaxGasLimit), this.client = client, this.address = address, this.signer = signer, this.store = store, this.metrics = metrics, this.txs = [], this.sendMutex = new Semaphore(1);
|
|
42
48
|
this.kzg = kzg;
|
|
@@ -99,6 +105,41 @@ export class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
99
105
|
address: this.getSenderAddress().toString()
|
|
100
106
|
});
|
|
101
107
|
}
|
|
108
|
+
/** Returns the sender balance recorded when a send was last rejected for insufficient funds, if any. */ getInsufficientFundsAtBalance() {
|
|
109
|
+
return this.insufficientFunds?.balance;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Returns whether this sender should be skipped because a previous send was rejected for insufficient funds and its
|
|
113
|
+
* balance has not increased since. Clears the mark once the given current balance is above the recorded one, or once
|
|
114
|
+
* INSUFFICIENT_FUNDS_BACKOFF_MS have elapsed since the rejection: a rejection can come from a send whose gas limit was
|
|
115
|
+
* far above what later sends need, so a balance that did not move is not proof the publisher cannot afford them.
|
|
116
|
+
*/ isBackedOffForInsufficientFunds(currentBalance) {
|
|
117
|
+
if (this.insufficientFunds === undefined) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (this.hasActiveInsufficientFundsBackoff(currentBalance)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
const { balance } = this.insufficientFunds;
|
|
124
|
+
this.logger.info(`Clearing insufficient funds backoff for publisher`, {
|
|
125
|
+
account: this.getSenderAddress().toString(),
|
|
126
|
+
balance: currentBalance,
|
|
127
|
+
insufficientFundsAtBalance: balance,
|
|
128
|
+
reason: currentBalance > balance ? 'balance-increased' : 'expired'
|
|
129
|
+
});
|
|
130
|
+
this.insufficientFunds = undefined;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Same check as {@link isBackedOffForInsufficientFunds}, but without clearing a lifted backoff or logging, so it can be
|
|
135
|
+
* used for reporting without affecting publisher selection.
|
|
136
|
+
*/ hasActiveInsufficientFundsBackoff(currentBalance) {
|
|
137
|
+
if (this.insufficientFunds === undefined) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
const { balance, atMs } = this.insufficientFunds;
|
|
141
|
+
return currentBalance <= balance && this.dateProvider.now() - atMs < INSUFFICIENT_FUNDS_BACKOFF_MS;
|
|
142
|
+
}
|
|
102
143
|
/**
|
|
103
144
|
* Rehydrates transaction states from the store and resumes monitoring for pending transactions.
|
|
104
145
|
* This should be called on startup to restore state and resume monitoring of any in-flight transactions.
|
|
@@ -151,10 +192,14 @@ export class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
151
192
|
}
|
|
152
193
|
async signTransaction(txRequest) {
|
|
153
194
|
const signature = await this.signer(txRequest, this.getSenderAddress());
|
|
154
|
-
return
|
|
195
|
+
return serializeSignedTransaction(txRequest, signature);
|
|
155
196
|
}
|
|
156
197
|
async prepareSignedTransaction(txData) {
|
|
157
|
-
|
|
198
|
+
// Passing the chain id keeps viem from routing a fully specified request through eth_fillTransaction.
|
|
199
|
+
const txRequest = await this.client.prepareTransactionRequest({
|
|
200
|
+
chainId: this.client.chain.id,
|
|
201
|
+
...txData
|
|
202
|
+
});
|
|
158
203
|
return await this.signTransaction(txRequest);
|
|
159
204
|
}
|
|
160
205
|
async checkInterruptedOrTimedOut(gasConfig) {
|
|
@@ -271,6 +316,9 @@ export class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
271
316
|
state: l1TxState
|
|
272
317
|
};
|
|
273
318
|
} catch (err) {
|
|
319
|
+
if (isInsufficientFundsRpcError(err) || getErrorCause(err, InsufficientFundsError)) {
|
|
320
|
+
await this.recordInsufficientFunds();
|
|
321
|
+
}
|
|
274
322
|
const viemError = formatViemError(err, request.abi);
|
|
275
323
|
this.logger.error(`Failed to send L1 transaction: ${viemError.message}`, viemError, {
|
|
276
324
|
request: pick(request, 'to', 'value')
|
|
@@ -278,6 +326,24 @@ export class L1TxUtils extends ReadOnlyL1TxUtils {
|
|
|
278
326
|
throw viemError;
|
|
279
327
|
}
|
|
280
328
|
}
|
|
329
|
+
/** Records the current sender balance as one that cannot afford a send, so selection skips it for a while. */ async recordInsufficientFunds() {
|
|
330
|
+
try {
|
|
331
|
+
const balance = await this.getSenderBalance();
|
|
332
|
+
this.insufficientFunds = {
|
|
333
|
+
balance,
|
|
334
|
+
atMs: this.dateProvider.now()
|
|
335
|
+
};
|
|
336
|
+
this.logger.warn(`L1 send rejected for insufficient funds, backing off publisher until its balance increases`, {
|
|
337
|
+
account: this.getSenderAddress().toString(),
|
|
338
|
+
balance,
|
|
339
|
+
backoffMs: INSUFFICIENT_FUNDS_BACKOFF_MS
|
|
340
|
+
});
|
|
341
|
+
} catch (err) {
|
|
342
|
+
this.logger.warn(`Failed to read balance after an insufficient funds rejection`, {
|
|
343
|
+
err
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
281
347
|
async tryGetTxReceipt(txHashes, nonce, isCancelTx) {
|
|
282
348
|
for (const hash of txHashes){
|
|
283
349
|
try {
|
|
@@ -5,6 +5,13 @@ import { type Abi, type Account, type BlockOverrides, type GetCodeReturnType, ty
|
|
|
5
5
|
import type { ViemClient } from '../types.js';
|
|
6
6
|
import { type L1TxUtilsConfig } from './config.js';
|
|
7
7
|
import type { FeesPerGas, L1BlobInputs, L1TxRequest, TransactionStats } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Returns true when an RPC transport error reports the node's upfront funds check
|
|
10
|
+
* (sender balance >= gasLimit * maxFeePerGas) rejecting the request. Matches on the message as well as on the
|
|
11
|
+
* error code, since RPC gateways differ in how they wrap node errors. Apply this only to transport errors: an
|
|
12
|
+
* execution revert string can mention insufficient funds without being this kind of rejection.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isInsufficientFundsRpcError(err: unknown): boolean;
|
|
8
15
|
/** Outcome of simulating a single top-level L1 transaction. */
|
|
9
16
|
export type L1SimulationResult = {
|
|
10
17
|
/** Gas used by the simulated transaction, as reported for the top-level call (not for the enclosing block). */
|
|
@@ -87,4 +94,4 @@ export declare class ReadOnlyL1TxUtils {
|
|
|
87
94
|
}, abi: Abi): Promise<L1SimulationResult>;
|
|
88
95
|
bumpGasLimit(gasLimit: bigint, _gasConfig?: L1TxUtilsConfig): bigint;
|
|
89
96
|
}
|
|
90
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhZG9ubHlfbDFfdHhfdXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMV90eF91dGlscy9yZWFkb25seV9sMV90eF91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQUNyRSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sNEJBQTRCLENBQUM7QUFFdkUsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRzVELE9BQU8sRUFDTCxLQUFLLEdBQUcsRUFDUixLQUFLLE9BQU8sRUFFWixLQUFLLGNBQWMsRUFFbkIsS0FBSyxpQkFBaUIsRUFDdEIsS0FBSyxHQUFHLEVBSVIsS0FBSyxhQUFhLEVBS25CLE1BQU0sTUFBTSxDQUFDO0FBR2QsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQzlDLE9BQU8sRUFBRSxLQUFLLGVBQWUsRUFBbUQsTUFBTSxhQUFhLENBQUM7QUFTcEcsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLFlBQVksRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxZQUFZLEN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,WAAW,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAA;KAAE,EACnD,cAAc,GAAE,cAAc,CAAC,MAAM,EAAE,MAAM,CAAM,EACnD,cAAc,GAAE,aAAkB,EAClC,GAAG,GAAE,GAAe,EACpB,UAAU,CAAC,EAAE,eAAe,GAAG;QAAE,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,GAC9D,OAAO,CAAC,kBAAkB,CAAC,CAU7B;IAED,UAAgB,SAAS,CACvB,IAAI,EAAE,GAAG,EACT,cAAc,4CAAqC,EACnD,cAAc,2BAAoB,EAClC,SAAS,EAAE,eAAe,GAAG;QAAE,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAC7D,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,kBAAkB,CAAC,CA2D7B;IAEM,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,MAAM,CAW1E;CACF"}
|
|
@@ -18,7 +18,7 @@ const CurrentStrategy = P75AllTxsPriorityFeeStrategy;
|
|
|
18
18
|
* (sender balance >= gasLimit * maxFeePerGas) rejecting the request. Matches on the message as well as on the
|
|
19
19
|
* error code, since RPC gateways differ in how they wrap node errors. Apply this only to transport errors: an
|
|
20
20
|
* execution revert string can mention insufficient funds without being this kind of rejection.
|
|
21
|
-
*/ function isInsufficientFundsRpcError(err) {
|
|
21
|
+
*/ export function isInsufficientFundsRpcError(err) {
|
|
22
22
|
if (getL1RpcErrorCode(err) === INSUFFICIENT_FUNDS_RPC_ERROR_CODE) {
|
|
23
23
|
return true;
|
|
24
24
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FeesPerGas } from './types.js';
|
|
2
|
+
/** Gas limit and blob count of an L1 send, used to bound the ETH a sender must hold to submit it. */
|
|
3
|
+
export type SendCostRequirement = {
|
|
4
|
+
/** Gas limit the tx will be sent with. */
|
|
5
|
+
gasLimit: bigint;
|
|
6
|
+
/** Number of blobs attached to the tx. */
|
|
7
|
+
blobCount: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Upper bound on the ETH a send needs up front: `gasLimit * maxFeePerGas + blobCount * GAS_PER_BLOB * maxFeePerBlobGas`.
|
|
11
|
+
* This is what the node checks against the sender balance before accepting the tx, so a sender holding less than this
|
|
12
|
+
* gets the tx rejected with an insufficient funds error.
|
|
13
|
+
*/
|
|
14
|
+
export declare function computeSendCost(fees: FeesPerGas, req: SendCostRequirement): bigint;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZF9jb3N0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbDFfdHhfdXRpbHMvc2VuZF9jb3N0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUU3QyxxR0FBcUc7QUFDckcsTUFBTSxNQUFNLG1CQUFtQixHQUFHO0lBQ2hDLDBDQUEwQztJQUMxQyxRQUFRLEVBQUUsTUFBTSxDQUFDO0lBQ2pCLDBDQUEwQztJQUMxQyxTQUFTLEVBQUUsTUFBTSxDQUFDO0NBQ25CLENBQUM7QUFFRjs7OztHQUlHO0FBQ0gsd0JBQWdCLGVBQWUsQ0FBQyxJQUFJLEVBQUUsVUFBVSxFQUFFLEdBQUcsRUFBRSxtQkFBbUIsR0FBRyxNQUFNLENBSWxGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send_cost.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/send_cost.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qGAAqG;AACrG,MAAM,MAAM,mBAAmB,GAAG;IAChC,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAIlF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GAS_PER_BLOB } from './constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Upper bound on the ETH a send needs up front: `gasLimit * maxFeePerGas + blobCount * GAS_PER_BLOB * maxFeePerBlobGas`.
|
|
4
|
+
* This is what the node checks against the sender balance before accepting the tx, so a sender holding less than this
|
|
5
|
+
* gets the tx rejected with an insufficient funds error.
|
|
6
|
+
*/ export function computeSendCost(fees, req) {
|
|
7
|
+
const executionCost = req.gasLimit * fees.maxFeePerGas;
|
|
8
|
+
const blobCost = BigInt(req.blobCount) * GAS_PER_BLOB * (fees.maxFeePerBlobGas ?? 0n);
|
|
9
|
+
return executionCost + blobCost;
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WalletClient } from 'viem';
|
|
2
2
|
import type { SigningCallback } from './types.js';
|
|
3
3
|
export declare function createViemSigner(client: WalletClient): SigningCallback;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbDFfdHhfdXRpbHMvc2lnbmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUEyQixZQUFZLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFHbEUsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBRWxELHdCQUFnQixnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsWUFBWSxtQkFvQnBEIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/signer.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/signer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,MAAM,CAAC;AAGlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,mBAoBpD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseSignedTransaction } from '../blob_tx.js';
|
|
2
2
|
export function createViemSigner(client) {
|
|
3
3
|
const signer = async (tx, _address)=>{
|
|
4
4
|
const signedTx = await client.signTransaction(tx);
|
|
5
|
-
const parsed =
|
|
5
|
+
const parsed = parseSignedTransaction(signedTx);
|
|
6
6
|
if (!parsed.r || !parsed.s || parsed.yParity !== 0 && parsed.yParity !== 1) {
|
|
7
7
|
throw new Error('Failed to extract signature from viem signed transaction');
|
|
8
8
|
}
|
|
@@ -55,4 +55,4 @@ export declare function createDelayer(dateProvider: DateProvider, opts: {
|
|
|
55
55
|
* The delayer intercepts sendRawTransaction calls and delays them based on the delayer's state.
|
|
56
56
|
*/
|
|
57
57
|
export declare function wrapClientWithDelayer<T extends ViemClient>(client: T, delayer: Delayer): T;
|
|
58
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
58
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfZGVsYXllci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2wxX3R4X3V0aWxzL3R4X2RlbGF5ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ik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q7OztHQUdHO0FBQ0gsd0JBQWdCLHFCQUFxQixDQUFDLENBQUMsU0FBUyxVQUFVLEVBQUUsTUFBTSxFQUFFLENBQUMsRUFBRSxPQUFPLEVBQUUsT0FBTyxHQUFHLENBQUMsQ0F1SDFGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_delayer.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/tx_delayer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tx_delayer.d.ts","sourceRoot":"","sources":["../../src/l1_tx_utils/tx_delayer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,4BAA4B,CAAC;AAE5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAmD,MAAM,MAAM,CAAC;AAG9F,OAAO,KAAK,EAA4B,UAAU,EAAE,MAAM,aAAa,CAAC;AAIxE,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAC7C,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,oBAiBjB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EACnD,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,oBAwBjB;AAED,sGAAsG;AACtG,qBAAa,OAAO;IAcT,YAAY,EAAE,YAAY;IAbnC,OAAO,CAAC,MAAM,CAAS;IAEhB,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAa;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EACX;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAChD;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD;QAAE,YAAY,EAAE,IAAI,CAAA;KAAE,GACtB,SAAS,CAAa;IACnB,YAAY,EAAE,GAAG,EAAE,CAAM;IACzB,YAAY,EAAE,GAAG,EAAE,CAAM;IAEhC,YACS,YAAY,EAAE,YAAY,EACjC,IAAI,EAAE;QAAE,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAC/C,QAAQ,EAAE,cAAc,EAIzB;IAED,wDAAwD;IACxD,SAAS,IAAI,MAAM,CAElB;IAED,sDAAsD;IACtD,eAAe,oBAEd;IAED,iDAAiD;IACjD,eAAe,IAAI,GAAG,EAAE,CAEvB;IAED,8EAA8E;IAC9E,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,QAE5E;IAED,wEAAwE;IACxE,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,QAE9E;IAED,kDAAkD;IAClD,YAAY,SAEX;IAED;;;;OAIG;IACH,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,QAEtD;CACF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE;IAAE,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAC/C,QAAQ,EAAE,cAAc,GACvB,OAAO,CAET;AAWD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,CAuH1F"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { omit } from '@aztec-labs/foundation/collection';
|
|
2
|
+
import { inspect } from '@aztec-labs/foundation/inspect';
|
|
2
3
|
import { createLogger } from '@aztec-labs/foundation/log';
|
|
3
4
|
import { retryUntil } from '@aztec-labs/foundation/retry';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { publicActions, walletActions } from 'viem';
|
|
6
|
+
import { computeSignedTransactionHash, parseSignedTransaction, recoverSignedTransactionAddress } from '../blob_tx.js';
|
|
6
7
|
const MAX_WAIT_TIME_SECONDS = 180;
|
|
7
8
|
export function waitUntilBlock(client, blockNumber, logger, timeout) {
|
|
8
9
|
const publicClient = 'getBlockNumber' in client && typeof client.getBlockNumber === 'function' ? client : client.extend(publicActions);
|
|
@@ -93,9 +94,7 @@ export function waitUntilL1Timestamp(client, timestamp, logger, timeout) {
|
|
|
93
94
|
}
|
|
94
95
|
/** Tries to recover the sender address from a serialized signed transaction. */ async function tryRecoverSender(serializedTransaction) {
|
|
95
96
|
try {
|
|
96
|
-
return await
|
|
97
|
-
serializedTransaction: serializedTransaction
|
|
98
|
-
});
|
|
97
|
+
return await recoverSignedTransactionAddress(serializedTransaction);
|
|
99
98
|
} catch {
|
|
100
99
|
return undefined;
|
|
101
100
|
}
|
|
@@ -123,7 +122,7 @@ export function waitUntilL1Timestamp(client, timestamp, logger, timeout) {
|
|
|
123
122
|
const waitUntil = delayer.nextWait;
|
|
124
123
|
delayer.nextWait = undefined;
|
|
125
124
|
// Compute the tx hash manually so we emulate sendRawTransaction response
|
|
126
|
-
txHash =
|
|
125
|
+
txHash = computeSignedTransactionHash(serializedTransaction);
|
|
127
126
|
// Cancel tx outright if instructed
|
|
128
127
|
if ('indefinitely' in waitUntil && waitUntil.indefinitely) {
|
|
129
128
|
logger.info(`Cancelling tx ${txHash}`, {
|
|
@@ -137,7 +136,7 @@ export function waitUntilL1Timestamp(client, timestamp, logger, timeout) {
|
|
|
137
136
|
logger.info(`Delaying tx ${txHash} until ${inspect(waitUntil)}`, {
|
|
138
137
|
sender,
|
|
139
138
|
argsLen: args.length,
|
|
140
|
-
...omit(
|
|
139
|
+
...omit(parseSignedTransaction(serializedTransaction), 'data', 'sidecars')
|
|
141
140
|
});
|
|
142
141
|
} else if (delayer.maxInclusionTimeIntoSlot !== undefined) {
|
|
143
142
|
// Check if we need to delay txs sent too close to the end of the slot.
|
|
@@ -146,10 +145,10 @@ export function waitUntilL1Timestamp(client, timestamp, logger, timeout) {
|
|
|
146
145
|
});
|
|
147
146
|
const { timestamp: lastBlockTimestamp, number } = currentBlock;
|
|
148
147
|
const now = delayer.dateProvider.now();
|
|
149
|
-
txHash =
|
|
148
|
+
txHash = computeSignedTransactionHash(serializedTransaction);
|
|
150
149
|
const logData = {
|
|
151
150
|
sender,
|
|
152
|
-
...omit(
|
|
151
|
+
...omit(parseSignedTransaction(serializedTransaction), 'data', 'sidecars'),
|
|
153
152
|
lastBlockTimestamp,
|
|
154
153
|
now,
|
|
155
154
|
maxInclusionTimeIntoSlot: delayer.maxInclusionTimeIntoSlot
|
|
@@ -204,20 +203,3 @@ export function waitUntilL1Timestamp(client, timestamp, logger, timeout) {
|
|
|
204
203
|
})) : withRawTx;
|
|
205
204
|
return extended;
|
|
206
205
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Compute the tx hash given the serialized tx. Note that if this is a blob tx, we need to
|
|
209
|
-
* exclude the blobs, commitments, and proofs from the hash.
|
|
210
|
-
*/ function computeTxHash(serializedTransaction) {
|
|
211
|
-
if (serializedTransaction.startsWith('0x03')) {
|
|
212
|
-
const parsed = parseTransaction(serializedTransaction);
|
|
213
|
-
if (parsed.blobs || parsed.sidecars) {
|
|
214
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
215
|
-
const { blobs, sidecars, ...rest } = parsed;
|
|
216
|
-
return keccak256(serializeTransaction({
|
|
217
|
-
type: 'eip4844',
|
|
218
|
-
...rest
|
|
219
|
-
}));
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return keccak256(serializedTransaction);
|
|
223
|
-
}
|
|
@@ -1,42 +1,156 @@
|
|
|
1
|
-
import { type LoggerBindings } from '@aztec-labs/foundation/log';
|
|
1
|
+
import { type Logger, type LoggerBindings } from '@aztec-labs/foundation/log';
|
|
2
2
|
import { RunningPromise } from '@aztec-labs/foundation/running-promise';
|
|
3
|
-
import { L1TxUtils } from './l1_tx_utils/index.js';
|
|
3
|
+
import { type FeesPerGas, L1TxUtils, type SendCostRequirement } from './l1_tx_utils/index.js';
|
|
4
4
|
export type PublisherFilter<UtilsType extends L1TxUtils> = (utils: UtilsType) => boolean;
|
|
5
5
|
/** Config accepted by PublisherManager. */
|
|
6
6
|
type PublisherManagerConfig = {
|
|
7
7
|
publisherAllowInvalidStates?: boolean;
|
|
8
8
|
publisherFundingThreshold?: bigint;
|
|
9
9
|
publisherFundingAmount?: bigint;
|
|
10
|
+
/** Warn when a publisher balance is below this multiple of the ETH required for the reference send. */
|
|
11
|
+
publisherLowBalanceWarningMultiplier?: number;
|
|
10
12
|
};
|
|
13
|
+
/** A send the periodic balance check prices at current fees, to report whether publishers can afford it. */
|
|
14
|
+
export type ReferenceSend = {
|
|
15
|
+
/** Short name of the send for logs, such as "proposal" or "epoch proof". */
|
|
16
|
+
name: string;
|
|
17
|
+
requirement: SendCostRequirement;
|
|
18
|
+
};
|
|
19
|
+
/** Balances read by a periodic balance check, and how many reference sends each publisher can afford. */
|
|
20
|
+
export type PublisherBalanceSnapshot = {
|
|
21
|
+
/** Publishers whose balance could be read. */
|
|
22
|
+
publishers: {
|
|
23
|
+
address: string;
|
|
24
|
+
balance: bigint;
|
|
25
|
+
/**
|
|
26
|
+
* Number of reference sends the balance covers at current fees, 0 while backed off after an insufficient funds
|
|
27
|
+
* rejection. Unset without a reference send or if fees could not be read.
|
|
28
|
+
*/
|
|
29
|
+
sendsAffordable?: number;
|
|
30
|
+
}[];
|
|
31
|
+
funder?: {
|
|
32
|
+
address: string;
|
|
33
|
+
balance: bigint;
|
|
34
|
+
};
|
|
35
|
+
/** ETH needed for the reference send at current fees. Unset without a reference send or if fees could not be read. */
|
|
36
|
+
required?: bigint;
|
|
37
|
+
};
|
|
38
|
+
/** Metrics emitted by the PublisherManager from its periodic balance check. */
|
|
39
|
+
export interface IPublisherManagerMetrics {
|
|
40
|
+
/** Records the latest balance snapshot, replacing the previous one. Undefined clears it once the manager stops. */
|
|
41
|
+
recordBalanceSnapshot(snapshot: PublisherBalanceSnapshot | undefined): void;
|
|
42
|
+
}
|
|
43
|
+
/** Balance snapshot of a publisher considered for an L1 send. */
|
|
44
|
+
export type PublisherBalanceInfo = {
|
|
45
|
+
address: string;
|
|
46
|
+
balance: bigint;
|
|
47
|
+
state: string;
|
|
48
|
+
/** Balance at which a previous send was rejected for insufficient funds, if the publisher is backed off. */
|
|
49
|
+
insufficientFundsAtBalance?: bigint;
|
|
50
|
+
};
|
|
51
|
+
/** Thrown when publishers are available but none holds enough ETH to afford the requested L1 send. */
|
|
52
|
+
export declare class NoAffordablePublisherError extends Error {
|
|
53
|
+
readonly required: bigint;
|
|
54
|
+
readonly requirement: SendCostRequirement;
|
|
55
|
+
readonly fees: FeesPerGas;
|
|
56
|
+
readonly publishers: PublisherBalanceInfo[];
|
|
57
|
+
constructor(required: bigint, requirement: SendCostRequirement, fees: FeesPerGas, publishers: PublisherBalanceInfo[]);
|
|
58
|
+
/**
|
|
59
|
+
* ETH the best funded publisher that is not backed off after an insufficient funds rejection is missing to afford the
|
|
60
|
+
* send. Undefined if every publisher is backed off.
|
|
61
|
+
*/
|
|
62
|
+
shortfall(): bigint | undefined;
|
|
63
|
+
/** Tells the operator which publisher to fund and with how much ETH for the send to become affordable. */
|
|
64
|
+
describeFunding(): string;
|
|
65
|
+
/** Structured context for logging. */
|
|
66
|
+
toLogContext(): {
|
|
67
|
+
required: bigint;
|
|
68
|
+
shortfall: bigint | undefined;
|
|
69
|
+
gasLimit: bigint;
|
|
70
|
+
blobCount: number;
|
|
71
|
+
maxFeePerGas: bigint;
|
|
72
|
+
maxFeePerBlobGas: bigint | undefined;
|
|
73
|
+
publishers: PublisherBalanceInfo[];
|
|
74
|
+
};
|
|
75
|
+
private getRichestNotBackedOff;
|
|
76
|
+
}
|
|
11
77
|
export declare class PublisherManager<UtilsType extends L1TxUtils = L1TxUtils> {
|
|
12
78
|
protected publishers: UtilsType[];
|
|
13
|
-
private
|
|
79
|
+
private static readonly BALANCE_CHECK_INTERVAL_MS;
|
|
80
|
+
protected log: Logger;
|
|
14
81
|
private config;
|
|
15
|
-
private static readonly FUNDING_CHECK_INTERVAL_MS;
|
|
16
82
|
protected funder?: UtilsType;
|
|
17
|
-
protected readonly
|
|
83
|
+
protected readonly balanceCheckPromise: RunningPromise;
|
|
18
84
|
private started;
|
|
85
|
+
private readonly metrics?;
|
|
86
|
+
private readonly referenceSend?;
|
|
87
|
+
/** Whether the balance check has run since the last start, so the first one logs a summary of all balances. */
|
|
88
|
+
private loggedBalanceSummary;
|
|
89
|
+
/** Last time a balance warning was logged, per publisher address or per kind of warning. */
|
|
90
|
+
private readonly lastLowBalanceWarningAt;
|
|
19
91
|
constructor(publishers: UtilsType[], config: PublisherManagerConfig, opts?: {
|
|
20
92
|
bindings?: LoggerBindings;
|
|
21
93
|
funder?: UtilsType;
|
|
94
|
+
metrics?: IPublisherManagerMetrics;
|
|
95
|
+
/**
|
|
96
|
+
* Send the balance check prices to report whether publishers can afford it. Without one, balances are still
|
|
97
|
+
* recorded, but affordability is neither recorded nor warned about.
|
|
98
|
+
*/
|
|
99
|
+
referenceSend?: ReferenceSend;
|
|
22
100
|
});
|
|
23
101
|
/**
|
|
24
102
|
* Clears any interrupted flag left by a previous {@link stop} so publishing works again after a restart,
|
|
25
|
-
* loads the state of all publishers and the funder, and starts periodic
|
|
26
|
-
* start while already started is a no-op, so it never re-runs
|
|
27
|
-
* would spawn a duplicate background monitor per pending nonce). Lifecycle
|
|
28
|
-
* serialized by the caller.
|
|
103
|
+
* loads the state of all publishers and the funder, and starts the periodic balance check, which also tops up
|
|
104
|
+
* publishers if funding is configured. Idempotent: a start while already started is a no-op, so it never re-runs
|
|
105
|
+
* `loadStateAndResumeMonitoring` (which would spawn a duplicate background monitor per pending nonce). Lifecycle
|
|
106
|
+
* calls are expected to be serialized by the caller.
|
|
29
107
|
*/
|
|
30
108
|
start(): Promise<void>;
|
|
31
109
|
/**
|
|
32
|
-
* Stops the
|
|
110
|
+
* Stops the balance check loop, interrupts all publishers so no further L1 txs are sent, and waits (bounded)
|
|
33
111
|
* for their in-flight tx monitor loops to wind down. Idempotent, and the manager may be restarted
|
|
34
112
|
* afterwards via {@link start}, which clears the interrupted flag.
|
|
35
113
|
*/
|
|
36
114
|
stop(): Promise<void>;
|
|
37
|
-
|
|
38
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Finds and prioritises an available publisher. Candidates must pass the filter and not be busy (unless
|
|
117
|
+
* `publisherAllowInvalidStates` is set and no idle publisher remains), and are ranked by state (see `stateRank`), then
|
|
118
|
+
* highest balance, then least recently used. Publishers backed off after an insufficient funds rejection are skipped
|
|
119
|
+
* until their balance increases or the backoff expires.
|
|
120
|
+
*
|
|
121
|
+
* With a `requirement`, only publishers whose balance covers the worst-case cost of that send are eligible, and a
|
|
122
|
+
* {@link NoAffordablePublisherError} is thrown if there are none. Without one, selection is lenient: it prefers funded
|
|
123
|
+
* publishers but falls back to unfunded ones rather than failing, for sends that are fine to attempt and lose.
|
|
124
|
+
*/
|
|
125
|
+
getAvailablePublisher(filter?: PublisherFilter<UtilsType>, opts?: {
|
|
126
|
+
requirement?: SendCostRequirement;
|
|
127
|
+
}): Promise<UtilsType>;
|
|
128
|
+
/**
|
|
129
|
+
* Reads the balance of every publisher and the funder, prices the reference send at current fees, records metrics,
|
|
130
|
+
* logs balances that are low or cannot afford the reference send, and tops up publishers below the funding threshold
|
|
131
|
+
* if funding is configured. Runs once a minute while started.
|
|
132
|
+
*/
|
|
133
|
+
protected checkBalances(): Promise<void>;
|
|
134
|
+
private getBalances;
|
|
135
|
+
private getAffordable;
|
|
136
|
+
private toBalanceInfo;
|
|
137
|
+
/**
|
|
138
|
+
* Prefers publishers that are funded and not backed off after an insufficient funds rejection, but never returns an
|
|
139
|
+
* empty list: if every candidate is excluded, falls back to the full set so lenient sends still have something to try.
|
|
140
|
+
*/
|
|
141
|
+
private getLenientCandidates;
|
|
142
|
+
private tryGetBalance;
|
|
143
|
+
private tryGetReferenceCost;
|
|
144
|
+
/**
|
|
145
|
+
* Logs a summary of all balances on the first check after a start, and an error (at most once per interval) while no
|
|
146
|
+
* publisher can afford the reference send.
|
|
147
|
+
*/
|
|
148
|
+
private logBalances;
|
|
149
|
+
/** Warns at most once per interval for every publisher below the low-balance level. */
|
|
150
|
+
private warnOnLowBalances;
|
|
151
|
+
private shouldWarn;
|
|
152
|
+
private fundIfNeeded;
|
|
39
153
|
private fundPublishers;
|
|
40
154
|
}
|
|
41
155
|
export {};
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
156
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGlzaGVyX21hbmFnZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wdWJsaXNoZXJfbWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQUUsS0FBSyxjQUFjLEVBQWdCLE1BQU0sNEJBQTRCLENBQUM7QUFDNUYsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLHdDQUF3QyxDQUFDO0FBSXhFLE9BQU8sRUFDTCxLQUFLLFVBQVUsRUFFZixTQUFTLEVBQ1QsS0FBSyxtQkFBbUIsRUFHekIsTUFBTSx3QkFBd0IsQ0FBQztBQTRCaEMsTUFBTSxNQUFNLGVBQWUsQ0FBQyxTQUFTLFNBQVMsU0FBUyxJQUFJLENBQUMsS0FBSyxFQUFFLFNBQVMsS0FBSyxPQUFPLENBQUM7QUFFekYsMkNBQTJDO0FBQzNDLEtBQUssc0JBQXNCLEdBQUc7SUFDNUIsMkJBQTJCLENBQ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V3JCOzs7T0FHRztJQUNILE9BQU8sQ0FBQyxvQkFBb0I7WUFhZCxhQUFhO1lBWWIsbUJBQW1CO0lBaUJqQzs7O09BR0c7SUFDSCxPQUFPLENBQUMsV0FBVztJQXVEbkIsdUZBQXVGO0lBQ3ZGLE9BQU8sQ0FBQyxpQkFBaUI7SUFvQ3pCLE9BQU8sQ0FBQyxVQUFVO1lBV0osWUFBWTtZQW1DWixjQUFjO0NBUzdCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publisher_manager.d.ts","sourceRoot":"","sources":["../src/publisher_manager.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"publisher_manager.d.ts","sourceRoot":"","sources":["../src/publisher_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAIxE,OAAO,EACL,KAAK,UAAU,EAEf,SAAS,EACT,KAAK,mBAAmB,EAGzB,MAAM,wBAAwB,CAAC;AA4BhC,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,SAAS,IAAI,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;AAEzF,2CAA2C;AAC3C,KAAK,sBAAsB,GAAG;IAC5B,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uGAAuG;IACvG,oCAAoC,CAAC,EAAE,MAAM,CAAC;CAC/C,CAAC;AAEF,4GAA4G;AAC5G,MAAM,MAAM,aAAa,GAAG;IAC1B,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF,yGAAyG;AACzG,MAAM,MAAM,wBAAwB,GAAG;IACrC,8CAA8C;IAC9C,U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