gate-evm-tools 1.0.26 → 1.0.28

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.
Files changed (338) hide show
  1. package/README.md +14 -0
  2. package/bin/workflow.cjs +19 -0
  3. package/dist/core/BytecodeChecker.d.ts.map +1 -1
  4. package/dist/core/BytecodeChecker.js +16 -1
  5. package/dist/core/BytecodeChecker.js.map +1 -1
  6. package/dist/core/legacyProxyArtifact.d.ts +6 -0
  7. package/dist/core/legacyProxyArtifact.d.ts.map +1 -0
  8. package/dist/core/legacyProxyArtifact.js +36 -0
  9. package/dist/core/legacyProxyArtifact.js.map +1 -0
  10. package/dist-runtime/config/hardhatAdapters.d.ts +7 -0
  11. package/dist-runtime/config/hardhatAdapters.js +61 -0
  12. package/dist-runtime/config/hardhatAdapters.js.map +1 -0
  13. package/dist-runtime/config/networks.d.ts +32 -0
  14. package/dist-runtime/config/networks.js +275 -0
  15. package/dist-runtime/config/networks.js.map +1 -0
  16. package/dist-runtime/config/openzeppelin.d.ts +28 -0
  17. package/dist-runtime/config/openzeppelin.js +144 -0
  18. package/dist-runtime/config/openzeppelin.js.map +1 -0
  19. package/dist-runtime/config/rpc.d.ts +7 -0
  20. package/dist-runtime/config/rpc.js +19 -0
  21. package/dist-runtime/config/rpc.js.map +1 -0
  22. package/dist-runtime/config/zksyncSolcPath.d.ts +1 -0
  23. package/dist-runtime/config/zksyncSolcPath.js +61 -0
  24. package/dist-runtime/config/zksyncSolcPath.js.map +1 -0
  25. package/dist-runtime/migrate.d.ts +13 -0
  26. package/dist-runtime/migrate.js +208 -0
  27. package/dist-runtime/migrate.js.map +1 -0
  28. package/dist-runtime/package.json +1 -0
  29. package/dist-runtime/projectHardhat.d.ts +4 -0
  30. package/dist-runtime/projectHardhat.js +16 -0
  31. package/dist-runtime/projectHardhat.js.map +1 -0
  32. package/dist-runtime/runtime-identity.json +4 -0
  33. package/dist-runtime/template-migration.json +293 -0
  34. package/dist-runtime/workflow/checkCode.d.ts +1 -0
  35. package/dist-runtime/workflow/checkCode.js +16 -0
  36. package/dist-runtime/workflow/checkCode.js.map +1 -0
  37. package/dist-runtime/workflow/checkCodeFinalize.d.ts +1 -0
  38. package/dist-runtime/workflow/checkCodeFinalize.js +11 -0
  39. package/dist-runtime/workflow/checkCodeFinalize.js.map +1 -0
  40. package/dist-runtime/workflow/checkCodePlan.d.ts +1 -0
  41. package/dist-runtime/workflow/checkCodePlan.js +11 -0
  42. package/dist-runtime/workflow/checkCodePlan.js.map +1 -0
  43. package/dist-runtime/workflow/cli.d.ts +1 -0
  44. package/dist-runtime/workflow/cli.js +302 -0
  45. package/dist-runtime/workflow/cli.js.map +1 -0
  46. package/dist-runtime/workflow/commitContractInfo.d.ts +1 -0
  47. package/dist-runtime/workflow/commitContractInfo.js +64 -0
  48. package/dist-runtime/workflow/commitContractInfo.js.map +1 -0
  49. package/dist-runtime/workflow/create2Hashes.d.ts +1 -0
  50. package/dist-runtime/workflow/create2Hashes.js +76 -0
  51. package/dist-runtime/workflow/create2Hashes.js.map +1 -0
  52. package/dist-runtime/workflow/forkSourceProxy.d.ts +1 -0
  53. package/dist-runtime/workflow/forkSourceProxy.js +151 -0
  54. package/dist-runtime/workflow/forkSourceProxy.js.map +1 -0
  55. package/dist-runtime/workflow/importState.d.ts +1 -0
  56. package/dist-runtime/workflow/importState.js +193 -0
  57. package/dist-runtime/workflow/importState.js.map +1 -0
  58. package/dist-runtime/workflow/lib/authority.d.ts +28 -0
  59. package/dist-runtime/workflow/lib/authority.js +122 -0
  60. package/dist-runtime/workflow/lib/authority.js.map +1 -0
  61. package/dist-runtime/workflow/lib/calldata.d.ts +2 -0
  62. package/dist-runtime/workflow/lib/calldata.js +8 -0
  63. package/dist-runtime/workflow/lib/calldata.js.map +1 -0
  64. package/dist-runtime/workflow/lib/calls.d.ts +23 -0
  65. package/dist-runtime/workflow/lib/calls.js +316 -0
  66. package/dist-runtime/workflow/lib/calls.js.map +1 -0
  67. package/dist-runtime/workflow/lib/checkCode/args.d.ts +2 -0
  68. package/dist-runtime/workflow/lib/checkCode/args.js +68 -0
  69. package/dist-runtime/workflow/lib/checkCode/args.js.map +1 -0
  70. package/dist-runtime/workflow/lib/checkCode/command.d.ts +5 -0
  71. package/dist-runtime/workflow/lib/checkCode/command.js +35 -0
  72. package/dist-runtime/workflow/lib/checkCode/command.js.map +1 -0
  73. package/dist-runtime/workflow/lib/checkCode/dependencies.d.ts +6 -0
  74. package/dist-runtime/workflow/lib/checkCode/dependencies.js +125 -0
  75. package/dist-runtime/workflow/lib/checkCode/dependencies.js.map +1 -0
  76. package/dist-runtime/workflow/lib/checkCode/finalize.d.ts +17 -0
  77. package/dist-runtime/workflow/lib/checkCode/finalize.js +174 -0
  78. package/dist-runtime/workflow/lib/checkCode/finalize.js.map +1 -0
  79. package/dist-runtime/workflow/lib/checkCode/index.d.ts +3 -0
  80. package/dist-runtime/workflow/lib/checkCode/index.js +20 -0
  81. package/dist-runtime/workflow/lib/checkCode/index.js.map +1 -0
  82. package/dist-runtime/workflow/lib/checkCode/plan.d.ts +22 -0
  83. package/dist-runtime/workflow/lib/checkCode/plan.js +145 -0
  84. package/dist-runtime/workflow/lib/checkCode/plan.js.map +1 -0
  85. package/dist-runtime/workflow/lib/checkCodeReport.d.ts +25 -0
  86. package/dist-runtime/workflow/lib/checkCodeReport.js +102 -0
  87. package/dist-runtime/workflow/lib/checkCodeReport.js.map +1 -0
  88. package/dist-runtime/workflow/lib/checkCodeRunner.d.ts +87 -0
  89. package/dist-runtime/workflow/lib/checkCodeRunner.js +964 -0
  90. package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -0
  91. package/dist-runtime/workflow/lib/cliTool.d.ts +10 -0
  92. package/dist-runtime/workflow/lib/cliTool.js +25 -0
  93. package/dist-runtime/workflow/lib/cliTool.js.map +1 -0
  94. package/dist-runtime/workflow/lib/config.d.ts +33 -0
  95. package/dist-runtime/workflow/lib/config.js +100 -0
  96. package/dist-runtime/workflow/lib/config.js.map +1 -0
  97. package/dist-runtime/workflow/lib/contractInfoCandidates.d.ts +82 -0
  98. package/dist-runtime/workflow/lib/contractInfoCandidates.js +441 -0
  99. package/dist-runtime/workflow/lib/contractInfoCandidates.js.map +1 -0
  100. package/dist-runtime/workflow/lib/controlledMulticallAbi.d.ts +2 -0
  101. package/dist-runtime/workflow/lib/controlledMulticallAbi.js +10 -0
  102. package/dist-runtime/workflow/lib/controlledMulticallAbi.js.map +1 -0
  103. package/dist-runtime/workflow/lib/create2.d.ts +49 -0
  104. package/dist-runtime/workflow/lib/create2.js +194 -0
  105. package/dist-runtime/workflow/lib/create2.js.map +1 -0
  106. package/dist-runtime/workflow/lib/create2Hashes.d.ts +22 -0
  107. package/dist-runtime/workflow/lib/create2Hashes.js +57 -0
  108. package/dist-runtime/workflow/lib/create2Hashes.js.map +1 -0
  109. package/dist-runtime/workflow/lib/deploymentInfo.d.ts +40 -0
  110. package/dist-runtime/workflow/lib/deploymentInfo.js +240 -0
  111. package/dist-runtime/workflow/lib/deploymentInfo.js.map +1 -0
  112. package/dist-runtime/workflow/lib/deploymentRecords.d.ts +137 -0
  113. package/dist-runtime/workflow/lib/deploymentRecords.js +374 -0
  114. package/dist-runtime/workflow/lib/deploymentRecords.js.map +1 -0
  115. package/dist-runtime/workflow/lib/deployments.d.ts +21 -0
  116. package/dist-runtime/workflow/lib/deployments.js +240 -0
  117. package/dist-runtime/workflow/lib/deployments.js.map +1 -0
  118. package/dist-runtime/workflow/lib/erc1967.d.ts +5 -0
  119. package/dist-runtime/workflow/lib/erc1967.js +29 -0
  120. package/dist-runtime/workflow/lib/erc1967.js.map +1 -0
  121. package/dist-runtime/workflow/lib/errors.d.ts +6 -0
  122. package/dist-runtime/workflow/lib/errors.js +77 -0
  123. package/dist-runtime/workflow/lib/errors.js.map +1 -0
  124. package/dist-runtime/workflow/lib/executionId.d.ts +7 -0
  125. package/dist-runtime/workflow/lib/executionId.js +26 -0
  126. package/dist-runtime/workflow/lib/executionId.js.map +1 -0
  127. package/dist-runtime/workflow/lib/executionPlan.d.ts +85 -0
  128. package/dist-runtime/workflow/lib/executionPlan.js +450 -0
  129. package/dist-runtime/workflow/lib/executionPlan.js.map +1 -0
  130. package/dist-runtime/workflow/lib/executionProgress.d.ts +5 -0
  131. package/dist-runtime/workflow/lib/executionProgress.js +100 -0
  132. package/dist-runtime/workflow/lib/executionProgress.js.map +1 -0
  133. package/dist-runtime/workflow/lib/external.d.ts +62 -0
  134. package/dist-runtime/workflow/lib/external.js +282 -0
  135. package/dist-runtime/workflow/lib/external.js.map +1 -0
  136. package/dist-runtime/workflow/lib/externalExecutionScanner.d.ts +64 -0
  137. package/dist-runtime/workflow/lib/externalExecutionScanner.js +638 -0
  138. package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -0
  139. package/dist-runtime/workflow/lib/forkSnapshot.d.ts +34 -0
  140. package/dist-runtime/workflow/lib/forkSnapshot.js +167 -0
  141. package/dist-runtime/workflow/lib/forkSnapshot.js.map +1 -0
  142. package/dist-runtime/workflow/lib/gateTool.d.ts +16 -0
  143. package/dist-runtime/workflow/lib/gateTool.js +177 -0
  144. package/dist-runtime/workflow/lib/gateTool.js.map +1 -0
  145. package/dist-runtime/workflow/lib/gateToolSync.d.ts +22 -0
  146. package/dist-runtime/workflow/lib/gateToolSync.js +253 -0
  147. package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -0
  148. package/dist-runtime/workflow/lib/lock.d.ts +52 -0
  149. package/dist-runtime/workflow/lib/lock.js +269 -0
  150. package/dist-runtime/workflow/lib/lock.js.map +1 -0
  151. package/dist-runtime/workflow/lib/migrationState.d.ts +103 -0
  152. package/dist-runtime/workflow/lib/migrationState.js +920 -0
  153. package/dist-runtime/workflow/lib/migrationState.js.map +1 -0
  154. package/dist-runtime/workflow/lib/operatorExecution.d.ts +28 -0
  155. package/dist-runtime/workflow/lib/operatorExecution.js +134 -0
  156. package/dist-runtime/workflow/lib/operatorExecution.js.map +1 -0
  157. package/dist-runtime/workflow/lib/parameters.d.ts +58 -0
  158. package/dist-runtime/workflow/lib/parameters.js +323 -0
  159. package/dist-runtime/workflow/lib/parameters.js.map +1 -0
  160. package/dist-runtime/workflow/lib/pendingDeploymentReuse.d.ts +29 -0
  161. package/dist-runtime/workflow/lib/pendingDeploymentReuse.js +277 -0
  162. package/dist-runtime/workflow/lib/pendingDeploymentReuse.js.map +1 -0
  163. package/dist-runtime/workflow/lib/proxy.d.ts +18 -0
  164. package/dist-runtime/workflow/lib/proxy.js +19 -0
  165. package/dist-runtime/workflow/lib/proxy.js.map +1 -0
  166. package/dist-runtime/workflow/lib/registryCommit.d.ts +33 -0
  167. package/dist-runtime/workflow/lib/registryCommit.js +319 -0
  168. package/dist-runtime/workflow/lib/registryCommit.js.map +1 -0
  169. package/dist-runtime/workflow/lib/release.d.ts +57 -0
  170. package/dist-runtime/workflow/lib/release.js +256 -0
  171. package/dist-runtime/workflow/lib/release.js.map +1 -0
  172. package/dist-runtime/workflow/lib/releaseFinalize.d.ts +14 -0
  173. package/dist-runtime/workflow/lib/releaseFinalize.js +571 -0
  174. package/dist-runtime/workflow/lib/releaseFinalize.js.map +1 -0
  175. package/dist-runtime/workflow/lib/releaseParameters.d.ts +43 -0
  176. package/dist-runtime/workflow/lib/releaseParameters.js +184 -0
  177. package/dist-runtime/workflow/lib/releaseParameters.js.map +1 -0
  178. package/dist-runtime/workflow/lib/reporter.d.ts +39 -0
  179. package/dist-runtime/workflow/lib/reporter.js +452 -0
  180. package/dist-runtime/workflow/lib/reporter.js.map +1 -0
  181. package/dist-runtime/workflow/lib/resultPaths.d.ts +17 -0
  182. package/dist-runtime/workflow/lib/resultPaths.js +29 -0
  183. package/dist-runtime/workflow/lib/resultPaths.js.map +1 -0
  184. package/dist-runtime/workflow/lib/runtimeVersion.d.ts +10 -0
  185. package/dist-runtime/workflow/lib/runtimeVersion.js +46 -0
  186. package/dist-runtime/workflow/lib/runtimeVersion.js.map +1 -0
  187. package/dist-runtime/workflow/lib/signer.d.ts +10 -0
  188. package/dist-runtime/workflow/lib/signer.js +105 -0
  189. package/dist-runtime/workflow/lib/signer.js.map +1 -0
  190. package/dist-runtime/workflow/lib/signerIdentity.d.ts +1 -0
  191. package/dist-runtime/workflow/lib/signerIdentity.js +23 -0
  192. package/dist-runtime/workflow/lib/signerIdentity.js.map +1 -0
  193. package/dist-runtime/workflow/lib/simulation.d.ts +35 -0
  194. package/dist-runtime/workflow/lib/simulation.js +282 -0
  195. package/dist-runtime/workflow/lib/simulation.js.map +1 -0
  196. package/dist-runtime/workflow/lib/simulationCallers.d.ts +44 -0
  197. package/dist-runtime/workflow/lib/simulationCallers.js +260 -0
  198. package/dist-runtime/workflow/lib/simulationCallers.js.map +1 -0
  199. package/dist-runtime/workflow/lib/sourceRpcPolicy.d.ts +1 -0
  200. package/dist-runtime/workflow/lib/sourceRpcPolicy.js +43 -0
  201. package/dist-runtime/workflow/lib/sourceRpcPolicy.js.map +1 -0
  202. package/dist-runtime/workflow/lib/state.d.ts +6 -0
  203. package/dist-runtime/workflow/lib/state.js +25 -0
  204. package/dist-runtime/workflow/lib/state.js.map +1 -0
  205. package/dist-runtime/workflow/lib/staticValidation.d.ts +22 -0
  206. package/dist-runtime/workflow/lib/staticValidation.js +124 -0
  207. package/dist-runtime/workflow/lib/staticValidation.js.map +1 -0
  208. package/dist-runtime/workflow/lib/zksyncForkCapability.d.ts +27 -0
  209. package/dist-runtime/workflow/lib/zksyncForkCapability.js +52 -0
  210. package/dist-runtime/workflow/lib/zksyncForkCapability.js.map +1 -0
  211. package/dist-runtime/workflow/lib/zksyncForkRunner.d.ts +57 -0
  212. package/dist-runtime/workflow/lib/zksyncForkRunner.js +344 -0
  213. package/dist-runtime/workflow/lib/zksyncForkRunner.js.map +1 -0
  214. package/dist-runtime/workflow/reconcileExternal.d.ts +1 -0
  215. package/dist-runtime/workflow/reconcileExternal.js +87 -0
  216. package/dist-runtime/workflow/reconcileExternal.js.map +1 -0
  217. package/dist-runtime/workflow/reconcileExternalRun.d.ts +1 -0
  218. package/dist-runtime/workflow/reconcileExternalRun.js +77 -0
  219. package/dist-runtime/workflow/reconcileExternalRun.js.map +1 -0
  220. package/dist-runtime/workflow/releaseFinalize.d.ts +1 -0
  221. package/dist-runtime/workflow/releaseFinalize.js +11 -0
  222. package/dist-runtime/workflow/releaseFinalize.js.map +1 -0
  223. package/dist-runtime/workflow/run.d.ts +40 -0
  224. package/dist-runtime/workflow/run.js +858 -0
  225. package/dist-runtime/workflow/run.js.map +1 -0
  226. package/dist-runtime/workflow/staticValidate.d.ts +1 -0
  227. package/dist-runtime/workflow/staticValidate.js +26 -0
  228. package/dist-runtime/workflow/staticValidate.js.map +1 -0
  229. package/dist-runtime/workflow/steps/call.d.ts +3 -0
  230. package/dist-runtime/workflow/steps/call.js +9 -0
  231. package/dist-runtime/workflow/steps/call.js.map +1 -0
  232. package/dist-runtime/workflow/steps/check.d.ts +3 -0
  233. package/dist-runtime/workflow/steps/check.js +9 -0
  234. package/dist-runtime/workflow/steps/check.js.map +1 -0
  235. package/dist-runtime/workflow/steps/custom.d.ts +3 -0
  236. package/dist-runtime/workflow/steps/custom.js +33 -0
  237. package/dist-runtime/workflow/steps/custom.js.map +1 -0
  238. package/dist-runtime/workflow/steps/deploy.d.ts +3 -0
  239. package/dist-runtime/workflow/steps/deploy.js +596 -0
  240. package/dist-runtime/workflow/steps/deploy.js.map +1 -0
  241. package/dist-runtime/workflow/steps/upgrade.d.ts +3 -0
  242. package/dist-runtime/workflow/steps/upgrade.js +466 -0
  243. package/dist-runtime/workflow/steps/upgrade.js.map +1 -0
  244. package/dist-runtime/workflow/steps/view.d.ts +3 -0
  245. package/dist-runtime/workflow/steps/view.js +9 -0
  246. package/dist-runtime/workflow/steps/view.js.map +1 -0
  247. package/docs/direct-package-acceptance.md +20 -0
  248. package/docs/external-infrastructure-acceptance.md +33 -0
  249. package/docs/network-runtime-acceptance.md +18 -0
  250. package/docs/plans/2026-09-09-workflow-extraction.md +16 -0
  251. package/docs/superpowers/plans/2026-07-22-manifest-bootstrap-transaction.md +50 -0
  252. package/docs/superpowers/plans/2026-07-22-manifest-review-remediation.md +49 -0
  253. package/docs/superpowers/plans/2026-08-17-custody-hardhat-signers.md +227 -0
  254. package/docs/superpowers/plans/2026-09-09-remove-template-infrastructure-contracts.md +11 -0
  255. package/docs/workflow-reference.md +1181 -0
  256. package/docs/workflow-runtime-acceptance.md +17 -0
  257. package/docs/workflow-runtime.md +56 -0
  258. package/package.json +26 -5
  259. package/runtime/config/hardhatAdapters.ts +58 -0
  260. package/runtime/config/networks.ts +305 -0
  261. package/runtime/config/openzeppelin.ts +173 -0
  262. package/runtime/config/rpc.ts +27 -0
  263. package/runtime/config/zksyncSolcPath.ts +59 -0
  264. package/runtime/hardhat-types.d.ts +2 -0
  265. package/runtime/migrate.ts +154 -0
  266. package/runtime/projectHardhat.ts +10 -0
  267. package/runtime/template-migration.json +293 -0
  268. package/runtime/workflow/checkCode.ts +13 -0
  269. package/runtime/workflow/checkCodeFinalize.ts +8 -0
  270. package/runtime/workflow/checkCodePlan.ts +8 -0
  271. package/runtime/workflow/cli.ts +356 -0
  272. package/runtime/workflow/commitContractInfo.ts +63 -0
  273. package/runtime/workflow/create2Hashes.ts +79 -0
  274. package/runtime/workflow/forkSourceProxy.ts +193 -0
  275. package/runtime/workflow/importState.ts +190 -0
  276. package/runtime/workflow/lib/authority.ts +170 -0
  277. package/runtime/workflow/lib/calldata.ts +9 -0
  278. package/runtime/workflow/lib/calls.ts +407 -0
  279. package/runtime/workflow/lib/checkCode/args.ts +76 -0
  280. package/runtime/workflow/lib/checkCode/command.ts +36 -0
  281. package/runtime/workflow/lib/checkCode/dependencies.ts +112 -0
  282. package/runtime/workflow/lib/checkCode/finalize.ts +198 -0
  283. package/runtime/workflow/lib/checkCode/index.ts +18 -0
  284. package/runtime/workflow/lib/checkCode/plan.ts +163 -0
  285. package/runtime/workflow/lib/checkCodeReport.ts +133 -0
  286. package/runtime/workflow/lib/checkCodeRunner.ts +1225 -0
  287. package/runtime/workflow/lib/cliTool.ts +31 -0
  288. package/runtime/workflow/lib/config.ts +130 -0
  289. package/runtime/workflow/lib/contractInfoCandidates.ts +690 -0
  290. package/runtime/workflow/lib/controlledMulticallAbi.ts +6 -0
  291. package/runtime/workflow/lib/create2.ts +278 -0
  292. package/runtime/workflow/lib/create2Hashes.ts +83 -0
  293. package/runtime/workflow/lib/deploymentInfo.ts +286 -0
  294. package/runtime/workflow/lib/deploymentRecords.ts +576 -0
  295. package/runtime/workflow/lib/deployments.ts +276 -0
  296. package/runtime/workflow/lib/erc1967.ts +57 -0
  297. package/runtime/workflow/lib/errors.ts +95 -0
  298. package/runtime/workflow/lib/executionId.ts +35 -0
  299. package/runtime/workflow/lib/executionPlan.ts +550 -0
  300. package/runtime/workflow/lib/executionProgress.ts +127 -0
  301. package/runtime/workflow/lib/external.ts +372 -0
  302. package/runtime/workflow/lib/externalExecutionScanner.ts +892 -0
  303. package/runtime/workflow/lib/forkSnapshot.ts +231 -0
  304. package/runtime/workflow/lib/gateTool.ts +261 -0
  305. package/runtime/workflow/lib/gateToolSync.ts +398 -0
  306. package/runtime/workflow/lib/lock.ts +388 -0
  307. package/runtime/workflow/lib/migrationState.ts +1246 -0
  308. package/runtime/workflow/lib/operatorExecution.ts +174 -0
  309. package/runtime/workflow/lib/parameters.ts +438 -0
  310. package/runtime/workflow/lib/pendingDeploymentReuse.ts +428 -0
  311. package/runtime/workflow/lib/proxy.ts +45 -0
  312. package/runtime/workflow/lib/registryCommit.ts +455 -0
  313. package/runtime/workflow/lib/release.ts +329 -0
  314. package/runtime/workflow/lib/releaseFinalize.ts +711 -0
  315. package/runtime/workflow/lib/releaseParameters.ts +248 -0
  316. package/runtime/workflow/lib/reporter.ts +502 -0
  317. package/runtime/workflow/lib/resultPaths.ts +49 -0
  318. package/runtime/workflow/lib/runtimeVersion.ts +28 -0
  319. package/runtime/workflow/lib/signer.ts +124 -0
  320. package/runtime/workflow/lib/signerIdentity.ts +22 -0
  321. package/runtime/workflow/lib/simulation.ts +415 -0
  322. package/runtime/workflow/lib/simulationCallers.ts +335 -0
  323. package/runtime/workflow/lib/sourceRpcPolicy.ts +41 -0
  324. package/runtime/workflow/lib/state.ts +25 -0
  325. package/runtime/workflow/lib/staticValidation.ts +142 -0
  326. package/runtime/workflow/lib/zksyncForkCapability.ts +80 -0
  327. package/runtime/workflow/lib/zksyncForkRunner.ts +505 -0
  328. package/runtime/workflow/reconcileExternal.ts +86 -0
  329. package/runtime/workflow/reconcileExternalRun.ts +88 -0
  330. package/runtime/workflow/releaseFinalize.ts +8 -0
  331. package/runtime/workflow/run.ts +1072 -0
  332. package/runtime/workflow/staticValidate.ts +23 -0
  333. package/runtime/workflow/steps/call.ts +10 -0
  334. package/runtime/workflow/steps/check.ts +10 -0
  335. package/runtime/workflow/steps/custom.ts +43 -0
  336. package/runtime/workflow/steps/deploy.ts +772 -0
  337. package/runtime/workflow/steps/upgrade.ts +599 -0
  338. package/runtime/workflow/steps/view.ts +10 -0
@@ -0,0 +1,240 @@
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.getDeploymentAddress = exports.findDeploymentAddress = exports.resolveDeployment = exports.planDeploymentAddress = exports.saveContractInfo = exports.loadContractInfo = exports.contractInfoKey = exports.deploymentInstanceId = exports.actualContractName = exports.cloneContractInfo = exports.validateContractInfo = exports.withContractInfoLock = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const ethers_1 = require("ethers");
10
+ const config_1 = require("./config");
11
+ const contractInfoPath = (root) => {
12
+ return path_1.default.join(root, "contractInfo.json");
13
+ };
14
+ const sleepSync = (milliseconds) => {
15
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, milliseconds);
16
+ };
17
+ const errorCode = (error) => {
18
+ return error && typeof error === "object" && "code" in error
19
+ ? String(error.code)
20
+ : undefined;
21
+ };
22
+ const lockOwnerIsAlive = (lockPath) => {
23
+ let ownerPid;
24
+ try {
25
+ ownerPid = Number.parseInt(fs_1.default.readFileSync(lockPath, "utf8").split("-", 1)[0], 10);
26
+ }
27
+ catch (error) {
28
+ if (errorCode(error) === "ENOENT")
29
+ return false;
30
+ return undefined;
31
+ }
32
+ if (!Number.isSafeInteger(ownerPid) || ownerPid <= 0)
33
+ return undefined;
34
+ try {
35
+ process.kill(ownerPid, 0);
36
+ return true;
37
+ }
38
+ catch (error) {
39
+ if (errorCode(error) === "ESRCH")
40
+ return false;
41
+ return true;
42
+ }
43
+ };
44
+ const withContractInfoLock = (root, operation) => {
45
+ const filePath = contractInfoPath(root);
46
+ const lockPath = `${filePath}.lock`;
47
+ const token = `${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
48
+ const startedAt = Date.now();
49
+ const timeoutMs = 10_000;
50
+ const staleMs = 30_000;
51
+ let lockFile;
52
+ fs_1.default.mkdirSync(path_1.default.dirname(lockPath), { recursive: true });
53
+ while (lockFile === undefined) {
54
+ try {
55
+ const candidate = fs_1.default.openSync(lockPath, "wx");
56
+ try {
57
+ fs_1.default.writeFileSync(candidate, `${token}\n`);
58
+ lockFile = candidate;
59
+ }
60
+ catch (error) {
61
+ fs_1.default.closeSync(candidate);
62
+ fs_1.default.unlinkSync(lockPath);
63
+ throw error;
64
+ }
65
+ }
66
+ catch (error) {
67
+ if (errorCode(error) !== "EEXIST")
68
+ throw error;
69
+ try {
70
+ const ownerAlive = lockOwnerIsAlive(lockPath);
71
+ const lockAgeMs = Date.now() - fs_1.default.statSync(lockPath).mtimeMs;
72
+ if (ownerAlive === false ||
73
+ (ownerAlive === undefined && lockAgeMs > staleMs)) {
74
+ fs_1.default.unlinkSync(lockPath);
75
+ continue;
76
+ }
77
+ }
78
+ catch (statError) {
79
+ if (errorCode(statError) === "ENOENT")
80
+ continue;
81
+ throw statError;
82
+ }
83
+ if (Date.now() - startedAt >= timeoutMs) {
84
+ throw new Error(`Timed out waiting for contractInfo lock: ${lockPath}`);
85
+ }
86
+ sleepSync(25);
87
+ }
88
+ }
89
+ let operationFailed = false;
90
+ try {
91
+ return operation();
92
+ }
93
+ catch (error) {
94
+ operationFailed = true;
95
+ throw error;
96
+ }
97
+ finally {
98
+ try {
99
+ fs_1.default.closeSync(lockFile);
100
+ if (fs_1.default.readFileSync(lockPath, "utf8").trim() === token) {
101
+ fs_1.default.unlinkSync(lockPath);
102
+ }
103
+ }
104
+ catch (error) {
105
+ if (!operationFailed && errorCode(error) !== "ENOENT")
106
+ throw error;
107
+ }
108
+ }
109
+ };
110
+ exports.withContractInfoLock = withContractInfoLock;
111
+ const isRecord = (value) => {
112
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
113
+ };
114
+ const validateContractInfo = (value) => {
115
+ if (!isRecord(value)) {
116
+ throw new Error("contractInfo.json must contain an object keyed by network");
117
+ }
118
+ const contractInfo = {};
119
+ for (const [targetId, targetValue] of Object.entries(value)) {
120
+ if (!isRecord(targetValue)) {
121
+ throw new Error(`contractInfo.json network ${targetId} must contain an object`);
122
+ }
123
+ const entries = {};
124
+ const instanceIds = new Set();
125
+ for (const [name, address] of Object.entries(targetValue)) {
126
+ const keyParts = name.split(":");
127
+ if (keyParts.length > 2 ||
128
+ keyParts.some((part) => !part.trim() || part !== part.trim())) {
129
+ throw new Error(`contractInfo.json key ${targetId}.${name} must use Contract or saveAs:Contract format`);
130
+ }
131
+ const instanceId = keyParts[0];
132
+ if (instanceIds.has(instanceId)) {
133
+ throw new Error(`contractInfo.json network ${targetId} defines deployment instance ${instanceId} more than once`);
134
+ }
135
+ instanceIds.add(instanceId);
136
+ if (typeof address !== "string" || !(0, ethers_1.isAddress)(address)) {
137
+ throw new Error(`contractInfo.json entry ${targetId}.${name} must be an address string with a valid EVM address`);
138
+ }
139
+ entries[name] = address;
140
+ }
141
+ contractInfo[targetId] = entries;
142
+ }
143
+ return contractInfo;
144
+ };
145
+ exports.validateContractInfo = validateContractInfo;
146
+ const cloneContractInfo = (contractInfo) => {
147
+ return Object.fromEntries(Object.entries(contractInfo).map(([targetId, entries]) => [
148
+ targetId,
149
+ { ...entries },
150
+ ]));
151
+ };
152
+ exports.cloneContractInfo = cloneContractInfo;
153
+ const actualContractName = (contractName) => {
154
+ const trimmed = contractName.trim();
155
+ if (!trimmed) {
156
+ throw new Error("Actual contract name must not be empty");
157
+ }
158
+ const separator = trimmed.lastIndexOf(":");
159
+ const actual = separator >= 0 ? trimmed.slice(separator + 1).trim() : trimmed;
160
+ if (!actual) {
161
+ throw new Error(`Invalid fully qualified contract name: ${contractName}`);
162
+ }
163
+ return actual;
164
+ };
165
+ exports.actualContractName = actualContractName;
166
+ const deploymentInstanceId = (instanceId) => {
167
+ const normalizedInstanceId = instanceId.trim();
168
+ if (!normalizedInstanceId) {
169
+ throw new Error("Deployment saveAs must not be empty");
170
+ }
171
+ if (normalizedInstanceId.includes(":")) {
172
+ throw new Error(`Deployment saveAs "${normalizedInstanceId}" must not contain ":"`);
173
+ }
174
+ return normalizedInstanceId;
175
+ };
176
+ exports.deploymentInstanceId = deploymentInstanceId;
177
+ const contractInfoKey = (instanceId, contractName) => {
178
+ const normalizedInstanceId = (0, exports.deploymentInstanceId)(instanceId);
179
+ const actual = (0, exports.actualContractName)(contractName);
180
+ return normalizedInstanceId === actual
181
+ ? actual
182
+ : `${normalizedInstanceId}:${actual}`;
183
+ };
184
+ exports.contractInfoKey = contractInfoKey;
185
+ const loadContractInfo = (root, _config) => {
186
+ const filePath = contractInfoPath(root);
187
+ if (!fs_1.default.existsSync(filePath))
188
+ return {};
189
+ return (0, exports.validateContractInfo)((0, config_1.readJsonFile)(filePath));
190
+ };
191
+ exports.loadContractInfo = loadContractInfo;
192
+ const saveContractInfo = (root, contractInfo) => {
193
+ (0, config_1.writeJsonFile)(contractInfoPath(root), (0, exports.validateContractInfo)(contractInfo));
194
+ };
195
+ exports.saveContractInfo = saveContractInfo;
196
+ const planDeploymentAddress = (contractInfo, targetId, instanceId, contractName, address) => {
197
+ const key = (0, exports.contractInfoKey)(instanceId, contractName);
198
+ const normalizedInstanceId = (0, exports.deploymentInstanceId)(instanceId);
199
+ const planned = (0, exports.cloneContractInfo)(contractInfo);
200
+ const targetEntries = { ...(planned[targetId] || {}) };
201
+ for (const existingKey of Object.keys(targetEntries)) {
202
+ if (existingKey === normalizedInstanceId ||
203
+ existingKey.startsWith(`${normalizedInstanceId}:`)) {
204
+ delete targetEntries[existingKey];
205
+ }
206
+ }
207
+ targetEntries[key] = address;
208
+ planned[targetId] = targetEntries;
209
+ return { key, contractInfo: planned };
210
+ };
211
+ exports.planDeploymentAddress = planDeploymentAddress;
212
+ const resolveDeployment = (contractInfo, targetId, name) => {
213
+ const entries = contractInfo[targetId] || {};
214
+ const exactAddress = entries[name];
215
+ if (exactAddress) {
216
+ return { key: name, address: exactAddress };
217
+ }
218
+ const aliases = Object.entries(entries).filter(([key]) => key.startsWith(`${name}:`));
219
+ if (aliases.length > 1) {
220
+ throw new Error(`Ambiguous contractInfo deployment ${targetId}.${name}; matches ${aliases.map(([key]) => key).join(", ")}`);
221
+ }
222
+ if (aliases.length === 1) {
223
+ return { key: aliases[0][0], address: aliases[0][1] };
224
+ }
225
+ return undefined;
226
+ };
227
+ exports.resolveDeployment = resolveDeployment;
228
+ const findDeploymentAddress = (root, config, targetId, name) => {
229
+ return (0, exports.resolveDeployment)((0, exports.loadContractInfo)(root, config), targetId, name)?.address;
230
+ };
231
+ exports.findDeploymentAddress = findDeploymentAddress;
232
+ const getDeploymentAddress = (root, config, targetId, name) => {
233
+ const deployment = (0, exports.resolveDeployment)((0, exports.loadContractInfo)(root, config), targetId, name);
234
+ if (!deployment) {
235
+ throw new Error(`Missing contractInfo address: ${targetId}.${name}`);
236
+ }
237
+ return deployment.address;
238
+ };
239
+ exports.getDeploymentAddress = getDeploymentAddress;
240
+ //# sourceMappingURL=deployments.js.map
@@ -0,0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AE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AArBW,QAAA,iBAAiB,qBAqB5B;AAEK,MAAM,qBAAqB,GAAG,CACnC,IAAY,EACZ,MAAsB,EACtB,QAAgB,EAChB,IAAY,EACQ,EAAE;IACtB,OAAO,IAAA,yBAAiB,EAAC,IAAA,wBAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC;AACpF,CAAC,CAAC;AAPW,QAAA,qBAAqB,yBAOhC;AAEK,MAAM,oBAAoB,GAAG,CAClC,IAAY,EACZ,MAAsB,EACtB,QAAgB,EAChB,IAAY,EACJ,EAAE;IACV,MAAM,UAAU,GAAG,IAAA,yBAAiB,EAAC,IAAA,wBAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACrF,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,UAAU,CAAC,OAAO,CAAC;AAC5B,CAAC,CAAC;AAXW,QAAA,oBAAoB,wBAW/B"}
@@ -0,0 +1,5 @@
1
+ import type { Provider } from "ethers";
2
+ export declare const ERC1967_IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
3
+ export declare const ERC1967_ADMIN_SLOT = "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103";
4
+ export declare const getERC1967Implementation: (provider: Pick<Provider, "getStorage">, proxyAddress: string, blockTag?: number) => Promise<string | undefined>;
5
+ export declare const getERC1967Admin: (provider: Pick<Provider, "getStorage">, proxyAddress: string, blockTag?: number) => Promise<string | undefined>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getERC1967Admin = exports.getERC1967Implementation = exports.ERC1967_ADMIN_SLOT = exports.ERC1967_IMPLEMENTATION_SLOT = void 0;
4
+ const ethers_1 = require("ethers");
5
+ exports.ERC1967_IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
6
+ exports.ERC1967_ADMIN_SLOT = "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103";
7
+ const getERC1967Address = async (provider, proxyAddress, slot, label, blockTag) => {
8
+ if (!(0, ethers_1.isAddress)(proxyAddress)) {
9
+ throw new Error("Invalid proxy candidate address: " + proxyAddress);
10
+ }
11
+ const storage = await provider.getStorage(proxyAddress, slot, blockTag);
12
+ if (!/^0x[0-9a-fA-F]{64}$/.test(storage)) {
13
+ throw new Error(`Invalid ERC1967 ${label} slot value for ${proxyAddress}`);
14
+ }
15
+ const storedAddress = "0x" + storage.slice(-40);
16
+ if (storedAddress.toLowerCase() === "0x" + "00".repeat(20)) {
17
+ return undefined;
18
+ }
19
+ return (0, ethers_1.getAddress)(storedAddress);
20
+ };
21
+ const getERC1967Implementation = async (provider, proxyAddress, blockTag) => {
22
+ return getERC1967Address(provider, proxyAddress, exports.ERC1967_IMPLEMENTATION_SLOT, "implementation", blockTag);
23
+ };
24
+ exports.getERC1967Implementation = getERC1967Implementation;
25
+ const getERC1967Admin = async (provider, proxyAddress, blockTag) => {
26
+ return getERC1967Address(provider, proxyAddress, exports.ERC1967_ADMIN_SLOT, "admin", blockTag);
27
+ };
28
+ exports.getERC1967Admin = getERC1967Admin;
29
+ //# sourceMappingURL=erc1967.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc1967.js","sourceRoot":"","sources":["../../../runtime/workflow/lib/erc1967.ts"],"names":[],"mappings":";;;AACA,mCAA+C;AAElC,QAAA,2BAA2B,GACtC,oEAAoE,CAAC;AAE1D,QAAA,kBAAkB,GA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AC;AAZW,QAAA,eAAe,mBAY1B"}
@@ -0,0 +1,6 @@
1
+ export type WorkflowErrorType = "transient" | "check_failed" | "parameter_error" | "config_error" | "contract_error" | "execution_reverted" | "unknown";
2
+ export interface WorkflowErrorClassification {
3
+ errorType: WorkflowErrorType;
4
+ retryable: boolean;
5
+ }
6
+ export declare const classifyWorkflowError: (error: unknown) => WorkflowErrorClassification;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.classifyWorkflowError = void 0;
4
+ const messageOf = (error) => {
5
+ return error instanceof Error ? error.message : String(error);
6
+ };
7
+ const matchesAny = (message, patterns) => {
8
+ return patterns.some((pattern) => pattern.test(message));
9
+ };
10
+ const classifyWorkflowError = (error) => {
11
+ const message = messageOf(error);
12
+ if (matchesAny(message, [
13
+ /timeout/i,
14
+ /timed out/i,
15
+ /rate limit/i,
16
+ /too many requests/i,
17
+ /\b429\b/,
18
+ /\b503\b/,
19
+ /ECONNRESET/i,
20
+ /ETIMEDOUT/i,
21
+ /EAI_AGAIN/i,
22
+ /header not found/i,
23
+ /missing trie node/i,
24
+ /could not detect network/i,
25
+ /network error/i,
26
+ /connection/i,
27
+ ])) {
28
+ return { errorType: "transient", retryable: true };
29
+ }
30
+ if (matchesAny(message, [
31
+ /Check failed/i,
32
+ ])) {
33
+ return { errorType: "check_failed", retryable: false };
34
+ }
35
+ if (matchesAny(message, [
36
+ /Missing parameters/i,
37
+ /Reference not found/i,
38
+ /must resolve to an array/i,
39
+ /Invalid admin address/i,
40
+ /requires saveAs/i,
41
+ /Duplicate deploy saveAs/i,
42
+ ])) {
43
+ return { errorType: "parameter_error", retryable: false };
44
+ }
45
+ if (matchesAny(message, [
46
+ /Missing config\.yaml/i,
47
+ /Missing hardhat\.config\.ts network/i,
48
+ /cannot be forked/i,
49
+ /no factory address/i,
50
+ /no salt/i,
51
+ /simulation callers?/i,
52
+ /releaseTargetNetworks/i,
53
+ /release-target simulation/i,
54
+ ])) {
55
+ return { errorType: "config_error", retryable: false };
56
+ }
57
+ if (matchesAny(message, [
58
+ /Contract does not expose method/i,
59
+ /missing upgradeToAndCall/i,
60
+ /missing newImplementation/i,
61
+ /Unsupported step kind/i,
62
+ ])) {
63
+ return { errorType: "contract_error", retryable: false };
64
+ }
65
+ if (matchesAny(message, [
66
+ /revert/i,
67
+ /reverted/i,
68
+ /CALL_EXCEPTION/i,
69
+ /transaction failed/i,
70
+ /gate-tool validate failed/i,
71
+ ])) {
72
+ return { errorType: "execution_reverted", retryable: false };
73
+ }
74
+ return { errorType: "unknown", retryable: false };
75
+ };
76
+ exports.classifyWorkflowError = classifyWorkflowError;
77
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../runtime/workflow/lib/errors.ts"],"names":[],"mappings":";;;AAcA,MAAM,SAAS,GAAG,CAAC,KAAc,EAAU,EAAE;IAC3C,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,QAAkB,EAAW,EAAE;IAClE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAC,KAAc,EAA+B,EAAE;IACnF,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEjC,IAAI,UAAU,CAAC,OAAO,EAAE;QACtB,UAAU;QACV,YAAY;QACZ,aAAa;QACb,oBAAoB;QACpB,SAAS;QACT,SAAS;QACT,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,mBAAmB;QACnB,oBAAoB;QACpB,2BAA2B;QAC3B,gBAAgB;QAChB,aAA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E,CAAC;AACpD,CAAC,CAAC;AAxEW,QAAA,qBAAqB,yBAwEhC"}
@@ -0,0 +1,7 @@
1
+ interface BuildExecutionIdOptions {
2
+ now?: Date;
3
+ random?: number;
4
+ }
5
+ export declare const validateExecutionId: (value: unknown, label?: string) => string;
6
+ export declare const buildExecutionId: (targetId: string, options?: BuildExecutionIdOptions) => string;
7
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildExecutionId = exports.validateExecutionId = void 0;
4
+ const EXECUTION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,199}$/;
5
+ const MAX_EXECUTION_ID_LENGTH = 200;
6
+ const validateExecutionId = (value, label = "executionId") => {
7
+ if (typeof value !== "string" || !EXECUTION_ID_PATTERN.test(value)) {
8
+ throw new Error(`${label} must match the canonical execution ID rule: `
9
+ + "1-200 letters, numbers, underscores, or hyphens, beginning with a letter or number");
10
+ }
11
+ return value;
12
+ };
13
+ exports.validateExecutionId = validateExecutionId;
14
+ const buildExecutionId = (targetId, options = {}) => {
15
+ const timestamp = (options.now || new Date()).toISOString().replace(/\D/g, "");
16
+ const random = options.random ?? Math.random();
17
+ const nonce = random.toString(36).slice(2).padEnd(8, "0").slice(0, 8);
18
+ const prefix = `exec-${timestamp}-${nonce}`;
19
+ const targetBudget = MAX_EXECUTION_ID_LENGTH - prefix.length - 1;
20
+ const targetSlug = targetId
21
+ .replace(/[^A-Za-z0-9_-]/g, "-")
22
+ .slice(0, targetBudget);
23
+ return (0, exports.validateExecutionId)(`${prefix}-${targetSlug}`);
24
+ };
25
+ exports.buildExecutionId = buildExecutionId;
26
+ //# sourceMappingURL=executionId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionId.js","sourceRoot":"","sources":["../../../runtime/workflow/lib/executionId.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AACjE,MAAM,uBAAuB,GAAG,G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ReleaseKind = "development" | "admin_release";
2
+ export type ExecutionRoute = "operator" | "external";
3
+ export interface ReleaseExecutionTransaction {
4
+ transactionId: string;
5
+ stepId: string;
6
+ transactionIndex: number;
7
+ route: ExecutionRoute;
8
+ executor: string;
9
+ to: string;
10
+ value: string;
11
+ data: string;
12
+ operation: 0 | 1;
13
+ scheme?: "zksync-eravm";
14
+ factoryDeps?: string[];
15
+ }
16
+ export interface ReleaseExecutionPlan {
17
+ version: 1;
18
+ taskId: string;
19
+ target: string;
20
+ executionId: string;
21
+ releaseKind: ReleaseKind;
22
+ operator: string;
23
+ transactions: ReleaseExecutionTransaction[];
24
+ planHash: string;
25
+ createdAt: string;
26
+ }
27
+ type PlanBody = Omit<ReleaseExecutionPlan, "planHash" | "createdAt">;
28
+ export interface ReleaseExecutionTransactionInput {
29
+ stepId: string;
30
+ executor: string;
31
+ to: string;
32
+ value: string;
33
+ data: string;
34
+ operation: 0 | 1;
35
+ scheme?: "zksync-eravm";
36
+ factoryDeps?: string[];
37
+ }
38
+ export interface CompletedExecutionTransaction {
39
+ transactionId: string;
40
+ transactionHash: string;
41
+ }
42
+ export interface PlannedExecutionTransaction extends ReleaseExecutionTransaction {
43
+ executionAction: "execute" | "package" | "replay";
44
+ transactionHash?: string;
45
+ }
46
+ export declare class ExecutionSegmentDeferred extends Error {
47
+ readonly transactionId: string;
48
+ constructor(transactionId: string);
49
+ }
50
+ export declare class ReleaseExecutionPlanner {
51
+ private readonly body;
52
+ private readonly expected?;
53
+ private readonly transactions;
54
+ private readonly segmentedExecution;
55
+ private readonly completedTransactions;
56
+ private readonly segmentEnd;
57
+ constructor(input: {
58
+ taskId: string;
59
+ target: string;
60
+ executionId: string;
61
+ releaseKind: ReleaseKind;
62
+ operator: string;
63
+ expectedPlan?: ReleaseExecutionPlan;
64
+ segmentedExecution?: boolean;
65
+ completedTransactions?: CompletedExecutionTransaction[];
66
+ });
67
+ add(input: ReleaseExecutionTransactionInput): PlannedExecutionTransaction;
68
+ complete(options?: {
69
+ allowPartial?: boolean;
70
+ }): PlanBody;
71
+ }
72
+ export declare const writeReleaseExecutionPlan: (input: {
73
+ root: string;
74
+ taskDir: string;
75
+ plan: PlanBody;
76
+ }) => ReleaseExecutionPlan;
77
+ export declare const loadReleaseExecutionPlan: (input: {
78
+ root: string;
79
+ taskDir: string;
80
+ target: string;
81
+ executionId: string;
82
+ expectedHash?: string;
83
+ }) => ReleaseExecutionPlan;
84
+ export declare const releaseExecutionPlanRelativePath: (taskDir: string, plan: Pick<ReleaseExecutionPlan, "target" | "executionId">) => string;
85
+ export {};