gate-evm-tools 1.0.26 → 1.0.27
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 +14 -0
- package/bin/workflow.cjs +19 -0
- package/dist/core/BytecodeChecker.d.ts.map +1 -1
- package/dist/core/BytecodeChecker.js +16 -1
- package/dist/core/BytecodeChecker.js.map +1 -1
- package/dist/core/legacyProxyArtifact.d.ts +6 -0
- package/dist/core/legacyProxyArtifact.d.ts.map +1 -0
- package/dist/core/legacyProxyArtifact.js +36 -0
- package/dist/core/legacyProxyArtifact.js.map +1 -0
- package/dist-runtime/config/hardhatAdapters.d.ts +5 -0
- package/dist-runtime/config/hardhatAdapters.js +53 -0
- package/dist-runtime/config/hardhatAdapters.js.map +1 -0
- package/dist-runtime/config/networks.d.ts +8 -0
- package/dist-runtime/config/networks.js +269 -0
- package/dist-runtime/config/networks.js.map +1 -0
- package/dist-runtime/config/openzeppelin.d.ts +28 -0
- package/dist-runtime/config/openzeppelin.js +144 -0
- package/dist-runtime/config/openzeppelin.js.map +1 -0
- package/dist-runtime/config/rpc.d.ts +7 -0
- package/dist-runtime/config/rpc.js +19 -0
- package/dist-runtime/config/rpc.js.map +1 -0
- package/dist-runtime/config/zksyncSolcPath.d.ts +1 -0
- package/dist-runtime/config/zksyncSolcPath.js +61 -0
- package/dist-runtime/config/zksyncSolcPath.js.map +1 -0
- package/dist-runtime/migrate.d.ts +13 -0
- package/dist-runtime/migrate.js +208 -0
- package/dist-runtime/migrate.js.map +1 -0
- package/dist-runtime/package.json +1 -0
- package/dist-runtime/projectHardhat.d.ts +4 -0
- package/dist-runtime/projectHardhat.js +16 -0
- package/dist-runtime/projectHardhat.js.map +1 -0
- package/dist-runtime/runtime-identity.json +4 -0
- package/dist-runtime/template-migration.json +293 -0
- package/dist-runtime/workflow/checkCode.d.ts +1 -0
- package/dist-runtime/workflow/checkCode.js +16 -0
- package/dist-runtime/workflow/checkCode.js.map +1 -0
- package/dist-runtime/workflow/checkCodeFinalize.d.ts +1 -0
- package/dist-runtime/workflow/checkCodeFinalize.js +11 -0
- package/dist-runtime/workflow/checkCodeFinalize.js.map +1 -0
- package/dist-runtime/workflow/checkCodePlan.d.ts +1 -0
- package/dist-runtime/workflow/checkCodePlan.js +11 -0
- package/dist-runtime/workflow/checkCodePlan.js.map +1 -0
- package/dist-runtime/workflow/cli.d.ts +1 -0
- package/dist-runtime/workflow/cli.js +302 -0
- package/dist-runtime/workflow/cli.js.map +1 -0
- package/dist-runtime/workflow/commitContractInfo.d.ts +1 -0
- package/dist-runtime/workflow/commitContractInfo.js +64 -0
- package/dist-runtime/workflow/commitContractInfo.js.map +1 -0
- package/dist-runtime/workflow/create2Hashes.d.ts +1 -0
- package/dist-runtime/workflow/create2Hashes.js +76 -0
- package/dist-runtime/workflow/create2Hashes.js.map +1 -0
- package/dist-runtime/workflow/forkSourceProxy.d.ts +1 -0
- package/dist-runtime/workflow/forkSourceProxy.js +151 -0
- package/dist-runtime/workflow/forkSourceProxy.js.map +1 -0
- package/dist-runtime/workflow/importState.d.ts +1 -0
- package/dist-runtime/workflow/importState.js +193 -0
- package/dist-runtime/workflow/importState.js.map +1 -0
- package/dist-runtime/workflow/lib/authority.d.ts +28 -0
- package/dist-runtime/workflow/lib/authority.js +122 -0
- package/dist-runtime/workflow/lib/authority.js.map +1 -0
- package/dist-runtime/workflow/lib/calldata.d.ts +2 -0
- package/dist-runtime/workflow/lib/calldata.js +8 -0
- package/dist-runtime/workflow/lib/calldata.js.map +1 -0
- package/dist-runtime/workflow/lib/calls.d.ts +23 -0
- package/dist-runtime/workflow/lib/calls.js +316 -0
- package/dist-runtime/workflow/lib/calls.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/args.d.ts +2 -0
- package/dist-runtime/workflow/lib/checkCode/args.js +68 -0
- package/dist-runtime/workflow/lib/checkCode/args.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/command.d.ts +5 -0
- package/dist-runtime/workflow/lib/checkCode/command.js +35 -0
- package/dist-runtime/workflow/lib/checkCode/command.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/dependencies.d.ts +6 -0
- package/dist-runtime/workflow/lib/checkCode/dependencies.js +125 -0
- package/dist-runtime/workflow/lib/checkCode/dependencies.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/finalize.d.ts +17 -0
- package/dist-runtime/workflow/lib/checkCode/finalize.js +174 -0
- package/dist-runtime/workflow/lib/checkCode/finalize.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/index.d.ts +3 -0
- package/dist-runtime/workflow/lib/checkCode/index.js +20 -0
- package/dist-runtime/workflow/lib/checkCode/index.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCode/plan.d.ts +22 -0
- package/dist-runtime/workflow/lib/checkCode/plan.js +145 -0
- package/dist-runtime/workflow/lib/checkCode/plan.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCodeReport.d.ts +25 -0
- package/dist-runtime/workflow/lib/checkCodeReport.js +102 -0
- package/dist-runtime/workflow/lib/checkCodeReport.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.d.ts +87 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.js +964 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -0
- package/dist-runtime/workflow/lib/cliTool.d.ts +10 -0
- package/dist-runtime/workflow/lib/cliTool.js +25 -0
- package/dist-runtime/workflow/lib/cliTool.js.map +1 -0
- package/dist-runtime/workflow/lib/config.d.ts +33 -0
- package/dist-runtime/workflow/lib/config.js +100 -0
- package/dist-runtime/workflow/lib/config.js.map +1 -0
- package/dist-runtime/workflow/lib/contractInfoCandidates.d.ts +82 -0
- package/dist-runtime/workflow/lib/contractInfoCandidates.js +441 -0
- package/dist-runtime/workflow/lib/contractInfoCandidates.js.map +1 -0
- package/dist-runtime/workflow/lib/create2.d.ts +49 -0
- package/dist-runtime/workflow/lib/create2.js +194 -0
- package/dist-runtime/workflow/lib/create2.js.map +1 -0
- package/dist-runtime/workflow/lib/create2Hashes.d.ts +22 -0
- package/dist-runtime/workflow/lib/create2Hashes.js +57 -0
- package/dist-runtime/workflow/lib/create2Hashes.js.map +1 -0
- package/dist-runtime/workflow/lib/deploymentInfo.d.ts +40 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js +240 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js.map +1 -0
- package/dist-runtime/workflow/lib/deploymentRecords.d.ts +137 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js +374 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js.map +1 -0
- package/dist-runtime/workflow/lib/deployments.d.ts +21 -0
- package/dist-runtime/workflow/lib/deployments.js +240 -0
- package/dist-runtime/workflow/lib/deployments.js.map +1 -0
- package/dist-runtime/workflow/lib/erc1967.d.ts +5 -0
- package/dist-runtime/workflow/lib/erc1967.js +29 -0
- package/dist-runtime/workflow/lib/erc1967.js.map +1 -0
- package/dist-runtime/workflow/lib/errors.d.ts +6 -0
- package/dist-runtime/workflow/lib/errors.js +77 -0
- package/dist-runtime/workflow/lib/errors.js.map +1 -0
- package/dist-runtime/workflow/lib/executionId.d.ts +7 -0
- package/dist-runtime/workflow/lib/executionId.js +26 -0
- package/dist-runtime/workflow/lib/executionId.js.map +1 -0
- package/dist-runtime/workflow/lib/executionPlan.d.ts +85 -0
- package/dist-runtime/workflow/lib/executionPlan.js +450 -0
- package/dist-runtime/workflow/lib/executionPlan.js.map +1 -0
- package/dist-runtime/workflow/lib/executionProgress.d.ts +5 -0
- package/dist-runtime/workflow/lib/executionProgress.js +100 -0
- package/dist-runtime/workflow/lib/executionProgress.js.map +1 -0
- package/dist-runtime/workflow/lib/external.d.ts +62 -0
- package/dist-runtime/workflow/lib/external.js +282 -0
- package/dist-runtime/workflow/lib/external.js.map +1 -0
- package/dist-runtime/workflow/lib/externalExecutionScanner.d.ts +64 -0
- package/dist-runtime/workflow/lib/externalExecutionScanner.js +638 -0
- package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -0
- package/dist-runtime/workflow/lib/forkSnapshot.d.ts +34 -0
- package/dist-runtime/workflow/lib/forkSnapshot.js +167 -0
- package/dist-runtime/workflow/lib/forkSnapshot.js.map +1 -0
- package/dist-runtime/workflow/lib/gateTool.d.ts +16 -0
- package/dist-runtime/workflow/lib/gateTool.js +177 -0
- package/dist-runtime/workflow/lib/gateTool.js.map +1 -0
- package/dist-runtime/workflow/lib/gateToolSync.d.ts +22 -0
- package/dist-runtime/workflow/lib/gateToolSync.js +253 -0
- package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -0
- package/dist-runtime/workflow/lib/lock.d.ts +52 -0
- package/dist-runtime/workflow/lib/lock.js +269 -0
- package/dist-runtime/workflow/lib/lock.js.map +1 -0
- package/dist-runtime/workflow/lib/migrationState.d.ts +103 -0
- package/dist-runtime/workflow/lib/migrationState.js +920 -0
- package/dist-runtime/workflow/lib/migrationState.js.map +1 -0
- package/dist-runtime/workflow/lib/operatorExecution.d.ts +28 -0
- package/dist-runtime/workflow/lib/operatorExecution.js +134 -0
- package/dist-runtime/workflow/lib/operatorExecution.js.map +1 -0
- package/dist-runtime/workflow/lib/parameters.d.ts +58 -0
- package/dist-runtime/workflow/lib/parameters.js +322 -0
- package/dist-runtime/workflow/lib/parameters.js.map +1 -0
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.d.ts +29 -0
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js +277 -0
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js.map +1 -0
- package/dist-runtime/workflow/lib/proxy.d.ts +18 -0
- package/dist-runtime/workflow/lib/proxy.js +19 -0
- package/dist-runtime/workflow/lib/proxy.js.map +1 -0
- package/dist-runtime/workflow/lib/registryCommit.d.ts +33 -0
- package/dist-runtime/workflow/lib/registryCommit.js +319 -0
- package/dist-runtime/workflow/lib/registryCommit.js.map +1 -0
- package/dist-runtime/workflow/lib/release.d.ts +57 -0
- package/dist-runtime/workflow/lib/release.js +256 -0
- package/dist-runtime/workflow/lib/release.js.map +1 -0
- package/dist-runtime/workflow/lib/releaseFinalize.d.ts +14 -0
- package/dist-runtime/workflow/lib/releaseFinalize.js +571 -0
- package/dist-runtime/workflow/lib/releaseFinalize.js.map +1 -0
- package/dist-runtime/workflow/lib/releaseParameters.d.ts +43 -0
- package/dist-runtime/workflow/lib/releaseParameters.js +184 -0
- package/dist-runtime/workflow/lib/releaseParameters.js.map +1 -0
- package/dist-runtime/workflow/lib/reporter.d.ts +39 -0
- package/dist-runtime/workflow/lib/reporter.js +452 -0
- package/dist-runtime/workflow/lib/reporter.js.map +1 -0
- package/dist-runtime/workflow/lib/resultPaths.d.ts +17 -0
- package/dist-runtime/workflow/lib/resultPaths.js +29 -0
- package/dist-runtime/workflow/lib/resultPaths.js.map +1 -0
- package/dist-runtime/workflow/lib/runtimeVersion.d.ts +10 -0
- package/dist-runtime/workflow/lib/runtimeVersion.js +46 -0
- package/dist-runtime/workflow/lib/runtimeVersion.js.map +1 -0
- package/dist-runtime/workflow/lib/signer.d.ts +10 -0
- package/dist-runtime/workflow/lib/signer.js +105 -0
- package/dist-runtime/workflow/lib/signer.js.map +1 -0
- package/dist-runtime/workflow/lib/signerIdentity.d.ts +1 -0
- package/dist-runtime/workflow/lib/signerIdentity.js +23 -0
- package/dist-runtime/workflow/lib/signerIdentity.js.map +1 -0
- package/dist-runtime/workflow/lib/simulation.d.ts +35 -0
- package/dist-runtime/workflow/lib/simulation.js +282 -0
- package/dist-runtime/workflow/lib/simulation.js.map +1 -0
- package/dist-runtime/workflow/lib/simulationCallers.d.ts +44 -0
- package/dist-runtime/workflow/lib/simulationCallers.js +260 -0
- package/dist-runtime/workflow/lib/simulationCallers.js.map +1 -0
- package/dist-runtime/workflow/lib/sourceRpcPolicy.d.ts +1 -0
- package/dist-runtime/workflow/lib/sourceRpcPolicy.js +43 -0
- package/dist-runtime/workflow/lib/sourceRpcPolicy.js.map +1 -0
- package/dist-runtime/workflow/lib/state.d.ts +6 -0
- package/dist-runtime/workflow/lib/state.js +25 -0
- package/dist-runtime/workflow/lib/state.js.map +1 -0
- package/dist-runtime/workflow/lib/staticValidation.d.ts +22 -0
- package/dist-runtime/workflow/lib/staticValidation.js +124 -0
- package/dist-runtime/workflow/lib/staticValidation.js.map +1 -0
- package/dist-runtime/workflow/lib/zksyncForkCapability.d.ts +27 -0
- package/dist-runtime/workflow/lib/zksyncForkCapability.js +52 -0
- package/dist-runtime/workflow/lib/zksyncForkCapability.js.map +1 -0
- package/dist-runtime/workflow/lib/zksyncForkRunner.d.ts +57 -0
- package/dist-runtime/workflow/lib/zksyncForkRunner.js +344 -0
- package/dist-runtime/workflow/lib/zksyncForkRunner.js.map +1 -0
- package/dist-runtime/workflow/reconcileExternal.d.ts +1 -0
- package/dist-runtime/workflow/reconcileExternal.js +87 -0
- package/dist-runtime/workflow/reconcileExternal.js.map +1 -0
- package/dist-runtime/workflow/reconcileExternalRun.d.ts +1 -0
- package/dist-runtime/workflow/reconcileExternalRun.js +77 -0
- package/dist-runtime/workflow/reconcileExternalRun.js.map +1 -0
- package/dist-runtime/workflow/releaseFinalize.d.ts +1 -0
- package/dist-runtime/workflow/releaseFinalize.js +11 -0
- package/dist-runtime/workflow/releaseFinalize.js.map +1 -0
- package/dist-runtime/workflow/run.d.ts +40 -0
- package/dist-runtime/workflow/run.js +858 -0
- package/dist-runtime/workflow/run.js.map +1 -0
- package/dist-runtime/workflow/staticValidate.d.ts +1 -0
- package/dist-runtime/workflow/staticValidate.js +26 -0
- package/dist-runtime/workflow/staticValidate.js.map +1 -0
- package/dist-runtime/workflow/steps/call.d.ts +3 -0
- package/dist-runtime/workflow/steps/call.js +9 -0
- package/dist-runtime/workflow/steps/call.js.map +1 -0
- package/dist-runtime/workflow/steps/check.d.ts +3 -0
- package/dist-runtime/workflow/steps/check.js +9 -0
- package/dist-runtime/workflow/steps/check.js.map +1 -0
- package/dist-runtime/workflow/steps/custom.d.ts +3 -0
- package/dist-runtime/workflow/steps/custom.js +33 -0
- package/dist-runtime/workflow/steps/custom.js.map +1 -0
- package/dist-runtime/workflow/steps/deploy.d.ts +3 -0
- package/dist-runtime/workflow/steps/deploy.js +595 -0
- package/dist-runtime/workflow/steps/deploy.js.map +1 -0
- package/dist-runtime/workflow/steps/upgrade.d.ts +3 -0
- package/dist-runtime/workflow/steps/upgrade.js +465 -0
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -0
- package/dist-runtime/workflow/steps/view.d.ts +3 -0
- package/dist-runtime/workflow/steps/view.js +9 -0
- package/dist-runtime/workflow/steps/view.js.map +1 -0
- package/package.json +25 -5
- package/runtime/config/hardhatAdapters.ts +50 -0
- package/runtime/config/networks.ts +296 -0
- package/runtime/config/openzeppelin.ts +173 -0
- package/runtime/config/rpc.ts +27 -0
- package/runtime/config/zksyncSolcPath.ts +59 -0
- package/runtime/hardhat-types.d.ts +2 -0
- package/runtime/migrate.ts +154 -0
- package/runtime/projectHardhat.ts +10 -0
- package/runtime/template-migration.json +293 -0
- package/runtime/workflow/checkCode.ts +13 -0
- package/runtime/workflow/checkCodeFinalize.ts +8 -0
- package/runtime/workflow/checkCodePlan.ts +8 -0
- package/runtime/workflow/cli.ts +356 -0
- package/runtime/workflow/commitContractInfo.ts +63 -0
- package/runtime/workflow/create2Hashes.ts +79 -0
- package/runtime/workflow/forkSourceProxy.ts +193 -0
- package/runtime/workflow/importState.ts +190 -0
- package/runtime/workflow/lib/authority.ts +170 -0
- package/runtime/workflow/lib/calldata.ts +9 -0
- package/runtime/workflow/lib/calls.ts +407 -0
- package/runtime/workflow/lib/checkCode/args.ts +76 -0
- package/runtime/workflow/lib/checkCode/command.ts +36 -0
- package/runtime/workflow/lib/checkCode/dependencies.ts +112 -0
- package/runtime/workflow/lib/checkCode/finalize.ts +198 -0
- package/runtime/workflow/lib/checkCode/index.ts +18 -0
- package/runtime/workflow/lib/checkCode/plan.ts +163 -0
- package/runtime/workflow/lib/checkCodeReport.ts +133 -0
- package/runtime/workflow/lib/checkCodeRunner.ts +1225 -0
- package/runtime/workflow/lib/cliTool.ts +31 -0
- package/runtime/workflow/lib/config.ts +130 -0
- package/runtime/workflow/lib/contractInfoCandidates.ts +690 -0
- package/runtime/workflow/lib/create2.ts +278 -0
- package/runtime/workflow/lib/create2Hashes.ts +83 -0
- package/runtime/workflow/lib/deploymentInfo.ts +286 -0
- package/runtime/workflow/lib/deploymentRecords.ts +576 -0
- package/runtime/workflow/lib/deployments.ts +276 -0
- package/runtime/workflow/lib/erc1967.ts +57 -0
- package/runtime/workflow/lib/errors.ts +95 -0
- package/runtime/workflow/lib/executionId.ts +35 -0
- package/runtime/workflow/lib/executionPlan.ts +550 -0
- package/runtime/workflow/lib/executionProgress.ts +127 -0
- package/runtime/workflow/lib/external.ts +372 -0
- package/runtime/workflow/lib/externalExecutionScanner.ts +892 -0
- package/runtime/workflow/lib/forkSnapshot.ts +231 -0
- package/runtime/workflow/lib/gateTool.ts +261 -0
- package/runtime/workflow/lib/gateToolSync.ts +398 -0
- package/runtime/workflow/lib/lock.ts +388 -0
- package/runtime/workflow/lib/migrationState.ts +1246 -0
- package/runtime/workflow/lib/operatorExecution.ts +174 -0
- package/runtime/workflow/lib/parameters.ts +437 -0
- package/runtime/workflow/lib/pendingDeploymentReuse.ts +428 -0
- package/runtime/workflow/lib/proxy.ts +45 -0
- package/runtime/workflow/lib/registryCommit.ts +455 -0
- package/runtime/workflow/lib/release.ts +329 -0
- package/runtime/workflow/lib/releaseFinalize.ts +711 -0
- package/runtime/workflow/lib/releaseParameters.ts +248 -0
- package/runtime/workflow/lib/reporter.ts +502 -0
- package/runtime/workflow/lib/resultPaths.ts +49 -0
- package/runtime/workflow/lib/runtimeVersion.ts +28 -0
- package/runtime/workflow/lib/signer.ts +124 -0
- package/runtime/workflow/lib/signerIdentity.ts +22 -0
- package/runtime/workflow/lib/simulation.ts +415 -0
- package/runtime/workflow/lib/simulationCallers.ts +335 -0
- package/runtime/workflow/lib/sourceRpcPolicy.ts +41 -0
- package/runtime/workflow/lib/state.ts +25 -0
- package/runtime/workflow/lib/staticValidation.ts +142 -0
- package/runtime/workflow/lib/zksyncForkCapability.ts +80 -0
- package/runtime/workflow/lib/zksyncForkRunner.ts +505 -0
- package/runtime/workflow/reconcileExternal.ts +86 -0
- package/runtime/workflow/reconcileExternalRun.ts +88 -0
- package/runtime/workflow/releaseFinalize.ts +8 -0
- package/runtime/workflow/run.ts +1072 -0
- package/runtime/workflow/staticValidate.ts +23 -0
- package/runtime/workflow/steps/call.ts +10 -0
- package/runtime/workflow/steps/check.ts +10 -0
- package/runtime/workflow/steps/custom.ts +43 -0
- package/runtime/workflow/steps/deploy.ts +771 -0
- package/runtime/workflow/steps/upgrade.ts +598 -0
- package/runtime/workflow/steps/view.ts +10 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { WorkflowConfig } from "./config";
|
|
2
|
+
import { ContractInfo } from "./deployments";
|
|
3
|
+
export type DeploymentExecutionStatus = "prepared" | "applied" | "waiting_code_check" | "waiting_external" | "partial";
|
|
4
|
+
export type DeploymentChangeStatus = "prepared" | "applied" | "waiting_code_check" | "waiting_external" | "failed";
|
|
5
|
+
export interface GateToolEvidence {
|
|
6
|
+
outputPath: string;
|
|
7
|
+
data: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface PendingDeploymentReuseEvidence {
|
|
10
|
+
status: "verified";
|
|
11
|
+
sourceExecutionId: string;
|
|
12
|
+
sourceCandidatePath: string;
|
|
13
|
+
archivedCandidatePath?: string;
|
|
14
|
+
sourceDeploymentRecordPath: string;
|
|
15
|
+
sourceExecutionPlanPath: string;
|
|
16
|
+
sourceOperatorExecutionPath?: string;
|
|
17
|
+
sourceExecutionResultPath: string;
|
|
18
|
+
sourceVerificationPath: string;
|
|
19
|
+
releaseFingerprint: {
|
|
20
|
+
manifestHash: string;
|
|
21
|
+
artifactHash: string;
|
|
22
|
+
parametersHash: string;
|
|
23
|
+
configHash: string;
|
|
24
|
+
};
|
|
25
|
+
artifactDigest: string;
|
|
26
|
+
proxyAddress: string;
|
|
27
|
+
implementationAddress: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DeploymentChange {
|
|
30
|
+
stepId: string;
|
|
31
|
+
kind: "deploy" | "upgrade";
|
|
32
|
+
instanceId: string;
|
|
33
|
+
actualContract: string;
|
|
34
|
+
contractInfoKey: string;
|
|
35
|
+
status?: DeploymentChangeStatus;
|
|
36
|
+
contractInfoChanged?: boolean;
|
|
37
|
+
strategy?: string;
|
|
38
|
+
proxyKind?: string;
|
|
39
|
+
address?: string;
|
|
40
|
+
proxyAddress?: string;
|
|
41
|
+
implementationAddress?: string;
|
|
42
|
+
preparedImplementationAddress?: string;
|
|
43
|
+
placeholderImplementationAddress?: string;
|
|
44
|
+
implementationTxHash?: string;
|
|
45
|
+
implementationSalt?: string;
|
|
46
|
+
constructorArgs?: unknown[];
|
|
47
|
+
factory?: string;
|
|
48
|
+
multicall?: string;
|
|
49
|
+
salt?: string;
|
|
50
|
+
expectedAddress?: string;
|
|
51
|
+
predictedAddress?: string;
|
|
52
|
+
leadingZeroBytes?: number;
|
|
53
|
+
txHash?: string;
|
|
54
|
+
proxyTransactionId?: string;
|
|
55
|
+
reused?: boolean;
|
|
56
|
+
alreadyDeployed?: boolean;
|
|
57
|
+
redeployReason?: string;
|
|
58
|
+
previousAddress?: string;
|
|
59
|
+
candidateAddress?: string;
|
|
60
|
+
candidatePath?: string;
|
|
61
|
+
backupPath?: string;
|
|
62
|
+
gateTool?: GateToolEvidence;
|
|
63
|
+
gateToolSync?: GateToolEvidence;
|
|
64
|
+
pendingReuse?: PendingDeploymentReuseEvidence;
|
|
65
|
+
}
|
|
66
|
+
export interface DeploymentExecutionRecord {
|
|
67
|
+
taskId: string;
|
|
68
|
+
executionId: string;
|
|
69
|
+
network: string;
|
|
70
|
+
status: DeploymentExecutionStatus;
|
|
71
|
+
startedAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
candidatePath?: string;
|
|
74
|
+
backupPath?: string;
|
|
75
|
+
candidateStatus?: "pending" | "promoted";
|
|
76
|
+
contractInfo: {
|
|
77
|
+
before: ContractInfo;
|
|
78
|
+
planned: ContractInfo;
|
|
79
|
+
after?: ContractInfo;
|
|
80
|
+
};
|
|
81
|
+
changes: Array<DeploymentChange & {
|
|
82
|
+
status: DeploymentChangeStatus;
|
|
83
|
+
contractInfoChanged: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
external?: Record<string, unknown>;
|
|
86
|
+
failure?: {
|
|
87
|
+
name?: string;
|
|
88
|
+
message: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export declare const deploymentRecordPath: (taskDir: string, network: string, executionId: string) => string;
|
|
92
|
+
export declare const loadDeploymentExecutionRecord: (input: {
|
|
93
|
+
taskDir: string;
|
|
94
|
+
taskId: string;
|
|
95
|
+
network: string;
|
|
96
|
+
executionId: string;
|
|
97
|
+
}) => DeploymentExecutionRecord;
|
|
98
|
+
export declare const markDeploymentRecordReconciled: (input: {
|
|
99
|
+
taskDir: string;
|
|
100
|
+
taskId: string;
|
|
101
|
+
network: string;
|
|
102
|
+
executionId: string;
|
|
103
|
+
reportPath: string;
|
|
104
|
+
reportHash: string;
|
|
105
|
+
gateToolSyncByStep?: Record<string, GateToolEvidence>;
|
|
106
|
+
}) => DeploymentExecutionRecord;
|
|
107
|
+
export interface DeploymentRecorderOptions {
|
|
108
|
+
root: string;
|
|
109
|
+
taskDir: string;
|
|
110
|
+
config: WorkflowConfig;
|
|
111
|
+
taskId: string;
|
|
112
|
+
executionId: string;
|
|
113
|
+
network: string;
|
|
114
|
+
awaitRegistryCommit?: boolean;
|
|
115
|
+
resume?: boolean;
|
|
116
|
+
}
|
|
117
|
+
export declare class DeploymentRecorder {
|
|
118
|
+
readonly filePath: string;
|
|
119
|
+
private readonly root;
|
|
120
|
+
private readonly config;
|
|
121
|
+
private readonly record;
|
|
122
|
+
private readonly awaitRegistryCommit;
|
|
123
|
+
constructor(options: DeploymentRecorderOptions);
|
|
124
|
+
prepare(change: DeploymentChange): void;
|
|
125
|
+
bindProxyTransaction(stepId: string, transactionId: string): void;
|
|
126
|
+
stageAddressCandidate(change: DeploymentChange, address: string): void;
|
|
127
|
+
applyAddress(change: DeploymentChange, address: string): void;
|
|
128
|
+
apply(change: DeploymentChange): void;
|
|
129
|
+
markWaitingExternal(external: Record<string, unknown>): void;
|
|
130
|
+
markPartial(error: unknown): void;
|
|
131
|
+
complete(): DeploymentExecutionStatus;
|
|
132
|
+
private upsertChange;
|
|
133
|
+
private updateAppliedStatus;
|
|
134
|
+
private persist;
|
|
135
|
+
private persistInitial;
|
|
136
|
+
private loadResumableRecord;
|
|
137
|
+
}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DeploymentRecorder = exports.markDeploymentRecordReconciled = exports.loadDeploymentExecutionRecord = exports.deploymentRecordPath = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const config_1 = require("./config");
|
|
10
|
+
const contractInfoCandidates_1 = require("./contractInfoCandidates");
|
|
11
|
+
const deployments_1 = require("./deployments");
|
|
12
|
+
const deploymentRecordPath = (taskDir, network, executionId) => path_1.default.join(taskDir, "results", `${network}.${executionId}.deployment.json`);
|
|
13
|
+
exports.deploymentRecordPath = deploymentRecordPath;
|
|
14
|
+
const loadDeploymentExecutionRecord = (input) => {
|
|
15
|
+
const filePath = (0, exports.deploymentRecordPath)(input.taskDir, input.network, input.executionId);
|
|
16
|
+
let record;
|
|
17
|
+
try {
|
|
18
|
+
record = JSON.parse(fs_1.default.readFileSync(filePath, "utf8"));
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw new Error(`Cannot load deployment record: ${error instanceof Error ? error.message : String(error)}`);
|
|
22
|
+
}
|
|
23
|
+
if (record.taskId !== input.taskId
|
|
24
|
+
|| record.network !== input.network
|
|
25
|
+
|| record.executionId !== input.executionId
|
|
26
|
+
|| !Array.isArray(record.changes)) {
|
|
27
|
+
throw new Error("Deployment record identity does not match requested execution");
|
|
28
|
+
}
|
|
29
|
+
return record;
|
|
30
|
+
};
|
|
31
|
+
exports.loadDeploymentExecutionRecord = loadDeploymentExecutionRecord;
|
|
32
|
+
const markDeploymentRecordReconciled = (input) => {
|
|
33
|
+
const filePath = (0, exports.deploymentRecordPath)(input.taskDir, input.network, input.executionId);
|
|
34
|
+
const record = (0, exports.loadDeploymentExecutionRecord)(input);
|
|
35
|
+
if (record.status !== "waiting_external" && record.status !== "waiting_code_check") {
|
|
36
|
+
throw new Error(`Deployment record cannot be reconciled from status ${record.status}`);
|
|
37
|
+
}
|
|
38
|
+
if (record.status === "waiting_code_check") {
|
|
39
|
+
const reconciliation = record.external?.reconciliation;
|
|
40
|
+
if (reconciliation?.reportPath === input.reportPath
|
|
41
|
+
&& reconciliation?.reportHash === input.reportHash) {
|
|
42
|
+
return record;
|
|
43
|
+
}
|
|
44
|
+
throw new Error("Deployment record was already reconciled with different evidence");
|
|
45
|
+
}
|
|
46
|
+
const next = {
|
|
47
|
+
...record,
|
|
48
|
+
status: "waiting_code_check",
|
|
49
|
+
updatedAt: new Date().toISOString(),
|
|
50
|
+
changes: record.changes.map((change) => (change.status === "waiting_external" || change.status === "prepared"
|
|
51
|
+
? {
|
|
52
|
+
...change,
|
|
53
|
+
status: "waiting_code_check",
|
|
54
|
+
...(input.gateToolSyncByStep?.[change.stepId]
|
|
55
|
+
? { gateToolSync: input.gateToolSyncByStep[change.stepId] }
|
|
56
|
+
: {}),
|
|
57
|
+
}
|
|
58
|
+
: input.gateToolSyncByStep?.[change.stepId]
|
|
59
|
+
? { ...change, gateToolSync: input.gateToolSyncByStep[change.stepId] }
|
|
60
|
+
: change)),
|
|
61
|
+
external: {
|
|
62
|
+
...(record.external || {}),
|
|
63
|
+
reconciliation: {
|
|
64
|
+
status: "reconciled",
|
|
65
|
+
reportPath: input.reportPath,
|
|
66
|
+
reportHash: input.reportHash,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
(0, config_1.writeJsonFile)(filePath, next);
|
|
71
|
+
return next;
|
|
72
|
+
};
|
|
73
|
+
exports.markDeploymentRecordReconciled = markDeploymentRecordReconciled;
|
|
74
|
+
const errorDetails = (error) => {
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
return { name: error.name, message: error.message };
|
|
77
|
+
}
|
|
78
|
+
return { message: String(error) };
|
|
79
|
+
};
|
|
80
|
+
class DeploymentRecorder {
|
|
81
|
+
filePath;
|
|
82
|
+
root;
|
|
83
|
+
config;
|
|
84
|
+
record;
|
|
85
|
+
awaitRegistryCommit;
|
|
86
|
+
constructor(options) {
|
|
87
|
+
this.root = options.root;
|
|
88
|
+
this.config = options.config;
|
|
89
|
+
this.awaitRegistryCommit = options.awaitRegistryCommit === true;
|
|
90
|
+
this.filePath = (0, exports.deploymentRecordPath)(options.taskDir, options.network, options.executionId);
|
|
91
|
+
if (options.resume === true) {
|
|
92
|
+
this.record = this.loadResumableRecord(options);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const startedAt = new Date().toISOString();
|
|
96
|
+
const before = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(options.root, options.config));
|
|
97
|
+
this.record = {
|
|
98
|
+
taskId: options.taskId,
|
|
99
|
+
executionId: options.executionId,
|
|
100
|
+
network: options.network,
|
|
101
|
+
status: "prepared",
|
|
102
|
+
startedAt,
|
|
103
|
+
updatedAt: startedAt,
|
|
104
|
+
contractInfo: {
|
|
105
|
+
before,
|
|
106
|
+
planned: (0, deployments_1.cloneContractInfo)(before),
|
|
107
|
+
},
|
|
108
|
+
changes: [],
|
|
109
|
+
};
|
|
110
|
+
this.persistInitial();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
prepare(change) {
|
|
114
|
+
(0, deployments_1.deploymentInstanceId)(change.instanceId);
|
|
115
|
+
this.upsertChange(change, "prepared", false);
|
|
116
|
+
this.record.status = "prepared";
|
|
117
|
+
delete this.record.failure;
|
|
118
|
+
this.persist();
|
|
119
|
+
}
|
|
120
|
+
bindProxyTransaction(stepId, transactionId) {
|
|
121
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]{0,199}$/.test(transactionId)) {
|
|
122
|
+
throw new Error("Deployment proxy transactionId is invalid");
|
|
123
|
+
}
|
|
124
|
+
const change = this.record.changes.find((entry) => entry.stepId === stepId);
|
|
125
|
+
if (!change || change.proxyKind !== "uups") {
|
|
126
|
+
throw new Error(`Cannot bind a proxy transaction for deployment change ${stepId}`);
|
|
127
|
+
}
|
|
128
|
+
if (change.proxyTransactionId
|
|
129
|
+
&& change.proxyTransactionId !== transactionId) {
|
|
130
|
+
throw new Error(`Deployment change ${stepId} is already bound to another proxy transaction`);
|
|
131
|
+
}
|
|
132
|
+
change.proxyTransactionId = transactionId;
|
|
133
|
+
this.persist();
|
|
134
|
+
}
|
|
135
|
+
stageAddressCandidate(change, address) {
|
|
136
|
+
const canonicalKey = (0, deployments_1.contractInfoKey)(change.instanceId, change.actualContract);
|
|
137
|
+
if (change.contractInfoKey !== canonicalKey) {
|
|
138
|
+
throw new Error(`Deployment record key ${change.contractInfoKey} does not match canonical key ${canonicalKey}`);
|
|
139
|
+
}
|
|
140
|
+
const staged = (0, contractInfoCandidates_1.stageContractInfoCandidate)({
|
|
141
|
+
root: this.root,
|
|
142
|
+
taskDir: path_1.default.dirname(path_1.default.dirname(this.filePath)),
|
|
143
|
+
config: this.config,
|
|
144
|
+
deploymentId: this.record.taskId,
|
|
145
|
+
executionId: this.record.executionId,
|
|
146
|
+
network: this.record.network,
|
|
147
|
+
supersedeCandidatePath: change.pendingReuse?.sourceCandidatePath,
|
|
148
|
+
}, {
|
|
149
|
+
instanceId: change.instanceId,
|
|
150
|
+
contractName: change.actualContract,
|
|
151
|
+
address,
|
|
152
|
+
});
|
|
153
|
+
this.record.candidatePath = staged.candidatePath;
|
|
154
|
+
this.record.backupPath = staged.backupPath;
|
|
155
|
+
this.record.candidateStatus = "pending";
|
|
156
|
+
this.record.contractInfo.planned = (0, deployments_1.cloneContractInfo)(staged.candidate.contractInfo);
|
|
157
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
158
|
+
this.upsertChange({
|
|
159
|
+
...change,
|
|
160
|
+
address,
|
|
161
|
+
previousAddress: staged.replacement.previousAddress,
|
|
162
|
+
candidateAddress: staged.replacement.candidateAddress,
|
|
163
|
+
candidatePath: staged.candidatePath,
|
|
164
|
+
backupPath: staged.backupPath,
|
|
165
|
+
...(change.pendingReuse
|
|
166
|
+
? {
|
|
167
|
+
pendingReuse: {
|
|
168
|
+
...change.pendingReuse,
|
|
169
|
+
...(staged.archivedCandidatePath
|
|
170
|
+
? { archivedCandidatePath: staged.archivedCandidatePath }
|
|
171
|
+
: {}),
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
175
|
+
}, "prepared", true);
|
|
176
|
+
this.record.status = "prepared";
|
|
177
|
+
this.persist();
|
|
178
|
+
}
|
|
179
|
+
applyAddress(change, address) {
|
|
180
|
+
const canonicalKey = (0, deployments_1.contractInfoKey)(change.instanceId, change.actualContract);
|
|
181
|
+
if (change.contractInfoKey !== canonicalKey) {
|
|
182
|
+
throw new Error(`Deployment record key ${change.contractInfoKey} does not match canonical key ${canonicalKey}`);
|
|
183
|
+
}
|
|
184
|
+
const preparedChange = {
|
|
185
|
+
...change,
|
|
186
|
+
address,
|
|
187
|
+
candidateAddress: address,
|
|
188
|
+
contractInfoKey: canonicalKey,
|
|
189
|
+
};
|
|
190
|
+
this.upsertChange(preparedChange, "prepared", true);
|
|
191
|
+
this.record.status = "prepared";
|
|
192
|
+
this.persist();
|
|
193
|
+
try {
|
|
194
|
+
const staged = (0, contractInfoCandidates_1.stageContractInfoCandidate)({
|
|
195
|
+
root: this.root,
|
|
196
|
+
taskDir: path_1.default.dirname(path_1.default.dirname(this.filePath)),
|
|
197
|
+
config: this.config,
|
|
198
|
+
deploymentId: this.record.taskId,
|
|
199
|
+
executionId: this.record.executionId,
|
|
200
|
+
network: this.record.network,
|
|
201
|
+
supersedeCandidatePath: change.pendingReuse?.sourceCandidatePath,
|
|
202
|
+
}, {
|
|
203
|
+
instanceId: change.instanceId,
|
|
204
|
+
contractName: change.actualContract,
|
|
205
|
+
address,
|
|
206
|
+
});
|
|
207
|
+
const pendingChange = {
|
|
208
|
+
...preparedChange,
|
|
209
|
+
contractInfoKey: staged.replacement.candidateKey,
|
|
210
|
+
previousAddress: staged.replacement.previousAddress,
|
|
211
|
+
candidateAddress: staged.replacement.candidateAddress,
|
|
212
|
+
candidatePath: staged.candidatePath,
|
|
213
|
+
backupPath: staged.backupPath,
|
|
214
|
+
...(change.pendingReuse
|
|
215
|
+
? {
|
|
216
|
+
pendingReuse: {
|
|
217
|
+
...change.pendingReuse,
|
|
218
|
+
...(staged.archivedCandidatePath
|
|
219
|
+
? { archivedCandidatePath: staged.archivedCandidatePath }
|
|
220
|
+
: {}),
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
: {}),
|
|
224
|
+
};
|
|
225
|
+
this.record.candidatePath = staged.candidatePath;
|
|
226
|
+
this.record.backupPath = staged.backupPath;
|
|
227
|
+
this.record.candidateStatus = "pending";
|
|
228
|
+
this.record.contractInfo.planned = (0, deployments_1.cloneContractInfo)(staged.candidate.contractInfo);
|
|
229
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
230
|
+
this.upsertChange(pendingChange, "waiting_code_check", true);
|
|
231
|
+
this.record.status = "waiting_code_check";
|
|
232
|
+
delete this.record.failure;
|
|
233
|
+
this.persist();
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
this.upsertChange(preparedChange, "failed", true);
|
|
237
|
+
this.record.status = "partial";
|
|
238
|
+
this.record.failure = errorDetails(error);
|
|
239
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
240
|
+
this.persist();
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
apply(change) {
|
|
245
|
+
const current = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
246
|
+
this.record.contractInfo.planned = current;
|
|
247
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)(current);
|
|
248
|
+
this.upsertChange(change, "applied", false);
|
|
249
|
+
this.updateAppliedStatus();
|
|
250
|
+
this.persist();
|
|
251
|
+
}
|
|
252
|
+
markWaitingExternal(external) {
|
|
253
|
+
this.record.status = "waiting_external";
|
|
254
|
+
this.record.external = external;
|
|
255
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
256
|
+
this.record.changes = this.record.changes.map((change) => (change.status === "prepared"
|
|
257
|
+
? { ...change, status: "waiting_external" }
|
|
258
|
+
: change));
|
|
259
|
+
this.persist();
|
|
260
|
+
}
|
|
261
|
+
markPartial(error) {
|
|
262
|
+
this.record.status = "partial";
|
|
263
|
+
this.record.failure = errorDetails(error);
|
|
264
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
265
|
+
this.record.changes = this.record.changes.map((change) => (change.status === "prepared" || change.status === "waiting_external"
|
|
266
|
+
? { ...change, status: "failed" }
|
|
267
|
+
: change));
|
|
268
|
+
this.persist();
|
|
269
|
+
}
|
|
270
|
+
complete() {
|
|
271
|
+
this.record.contractInfo.after = (0, deployments_1.cloneContractInfo)((0, deployments_1.loadContractInfo)(this.root, this.config));
|
|
272
|
+
if (this.awaitRegistryCommit
|
|
273
|
+
&& this.record.changes.every((change) => change.status !== "failed")) {
|
|
274
|
+
this.record.status = "waiting_code_check";
|
|
275
|
+
}
|
|
276
|
+
else if (this.record.changes.some((change) => change.status === "waiting_code_check")) {
|
|
277
|
+
this.record.status = "waiting_code_check";
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
this.record.status = this.record.changes.every((change) => change.status === "applied")
|
|
281
|
+
? "applied"
|
|
282
|
+
: "partial";
|
|
283
|
+
}
|
|
284
|
+
this.persist();
|
|
285
|
+
return this.record.status;
|
|
286
|
+
}
|
|
287
|
+
upsertChange(change, status, contractInfoChanged) {
|
|
288
|
+
const index = this.record.changes.findIndex((item) => item.stepId === change.stepId);
|
|
289
|
+
const existing = index >= 0 ? this.record.changes[index] : undefined;
|
|
290
|
+
let pendingReuse = change.pendingReuse ?? existing?.pendingReuse;
|
|
291
|
+
if (existing?.pendingReuse && change.pendingReuse) {
|
|
292
|
+
pendingReuse = { ...existing.pendingReuse, ...change.pendingReuse };
|
|
293
|
+
}
|
|
294
|
+
const next = {
|
|
295
|
+
...existing,
|
|
296
|
+
...change,
|
|
297
|
+
status,
|
|
298
|
+
contractInfoChanged: existing?.contractInfoChanged || contractInfoChanged,
|
|
299
|
+
...(pendingReuse ? { pendingReuse } : {}),
|
|
300
|
+
};
|
|
301
|
+
if (index >= 0) {
|
|
302
|
+
this.record.changes[index] = next;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.record.changes.push(next);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
updateAppliedStatus() {
|
|
309
|
+
if (this.record.changes.some((change) => change.status === "waiting_code_check")) {
|
|
310
|
+
this.record.status = "waiting_code_check";
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
this.record.status = this.record.changes.every((change) => change.status === "applied")
|
|
314
|
+
? "applied"
|
|
315
|
+
: "prepared";
|
|
316
|
+
}
|
|
317
|
+
delete this.record.failure;
|
|
318
|
+
}
|
|
319
|
+
persist() {
|
|
320
|
+
this.record.updatedAt = new Date().toISOString();
|
|
321
|
+
(0, config_1.writeJsonFile)(this.filePath, this.record);
|
|
322
|
+
}
|
|
323
|
+
persistInitial() {
|
|
324
|
+
this.record.updatedAt = new Date().toISOString();
|
|
325
|
+
fs_1.default.mkdirSync(path_1.default.dirname(this.filePath), { recursive: true });
|
|
326
|
+
let file;
|
|
327
|
+
try {
|
|
328
|
+
file = fs_1.default.openSync(this.filePath, "wx");
|
|
329
|
+
}
|
|
330
|
+
catch (error) {
|
|
331
|
+
if (error &&
|
|
332
|
+
typeof error === "object" &&
|
|
333
|
+
"code" in error &&
|
|
334
|
+
String(error.code) === "EEXIST") {
|
|
335
|
+
throw new Error(`Deployment record already exists: ${this.filePath}`);
|
|
336
|
+
}
|
|
337
|
+
throw error;
|
|
338
|
+
}
|
|
339
|
+
try {
|
|
340
|
+
fs_1.default.writeFileSync(file, `${JSON.stringify(this.record, null, 2)}\n`);
|
|
341
|
+
fs_1.default.fsyncSync(file);
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
fs_1.default.closeSync(file);
|
|
345
|
+
fs_1.default.unlinkSync(this.filePath);
|
|
346
|
+
throw error;
|
|
347
|
+
}
|
|
348
|
+
fs_1.default.closeSync(file);
|
|
349
|
+
}
|
|
350
|
+
loadResumableRecord(options) {
|
|
351
|
+
let parsed;
|
|
352
|
+
try {
|
|
353
|
+
parsed = JSON.parse(fs_1.default.readFileSync(this.filePath, "utf8"));
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
throw new Error(`Cannot resume deployment record: ${error instanceof Error ? error.message : String(error)}`);
|
|
357
|
+
}
|
|
358
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
359
|
+
throw new Error("Cannot resume an invalid deployment record");
|
|
360
|
+
}
|
|
361
|
+
const record = parsed;
|
|
362
|
+
if (record.taskId !== options.taskId
|
|
363
|
+
|| record.executionId !== options.executionId
|
|
364
|
+
|| record.network !== options.network
|
|
365
|
+
|| (record.status !== "waiting_external" && record.status !== "partial")
|
|
366
|
+
|| !record.contractInfo
|
|
367
|
+
|| !Array.isArray(record.changes)) {
|
|
368
|
+
throw new Error("Deployment record is not resumable for this execution");
|
|
369
|
+
}
|
|
370
|
+
return record;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
exports.DeploymentRecorder = DeploymentRecorder;
|
|
374
|
+
//# sourceMappingURL=deploymentRecords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploymentRecords.js","sourceRoot":"","sources":["../../../runtime/workflow/lib/deploymentRecords.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,qCAAyC;AACzC,qEAAsE;AACtE,+CAMuB;AA0GhB,MAAM,oBAAoB,GAAG,CAClC,OAAe,EACf,OAAe,EACf,WAAmB,EACX,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,IAAI,WAAW,kBAAkB,CAAC,CAAC;AAJ3E,QAAA,oBAAoB,wBAIuD;AAEjF,MAAM,6BAA6B,GAAG,CAAC,KAK7C,EAA6B,EAAE;IAC9B,MAAM,QAAQ,GAAG,IAAA,4BAAoB,EAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACvF,IAAI,MAAiC,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAA8B,CAAC;IACtF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,kCAAkC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,C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K,CAAC,uDAAuD,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlWD,gDAkWC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WorkflowConfig } from "./config";
|
|
2
|
+
export type ContractInfo = Record<string, Record<string, string>>;
|
|
3
|
+
export interface ResolvedDeployment {
|
|
4
|
+
key: string;
|
|
5
|
+
address: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const withContractInfoLock: <T>(root: string, operation: () => T) => T;
|
|
8
|
+
export declare const validateContractInfo: (value: unknown) => ContractInfo;
|
|
9
|
+
export declare const cloneContractInfo: (contractInfo: ContractInfo) => ContractInfo;
|
|
10
|
+
export declare const actualContractName: (contractName: string) => string;
|
|
11
|
+
export declare const deploymentInstanceId: (instanceId: string) => string;
|
|
12
|
+
export declare const contractInfoKey: (instanceId: string, contractName: string) => string;
|
|
13
|
+
export declare const loadContractInfo: (root: string, _config: WorkflowConfig) => ContractInfo;
|
|
14
|
+
export declare const saveContractInfo: (root: string, contractInfo: ContractInfo) => void;
|
|
15
|
+
export declare const planDeploymentAddress: (contractInfo: ContractInfo, targetId: string, instanceId: string, contractName: string, address: string) => {
|
|
16
|
+
key: string;
|
|
17
|
+
contractInfo: ContractInfo;
|
|
18
|
+
};
|
|
19
|
+
export declare const resolveDeployment: (contractInfo: ContractInfo, targetId: string, name: string) => ResolvedDeployment | undefined;
|
|
20
|
+
export declare const findDeploymentAddress: (root: string, config: WorkflowConfig, targetId: string, name: string) => string | undefined;
|
|
21
|
+
export declare const getDeploymentAddress: (root: string, config: WorkflowConfig, targetId: string, name: string) => string;
|