@gzeoneth/gov-tracker 0.1.0 → 0.1.1-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/README.md +75 -119
- package/dist/calldata/address-utils.d.ts +22 -0
- package/dist/calldata/address-utils.d.ts.map +1 -0
- package/dist/calldata/address-utils.js +84 -0
- package/dist/calldata/address-utils.js.map +1 -0
- package/dist/calldata/decoder.d.ts +27 -0
- package/dist/calldata/decoder.d.ts.map +1 -0
- package/dist/calldata/decoder.js +238 -0
- package/dist/calldata/decoder.js.map +1 -0
- package/dist/calldata/index.d.ts +13 -0
- package/dist/calldata/index.d.ts.map +1 -0
- package/dist/calldata/index.js +46 -0
- package/dist/calldata/index.js.map +1 -0
- package/dist/calldata/parameter-decoder.d.ts +44 -0
- package/dist/calldata/parameter-decoder.d.ts.map +1 -0
- package/dist/calldata/parameter-decoder.js +163 -0
- package/dist/calldata/parameter-decoder.js.map +1 -0
- package/dist/calldata/retryable-ticket.d.ts +55 -0
- package/dist/calldata/retryable-ticket.d.ts.map +1 -0
- package/dist/calldata/retryable-ticket.js +104 -0
- package/dist/calldata/retryable-ticket.js.map +1 -0
- package/dist/calldata/signature-lookup.d.ts +46 -0
- package/dist/calldata/signature-lookup.d.ts.map +1 -0
- package/dist/calldata/signature-lookup.js +160 -0
- package/dist/calldata/signature-lookup.js.map +1 -0
- package/dist/cli/lib/cli.d.ts +74 -6
- package/dist/cli/lib/cli.d.ts.map +1 -1
- package/dist/cli/lib/cli.js +240 -69
- package/dist/cli/lib/cli.js.map +1 -1
- package/dist/cli/monitor.js +258 -111
- package/dist/cli/monitor.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/simulation/address-alias.d.ts +35 -0
- package/dist/simulation/address-alias.d.ts.map +1 -0
- package/dist/simulation/address-alias.js +46 -0
- package/dist/simulation/address-alias.js.map +1 -0
- package/dist/simulation/index.d.ts +9 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +26 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/simulation-data.d.ts +77 -0
- package/dist/simulation/simulation-data.d.ts.map +1 -0
- package/dist/simulation/simulation-data.js +327 -0
- package/dist/simulation/simulation-data.js.map +1 -0
- package/dist/stages/l2-to-l1-message.d.ts +2 -2
- package/dist/stages/l2-to-l1-message.d.ts.map +1 -1
- package/dist/stages/l2-to-l1-message.js +5 -3
- package/dist/stages/l2-to-l1-message.js.map +1 -1
- package/dist/stages/retryables.d.ts +2 -2
- package/dist/stages/retryables.d.ts.map +1 -1
- package/dist/stages/retryables.js +5 -3
- package/dist/stages/retryables.js.map +1 -1
- package/dist/stages/timelock.d.ts.map +1 -1
- package/dist/stages/timelock.js +5 -3
- package/dist/stages/timelock.js.map +1 -1
- package/dist/tracker/execute.d.ts.map +1 -1
- package/dist/tracker/execute.js +34 -22
- package/dist/tracker/execute.js.map +1 -1
- package/dist/tracker.d.ts.map +1 -1
- package/dist/tracker.js +6 -2
- package/dist/tracker.js.map +1 -1
- package/dist/types/calldata.d.ts +91 -0
- package/dist/types/calldata.d.ts.map +1 -0
- package/dist/types/calldata.js +9 -0
- package/dist/types/calldata.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/simulation.d.ts +101 -0
- package/dist/types/simulation.d.ts.map +1 -0
- package/dist/types/simulation.js +9 -0
- package/dist/types/simulation.js.map +1 -0
- package/dist/types/tracking.d.ts +2 -1
- package/dist/types/tracking.d.ts.map +1 -1
- package/dist/utils/error-classification.d.ts +13 -0
- package/dist/utils/error-classification.d.ts.map +1 -0
- package/dist/utils/error-classification.js +28 -0
- package/dist/utils/error-classification.js.map +1 -0
- package/dist/utils/stage-helpers.d.ts +1 -1
- package/dist/utils/stage-helpers.d.ts.map +1 -1
- package/dist/utils/stage-helpers.js +1 -1
- package/dist/utils/stage-helpers.js.map +1 -1
- package/dist/utils/urls.d.ts +24 -1
- package/dist/utils/urls.d.ts.map +1 -1
- package/dist/utils/urls.js +50 -0
- package/dist/utils/urls.js.map +1 -1
- package/package.json +6 -3
package/dist/cli/lib/cli.d.ts
CHANGED
|
@@ -17,8 +17,68 @@ export declare const DEFAULT_BLOCK_LAG = 12;
|
|
|
17
17
|
export declare const DEFAULT_MAX_AGE_DAYS = 60;
|
|
18
18
|
/** Maximum consecutive errors before skipping an item */
|
|
19
19
|
export declare const MAX_CONSECUTIVE_ERRORS = 5;
|
|
20
|
+
/** Default gas settings for L2 chains (Arb1 and Nova) */
|
|
21
|
+
export declare const DEFAULT_L2_GAS_SETTINGS: {
|
|
22
|
+
/** Max fee per gas in gwei (0.10 gwei = 100000000 wei) */
|
|
23
|
+
maxFeePerGas: number;
|
|
24
|
+
/** Max priority fee per gas in gwei */
|
|
25
|
+
maxPriorityFeePerGas: number;
|
|
26
|
+
};
|
|
27
|
+
/** Gas settings interface */
|
|
28
|
+
export interface GasSettings {
|
|
29
|
+
maxFeePerGas: number;
|
|
30
|
+
maxPriorityFeePerGas: number;
|
|
31
|
+
}
|
|
20
32
|
export declare const rpcOptions: Option[];
|
|
33
|
+
/**
|
|
34
|
+
* Verbose logging option - enables debug output
|
|
35
|
+
*/
|
|
36
|
+
export declare const verboseOption: Option;
|
|
37
|
+
/**
|
|
38
|
+
* Cache-related options for commands that use the tracker cache
|
|
39
|
+
*/
|
|
40
|
+
export declare const cacheOptions: {
|
|
41
|
+
/** Cache file path option (default is set in monitor.ts) */
|
|
42
|
+
cache: (defaultPath: string) => Option;
|
|
43
|
+
/** Force flag to bypass cache and re-track from scratch */
|
|
44
|
+
force: Option;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Execution-related options for commands that can prepare/execute transactions
|
|
48
|
+
*/
|
|
49
|
+
export declare const executionOptions: Option[];
|
|
50
|
+
/**
|
|
51
|
+
* Chunking options for log search performance tuning
|
|
52
|
+
*/
|
|
53
|
+
export declare const chunkingOptions: (l1Default: number, l2Default: number) => Option[];
|
|
54
|
+
/**
|
|
55
|
+
* Gas options for L2 transaction execution
|
|
56
|
+
*/
|
|
57
|
+
export declare const gasOptions: Option[];
|
|
58
|
+
/**
|
|
59
|
+
* Loop-related options for commands that can run continuously
|
|
60
|
+
*/
|
|
61
|
+
export declare const loopOptions: Option[];
|
|
21
62
|
export declare function addOptions(cmd: Command, opts: Option[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* Parse gas settings from CLI options
|
|
65
|
+
*/
|
|
66
|
+
export declare function parseGasSettings(opts: {
|
|
67
|
+
l2MaxFee?: string;
|
|
68
|
+
l2PriorityFee?: string;
|
|
69
|
+
}): GasSettings;
|
|
70
|
+
/**
|
|
71
|
+
* Parse chunking config from CLI options
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseChunkingConfig(opts: {
|
|
74
|
+
l1ChunkSize?: string;
|
|
75
|
+
l2ChunkSize?: string;
|
|
76
|
+
}, delayMs: number): {
|
|
77
|
+
l1ChunkSize: number;
|
|
78
|
+
l2ChunkSize: number;
|
|
79
|
+
novaChunkSize: number;
|
|
80
|
+
delayBetweenChunks: number;
|
|
81
|
+
};
|
|
22
82
|
export interface ProviderBundle {
|
|
23
83
|
l2Provider: ethers.providers.JsonRpcProvider;
|
|
24
84
|
l1Provider: ethers.providers.JsonRpcProvider;
|
|
@@ -34,15 +94,21 @@ export declare function requirePrivateKeyForWrite(opts: {
|
|
|
34
94
|
privateKey?: string;
|
|
35
95
|
}): void;
|
|
36
96
|
export declare function createSigner(privateKey: string): ethers.Wallet;
|
|
37
|
-
export declare function executeTransaction(prepared: PreparedTransaction, signer: ethers.Wallet, providers: ProviderBundle): Promise<{
|
|
97
|
+
export declare function executeTransaction(prepared: PreparedTransaction, signer: ethers.Wallet, providers: ProviderBundle, gasSettings?: GasSettings): Promise<{
|
|
38
98
|
success: boolean;
|
|
39
99
|
txHash?: string;
|
|
40
100
|
error?: string;
|
|
41
101
|
}>;
|
|
42
102
|
export declare function formatDryRun(prepared: PreparedTransaction): string;
|
|
103
|
+
/**
|
|
104
|
+
* Format multiple prepared transactions for display
|
|
105
|
+
*/
|
|
106
|
+
export declare function formatMultiplePreparedTransactions(preparedTransactions: PreparedTransaction[]): string;
|
|
43
107
|
export declare function formatTrackingResult(result: TrackingResult, label?: string): string;
|
|
44
108
|
export declare function formatStagesBrief(stages: TrackedStage[]): string;
|
|
45
109
|
export declare function formatCacheStatus(checkpoints: Map<string, TrackingCheckpoint>): string;
|
|
110
|
+
/** Check if shutdown has been requested */
|
|
111
|
+
export declare function isShuttingDown(): boolean;
|
|
46
112
|
export declare function runWithLoop(cycleFn: () => Promise<void>, options: {
|
|
47
113
|
loop: boolean;
|
|
48
114
|
intervalMs: number;
|
|
@@ -52,6 +118,7 @@ export interface TrackCallbackResult {
|
|
|
52
118
|
key: string;
|
|
53
119
|
result: TrackingResult | null;
|
|
54
120
|
prepared?: PreparedTransaction;
|
|
121
|
+
preparedTransactions?: PreparedTransaction[];
|
|
55
122
|
error?: string;
|
|
56
123
|
}
|
|
57
124
|
export interface TrackCallbackReturn {
|
|
@@ -59,7 +126,7 @@ export interface TrackCallbackReturn {
|
|
|
59
126
|
}
|
|
60
127
|
export interface MonitorRunOptions {
|
|
61
128
|
prepare?: boolean;
|
|
62
|
-
|
|
129
|
+
prepareCompleted?: boolean;
|
|
63
130
|
preparePending?: boolean;
|
|
64
131
|
onTrack?: (result: TrackCallbackResult) => Promise<TrackCallbackReturn | void> | void;
|
|
65
132
|
startBlock?: number;
|
|
@@ -75,18 +142,19 @@ export interface MonitorRunResult {
|
|
|
75
142
|
errors: number;
|
|
76
143
|
retracked: number;
|
|
77
144
|
}
|
|
78
|
-
export declare function runMonitorCycle(tracker: ProposalStageTracker,
|
|
145
|
+
export declare function runMonitorCycle(tracker: ProposalStageTracker, providers: ProviderBundle, options?: MonitorRunOptions): Promise<{
|
|
79
146
|
result: MonitorRunResult;
|
|
80
147
|
proposals: DiscoveredProposal[];
|
|
81
148
|
timelockOps: DiscoveredTimelockOp[];
|
|
82
149
|
watermarks: DiscoveryWatermarks;
|
|
83
150
|
}>;
|
|
84
|
-
export declare function trackAndPrepare(tracker: ProposalStageTracker, txHash: string, options
|
|
151
|
+
export declare function trackAndPrepare(tracker: ProposalStageTracker, txHash: string, options: {
|
|
85
152
|
prepare?: boolean;
|
|
86
|
-
|
|
153
|
+
prepareCompleted?: boolean;
|
|
87
154
|
preparePending?: boolean;
|
|
88
|
-
}): Promise<{
|
|
155
|
+
} | undefined, providers: ProviderBundle): Promise<{
|
|
89
156
|
results: TrackingResult[];
|
|
90
157
|
preparations: PrepareResult[];
|
|
158
|
+
preparedTransactions: PreparedTransaction[];
|
|
91
159
|
}>;
|
|
92
160
|
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAQb,kBAAkB,EAIlB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAQb,kBAAkB,EAIlB,kBAAkB,EA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C,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAkID,wBAAsB,eAAe,CACnC,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,cAAc,EACzB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC;IACT,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC,CAqMD;AAMD,wBAAsB,eAAe,CACnC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,YAAK,EACzF,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;CAC7C,CAAC,CAYD"}
|
package/dist/cli/lib/cli.js
CHANGED
|
@@ -12,16 +12,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.rpcOptions = exports.MAX_CONSECUTIVE_ERRORS = exports.DEFAULT_MAX_AGE_DAYS = exports.DEFAULT_BLOCK_LAG = exports.isElectionGovernor = void 0;
|
|
15
|
+
exports.loopOptions = exports.gasOptions = exports.chunkingOptions = exports.executionOptions = exports.cacheOptions = exports.verboseOption = exports.rpcOptions = exports.DEFAULT_L2_GAS_SETTINGS = exports.MAX_CONSECUTIVE_ERRORS = exports.DEFAULT_MAX_AGE_DAYS = exports.DEFAULT_BLOCK_LAG = exports.isElectionGovernor = void 0;
|
|
16
16
|
exports.addOptions = addOptions;
|
|
17
|
+
exports.parseGasSettings = parseGasSettings;
|
|
18
|
+
exports.parseChunkingConfig = parseChunkingConfig;
|
|
17
19
|
exports.createProvidersFromOptions = createProvidersFromOptions;
|
|
18
20
|
exports.requirePrivateKeyForWrite = requirePrivateKeyForWrite;
|
|
19
21
|
exports.createSigner = createSigner;
|
|
20
22
|
exports.executeTransaction = executeTransaction;
|
|
21
23
|
exports.formatDryRun = formatDryRun;
|
|
24
|
+
exports.formatMultiplePreparedTransactions = formatMultiplePreparedTransactions;
|
|
22
25
|
exports.formatTrackingResult = formatTrackingResult;
|
|
23
26
|
exports.formatStagesBrief = formatStagesBrief;
|
|
24
27
|
exports.formatCacheStatus = formatCacheStatus;
|
|
28
|
+
exports.isShuttingDown = isShuttingDown;
|
|
25
29
|
exports.runWithLoop = runWithLoop;
|
|
26
30
|
exports.runMonitorCycle = runMonitorCycle;
|
|
27
31
|
exports.trackAndPrepare = trackAndPrepare;
|
|
@@ -40,6 +44,13 @@ exports.DEFAULT_BLOCK_LAG = 12;
|
|
|
40
44
|
exports.DEFAULT_MAX_AGE_DAYS = 60;
|
|
41
45
|
/** Maximum consecutive errors before skipping an item */
|
|
42
46
|
exports.MAX_CONSECUTIVE_ERRORS = 5;
|
|
47
|
+
/** Default gas settings for L2 chains (Arb1 and Nova) */
|
|
48
|
+
exports.DEFAULT_L2_GAS_SETTINGS = {
|
|
49
|
+
/** Max fee per gas in gwei (0.10 gwei = 100000000 wei) */
|
|
50
|
+
maxFeePerGas: 0.1,
|
|
51
|
+
/** Max priority fee per gas in gwei */
|
|
52
|
+
maxPriorityFeePerGas: 0,
|
|
53
|
+
};
|
|
43
54
|
// ============================================================================
|
|
44
55
|
// RPC Configuration
|
|
45
56
|
// ============================================================================
|
|
@@ -48,9 +59,82 @@ exports.rpcOptions = [
|
|
|
48
59
|
new commander_1.Option("--l1-rpc <url>", "L1 RPC URL").env("ETH_RPC"),
|
|
49
60
|
new commander_1.Option("--nova-rpc <url>", "Nova RPC URL").env("NOVA_RPC"),
|
|
50
61
|
];
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Common Options (shared across multiple commands)
|
|
64
|
+
// ============================================================================
|
|
65
|
+
/**
|
|
66
|
+
* Verbose logging option - enables debug output
|
|
67
|
+
*/
|
|
68
|
+
exports.verboseOption = new commander_1.Option("--verbose", "Enable verbose logging");
|
|
69
|
+
/**
|
|
70
|
+
* Cache-related options for commands that use the tracker cache
|
|
71
|
+
*/
|
|
72
|
+
exports.cacheOptions = {
|
|
73
|
+
/** Cache file path option (default is set in monitor.ts) */
|
|
74
|
+
cache: (defaultPath) => new commander_1.Option("--cache <path>", "Cache file").default(defaultPath),
|
|
75
|
+
/** Force flag to bypass cache and re-track from scratch */
|
|
76
|
+
force: new commander_1.Option("--force", "Force refresh, ignoring cached data"),
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Execution-related options for commands that can prepare/execute transactions
|
|
80
|
+
*/
|
|
81
|
+
exports.executionOptions = [
|
|
82
|
+
new commander_1.Option("--prepare", "Prepare transactions for ready stages (dry-run)"),
|
|
83
|
+
new commander_1.Option("--write", "Execute prepared transactions (requires --private-key)"),
|
|
84
|
+
new commander_1.Option("--private-key <key>", "Private key for execution").env("PRIVATE_KEY"),
|
|
85
|
+
new commander_1.Option("--prepare-completed", "Prepare completed stages (for historical validation)"),
|
|
86
|
+
new commander_1.Option("--prepare-pending", "Prepare pending stages (waiting for delays)"),
|
|
87
|
+
];
|
|
88
|
+
/**
|
|
89
|
+
* Chunking options for log search performance tuning
|
|
90
|
+
*/
|
|
91
|
+
const chunkingOptions = (l1Default, l2Default) => [
|
|
92
|
+
new commander_1.Option("--l1-chunk-size <size>", `L1 chunk size for log searches (default: ${l1Default})`).default(String(l1Default)),
|
|
93
|
+
new commander_1.Option("--l2-chunk-size <size>", `L2 chunk size for log searches (default: ${l2Default})`).default(String(l2Default)),
|
|
94
|
+
];
|
|
95
|
+
exports.chunkingOptions = chunkingOptions;
|
|
96
|
+
/**
|
|
97
|
+
* Gas options for L2 transaction execution
|
|
98
|
+
*/
|
|
99
|
+
exports.gasOptions = [
|
|
100
|
+
new commander_1.Option("--l2-max-fee <gwei>", `Max fee per gas for L2 chains in gwei (default: ${exports.DEFAULT_L2_GAS_SETTINGS.maxFeePerGas})`),
|
|
101
|
+
new commander_1.Option("--l2-priority-fee <gwei>", `Max priority fee for L2 chains in gwei (default: ${exports.DEFAULT_L2_GAS_SETTINGS.maxPriorityFeePerGas})`),
|
|
102
|
+
];
|
|
103
|
+
/**
|
|
104
|
+
* Loop-related options for commands that can run continuously
|
|
105
|
+
*/
|
|
106
|
+
exports.loopOptions = [
|
|
107
|
+
new commander_1.Option("--loop", "Run in continuous loop"),
|
|
108
|
+
new commander_1.Option("--interval <seconds>", "Loop interval in seconds").default("60"),
|
|
109
|
+
new commander_1.Option("--health-check-url <url>", "Health check URL to ping").env("HEALTH_CHECK_URL"),
|
|
110
|
+
];
|
|
51
111
|
function addOptions(cmd, opts) {
|
|
52
112
|
opts.forEach((o) => cmd.addOption(o));
|
|
53
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Parse gas settings from CLI options
|
|
116
|
+
*/
|
|
117
|
+
function parseGasSettings(opts) {
|
|
118
|
+
return {
|
|
119
|
+
maxFeePerGas: opts.l2MaxFee ? parseFloat(opts.l2MaxFee) : exports.DEFAULT_L2_GAS_SETTINGS.maxFeePerGas,
|
|
120
|
+
maxPriorityFeePerGas: opts.l2PriorityFee
|
|
121
|
+
? parseFloat(opts.l2PriorityFee)
|
|
122
|
+
: exports.DEFAULT_L2_GAS_SETTINGS.maxPriorityFeePerGas,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Parse chunking config from CLI options
|
|
127
|
+
*/
|
|
128
|
+
function parseChunkingConfig(opts, delayMs) {
|
|
129
|
+
const l1ChunkSize = parseInt(opts.l1ChunkSize || "0", 10);
|
|
130
|
+
const l2ChunkSize = parseInt(opts.l2ChunkSize || "0", 10);
|
|
131
|
+
return {
|
|
132
|
+
l1ChunkSize,
|
|
133
|
+
l2ChunkSize,
|
|
134
|
+
novaChunkSize: l2ChunkSize,
|
|
135
|
+
delayBetweenChunks: delayMs,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
54
138
|
function createProvidersFromOptions(opts) {
|
|
55
139
|
const l2Rpc = opts.l2Rpc || process.env.ARB1_RPC || index_1.DEFAULT_RPC_URLS.ARB_ONE;
|
|
56
140
|
const l1Rpc = opts.l1Rpc || process.env.ETH_RPC;
|
|
@@ -79,51 +163,51 @@ function createSigner(privateKey) {
|
|
|
79
163
|
// ============================================================================
|
|
80
164
|
// Transaction Execution
|
|
81
165
|
// ============================================================================
|
|
82
|
-
|
|
83
|
-
const RETRYABLE_RETRY_DELAY_MS = 5000;
|
|
84
|
-
async function executeTransaction(prepared, signer, providers) {
|
|
166
|
+
async function executeTransaction(prepared, signer, providers, gasSettings) {
|
|
85
167
|
const isRetryable = prepared.description?.toLowerCase().includes("retryable") ?? false;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
168
|
+
try {
|
|
169
|
+
const provider = prepared.chain === "L1"
|
|
170
|
+
? providers.l1Provider
|
|
171
|
+
: prepared.chain === "NOVA"
|
|
172
|
+
? providers.novaProvider
|
|
173
|
+
: providers.l2Provider;
|
|
174
|
+
const connectedSigner = signer.connect(provider);
|
|
175
|
+
console.log(`\nExecuting on ${prepared.chain}: ${prepared.description}`);
|
|
176
|
+
console.log(` To: ${prepared.to}`);
|
|
177
|
+
if (prepared.value !== "0")
|
|
178
|
+
console.log(` Value: ${prepared.value}`);
|
|
179
|
+
// Use custom gas settings for L2 chains (Arb1 and Nova)
|
|
180
|
+
const isL2Chain = prepared.chain === "L2" || prepared.chain === "NOVA";
|
|
181
|
+
const effectiveGasSettings = isL2Chain ? (gasSettings ?? exports.DEFAULT_L2_GAS_SETTINGS) : undefined;
|
|
182
|
+
const txRequest = {
|
|
183
|
+
to: prepared.to,
|
|
184
|
+
data: prepared.data,
|
|
185
|
+
value: prepared.value,
|
|
186
|
+
};
|
|
187
|
+
if (effectiveGasSettings) {
|
|
188
|
+
// Convert gwei to wei
|
|
189
|
+
txRequest.maxFeePerGas = ethers_1.ethers.utils.parseUnits(effectiveGasSettings.maxFeePerGas.toString(), "gwei");
|
|
190
|
+
txRequest.maxPriorityFeePerGas = ethers_1.ethers.utils.parseUnits(effectiveGasSettings.maxPriorityFeePerGas.toString(), "gwei");
|
|
191
|
+
console.log(` Gas: ${effectiveGasSettings.maxFeePerGas} gwei maxFee, ${effectiveGasSettings.maxPriorityFeePerGas} gwei priority`);
|
|
107
192
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
console.log(`
|
|
122
|
-
|
|
123
|
-
await new Promise((resolve) => setTimeout(resolve, RETRYABLE_RETRY_DELAY_MS));
|
|
193
|
+
const tx = await connectedSigner.sendTransaction(txRequest);
|
|
194
|
+
console.log(` Tx sent: ${tx.hash}`);
|
|
195
|
+
const receipt = await tx.wait();
|
|
196
|
+
console.log(` Confirmed in block ${receipt.blockNumber}`);
|
|
197
|
+
return { success: true, txHash: tx.hash };
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
201
|
+
// For retryables, check if already redeemed
|
|
202
|
+
if (isRetryable &&
|
|
203
|
+
(message.includes("REDEEMED") ||
|
|
204
|
+
message.includes("already redeemed") ||
|
|
205
|
+
message.includes("NoTicketWithID"))) {
|
|
206
|
+
console.log(` Retryable already redeemed, treating as success`);
|
|
207
|
+
return { success: true };
|
|
124
208
|
}
|
|
209
|
+
return { success: false, error: message };
|
|
125
210
|
}
|
|
126
|
-
return { success: false, error: "Unexpected retry loop exit" };
|
|
127
211
|
}
|
|
128
212
|
// ============================================================================
|
|
129
213
|
// Output Formatting
|
|
@@ -146,6 +230,35 @@ function formatDryRun(prepared) {
|
|
|
146
230
|
}
|
|
147
231
|
return lines.join("\n");
|
|
148
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Format multiple prepared transactions for display
|
|
235
|
+
*/
|
|
236
|
+
function formatMultiplePreparedTransactions(preparedTransactions) {
|
|
237
|
+
if (preparedTransactions.length === 0)
|
|
238
|
+
return "";
|
|
239
|
+
if (preparedTransactions.length === 1)
|
|
240
|
+
return formatDryRun(preparedTransactions[0]);
|
|
241
|
+
const lines = [];
|
|
242
|
+
for (let i = 0; i < preparedTransactions.length; i++) {
|
|
243
|
+
const prepared = preparedTransactions[i];
|
|
244
|
+
lines.push(`[DRY RUN ${i + 1}/${preparedTransactions.length}] ${prepared.description}`);
|
|
245
|
+
lines.push(` Chain: ${prepared.chain}`);
|
|
246
|
+
lines.push(` To: ${prepared.to}`);
|
|
247
|
+
if (prepared.operationId)
|
|
248
|
+
lines.push(` OperationId: ${prepared.operationId}`);
|
|
249
|
+
if (prepared.value !== "0")
|
|
250
|
+
lines.push(` Value: ${prepared.value}`);
|
|
251
|
+
lines.push(` Data: ${prepared.data}`);
|
|
252
|
+
if (prepared.hashValidation) {
|
|
253
|
+
lines.push(prepared.hashValidation.isValid
|
|
254
|
+
? ` Hash Valid: YES`
|
|
255
|
+
: ` WARNING: Hash validation failed - ${prepared.hashValidation.error}`);
|
|
256
|
+
}
|
|
257
|
+
if (i < preparedTransactions.length - 1)
|
|
258
|
+
lines.push(""); // Blank line between transactions
|
|
259
|
+
}
|
|
260
|
+
return lines.join("\n");
|
|
261
|
+
}
|
|
149
262
|
function formatTrackingResult(result, label) {
|
|
150
263
|
const lines = [];
|
|
151
264
|
if (label)
|
|
@@ -281,6 +394,12 @@ async function waitWithChunks(ms) {
|
|
|
281
394
|
remaining -= MAX_CHUNK;
|
|
282
395
|
}
|
|
283
396
|
}
|
|
397
|
+
/** Shared abort controller for graceful shutdown */
|
|
398
|
+
let globalAbortController = null;
|
|
399
|
+
/** Check if shutdown has been requested */
|
|
400
|
+
function isShuttingDown() {
|
|
401
|
+
return globalAbortController?.signal.aborted ?? false;
|
|
402
|
+
}
|
|
284
403
|
async function runWithLoop(cycleFn, options) {
|
|
285
404
|
if (!options.loop) {
|
|
286
405
|
await cycleFn();
|
|
@@ -288,8 +407,11 @@ async function runWithLoop(cycleFn, options) {
|
|
|
288
407
|
}
|
|
289
408
|
let consecutiveErrors = 0;
|
|
290
409
|
let running = true;
|
|
410
|
+
// Create abort controller for graceful shutdown
|
|
411
|
+
globalAbortController = new AbortController();
|
|
291
412
|
process.on("SIGINT", () => {
|
|
292
413
|
running = false;
|
|
414
|
+
globalAbortController?.abort();
|
|
293
415
|
console.log("\nGracefully shutting down...");
|
|
294
416
|
});
|
|
295
417
|
while (running) {
|
|
@@ -325,22 +447,68 @@ const PREPARABLE_STAGE_TYPES = [
|
|
|
325
447
|
"L2_TO_L1_MESSAGE",
|
|
326
448
|
"RETRYABLE_EXECUTED",
|
|
327
449
|
];
|
|
328
|
-
async function prepareStagesForResult(tracker, stages, options) {
|
|
450
|
+
async function prepareStagesForResult(tracker, stages, options, providers) {
|
|
329
451
|
const preparations = [];
|
|
452
|
+
const preparedTransactions = [];
|
|
330
453
|
let prepared;
|
|
331
454
|
let count = 0;
|
|
332
455
|
if (!options.prepare)
|
|
333
|
-
return { preparations, count };
|
|
334
|
-
|
|
456
|
+
return { preparations, preparedTransactions, count };
|
|
457
|
+
/**
|
|
458
|
+
* Helper to prepare a stage and handle bulk results for RETRYABLE_EXECUTED and L2_TO_L1_MESSAGE
|
|
459
|
+
*/
|
|
460
|
+
async function prepareSingleStage(stage, prepOpts) {
|
|
461
|
+
// For retryable and L2→L1 message stages, use bulk prepare to get all transactions
|
|
462
|
+
if (stage.type === "RETRYABLE_EXECUTED") {
|
|
463
|
+
const retryableData = (0, index_1.getStageData)(stage, "RETRYABLE_EXECUTED");
|
|
464
|
+
const targetChains = retryableData?.targetChains;
|
|
465
|
+
if (!targetChains || targetChains.length === 0) {
|
|
466
|
+
preparations.push({ success: false, error: "No target chains found" });
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
// Prepare retryables for each target chain (can be both Arb1 and Nova)
|
|
470
|
+
for (const targetChain of targetChains) {
|
|
471
|
+
const targetProvider = targetChain === "Nova" ? providers.novaProvider : providers.l2Provider;
|
|
472
|
+
const { results } = await (0, index_1.prepareRetryableStage)(stage, providers.l1Provider, targetProvider, prepOpts);
|
|
473
|
+
preparations.push(...results);
|
|
474
|
+
for (const result of results) {
|
|
475
|
+
if (result.success) {
|
|
476
|
+
count++;
|
|
477
|
+
preparedTransactions.push(result.prepared);
|
|
478
|
+
if (!prepared)
|
|
479
|
+
prepared = result.prepared;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
else if (stage.type === "L2_TO_L1_MESSAGE") {
|
|
485
|
+
const { results } = await (0, index_1.prepareL2ToL1MessageStage)(stage, providers.l2Provider, providers.l1Provider, prepOpts);
|
|
486
|
+
preparations.push(...results);
|
|
487
|
+
for (const result of results) {
|
|
488
|
+
if (result.success) {
|
|
489
|
+
count++;
|
|
490
|
+
preparedTransactions.push(result.prepared);
|
|
491
|
+
if (!prepared)
|
|
492
|
+
prepared = result.prepared;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
// For other stages, use the tracker's prepareTransaction
|
|
498
|
+
const prepResult = await tracker.prepareTransaction(stage, prepOpts);
|
|
499
|
+
preparations.push(prepResult);
|
|
500
|
+
if (prepResult.success) {
|
|
501
|
+
count++;
|
|
502
|
+
preparedTransactions.push(prepResult.prepared);
|
|
503
|
+
prepared = prepResult.prepared;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
if (options.prepareCompleted) {
|
|
335
508
|
// Historical validation: prepare COMPLETED timelock stages
|
|
336
509
|
for (const stage of stages) {
|
|
337
510
|
if (stage.status === "COMPLETED" && (0, index_1.isTimelockStage)(stage.type)) {
|
|
338
|
-
|
|
339
|
-
preparations.push(prepResult);
|
|
340
|
-
if (prepResult.success) {
|
|
341
|
-
count++;
|
|
342
|
-
prepared = prepResult.prepared;
|
|
343
|
-
}
|
|
511
|
+
await prepareSingleStage(stage, { prepareCompleted: true });
|
|
344
512
|
}
|
|
345
513
|
}
|
|
346
514
|
}
|
|
@@ -349,12 +517,7 @@ async function prepareStagesForResult(tracker, stages, options) {
|
|
|
349
517
|
for (const stage of stages) {
|
|
350
518
|
const isPreparable = PREPARABLE_STAGE_TYPES.includes(stage.type);
|
|
351
519
|
if (isPreparable && stage.status === "PENDING") {
|
|
352
|
-
|
|
353
|
-
preparations.push(prepResult);
|
|
354
|
-
if (prepResult.success) {
|
|
355
|
-
count++;
|
|
356
|
-
prepared = prepResult.prepared;
|
|
357
|
-
}
|
|
520
|
+
await prepareSingleStage(stage, { prepareCompleted: true });
|
|
358
521
|
}
|
|
359
522
|
}
|
|
360
523
|
}
|
|
@@ -362,15 +525,10 @@ async function prepareStagesForResult(tracker, stages, options) {
|
|
|
362
525
|
// Normal: prepare only READY stages
|
|
363
526
|
const ready = (0, index_1.findExecutableStage)(stages);
|
|
364
527
|
if (ready) {
|
|
365
|
-
|
|
366
|
-
preparations.push(prepResult);
|
|
367
|
-
if (prepResult.success) {
|
|
368
|
-
count++;
|
|
369
|
-
prepared = prepResult.prepared;
|
|
370
|
-
}
|
|
528
|
+
await prepareSingleStage(ready, {});
|
|
371
529
|
}
|
|
372
530
|
}
|
|
373
|
-
return { prepared, preparations, count };
|
|
531
|
+
return { prepared, preparedTransactions, preparations, count };
|
|
374
532
|
}
|
|
375
533
|
// ============================================================================
|
|
376
534
|
// Monitor Cycle
|
|
@@ -384,7 +542,8 @@ function shortScope(key) {
|
|
|
384
542
|
}
|
|
385
543
|
return key.slice(0, 12);
|
|
386
544
|
}
|
|
387
|
-
async function runMonitorCycle(tracker,
|
|
545
|
+
async function runMonitorCycle(tracker, providers, options = {}) {
|
|
546
|
+
const l2Provider = providers.l2Provider;
|
|
388
547
|
const tipBlock = await l2Provider.getBlockNumber();
|
|
389
548
|
const blockLag = options.blockLag ?? exports.DEFAULT_BLOCK_LAG;
|
|
390
549
|
const currentBlock = Math.max(0, tipBlock - blockLag);
|
|
@@ -414,16 +573,23 @@ async function runMonitorCycle(tracker, l2Provider, options = {}) {
|
|
|
414
573
|
await (0, logger_1.withScope)(shortScope(key), async () => {
|
|
415
574
|
try {
|
|
416
575
|
const trackResult = await trackFn();
|
|
576
|
+
// Skip callback if shutting down
|
|
577
|
+
if (isShuttingDown())
|
|
578
|
+
return;
|
|
417
579
|
result.tracked++;
|
|
418
580
|
if (trackResult.timelockLink?.operationId) {
|
|
419
581
|
trackedOperationIds.add(trackResult.timelockLink.operationId.toLowerCase());
|
|
420
582
|
}
|
|
421
|
-
const prepResult = await prepareStagesForResult(tracker, trackResult.stages, options);
|
|
583
|
+
const prepResult = await prepareStagesForResult(tracker, trackResult.stages, options, providers);
|
|
422
584
|
result.prepared += prepResult.count;
|
|
585
|
+
// Skip callback if shutting down
|
|
586
|
+
if (isShuttingDown())
|
|
587
|
+
return;
|
|
423
588
|
const callbackResult = await options.onTrack?.({
|
|
424
589
|
key,
|
|
425
590
|
result: trackResult,
|
|
426
591
|
prepared: prepResult.prepared,
|
|
592
|
+
preparedTransactions: prepResult.preparedTransactions,
|
|
427
593
|
});
|
|
428
594
|
if (callbackResult?.shouldRetrack) {
|
|
429
595
|
trackedKeys.delete(key);
|
|
@@ -431,6 +597,9 @@ async function runMonitorCycle(tracker, l2Provider, options = {}) {
|
|
|
431
597
|
}
|
|
432
598
|
}
|
|
433
599
|
catch (error) {
|
|
600
|
+
// Skip error callback if shutting down
|
|
601
|
+
if (isShuttingDown())
|
|
602
|
+
return;
|
|
434
603
|
result.errors++;
|
|
435
604
|
// Wrap error callback in try-catch to prevent nested errors from propagating
|
|
436
605
|
try {
|
|
@@ -550,13 +719,15 @@ async function runMonitorCycle(tracker, l2Provider, options = {}) {
|
|
|
550
719
|
// ============================================================================
|
|
551
720
|
// Track and Prepare (for single-item tracking)
|
|
552
721
|
// ============================================================================
|
|
553
|
-
async function trackAndPrepare(tracker, txHash, options = {}) {
|
|
722
|
+
async function trackAndPrepare(tracker, txHash, options = {}, providers) {
|
|
554
723
|
const results = await tracker.trackByTxHash(txHash);
|
|
555
724
|
const preparations = [];
|
|
725
|
+
const preparedTransactions = [];
|
|
556
726
|
for (const result of results) {
|
|
557
|
-
const prepResult = await prepareStagesForResult(tracker, result.stages, options);
|
|
727
|
+
const prepResult = await prepareStagesForResult(tracker, result.stages, options, providers);
|
|
558
728
|
preparations.push(...prepResult.preparations);
|
|
729
|
+
preparedTransactions.push(...prepResult.preparedTransactions);
|
|
559
730
|
}
|
|
560
|
-
return { results, preparations };
|
|
731
|
+
return { results, preparations, preparedTransactions };
|
|
561
732
|
}
|
|
562
733
|
//# sourceMappingURL=cli.js.map
|