@gzeoneth/gov-tracker 0.2.1-alpha.cli-preview.a12cfd9 → 0.2.1-alpha.feat-election-api-improvements.101fb82
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 +1 -1
- package/dist/abis.d.ts +1 -0
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +6 -1
- package/dist/abis.js.map +1 -1
- package/dist/cli/cli.js +89 -94
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/lib/cli.d.ts +41 -3
- package/dist/cli/lib/cli.d.ts.map +1 -1
- package/dist/cli/lib/cli.js +321 -126
- package/dist/cli/lib/cli.js.map +1 -1
- package/dist/cli/lib/json-state.d.ts +23 -0
- package/dist/cli/lib/json-state.d.ts.map +1 -1
- package/dist/cli/lib/json-state.js +51 -4
- package/dist/cli/lib/json-state.js.map +1 -1
- package/dist/constants.d.ts +38 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +46 -1
- package/dist/constants.js.map +1 -1
- package/dist/data/bundled-cache.json +4387 -1842
- package/dist/discovery/governor-discovery.d.ts.map +1 -1
- package/dist/discovery/governor-discovery.js +13 -14
- package/dist/discovery/governor-discovery.js.map +1 -1
- package/dist/discovery/timelock-discovery.d.ts +12 -6
- package/dist/discovery/timelock-discovery.d.ts.map +1 -1
- package/dist/discovery/timelock-discovery.js +2 -1
- package/dist/discovery/timelock-discovery.js.map +1 -1
- package/dist/election/contracts.d.ts +8 -0
- package/dist/election/contracts.d.ts.map +1 -0
- package/dist/election/contracts.js +28 -0
- package/dist/election/contracts.js.map +1 -0
- package/dist/election/details.d.ts +15 -0
- package/dist/election/details.d.ts.map +1 -0
- package/dist/election/details.js +157 -0
- package/dist/election/details.js.map +1 -0
- package/dist/election/index.d.ts +11 -0
- package/dist/election/index.d.ts.map +1 -0
- package/dist/election/index.js +48 -0
- package/dist/election/index.js.map +1 -0
- package/dist/election/params.d.ts +13 -0
- package/dist/election/params.d.ts.map +1 -0
- package/dist/election/params.js +93 -0
- package/dist/election/params.js.map +1 -0
- package/dist/election/participants.d.ts +6 -0
- package/dist/election/participants.d.ts.map +1 -0
- package/dist/election/participants.js +102 -0
- package/dist/election/participants.js.map +1 -0
- package/dist/election/prepare.d.ts +10 -0
- package/dist/election/prepare.d.ts.map +1 -0
- package/dist/election/prepare.js +52 -0
- package/dist/election/prepare.js.map +1 -0
- package/dist/election/proposal-ids.d.ts +18 -0
- package/dist/election/proposal-ids.d.ts.map +1 -0
- package/dist/election/proposal-ids.js +77 -0
- package/dist/election/proposal-ids.js.map +1 -0
- package/dist/election/status.d.ts +15 -0
- package/dist/election/status.d.ts.map +1 -0
- package/dist/election/status.js +102 -0
- package/dist/election/status.js.map +1 -0
- package/dist/election/tracking.d.ts +28 -0
- package/dist/election/tracking.d.ts.map +1 -0
- package/dist/election/tracking.js +412 -0
- package/dist/election/tracking.js.map +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -11
- package/dist/index.js.map +1 -1
- package/dist/stages/timelock.d.ts +1 -1
- package/dist/stages/timelock.d.ts.map +1 -1
- package/dist/stages/timelock.js +7 -11
- package/dist/stages/timelock.js.map +1 -1
- package/dist/stages/utils.d.ts +5 -9
- package/dist/stages/utils.d.ts.map +1 -1
- package/dist/stages/utils.js +26 -26
- package/dist/stages/utils.js.map +1 -1
- package/dist/tracker/cache.d.ts +10 -6
- package/dist/tracker/cache.d.ts.map +1 -1
- package/dist/tracker/cache.js +32 -13
- package/dist/tracker/cache.js.map +1 -1
- package/dist/tracker/checkpoint-helpers.d.ts +63 -0
- package/dist/tracker/checkpoint-helpers.d.ts.map +1 -0
- package/dist/tracker/checkpoint-helpers.js +176 -0
- package/dist/tracker/checkpoint-helpers.js.map +1 -0
- package/dist/tracker/discovery.d.ts +1 -1
- package/dist/tracker/discovery.d.ts.map +1 -1
- package/dist/tracker/discovery.js +11 -3
- package/dist/tracker/discovery.js.map +1 -1
- package/dist/tracker/execute.d.ts.map +1 -1
- package/dist/tracker/execute.js +1 -25
- package/dist/tracker/execute.js.map +1 -1
- package/dist/tracker/pipeline.d.ts.map +1 -1
- package/dist/tracker/pipeline.js +20 -10
- package/dist/tracker/pipeline.js.map +1 -1
- package/dist/tracker/query.d.ts +1 -0
- package/dist/tracker/query.d.ts.map +1 -1
- package/dist/tracker/query.js +14 -61
- package/dist/tracker/query.js.map +1 -1
- package/dist/tracker/state.d.ts.map +1 -1
- package/dist/tracker/state.js +1 -15
- package/dist/tracker/state.js.map +1 -1
- package/dist/tracker.d.ts +39 -2
- package/dist/tracker.d.ts.map +1 -1
- package/dist/tracker.js +200 -12
- package/dist/tracker.js.map +1 -1
- package/dist/types/config.d.ts +49 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/core.d.ts +1 -1
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/election.d.ts +66 -0
- package/dist/types/election.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/stages.d.ts +66 -7
- package/dist/types/stages.d.ts.map +1 -1
- package/dist/types/stages.js.map +1 -1
- package/dist/types/tracking.d.ts +7 -7
- package/dist/types/tracking.d.ts.map +1 -1
- package/dist/utils/block-cache.d.ts +50 -0
- package/dist/utils/block-cache.d.ts.map +1 -0
- package/dist/utils/block-cache.js +80 -0
- package/dist/utils/block-cache.js.map +1 -0
- package/dist/utils/formatters.d.ts +91 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +327 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/multicall.d.ts +0 -15
- package/dist/utils/multicall.d.ts.map +1 -1
- package/dist/utils/multicall.js +0 -35
- package/dist/utils/multicall.js.map +1 -1
- package/dist/utils/salt-computation.d.ts.map +1 -1
- package/dist/utils/salt-computation.js +33 -7
- package/dist/utils/salt-computation.js.map +1 -1
- package/dist/utils/stage-metadata.d.ts +0 -20
- package/dist/utils/stage-metadata.d.ts.map +1 -1
- package/dist/utils/stage-metadata.js +29 -44
- package/dist/utils/stage-metadata.js.map +1 -1
- package/package.json +4 -7
- package/dist/cli/tui/App.d.ts +0 -13
- package/dist/cli/tui/App.d.ts.map +0 -1
- package/dist/cli/tui/App.js +0 -152
- package/dist/cli/tui/App.js.map +0 -1
- package/dist/cli/tui/components/CollapsibleSection.d.ts +0 -20
- package/dist/cli/tui/components/CollapsibleSection.d.ts.map +0 -1
- package/dist/cli/tui/components/CollapsibleSection.js +0 -29
- package/dist/cli/tui/components/CollapsibleSection.js.map +0 -1
- package/dist/cli/tui/components/ConfirmDialog.d.ts +0 -14
- package/dist/cli/tui/components/ConfirmDialog.d.ts.map +0 -1
- package/dist/cli/tui/components/ConfirmDialog.js +0 -29
- package/dist/cli/tui/components/ConfirmDialog.js.map +0 -1
- package/dist/cli/tui/components/CopyableText.d.ts +0 -23
- package/dist/cli/tui/components/CopyableText.d.ts.map +0 -1
- package/dist/cli/tui/components/CopyableText.js +0 -49
- package/dist/cli/tui/components/CopyableText.js.map +0 -1
- package/dist/cli/tui/components/EmptyState.d.ts +0 -11
- package/dist/cli/tui/components/EmptyState.d.ts.map +0 -1
- package/dist/cli/tui/components/EmptyState.js +0 -34
- package/dist/cli/tui/components/EmptyState.js.map +0 -1
- package/dist/cli/tui/components/ErrorDisplay.d.ts +0 -17
- package/dist/cli/tui/components/ErrorDisplay.d.ts.map +0 -1
- package/dist/cli/tui/components/ErrorDisplay.js +0 -66
- package/dist/cli/tui/components/ErrorDisplay.js.map +0 -1
- package/dist/cli/tui/components/Header.d.ts +0 -22
- package/dist/cli/tui/components/Header.d.ts.map +0 -1
- package/dist/cli/tui/components/Header.js +0 -73
- package/dist/cli/tui/components/Header.js.map +0 -1
- package/dist/cli/tui/components/KeyHelp.d.ts +0 -20
- package/dist/cli/tui/components/KeyHelp.d.ts.map +0 -1
- package/dist/cli/tui/components/KeyHelp.js +0 -136
- package/dist/cli/tui/components/KeyHelp.js.map +0 -1
- package/dist/cli/tui/components/ProposalRow.d.ts +0 -11
- package/dist/cli/tui/components/ProposalRow.d.ts.map +0 -1
- package/dist/cli/tui/components/ProposalRow.js +0 -106
- package/dist/cli/tui/components/ProposalRow.js.map +0 -1
- package/dist/cli/tui/components/ScrollIndicator.d.ts +0 -26
- package/dist/cli/tui/components/ScrollIndicator.d.ts.map +0 -1
- package/dist/cli/tui/components/ScrollIndicator.js +0 -59
- package/dist/cli/tui/components/ScrollIndicator.js.map +0 -1
- package/dist/cli/tui/components/SearchBar.d.ts +0 -12
- package/dist/cli/tui/components/SearchBar.d.ts.map +0 -1
- package/dist/cli/tui/components/SearchBar.js +0 -36
- package/dist/cli/tui/components/SearchBar.js.map +0 -1
- package/dist/cli/tui/components/Skeleton.d.ts +0 -22
- package/dist/cli/tui/components/Skeleton.d.ts.map +0 -1
- package/dist/cli/tui/components/Skeleton.js +0 -35
- package/dist/cli/tui/components/Skeleton.js.map +0 -1
- package/dist/cli/tui/components/Spinner.d.ts +0 -10
- package/dist/cli/tui/components/Spinner.d.ts.map +0 -1
- package/dist/cli/tui/components/Spinner.js +0 -24
- package/dist/cli/tui/components/Spinner.js.map +0 -1
- package/dist/cli/tui/components/StageProgress.d.ts +0 -12
- package/dist/cli/tui/components/StageProgress.d.ts.map +0 -1
- package/dist/cli/tui/components/StageProgress.js +0 -72
- package/dist/cli/tui/components/StageProgress.js.map +0 -1
- package/dist/cli/tui/components/StageRow.d.ts +0 -12
- package/dist/cli/tui/components/StageRow.d.ts.map +0 -1
- package/dist/cli/tui/components/StageRow.js +0 -101
- package/dist/cli/tui/components/StageRow.js.map +0 -1
- package/dist/cli/tui/components/StatusBadge.d.ts +0 -12
- package/dist/cli/tui/components/StatusBadge.d.ts.map +0 -1
- package/dist/cli/tui/components/StatusBadge.js +0 -27
- package/dist/cli/tui/components/StatusBadge.js.map +0 -1
- package/dist/cli/tui/components/StatusBar.d.ts +0 -12
- package/dist/cli/tui/components/StatusBar.d.ts.map +0 -1
- package/dist/cli/tui/components/StatusBar.js +0 -14
- package/dist/cli/tui/components/StatusBar.js.map +0 -1
- package/dist/cli/tui/components/Timeline.d.ts +0 -12
- package/dist/cli/tui/components/Timeline.d.ts.map +0 -1
- package/dist/cli/tui/components/Timeline.js +0 -91
- package/dist/cli/tui/components/Timeline.js.map +0 -1
- package/dist/cli/tui/components/Toast.d.ts +0 -13
- package/dist/cli/tui/components/Toast.d.ts.map +0 -1
- package/dist/cli/tui/components/Toast.js +0 -35
- package/dist/cli/tui/components/Toast.js.map +0 -1
- package/dist/cli/tui/components/TrackingProgress.d.ts +0 -24
- package/dist/cli/tui/components/TrackingProgress.d.ts.map +0 -1
- package/dist/cli/tui/components/TrackingProgress.js +0 -82
- package/dist/cli/tui/components/TrackingProgress.js.map +0 -1
- package/dist/cli/tui/components/ViewLayout.d.ts +0 -26
- package/dist/cli/tui/components/ViewLayout.d.ts.map +0 -1
- package/dist/cli/tui/components/ViewLayout.js +0 -57
- package/dist/cli/tui/components/ViewLayout.js.map +0 -1
- package/dist/cli/tui/components/VotingStats.d.ts +0 -11
- package/dist/cli/tui/components/VotingStats.d.ts.map +0 -1
- package/dist/cli/tui/components/VotingStats.js +0 -87
- package/dist/cli/tui/components/VotingStats.js.map +0 -1
- package/dist/cli/tui/config.d.ts +0 -42
- package/dist/cli/tui/config.d.ts.map +0 -1
- package/dist/cli/tui/config.js +0 -144
- package/dist/cli/tui/config.js.map +0 -1
- package/dist/cli/tui/hooks/index.d.ts +0 -16
- package/dist/cli/tui/hooks/index.d.ts.map +0 -1
- package/dist/cli/tui/hooks/index.js +0 -22
- package/dist/cli/tui/hooks/index.js.map +0 -1
- package/dist/cli/tui/hooks/useCache.d.ts +0 -12
- package/dist/cli/tui/hooks/useCache.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useCache.js +0 -107
- package/dist/cli/tui/hooks/useCache.js.map +0 -1
- package/dist/cli/tui/hooks/useCliProcess.d.ts +0 -19
- package/dist/cli/tui/hooks/useCliProcess.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useCliProcess.js +0 -135
- package/dist/cli/tui/hooks/useCliProcess.js.map +0 -1
- package/dist/cli/tui/hooks/useElectionData.d.ts +0 -14
- package/dist/cli/tui/hooks/useElectionData.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useElectionData.js +0 -86
- package/dist/cli/tui/hooks/useElectionData.js.map +0 -1
- package/dist/cli/tui/hooks/useElectionDetails.d.ts +0 -18
- package/dist/cli/tui/hooks/useElectionDetails.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useElectionDetails.js +0 -47
- package/dist/cli/tui/hooks/useElectionDetails.js.map +0 -1
- package/dist/cli/tui/hooks/useNavigation.d.ts +0 -40
- package/dist/cli/tui/hooks/useNavigation.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useNavigation.js +0 -229
- package/dist/cli/tui/hooks/useNavigation.js.map +0 -1
- package/dist/cli/tui/hooks/useProposals.d.ts +0 -10
- package/dist/cli/tui/hooks/useProposals.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useProposals.js +0 -207
- package/dist/cli/tui/hooks/useProposals.js.map +0 -1
- package/dist/cli/tui/hooks/useStageCalldata.d.ts +0 -17
- package/dist/cli/tui/hooks/useStageCalldata.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useStageCalldata.js +0 -77
- package/dist/cli/tui/hooks/useStageCalldata.js.map +0 -1
- package/dist/cli/tui/hooks/useTracker.d.ts +0 -27
- package/dist/cli/tui/hooks/useTracker.d.ts.map +0 -1
- package/dist/cli/tui/hooks/useTracker.js +0 -200
- package/dist/cli/tui/hooks/useTracker.js.map +0 -1
- package/dist/cli/tui/index.d.ts +0 -15
- package/dist/cli/tui/index.d.ts.map +0 -1
- package/dist/cli/tui/index.js +0 -100
- package/dist/cli/tui/index.js.map +0 -1
- package/dist/cli/tui/ink-wrapper.d.ts +0 -43
- package/dist/cli/tui/ink-wrapper.d.ts.map +0 -1
- package/dist/cli/tui/ink-wrapper.js +0 -41
- package/dist/cli/tui/ink-wrapper.js.map +0 -1
- package/dist/cli/tui/types.d.ts +0 -37
- package/dist/cli/tui/types.d.ts.map +0 -1
- package/dist/cli/tui/types.js +0 -6
- package/dist/cli/tui/types.js.map +0 -1
- package/dist/cli/tui/utils/calldata-formatter.d.ts +0 -17
- package/dist/cli/tui/utils/calldata-formatter.d.ts.map +0 -1
- package/dist/cli/tui/utils/calldata-formatter.js +0 -91
- package/dist/cli/tui/utils/calldata-formatter.js.map +0 -1
- package/dist/cli/tui/utils/clipboard.d.ts +0 -7
- package/dist/cli/tui/utils/clipboard.d.ts.map +0 -1
- package/dist/cli/tui/utils/clipboard.js +0 -46
- package/dist/cli/tui/utils/clipboard.js.map +0 -1
- package/dist/cli/tui/utils/help-data.d.ts +0 -15
- package/dist/cli/tui/utils/help-data.d.ts.map +0 -1
- package/dist/cli/tui/utils/help-data.js +0 -88
- package/dist/cli/tui/utils/help-data.js.map +0 -1
- package/dist/cli/tui/utils/index.d.ts +0 -16
- package/dist/cli/tui/utils/index.d.ts.map +0 -1
- package/dist/cli/tui/utils/index.js +0 -36
- package/dist/cli/tui/utils/index.js.map +0 -1
- package/dist/cli/tui/utils/markdown-parser.d.ts +0 -11
- package/dist/cli/tui/utils/markdown-parser.d.ts.map +0 -1
- package/dist/cli/tui/utils/markdown-parser.js +0 -100
- package/dist/cli/tui/utils/markdown-parser.js.map +0 -1
- package/dist/cli/tui/utils/proposal-detail-helpers.d.ts +0 -17
- package/dist/cli/tui/utils/proposal-detail-helpers.d.ts.map +0 -1
- package/dist/cli/tui/utils/proposal-detail-helpers.js +0 -46
- package/dist/cli/tui/utils/proposal-detail-helpers.js.map +0 -1
- package/dist/cli/tui/utils/settings-data.d.ts +0 -36
- package/dist/cli/tui/utils/settings-data.d.ts.map +0 -1
- package/dist/cli/tui/utils/settings-data.js +0 -220
- package/dist/cli/tui/utils/settings-data.js.map +0 -1
- package/dist/cli/tui/utils/stage-formatter.d.ts +0 -13
- package/dist/cli/tui/utils/stage-formatter.d.ts.map +0 -1
- package/dist/cli/tui/utils/stage-formatter.js +0 -100
- package/dist/cli/tui/utils/stage-formatter.js.map +0 -1
- package/dist/cli/tui/utils/terminal.d.ts +0 -18
- package/dist/cli/tui/utils/terminal.d.ts.map +0 -1
- package/dist/cli/tui/utils/terminal.js +0 -26
- package/dist/cli/tui/utils/terminal.js.map +0 -1
- package/dist/cli/tui/utils/text.d.ts +0 -12
- package/dist/cli/tui/utils/text.d.ts.map +0 -1
- package/dist/cli/tui/utils/text.js +0 -30
- package/dist/cli/tui/utils/text.js.map +0 -1
- package/dist/cli/tui/views/CalldataView.d.ts +0 -12
- package/dist/cli/tui/views/CalldataView.d.ts.map +0 -1
- package/dist/cli/tui/views/CalldataView.js +0 -123
- package/dist/cli/tui/views/CalldataView.js.map +0 -1
- package/dist/cli/tui/views/DescriptionView.d.ts +0 -12
- package/dist/cli/tui/views/DescriptionView.d.ts.map +0 -1
- package/dist/cli/tui/views/DescriptionView.js +0 -98
- package/dist/cli/tui/views/DescriptionView.js.map +0 -1
- package/dist/cli/tui/views/ElectionView.d.ts +0 -12
- package/dist/cli/tui/views/ElectionView.d.ts.map +0 -1
- package/dist/cli/tui/views/ElectionView.js +0 -297
- package/dist/cli/tui/views/ElectionView.js.map +0 -1
- package/dist/cli/tui/views/HelpView.d.ts +0 -10
- package/dist/cli/tui/views/HelpView.d.ts.map +0 -1
- package/dist/cli/tui/views/HelpView.js +0 -90
- package/dist/cli/tui/views/HelpView.js.map +0 -1
- package/dist/cli/tui/views/ProposalDetail.d.ts +0 -14
- package/dist/cli/tui/views/ProposalDetail.d.ts.map +0 -1
- package/dist/cli/tui/views/ProposalDetail.js +0 -122
- package/dist/cli/tui/views/ProposalDetail.js.map +0 -1
- package/dist/cli/tui/views/ProposalList.d.ts +0 -17
- package/dist/cli/tui/views/ProposalList.d.ts.map +0 -1
- package/dist/cli/tui/views/ProposalList.js +0 -143
- package/dist/cli/tui/views/ProposalList.js.map +0 -1
- package/dist/cli/tui/views/SettingsView.d.ts +0 -12
- package/dist/cli/tui/views/SettingsView.d.ts.map +0 -1
- package/dist/cli/tui/views/SettingsView.js +0 -133
- package/dist/cli/tui/views/SettingsView.js.map +0 -1
- package/dist/cli/tui/views/SimulationView.d.ts +0 -12
- package/dist/cli/tui/views/SimulationView.d.ts.map +0 -1
- package/dist/cli/tui/views/SimulationView.js +0 -113
- package/dist/cli/tui/views/SimulationView.js.map +0 -1
- package/dist/cli/tui/views/StageView.d.ts +0 -12
- package/dist/cli/tui/views/StageView.d.ts.map +0 -1
- package/dist/cli/tui/views/StageView.js +0 -127
- package/dist/cli/tui/views/StageView.js.map +0 -1
- package/dist/election.d.ts +0 -312
- package/dist/election.d.ts.map +0 -1
- package/dist/election.js +0 -911
- package/dist/election.js.map +0 -1
- package/dist/types/cross-chain.d.ts +0 -24
- package/dist/types/cross-chain.d.ts.map +0 -1
- package/dist/types/cross-chain.js +0 -6
- package/dist/types/cross-chain.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,oBAAoB,EAEpB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,oBAAoB,EAEpB,cAAc,EACd,kBAAkB,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E,kBAAkB,CAAC,EAC5C,OAAO,EAAE,gBAAgB,GACxB,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAQjC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAC5C,OAAO,EAAE,gBAAgB,EACzB,aAAa,GAAE,MAAU,GACxB,YAAY,CAqEd;AAED,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;IAChC,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC,CAAC,CAgRD;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
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.loopOptions = exports.gasOptions = exports.chunkingOptions = exports.executionOptions = exports.cacheOptions = exports.verboseOption = exports.rpcOptions = exports.HEALTH_CHECK_TIMEOUT_MS = 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.validateCliOptions = validateCliOptions;
|
|
17
18
|
exports.parseGasSettings = parseGasSettings;
|
|
18
19
|
exports.parseChunkingConfig = parseChunkingConfig;
|
|
19
20
|
exports.createProvidersFromOptions = createProvidersFromOptions;
|
|
@@ -24,9 +25,12 @@ exports.formatDryRun = formatDryRun;
|
|
|
24
25
|
exports.formatMultiplePreparedTransactions = formatMultiplePreparedTransactions;
|
|
25
26
|
exports.formatTrackingResult = formatTrackingResult;
|
|
26
27
|
exports.formatCacheStatus = formatCacheStatus;
|
|
28
|
+
exports.formatElectionResult = formatElectionResult;
|
|
27
29
|
exports.displayTrackingResult = displayTrackingResult;
|
|
28
30
|
exports.isShuttingDown = isShuttingDown;
|
|
29
31
|
exports.runWithLoop = runWithLoop;
|
|
32
|
+
exports.filterCheckpointsByTargets = filterCheckpointsByTargets;
|
|
33
|
+
exports.calculateFilteredStats = calculateFilteredStats;
|
|
30
34
|
exports.runMonitorCycle = runMonitorCycle;
|
|
31
35
|
exports.trackAndPrepare = trackAndPrepare;
|
|
32
36
|
const commander_1 = require("commander");
|
|
@@ -115,6 +119,59 @@ exports.loopOptions = [
|
|
|
115
119
|
function addOptions(cmd, opts) {
|
|
116
120
|
opts.forEach((o) => cmd.addOption(o));
|
|
117
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Validate CLI options for contradictions and conflicts.
|
|
124
|
+
* Throws an error if conflicting options are detected.
|
|
125
|
+
*/
|
|
126
|
+
function validateCliOptions(opts, command) {
|
|
127
|
+
const errors = [];
|
|
128
|
+
// Cache conflicts
|
|
129
|
+
if (opts.cache && opts.noCache) {
|
|
130
|
+
errors.push({
|
|
131
|
+
flags: ["--cache", "--no-cache"],
|
|
132
|
+
message: "--cache and --no-cache are mutually exclusive",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// --force overrides --start-block (warn, not error)
|
|
136
|
+
if (opts.force && opts.startBlock) {
|
|
137
|
+
errors.push({
|
|
138
|
+
flags: ["--force", "--start-block"],
|
|
139
|
+
message: "--force resets discovery to block 0, overriding --start-block",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Track command specific validations
|
|
143
|
+
if (command === "track") {
|
|
144
|
+
// --inspect and --inspect-only are mutually exclusive
|
|
145
|
+
if (opts.inspect && opts.inspectOnly) {
|
|
146
|
+
errors.push({
|
|
147
|
+
flags: ["--inspect", "--inspect-only"],
|
|
148
|
+
message: "--inspect and --inspect-only are mutually exclusive",
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// --inspect-only skips tracking, so execution options don't make sense
|
|
152
|
+
if (opts.inspectOnly) {
|
|
153
|
+
const conflictingFlags = [];
|
|
154
|
+
if (opts.prepare)
|
|
155
|
+
conflictingFlags.push("--prepare");
|
|
156
|
+
if (opts.write)
|
|
157
|
+
conflictingFlags.push("--write");
|
|
158
|
+
if (opts.prepareCompleted)
|
|
159
|
+
conflictingFlags.push("--prepare-completed");
|
|
160
|
+
if (opts.preparePending)
|
|
161
|
+
conflictingFlags.push("--prepare-pending");
|
|
162
|
+
if (conflictingFlags.length > 0) {
|
|
163
|
+
errors.push({
|
|
164
|
+
flags: ["--inspect-only", ...conflictingFlags],
|
|
165
|
+
message: `--inspect-only skips tracking; ${conflictingFlags.join(", ")} require tracking`,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (errors.length > 0) {
|
|
171
|
+
const messages = errors.map((e) => ` ${e.flags.join(" + ")}: ${e.message}`);
|
|
172
|
+
throw new Error(`Conflicting options detected:\n${messages.join("\n")}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
118
175
|
/**
|
|
119
176
|
* Parse gas settings from CLI options
|
|
120
177
|
*/
|
|
@@ -341,113 +398,112 @@ function formatTrackingResult(result, label) {
|
|
|
341
398
|
}
|
|
342
399
|
return lines.join("\n").concat("\n");
|
|
343
400
|
}
|
|
344
|
-
function formatCacheStatus(checkpoints) {
|
|
345
|
-
|
|
346
|
-
let timelockTotal = 0, timelockComplete = 0, timelockActive = 0, timelockFailed = 0;
|
|
347
|
-
let electionTotal = 0, electionComplete = 0, electionActive = 0;
|
|
348
|
-
for (const [, checkpoint] of checkpoints) {
|
|
349
|
-
const stages = checkpoint.cachedData?.completedStages ?? [];
|
|
350
|
-
const isComplete = stages.length > 0 && (0, index_1.areAllStagesComplete)(stages);
|
|
351
|
-
const errorCount = checkpoint.metadata?.errorCount ?? 0;
|
|
352
|
-
const isFailed = errorCount >= exports.MAX_CONSECUTIVE_ERRORS;
|
|
353
|
-
const input = checkpoint.input;
|
|
354
|
-
if (input.type === "governor") {
|
|
355
|
-
if ((0, index_1.isElectionGovernor)(input.governorAddress)) {
|
|
356
|
-
// Legacy election governor checkpoints (discovered but not tracked)
|
|
357
|
-
// These will be replaced by proper election checkpoints
|
|
358
|
-
electionTotal++;
|
|
359
|
-
if (isComplete)
|
|
360
|
-
electionComplete++;
|
|
361
|
-
else
|
|
362
|
-
electionActive++;
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
proposalTotal++;
|
|
366
|
-
if (isComplete)
|
|
367
|
-
proposalComplete++;
|
|
368
|
-
else if (isFailed)
|
|
369
|
-
proposalFailed++;
|
|
370
|
-
else
|
|
371
|
-
proposalActive++;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
else if (input.type === "timelock") {
|
|
375
|
-
timelockTotal++;
|
|
376
|
-
if (isComplete)
|
|
377
|
-
timelockComplete++;
|
|
378
|
-
else if (isFailed)
|
|
379
|
-
timelockFailed++;
|
|
380
|
-
else
|
|
381
|
-
timelockActive++;
|
|
382
|
-
}
|
|
383
|
-
else if (input.type === "election") {
|
|
384
|
-
// Proper election checkpoints with phase tracking
|
|
385
|
-
electionTotal++;
|
|
386
|
-
const electionStatus = checkpoint.cachedData?.electionStatus;
|
|
387
|
-
if (electionStatus?.phase === "COMPLETED") {
|
|
388
|
-
electionComplete++;
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
electionActive++;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
401
|
+
function formatCacheStatus(checkpoints, elections) {
|
|
402
|
+
const stats = (0, index_1.computeCacheStats)(checkpoints, elections, exports.MAX_CONSECUTIVE_ERRORS);
|
|
395
403
|
const lines = [
|
|
396
|
-
`Total cached: ${
|
|
404
|
+
`Total cached: ${stats.total}`,
|
|
397
405
|
``,
|
|
398
|
-
`Proposals: ${
|
|
399
|
-
` Complete: ${
|
|
400
|
-
` Active: ${
|
|
406
|
+
`Proposals: ${stats.proposals.total}`,
|
|
407
|
+
` Complete: ${stats.proposals.complete}`,
|
|
408
|
+
` Active: ${stats.proposals.active}`,
|
|
401
409
|
];
|
|
402
|
-
if (
|
|
403
|
-
lines.push(` Failed: ${
|
|
404
|
-
lines.push(``, `Timelock Ops: ${
|
|
405
|
-
if (
|
|
406
|
-
lines.push(` Failed: ${
|
|
407
|
-
if (
|
|
408
|
-
|
|
410
|
+
if (stats.proposals.errored > 0)
|
|
411
|
+
lines.push(` Failed: ${stats.proposals.errored}`);
|
|
412
|
+
lines.push(``, `Timelock Ops: ${stats.timelocks.total}`, ` Complete: ${stats.timelocks.complete}`, ` Active: ${stats.timelocks.active}`);
|
|
413
|
+
if (stats.timelocks.errored > 0)
|
|
414
|
+
lines.push(` Failed: ${stats.timelocks.errored}`);
|
|
415
|
+
if (stats.elections.total > 0) {
|
|
416
|
+
const active = stats.elections.total - stats.elections.complete;
|
|
417
|
+
lines.push(``, `Elections: ${stats.elections.total}`, ` Complete: ${stats.elections.complete}`, ` Active: ${active}`);
|
|
418
|
+
}
|
|
419
|
+
return lines.join("\n");
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Format an election status for CLI output
|
|
423
|
+
*/
|
|
424
|
+
function formatElectionResult(election) {
|
|
425
|
+
const lines = [];
|
|
426
|
+
const cohortName = election.cohort === 0 ? "First" : "Second";
|
|
427
|
+
const phaseName = election.phase.replace(/_/g, " ");
|
|
428
|
+
lines.push(`[Election #${election.electionIndex}]`);
|
|
429
|
+
lines.push(`Phase: ${phaseName}`);
|
|
430
|
+
lines.push(`Cohort: ${cohortName}`);
|
|
431
|
+
lines.push(`Complete: ${election.phase === "COMPLETED"}`);
|
|
432
|
+
lines.push(`Stages: ${election.stages?.length ?? 0}`);
|
|
433
|
+
lines.push("");
|
|
434
|
+
if (election.stages && election.stages.length > 0) {
|
|
435
|
+
for (let i = 0; i < election.stages.length; i++) {
|
|
436
|
+
const stage = election.stages[i];
|
|
437
|
+
const statusStr = stage.status;
|
|
438
|
+
const title = (0, index_1.formatStageTitle)(stage.type);
|
|
439
|
+
const eta = (0, index_1.calculateExpectedEta)(election.stages, i);
|
|
440
|
+
let line = ` ${title}: ${statusStr}`;
|
|
441
|
+
if (eta)
|
|
442
|
+
line += ` | ETA: ${new Date(eta * 1000).toISOString()}`;
|
|
443
|
+
lines.push(line);
|
|
444
|
+
for (const tx of stage.transactions) {
|
|
445
|
+
lines.push(` tx: ${tx.hash}`);
|
|
446
|
+
const url = (0, index_1.getStageTransactionUrl)(tx);
|
|
447
|
+
if (url)
|
|
448
|
+
lines.push(` ${url}`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
409
451
|
}
|
|
452
|
+
// Show timelock operation ID if tracked (useful for cross-referencing)
|
|
453
|
+
if (election.timelockOperationId) {
|
|
454
|
+
lines.push(` Timelock Op: ${election.timelockOperationId}`);
|
|
455
|
+
}
|
|
456
|
+
if (election.canProceedToMemberPhase) {
|
|
457
|
+
lines.push("");
|
|
458
|
+
lines.push(" → Ready to trigger member election");
|
|
459
|
+
}
|
|
460
|
+
if (election.canExecuteMember) {
|
|
461
|
+
lines.push("");
|
|
462
|
+
lines.push(" → Ready to execute member election");
|
|
463
|
+
}
|
|
464
|
+
if (election.canCreateElection) {
|
|
465
|
+
lines.push("");
|
|
466
|
+
lines.push(" → Ready to create election");
|
|
467
|
+
}
|
|
468
|
+
lines.push("");
|
|
410
469
|
return lines.join("\n");
|
|
411
470
|
}
|
|
412
471
|
/**
|
|
413
472
|
* Display a tracking result, automatically switching to election display for election proposals.
|
|
414
473
|
* Handles the election auto-switch logic internally, falling back to formatTrackingResult for non-elections.
|
|
474
|
+
*
|
|
475
|
+
* @param result - Tracking result to display
|
|
476
|
+
* @param label - Optional label prefix
|
|
415
477
|
*/
|
|
416
|
-
|
|
417
|
-
if (result.isElection) {
|
|
418
|
-
const
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
console.log(
|
|
426
|
-
console.log(
|
|
427
|
-
console.log(`
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
console.log(`\nElection ID: ${election.nomineeProposalId}`);
|
|
431
|
-
console.log(`\nNominee Phase:`);
|
|
432
|
-
console.log(` State: ${election.nomineeProposalState}`);
|
|
433
|
-
if (election.vettingDeadline) {
|
|
434
|
-
console.log(` Vetting Deadline: block ${election.vettingDeadline}`);
|
|
435
|
-
}
|
|
436
|
-
console.log(` In Vetting Period: ${election.isInVettingPeriod ? "YES" : "NO"}`);
|
|
478
|
+
function displayTrackingResult(result, label) {
|
|
479
|
+
if (result.isElection && result.electionStatus) {
|
|
480
|
+
const election = result.electionStatus;
|
|
481
|
+
const cohortName = election.cohort === 0 ? "First" : "Second";
|
|
482
|
+
console.log(`=== Election #${election.electionIndex} ===`);
|
|
483
|
+
console.log(`Phase: ${election.phase}`);
|
|
484
|
+
console.log(`Cohort: ${cohortName} (${election.cohort})`);
|
|
485
|
+
console.log(`Compliant Nominees: ${election.compliantNomineeCount}/${election.targetNomineeCount}`);
|
|
486
|
+
if (election.nomineeProposalId) {
|
|
487
|
+
console.log(`\nElection ID: ${election.nomineeProposalId}`);
|
|
488
|
+
console.log(`\nNominee Phase:`);
|
|
489
|
+
console.log(` State: ${election.nomineeProposalState}`);
|
|
490
|
+
if (election.vettingDeadline) {
|
|
491
|
+
console.log(` Vetting Deadline: block ${election.vettingDeadline}`);
|
|
437
492
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
console.log(`\n→ Ready to execute member election`);
|
|
447
|
-
}
|
|
448
|
-
console.log("");
|
|
449
|
-
return;
|
|
493
|
+
console.log(` In Vetting Period: ${election.isInVettingPeriod ? "YES" : "NO"}`);
|
|
494
|
+
}
|
|
495
|
+
if (election.memberProposalId) {
|
|
496
|
+
console.log(`\nMember Phase:`);
|
|
497
|
+
console.log(` State: ${election.memberProposalState}`);
|
|
498
|
+
}
|
|
499
|
+
if (election.canProceedToMemberPhase) {
|
|
500
|
+
console.log(`\n→ Ready to trigger member election`);
|
|
450
501
|
}
|
|
502
|
+
if (election.canExecuteMember) {
|
|
503
|
+
console.log(`\n→ Ready to execute member election`);
|
|
504
|
+
}
|
|
505
|
+
console.log("");
|
|
506
|
+
return;
|
|
451
507
|
}
|
|
452
508
|
console.log(formatTrackingResult(result, label));
|
|
453
509
|
}
|
|
@@ -608,7 +664,145 @@ function shortScope(key) {
|
|
|
608
664
|
}
|
|
609
665
|
return key;
|
|
610
666
|
}
|
|
667
|
+
/**
|
|
668
|
+
* Check if a checkpoint matches the enabled discovery targets.
|
|
669
|
+
* Used to filter incomplete checkpoints to only re-track types that are enabled.
|
|
670
|
+
*/
|
|
671
|
+
function checkpointMatchesTargets(checkpoint, targets) {
|
|
672
|
+
if (checkpoint.input.type === "governor") {
|
|
673
|
+
const governorAddress = checkpoint.input.governorAddress;
|
|
674
|
+
// Skip election governors - they're handled separately
|
|
675
|
+
if ((0, index_1.isElectionGovernor)(governorAddress))
|
|
676
|
+
return false;
|
|
677
|
+
// Check if constitutional or non-constitutional governor is enabled
|
|
678
|
+
const isCore = (0, index_1.isConstitutional)(governorAddress);
|
|
679
|
+
return isCore ? !!targets.constitutionalGovernor : !!targets.nonConstitutionalGovernor;
|
|
680
|
+
}
|
|
681
|
+
if (checkpoint.input.type === "timelock") {
|
|
682
|
+
// Timelock operations: check if the corresponding timelock target is enabled
|
|
683
|
+
const timelockAddress = checkpoint.input.timelockAddress;
|
|
684
|
+
const isCore = (0, index_1.isConstitutional)(timelockAddress);
|
|
685
|
+
return isCore ? !!targets.l2ConstitutionalTimelock : !!targets.l2NonConstitutionalTimelock;
|
|
686
|
+
}
|
|
687
|
+
if (checkpoint.input.type === "election") {
|
|
688
|
+
return !!targets.electionNomineeGovernor || !!targets.electionMemberGovernor;
|
|
689
|
+
}
|
|
690
|
+
// Discovery checkpoints don't need re-tracking
|
|
691
|
+
return false;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Filter checkpoints to only include those matching enabled discovery targets.
|
|
695
|
+
* Used for JSON output and stats to ensure we only show tracked types.
|
|
696
|
+
*/
|
|
697
|
+
function filterCheckpointsByTargets(checkpoints, targets) {
|
|
698
|
+
const filtered = new Map();
|
|
699
|
+
for (const [key, checkpoint] of checkpoints) {
|
|
700
|
+
if (checkpointMatchesTargets(checkpoint, targets)) {
|
|
701
|
+
filtered.set(key, checkpoint);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
return filtered;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Calculate stats filtered by enabled discovery targets.
|
|
708
|
+
* Only counts checkpoints that match the enabled governors/timelocks.
|
|
709
|
+
*/
|
|
710
|
+
function calculateFilteredStats(checkpoints, targets, maxErrorCount = 5) {
|
|
711
|
+
let proposalTotal = 0, proposalComplete = 0, proposalActive = 0, proposalErrored = 0;
|
|
712
|
+
let timelockTotal = 0, timelockComplete = 0, timelockActive = 0, timelockErrored = 0;
|
|
713
|
+
let electionTotal = 0, electionComplete = 0;
|
|
714
|
+
for (const [, checkpoint] of checkpoints) {
|
|
715
|
+
const complete = (0, index_1.isCheckpointComplete)(checkpoint);
|
|
716
|
+
const errored = (0, index_1.isCheckpointErrored)(checkpoint, maxErrorCount);
|
|
717
|
+
const inputType = checkpoint.input.type;
|
|
718
|
+
if (inputType === "governor") {
|
|
719
|
+
const governorAddress = checkpoint.input.governorAddress;
|
|
720
|
+
if ((0, index_1.isElectionGovernor)(governorAddress))
|
|
721
|
+
continue;
|
|
722
|
+
const isCore = (0, index_1.isConstitutional)(governorAddress);
|
|
723
|
+
const matchesTarget = isCore
|
|
724
|
+
? !!targets.constitutionalGovernor
|
|
725
|
+
: !!targets.nonConstitutionalGovernor;
|
|
726
|
+
if (!matchesTarget)
|
|
727
|
+
continue;
|
|
728
|
+
proposalTotal++;
|
|
729
|
+
if (complete)
|
|
730
|
+
proposalComplete++;
|
|
731
|
+
else if (errored)
|
|
732
|
+
proposalErrored++;
|
|
733
|
+
else
|
|
734
|
+
proposalActive++;
|
|
735
|
+
}
|
|
736
|
+
else if (inputType === "timelock") {
|
|
737
|
+
const timelockAddress = checkpoint.input.timelockAddress;
|
|
738
|
+
const isCore = (0, index_1.isConstitutional)(timelockAddress);
|
|
739
|
+
const matchesTarget = isCore
|
|
740
|
+
? !!targets.l2ConstitutionalTimelock
|
|
741
|
+
: !!targets.l2NonConstitutionalTimelock;
|
|
742
|
+
if (!matchesTarget)
|
|
743
|
+
continue;
|
|
744
|
+
timelockTotal++;
|
|
745
|
+
if (complete)
|
|
746
|
+
timelockComplete++;
|
|
747
|
+
else if (errored)
|
|
748
|
+
timelockErrored++;
|
|
749
|
+
else
|
|
750
|
+
timelockActive++;
|
|
751
|
+
}
|
|
752
|
+
else if (inputType === "election") {
|
|
753
|
+
// Only count elections if election tracking is enabled
|
|
754
|
+
if (!targets.electionNomineeGovernor && !targets.electionMemberGovernor)
|
|
755
|
+
continue;
|
|
756
|
+
electionTotal++;
|
|
757
|
+
if (complete)
|
|
758
|
+
electionComplete++;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return {
|
|
762
|
+
total: proposalTotal + timelockTotal + electionTotal,
|
|
763
|
+
proposals: {
|
|
764
|
+
total: proposalTotal,
|
|
765
|
+
complete: proposalComplete,
|
|
766
|
+
active: proposalActive,
|
|
767
|
+
errored: proposalErrored,
|
|
768
|
+
},
|
|
769
|
+
timelocks: {
|
|
770
|
+
total: timelockTotal,
|
|
771
|
+
complete: timelockComplete,
|
|
772
|
+
active: timelockActive,
|
|
773
|
+
errored: timelockErrored,
|
|
774
|
+
},
|
|
775
|
+
elections: { total: electionTotal, complete: electionComplete },
|
|
776
|
+
};
|
|
777
|
+
}
|
|
611
778
|
async function runMonitorCycle(tracker, providers, options = {}) {
|
|
779
|
+
const result = { tracked: 0, prepared: 0, errors: 0, retracked: 0 };
|
|
780
|
+
// Fast path: elections-only mode skips discovery entirely
|
|
781
|
+
if (options.electionsOnly) {
|
|
782
|
+
const elections = [];
|
|
783
|
+
if (!isShuttingDown()) {
|
|
784
|
+
try {
|
|
785
|
+
// Use tracker's cached method - completed elections use cache (0 RPC calls)
|
|
786
|
+
// Use forceElections to bypass cache when --force is specified
|
|
787
|
+
const allElections = await tracker.trackAllElections({ force: options.forceElections });
|
|
788
|
+
for (const electionStatus of allElections) {
|
|
789
|
+
elections.push(electionStatus);
|
|
790
|
+
// Print each election
|
|
791
|
+
console.log(formatElectionResult(electionStatus));
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
catch (err) {
|
|
795
|
+
console.error("Election tracking failed:", err);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
return {
|
|
799
|
+
result,
|
|
800
|
+
proposals: [],
|
|
801
|
+
timelockOps: [],
|
|
802
|
+
watermarks: {},
|
|
803
|
+
elections,
|
|
804
|
+
};
|
|
805
|
+
}
|
|
612
806
|
const l2Provider = providers.l2Provider;
|
|
613
807
|
const tipBlock = await l2Provider.getBlockNumber();
|
|
614
808
|
const blockLag = options.blockLag ?? exports.DEFAULT_BLOCK_LAG;
|
|
@@ -620,6 +814,9 @@ async function runMonitorCycle(tracker, providers, options = {}) {
|
|
|
620
814
|
// ~7200 blocks per day on Arbitrum (12s block time on L1, ~250ms on L2)
|
|
621
815
|
const BLOCKS_PER_DAY = 86400 / 0.25; // ~345,600 blocks/day on Arbitrum One
|
|
622
816
|
let startBlockWatermarks;
|
|
817
|
+
// Load existing watermarks to determine scan range
|
|
818
|
+
const loadedWatermarks = await tracker.loadWatermarks();
|
|
819
|
+
const hasWatermarks = Object.values(loadedWatermarks.watermarks).some((v) => v !== undefined);
|
|
623
820
|
if (options.startBlock !== undefined) {
|
|
624
821
|
// Explicit startBlock override (watermarks are exclusive, so subtract 1)
|
|
625
822
|
startBlockWatermarks = {
|
|
@@ -630,28 +827,30 @@ async function runMonitorCycle(tracker, providers, options = {}) {
|
|
|
630
827
|
l2ConstitutionalTimelock: options.startBlock - 1,
|
|
631
828
|
l2NonConstitutionalTimelock: options.startBlock - 1,
|
|
632
829
|
};
|
|
830
|
+
console.log(`Discovery: blocks ${options.startBlock} → ${currentBlock}`);
|
|
831
|
+
}
|
|
832
|
+
else if (!hasWatermarks) {
|
|
833
|
+
// No cache - calculate start block from maxAgeDays
|
|
834
|
+
const defaultStartBlock = Math.max(0, currentBlock - Math.floor(maxAgeDays * BLOCKS_PER_DAY));
|
|
835
|
+
startBlockWatermarks = {
|
|
836
|
+
constitutionalGovernor: defaultStartBlock,
|
|
837
|
+
nonConstitutionalGovernor: defaultStartBlock,
|
|
838
|
+
electionNomineeGovernor: defaultStartBlock,
|
|
839
|
+
electionMemberGovernor: defaultStartBlock,
|
|
840
|
+
l2ConstitutionalTimelock: defaultStartBlock,
|
|
841
|
+
l2NonConstitutionalTimelock: defaultStartBlock,
|
|
842
|
+
};
|
|
843
|
+
console.log(`No cached watermarks. Discovery: blocks ${defaultStartBlock} → ${currentBlock} (~${maxAgeDays} days)`);
|
|
633
844
|
}
|
|
634
845
|
else {
|
|
635
|
-
//
|
|
636
|
-
const
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const defaultStartBlock = Math.max(0, currentBlock - Math.floor(maxAgeDays * BLOCKS_PER_DAY));
|
|
641
|
-
startBlockWatermarks = {
|
|
642
|
-
constitutionalGovernor: defaultStartBlock,
|
|
643
|
-
nonConstitutionalGovernor: defaultStartBlock,
|
|
644
|
-
electionNomineeGovernor: defaultStartBlock,
|
|
645
|
-
electionMemberGovernor: defaultStartBlock,
|
|
646
|
-
l2ConstitutionalTimelock: defaultStartBlock,
|
|
647
|
-
l2NonConstitutionalTimelock: defaultStartBlock,
|
|
648
|
-
};
|
|
649
|
-
console.log(`No cached watermarks found. Starting discovery from ~${maxAgeDays} days ago (block ${defaultStartBlock})`);
|
|
650
|
-
}
|
|
846
|
+
// Cached watermarks exist - calculate effective range from min watermark
|
|
847
|
+
const watermarkBlocks = Object.values(loadedWatermarks.watermarks).filter((v) => v !== undefined);
|
|
848
|
+
const minWatermark = Math.min(...watermarkBlocks);
|
|
849
|
+
const blockRange = currentBlock - minWatermark;
|
|
850
|
+
console.log(`Discovery: blocks ${minWatermark} → ${currentBlock} (${blockRange.toLocaleString()} blocks)`);
|
|
651
851
|
}
|
|
652
852
|
const targets = options.targets ?? (0, index_1.buildDefaultTargets)();
|
|
653
853
|
const discoveryResult = await tracker.discoverAll(targets, currentBlock, startBlockWatermarks);
|
|
654
|
-
const result = { tracked: 0, prepared: 0, errors: 0, retracked: 0 };
|
|
655
854
|
const trackedKeys = new Set();
|
|
656
855
|
const trackedOperationIds = new Set();
|
|
657
856
|
async function track(key, trackFn) {
|
|
@@ -735,14 +934,10 @@ async function runMonitorCycle(tracker, providers, options = {}) {
|
|
|
735
934
|
},
|
|
736
935
|
});
|
|
737
936
|
}
|
|
738
|
-
// 1b. Incomplete
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
return true;
|
|
743
|
-
});
|
|
744
|
-
result.retracked = nonElectionCheckpoints.length;
|
|
745
|
-
for (const { key, checkpoint } of nonElectionCheckpoints) {
|
|
937
|
+
// 1b. Incomplete checkpoints to re-track (filtered by enabled targets)
|
|
938
|
+
const targetMatchingCheckpoints = incompleteCheckpoints.filter(({ checkpoint }) => checkpointMatchesTargets(checkpoint, targets));
|
|
939
|
+
result.retracked = targetMatchingCheckpoints.length;
|
|
940
|
+
for (const { key, checkpoint } of targetMatchingCheckpoints) {
|
|
746
941
|
if (checkpoint.input.type === "governor") {
|
|
747
942
|
proposalTasks.push({
|
|
748
943
|
key,
|
|
@@ -780,7 +975,7 @@ async function runMonitorCycle(tracker, providers, options = {}) {
|
|
|
780
975
|
});
|
|
781
976
|
}
|
|
782
977
|
// 2b. Incomplete timelock checkpoints to re-track
|
|
783
|
-
for (const { key, checkpoint } of
|
|
978
|
+
for (const { key, checkpoint } of targetMatchingCheckpoints) {
|
|
784
979
|
if (checkpoint.input.type === "timelock") {
|
|
785
980
|
const operationId = checkpoint.input.operationId;
|
|
786
981
|
// Skip if already tracked via proposal
|
|
@@ -796,15 +991,15 @@ async function runMonitorCycle(tracker, providers, options = {}) {
|
|
|
796
991
|
}
|
|
797
992
|
// Run timelock tasks
|
|
798
993
|
await Promise.all(timelockTasks.map((task) => limit(() => track(task.key, task.fn))));
|
|
799
|
-
// Phase 3: Track elections
|
|
800
|
-
// This tracks all elections and stores their status in the cache
|
|
994
|
+
// Phase 3: Track elections (only if election targets are enabled)
|
|
801
995
|
const elections = [];
|
|
802
|
-
|
|
996
|
+
const shouldTrackElections = targets.electionNomineeGovernor || targets.electionMemberGovernor;
|
|
997
|
+
if (shouldTrackElections && !isShuttingDown()) {
|
|
803
998
|
try {
|
|
804
|
-
|
|
999
|
+
// Use tracker's cached method - completed elections use cache (0 RPC calls)
|
|
1000
|
+
const allElections = await tracker.trackAllElections({ force: options.forceElections });
|
|
805
1001
|
for (const electionStatus of allElections) {
|
|
806
1002
|
elections.push(electionStatus);
|
|
807
|
-
await tracker.saveElectionCheckpoint(electionStatus);
|
|
808
1003
|
}
|
|
809
1004
|
}
|
|
810
1005
|
catch (err) {
|