gate-evm-tools 1.0.28 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -18
- package/bin/cli.js +6 -0
- package/bin/delivery.cjs +52 -0
- package/bin/manifest-bootstrap.js +4 -15
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +26 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/plan/file-store.d.ts.map +1 -0
- package/dist/commands/plan/generate-deployment.d.ts +48 -0
- package/dist/commands/plan/generate-deployment.d.ts.map +1 -0
- package/dist/commands/plan/generate-deployment.js +211 -0
- package/dist/commands/plan/generate-deployment.js.map +1 -0
- package/dist/commands/plan/helpers.d.ts.map +1 -0
- package/dist/commands/plan/index.d.ts +3 -0
- package/dist/commands/plan/index.d.ts.map +1 -0
- package/dist/commands/plan/index.js +88 -0
- package/dist/commands/plan/index.js.map +1 -0
- package/dist/commands/sync.js +1 -1
- package/dist/commands/sync.js.map +1 -1
- package/dist/core/BytecodeChecker.d.ts.map +1 -1
- package/dist/core/BytecodeChecker.js +27 -8
- package/dist/core/BytecodeChecker.js.map +1 -1
- package/dist/core/preparation/artifacts.d.ts +2 -0
- package/dist/core/preparation/artifacts.d.ts.map +1 -1
- package/dist/core/preparation/artifacts.js +9 -3
- package/dist/core/preparation/artifacts.js.map +1 -1
- package/dist/core/preparation/batch.d.ts +26 -0
- package/dist/core/preparation/batch.d.ts.map +1 -0
- package/dist/core/preparation/batch.js +72 -0
- package/dist/core/preparation/batch.js.map +1 -0
- package/dist/core/preparation/evm.d.ts +61 -6
- package/dist/core/preparation/evm.d.ts.map +1 -1
- package/dist/core/preparation/evm.js +122 -34
- package/dist/core/preparation/evm.js.map +1 -1
- package/dist/core/preparation/evmManifestSync.d.ts +68 -0
- package/dist/core/preparation/evmManifestSync.d.ts.map +1 -0
- package/dist/core/preparation/evmManifestSync.js +154 -0
- package/dist/core/preparation/evmManifestSync.js.map +1 -0
- package/dist/core/preparation/index.d.ts +40 -2
- package/dist/core/preparation/index.d.ts.map +1 -1
- package/dist/core/preparation/index.js +3 -3
- package/dist/core/preparation/index.js.map +1 -1
- package/dist/core/preparation/manifest.d.ts +17 -3
- package/dist/core/preparation/manifest.d.ts.map +1 -1
- package/dist/core/preparation/manifest.js +23 -28
- package/dist/core/preparation/manifest.js.map +1 -1
- package/dist/core/preparation/normalize.d.ts.map +1 -1
- package/dist/core/preparation/normalize.js +67 -20
- package/dist/core/preparation/normalize.js.map +1 -1
- package/dist/core/preparation/transparent.d.ts +23 -0
- package/dist/core/preparation/transparent.d.ts.map +1 -0
- package/dist/core/preparation/transparent.js +103 -0
- package/dist/core/preparation/transparent.js.map +1 -0
- package/dist/core/preparation/types.d.ts +54 -7
- package/dist/core/preparation/types.d.ts.map +1 -1
- package/dist/core/preparation/zksync.d.ts.map +1 -1
- package/dist/core/preparation/zksync.js +2 -0
- package/dist/core/preparation/zksync.js.map +1 -1
- package/dist/custody/credential.d.ts.map +1 -1
- package/dist/custody/credential.js +1 -6
- package/dist/custody/credential.js.map +1 -1
- package/dist/custody/hardhat-runtime.d.ts.map +1 -1
- package/dist/custody/hardhat-runtime.js +2 -0
- package/dist/custody/hardhat-runtime.js.map +1 -1
- package/dist/custody/hardhat.d.ts +1 -0
- package/dist/custody/hardhat.d.ts.map +1 -1
- package/dist/custody/hardhat.js +1 -0
- package/dist/custody/hardhat.js.map +1 -1
- package/dist/custody/index.d.ts +1 -0
- package/dist/custody/index.d.ts.map +1 -1
- package/dist/custody/index.js +1 -0
- package/dist/custody/index.js.map +1 -1
- package/dist/custody/provider-wait.d.ts +13 -0
- package/dist/custody/provider-wait.d.ts.map +1 -0
- package/dist/custody/provider-wait.js +78 -0
- package/dist/custody/provider-wait.js.map +1 -0
- package/dist/delivery/policy.d.ts +6 -0
- package/dist/delivery/policy.d.ts.map +1 -0
- package/dist/delivery/policy.js +24 -0
- package/dist/delivery/policy.js.map +1 -0
- package/dist/deployment-evm/index.d.ts +4 -0
- package/dist/deployment-evm/index.d.ts.map +1 -0
- package/dist/deployment-evm/index.js +3 -0
- package/dist/deployment-evm/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/sync/index.d.ts +15 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +13 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow/index.d.ts +10 -2
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +6 -0
- package/dist/workflow/index.js.map +1 -1
- package/dist-cjs/core/BytecodeChecker.js +526 -0
- package/dist-cjs/core/BytecodeChecker.js.map +1 -0
- package/dist-cjs/core/legacyProxyArtifact.js +42 -0
- package/dist-cjs/core/legacyProxyArtifact.js.map +1 -0
- package/dist-cjs/core/preparation/artifacts.js +11 -4
- package/dist-cjs/core/preparation/artifacts.js.map +1 -1
- package/dist-cjs/core/preparation/batch.js +76 -0
- package/dist-cjs/core/preparation/batch.js.map +1 -0
- package/dist-cjs/core/preparation/evm.js +128 -37
- package/dist-cjs/core/preparation/evm.js.map +1 -1
- package/dist-cjs/core/preparation/evmManifestSync.js +163 -0
- package/dist-cjs/core/preparation/evmManifestSync.js.map +1 -0
- package/dist-cjs/core/preparation/index.js +3 -3
- package/dist-cjs/core/preparation/index.js.map +1 -1
- package/dist-cjs/core/preparation/manifest.js +25 -30
- package/dist-cjs/core/preparation/manifest.js.map +1 -1
- package/dist-cjs/core/preparation/normalize.js +67 -20
- package/dist-cjs/core/preparation/normalize.js.map +1 -1
- package/dist-cjs/core/preparation/transparent.js +110 -0
- package/dist-cjs/core/preparation/transparent.js.map +1 -0
- package/dist-cjs/core/preparation/zksync.js +2 -0
- package/dist-cjs/core/preparation/zksync.js.map +1 -1
- package/dist-cjs/custody/credential.js +1 -6
- package/dist-cjs/custody/credential.js.map +1 -1
- package/dist-cjs/custody/hardhat-runtime.js +2 -0
- package/dist-cjs/custody/hardhat-runtime.js.map +1 -1
- package/dist-cjs/custody/hardhat.js +3 -1
- package/dist-cjs/custody/hardhat.js.map +1 -1
- package/dist-cjs/custody/index.js +3 -1
- package/dist-cjs/custody/index.js.map +1 -1
- package/dist-cjs/custody/provider-wait.js +81 -0
- package/dist-cjs/custody/provider-wait.js.map +1 -0
- package/dist-cjs/delivery/policy.js +29 -0
- package/dist-cjs/delivery/policy.js.map +1 -0
- package/dist-cjs/deployment-evm/index.js +10 -0
- package/dist-cjs/deployment-evm/index.js.map +1 -0
- package/dist-cjs/sync/index.js +13 -0
- package/dist-cjs/sync/index.js.map +1 -1
- package/dist-cjs/workflow/index.js +22 -1
- package/dist-cjs/workflow/index.js.map +1 -1
- package/dist-runtime/config/hardhatAdapters.js +2 -1
- package/dist-runtime/config/hardhatAdapters.js.map +1 -1
- package/dist-runtime/config/openzeppelin.d.ts +2 -1
- package/dist-runtime/config/openzeppelin.js +2 -19
- package/dist-runtime/config/openzeppelin.js.map +1 -1
- package/dist-runtime/delivery/abi.d.ts +14 -0
- package/dist-runtime/delivery/abi.js +161 -0
- package/dist-runtime/delivery/abi.js.map +1 -0
- package/dist-runtime/delivery/aggregate-bootstrap.d.ts +12 -0
- package/dist-runtime/delivery/aggregate-bootstrap.js +42 -0
- package/dist-runtime/delivery/aggregate-bootstrap.js.map +1 -0
- package/dist-runtime/delivery/aggregate-channel.d.ts +28 -0
- package/dist-runtime/delivery/aggregate-channel.js +159 -0
- package/dist-runtime/delivery/aggregate-channel.js.map +1 -0
- package/dist-runtime/delivery/aggregate-diagnostics.d.ts +14 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js +73 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js.map +1 -0
- package/dist-runtime/delivery/aggregate-inputs.d.ts +172 -0
- package/dist-runtime/delivery/aggregate-inputs.js +57 -0
- package/dist-runtime/delivery/aggregate-inputs.js.map +1 -0
- package/dist-runtime/delivery/aggregate-source.d.ts +25 -0
- package/dist-runtime/delivery/aggregate-source.js +87 -0
- package/dist-runtime/delivery/aggregate-source.js.map +1 -0
- package/dist-runtime/delivery/aggregate-worker.d.ts +1 -0
- package/dist-runtime/delivery/aggregate-worker.js +199 -0
- package/dist-runtime/delivery/aggregate-worker.js.map +1 -0
- package/dist-runtime/delivery/aggregate.d.ts +51 -0
- package/dist-runtime/delivery/aggregate.js +190 -0
- package/dist-runtime/delivery/aggregate.js.map +1 -0
- package/dist-runtime/delivery/bindings.d.ts +21 -0
- package/dist-runtime/delivery/bindings.js +53 -0
- package/dist-runtime/delivery/bindings.js.map +1 -0
- package/dist-runtime/delivery/business-extension.d.ts +10 -0
- package/dist-runtime/delivery/business-extension.js +38 -0
- package/dist-runtime/delivery/business-extension.js.map +1 -0
- package/dist-runtime/delivery/calldata-archive.d.ts +18 -0
- package/dist-runtime/delivery/calldata-archive.js +31 -0
- package/dist-runtime/delivery/calldata-archive.js.map +1 -0
- package/dist-runtime/delivery/calldata-details.d.ts +47 -0
- package/dist-runtime/delivery/calldata-details.js +94 -0
- package/dist-runtime/delivery/calldata-details.js.map +1 -0
- package/dist-runtime/delivery/calldata-format.d.ts +4 -0
- package/dist-runtime/delivery/calldata-format.js +17 -0
- package/dist-runtime/delivery/calldata-format.js.map +1 -0
- package/dist-runtime/delivery/calldata-preparations.d.ts +13 -0
- package/dist-runtime/delivery/calldata-preparations.js +85 -0
- package/dist-runtime/delivery/calldata-preparations.js.map +1 -0
- package/dist-runtime/delivery/calldata-review.d.ts +44 -0
- package/dist-runtime/delivery/calldata-review.js +131 -0
- package/dist-runtime/delivery/calldata-review.js.map +1 -0
- package/dist-runtime/delivery/check-code.d.ts +19 -0
- package/dist-runtime/delivery/check-code.js +63 -0
- package/dist-runtime/delivery/check-code.js.map +1 -0
- package/dist-runtime/delivery/closure-format.d.ts +77 -0
- package/dist-runtime/delivery/closure-format.js +225 -0
- package/dist-runtime/delivery/closure-format.js.map +1 -0
- package/dist-runtime/delivery/codec-pin.d.ts +2 -0
- package/dist-runtime/delivery/codec-pin.js +7 -0
- package/dist-runtime/delivery/codec-pin.js.map +1 -0
- package/dist-runtime/delivery/codec.d.ts +19 -0
- package/dist-runtime/delivery/codec.js +73 -0
- package/dist-runtime/delivery/codec.js.map +1 -0
- package/dist-runtime/delivery/compiler-dependency-pins.d.ts +7 -0
- package/dist-runtime/delivery/compiler-dependency-pins.js +1689 -0
- package/dist-runtime/delivery/compiler-dependency-pins.js.map +1 -0
- package/dist-runtime/delivery/compiler-files.d.ts +40 -0
- package/dist-runtime/delivery/compiler-files.js +222 -0
- package/dist-runtime/delivery/compiler-files.js.map +1 -0
- package/dist-runtime/delivery/compiler-io.d.ts +2 -0
- package/dist-runtime/delivery/compiler-io.js +13 -0
- package/dist-runtime/delivery/compiler-io.js.map +1 -0
- package/dist-runtime/delivery/compiler-pins.d.ts +10 -0
- package/dist-runtime/delivery/compiler-pins.js +147 -0
- package/dist-runtime/delivery/compiler-pins.js.map +1 -0
- package/dist-runtime/delivery/compiler.d.ts +188 -0
- package/dist-runtime/delivery/compiler.js +851 -0
- package/dist-runtime/delivery/compiler.js.map +1 -0
- package/dist-runtime/delivery/config.d.ts +48 -0
- package/dist-runtime/delivery/config.js +124 -0
- package/dist-runtime/delivery/config.js.map +1 -0
- package/dist-runtime/delivery/configuration-definition.d.ts +31 -0
- package/dist-runtime/delivery/configuration-definition.js +343 -0
- package/dist-runtime/delivery/configuration-definition.js.map +1 -0
- package/dist-runtime/delivery/configuration-hre.d.ts +17 -0
- package/dist-runtime/delivery/configuration-hre.js +198 -0
- package/dist-runtime/delivery/configuration-hre.js.map +1 -0
- package/dist-runtime/delivery/configuration-runtime.d.ts +36 -0
- package/dist-runtime/delivery/configuration-runtime.js +248 -0
- package/dist-runtime/delivery/configuration-runtime.js.map +1 -0
- package/dist-runtime/delivery/configuration.d.ts +35 -0
- package/dist-runtime/delivery/configuration.js +86 -0
- package/dist-runtime/delivery/configuration.js.map +1 -0
- package/dist-runtime/delivery/contract-source.d.ts +14 -0
- package/dist-runtime/delivery/contract-source.js +138 -0
- package/dist-runtime/delivery/contract-source.js.map +1 -0
- package/dist-runtime/delivery/create2.d.ts +3 -0
- package/dist-runtime/delivery/create2.js +48 -0
- package/dist-runtime/delivery/create2.js.map +1 -0
- package/dist-runtime/delivery/custom-closure.d.ts +27 -0
- package/dist-runtime/delivery/custom-closure.js +818 -0
- package/dist-runtime/delivery/custom-closure.js.map +1 -0
- package/dist-runtime/delivery/custom-format.d.ts +35 -0
- package/dist-runtime/delivery/custom-format.js +410 -0
- package/dist-runtime/delivery/custom-format.js.map +1 -0
- package/dist-runtime/delivery/custom.d.ts +32 -0
- package/dist-runtime/delivery/custom.js +158 -0
- package/dist-runtime/delivery/custom.js.map +1 -0
- package/dist-runtime/delivery/data.d.ts +7 -0
- package/dist-runtime/delivery/data.js +86 -0
- package/dist-runtime/delivery/data.js.map +1 -0
- package/dist-runtime/delivery/development.d.ts +92 -0
- package/dist-runtime/delivery/development.js +406 -0
- package/dist-runtime/delivery/development.js.map +1 -0
- package/dist-runtime/delivery/engine.d.ts +9 -0
- package/dist-runtime/delivery/engine.js +23 -0
- package/dist-runtime/delivery/engine.js.map +1 -0
- package/dist-runtime/delivery/eoa-observation.d.ts +43 -0
- package/dist-runtime/delivery/eoa-observation.js +145 -0
- package/dist-runtime/delivery/eoa-observation.js.map +1 -0
- package/dist-runtime/delivery/eoa-signed.d.ts +2 -0
- package/dist-runtime/delivery/eoa-signed.js +74 -0
- package/dist-runtime/delivery/eoa-signed.js.map +1 -0
- package/dist-runtime/delivery/eoa.d.ts +82 -0
- package/dist-runtime/delivery/eoa.js +274 -0
- package/dist-runtime/delivery/eoa.js.map +1 -0
- package/dist-runtime/delivery/execution-db.d.ts +20 -0
- package/dist-runtime/delivery/execution-db.js +153 -0
- package/dist-runtime/delivery/execution-db.js.map +1 -0
- package/dist-runtime/delivery/execution-files.d.ts +9 -0
- package/dist-runtime/delivery/execution-files.js +138 -0
- package/dist-runtime/delivery/execution-files.js.map +1 -0
- package/dist-runtime/delivery/execution-identity.d.ts +15 -0
- package/dist-runtime/delivery/execution-identity.js +33 -0
- package/dist-runtime/delivery/execution-identity.js.map +1 -0
- package/dist-runtime/delivery/execution-model.d.ts +56 -0
- package/dist-runtime/delivery/execution-model.js +66 -0
- package/dist-runtime/delivery/execution-model.js.map +1 -0
- package/dist-runtime/delivery/execution-store.d.ts +48 -0
- package/dist-runtime/delivery/execution-store.js +361 -0
- package/dist-runtime/delivery/execution-store.js.map +1 -0
- package/dist-runtime/delivery/existing-code.d.ts +37 -0
- package/dist-runtime/delivery/existing-code.js +83 -0
- package/dist-runtime/delivery/existing-code.js.map +1 -0
- package/dist-runtime/delivery/export.d.ts +51 -0
- package/dist-runtime/delivery/export.js +69 -0
- package/dist-runtime/delivery/export.js.map +1 -0
- package/dist-runtime/delivery/forkAudit.d.ts +119 -0
- package/dist-runtime/delivery/forkAudit.js +473 -0
- package/dist-runtime/delivery/forkAudit.js.map +1 -0
- package/dist-runtime/delivery/hardhat.d.ts +3 -0
- package/dist-runtime/delivery/hardhat.js +45 -0
- package/dist-runtime/delivery/hardhat.js.map +1 -0
- package/dist-runtime/delivery/history-registration.d.ts +2 -0
- package/dist-runtime/delivery/history-registration.js +17 -0
- package/dist-runtime/delivery/history-registration.js.map +1 -0
- package/dist-runtime/delivery/identities.d.ts +22 -0
- package/dist-runtime/delivery/identities.js +97 -0
- package/dist-runtime/delivery/identities.js.map +1 -0
- package/dist-runtime/delivery/input-files.d.ts +5 -0
- package/dist-runtime/delivery/input-files.js +70 -0
- package/dist-runtime/delivery/input-files.js.map +1 -0
- package/dist-runtime/delivery/inputs.d.ts +62 -0
- package/dist-runtime/delivery/inputs.js +194 -0
- package/dist-runtime/delivery/inputs.js.map +1 -0
- package/dist-runtime/delivery/journal.d.ts +35 -0
- package/dist-runtime/delivery/journal.js +278 -0
- package/dist-runtime/delivery/journal.js.map +1 -0
- package/dist-runtime/delivery/manifest.d.ts +14 -0
- package/dist-runtime/delivery/manifest.js +68 -0
- package/dist-runtime/delivery/manifest.js.map +1 -0
- package/dist-runtime/delivery/materialization.d.ts +20 -0
- package/dist-runtime/delivery/materialization.js +138 -0
- package/dist-runtime/delivery/materialization.js.map +1 -0
- package/dist-runtime/delivery/observations.d.ts +31 -0
- package/dist-runtime/delivery/observations.js +38 -0
- package/dist-runtime/delivery/observations.js.map +1 -0
- package/dist-runtime/delivery/parameter-defaults.d.ts +10 -0
- package/dist-runtime/delivery/parameter-defaults.js +86 -0
- package/dist-runtime/delivery/parameter-defaults.js.map +1 -0
- package/dist-runtime/delivery/parameters.d.ts +55 -0
- package/dist-runtime/delivery/parameters.js +279 -0
- package/dist-runtime/delivery/parameters.js.map +1 -0
- package/dist-runtime/delivery/pending.d.ts +70 -0
- package/dist-runtime/delivery/pending.js +99 -0
- package/dist-runtime/delivery/pending.js.map +1 -0
- package/dist-runtime/delivery/plan.d.ts +50 -0
- package/dist-runtime/delivery/plan.js +209 -0
- package/dist-runtime/delivery/plan.js.map +1 -0
- package/dist-runtime/delivery/planning.d.ts +84 -0
- package/dist-runtime/delivery/planning.js +318 -0
- package/dist-runtime/delivery/planning.js.map +1 -0
- package/dist-runtime/delivery/policy.d.ts +4 -0
- package/dist-runtime/delivery/policy.js +9 -0
- package/dist-runtime/delivery/policy.js.map +1 -0
- package/dist-runtime/delivery/preparation.d.ts +6 -0
- package/dist-runtime/delivery/preparation.js +178 -0
- package/dist-runtime/delivery/preparation.js.map +1 -0
- package/dist-runtime/delivery/production-environment.d.ts +2 -0
- package/dist-runtime/delivery/production-environment.js +13 -0
- package/dist-runtime/delivery/production-environment.js.map +1 -0
- package/dist-runtime/delivery/production-finalization.d.ts +86 -0
- package/dist-runtime/delivery/production-finalization.js +292 -0
- package/dist-runtime/delivery/production-finalization.js.map +1 -0
- package/dist-runtime/delivery/production-intent.d.ts +2 -0
- package/dist-runtime/delivery/production-intent.js +16 -0
- package/dist-runtime/delivery/production-intent.js.map +1 -0
- package/dist-runtime/delivery/production.d.ts +582 -0
- package/dist-runtime/delivery/production.js +445 -0
- package/dist-runtime/delivery/production.js.map +1 -0
- package/dist-runtime/delivery/project-files.d.ts +8 -0
- package/dist-runtime/delivery/project-files.js +87 -0
- package/dist-runtime/delivery/project-files.js.map +1 -0
- package/dist-runtime/delivery/project-rpc.d.ts +19 -0
- package/dist-runtime/delivery/project-rpc.js +138 -0
- package/dist-runtime/delivery/project-rpc.js.map +1 -0
- package/dist-runtime/delivery/project.d.ts +17 -0
- package/dist-runtime/delivery/project.js +170 -0
- package/dist-runtime/delivery/project.js.map +1 -0
- package/dist-runtime/delivery/protocol.d.ts +49 -0
- package/dist-runtime/delivery/protocol.js +112 -0
- package/dist-runtime/delivery/protocol.js.map +1 -0
- package/dist-runtime/delivery/public-calldata.d.ts +25 -0
- package/dist-runtime/delivery/public-calldata.js +97 -0
- package/dist-runtime/delivery/public-calldata.js.map +1 -0
- package/dist-runtime/delivery/references.d.ts +19 -0
- package/dist-runtime/delivery/references.js +84 -0
- package/dist-runtime/delivery/references.js.map +1 -0
- package/dist-runtime/delivery/release-graph.d.ts +97 -0
- package/dist-runtime/delivery/release-graph.js +139 -0
- package/dist-runtime/delivery/release-graph.js.map +1 -0
- package/dist-runtime/delivery/release-history-capture.d.ts +7 -0
- package/dist-runtime/delivery/release-history-capture.js +76 -0
- package/dist-runtime/delivery/release-history-capture.js.map +1 -0
- package/dist-runtime/delivery/release-history.d.ts +43 -0
- package/dist-runtime/delivery/release-history.js +322 -0
- package/dist-runtime/delivery/release-history.js.map +1 -0
- package/dist-runtime/delivery/release-inputs.d.ts +33 -0
- package/dist-runtime/delivery/release-inputs.js +129 -0
- package/dist-runtime/delivery/release-inputs.js.map +1 -0
- package/dist-runtime/delivery/release.d.ts +196 -0
- package/dist-runtime/delivery/release.js +261 -0
- package/dist-runtime/delivery/release.js.map +1 -0
- package/dist-runtime/delivery/safe-manifest.d.ts +9 -0
- package/dist-runtime/delivery/safe-manifest.js +13 -0
- package/dist-runtime/delivery/safe-manifest.js.map +1 -0
- package/dist-runtime/delivery/safe-observation.d.ts +30 -0
- package/dist-runtime/delivery/safe-observation.js +487 -0
- package/dist-runtime/delivery/safe-observation.js.map +1 -0
- package/dist-runtime/delivery/safe-prepare.d.ts +13 -0
- package/dist-runtime/delivery/safe-prepare.js +81 -0
- package/dist-runtime/delivery/safe-prepare.js.map +1 -0
- package/dist-runtime/delivery/safe.d.ts +92 -0
- package/dist-runtime/delivery/safe.js +254 -0
- package/dist-runtime/delivery/safe.js.map +1 -0
- package/dist-runtime/delivery/same-fork-baseline.d.ts +8 -0
- package/dist-runtime/delivery/same-fork-baseline.js +21 -0
- package/dist-runtime/delivery/same-fork-baseline.js.map +1 -0
- package/dist-runtime/delivery/setup.d.ts +31 -0
- package/dist-runtime/delivery/setup.js +230 -0
- package/dist-runtime/delivery/setup.js.map +1 -0
- package/dist-runtime/delivery/source.d.ts +42 -0
- package/dist-runtime/delivery/source.js +139 -0
- package/dist-runtime/delivery/source.js.map +1 -0
- package/dist-runtime/delivery/target-fields.d.ts +2 -0
- package/dist-runtime/delivery/target-fields.js +11 -0
- package/dist-runtime/delivery/target-fields.js.map +1 -0
- package/dist-runtime/delivery/task-identity.d.ts +23 -0
- package/dist-runtime/delivery/task-identity.js +109 -0
- package/dist-runtime/delivery/task-identity.js.map +1 -0
- package/dist-runtime/delivery/toolchain.d.ts +3 -0
- package/dist-runtime/delivery/toolchain.js +52 -0
- package/dist-runtime/delivery/toolchain.js.map +1 -0
- package/dist-runtime/delivery/validation.d.ts +9 -0
- package/dist-runtime/delivery/validation.js +155 -0
- package/dist-runtime/delivery/validation.js.map +1 -0
- package/dist-runtime/delivery/verification.d.ts +16 -0
- package/dist-runtime/delivery/verification.js +65 -0
- package/dist-runtime/delivery/verification.js.map +1 -0
- package/dist-runtime/migrate.js +1 -0
- package/dist-runtime/migrate.js.map +1 -1
- package/dist-runtime/miner/binary.d.ts +2 -0
- package/dist-runtime/miner/binary.js +54 -0
- package/dist-runtime/miner/binary.js.map +1 -0
- package/dist-runtime/miner/cli.d.ts +1 -0
- package/dist-runtime/miner/cli.js +131 -0
- package/dist-runtime/miner/cli.js.map +1 -0
- package/dist-runtime/miner/index.d.ts +5 -0
- package/dist-runtime/miner/index.js +13 -0
- package/dist-runtime/miner/index.js.map +1 -0
- package/dist-runtime/miner/request.d.ts +7 -0
- package/dist-runtime/miner/request.js +73 -0
- package/dist-runtime/miner/request.js.map +1 -0
- package/dist-runtime/miner/runner.d.ts +2 -0
- package/dist-runtime/miner/runner.js +131 -0
- package/dist-runtime/miner/runner.js.map +1 -0
- package/dist-runtime/miner/types.d.ts +89 -0
- package/dist-runtime/miner/types.js +3 -0
- package/dist-runtime/miner/types.js.map +1 -0
- package/dist-runtime/miner/verify.d.ts +2 -0
- package/dist-runtime/miner/verify.js +75 -0
- package/dist-runtime/miner/verify.js.map +1 -0
- package/dist-runtime/runtime-identity.json +2 -2
- package/dist-runtime/vendor/plan-codec/index.cjs +897 -0
- package/dist-runtime/vendor/plan-codec/index.d.cts +38 -0
- package/dist-runtime/vendor/plan-codec/provenance.json +25 -0
- package/dist-runtime/workflow/engine.d.ts +14 -0
- package/dist-runtime/workflow/engine.js +160 -0
- package/dist-runtime/workflow/engine.js.map +1 -0
- package/dist-runtime/workflow/lib/authority.d.ts +6 -3
- package/dist-runtime/workflow/lib/authority.js.map +1 -1
- package/dist-runtime/workflow/lib/calls.d.ts +1 -1
- package/dist-runtime/workflow/lib/calls.js +44 -34
- package/dist-runtime/workflow/lib/calls.js.map +1 -1
- package/dist-runtime/workflow/lib/canonicalData.d.ts +8 -0
- package/dist-runtime/workflow/lib/canonicalData.js +68 -0
- package/dist-runtime/workflow/lib/canonicalData.js.map +1 -0
- package/dist-runtime/workflow/lib/checkCodeRunner.js +7 -4
- package/dist-runtime/workflow/lib/checkCodeRunner.js.map +1 -1
- package/dist-runtime/workflow/lib/config.d.ts +3 -1
- package/dist-runtime/workflow/lib/config.js.map +1 -1
- package/dist-runtime/workflow/lib/context.d.ts +77 -0
- package/dist-runtime/workflow/lib/context.js +3 -0
- package/dist-runtime/workflow/lib/context.js.map +1 -0
- package/dist-runtime/workflow/lib/create2.d.ts +5 -27
- package/dist-runtime/workflow/lib/create2.js +11 -79
- package/dist-runtime/workflow/lib/create2.js.map +1 -1
- package/dist-runtime/workflow/lib/deploymentInfo.d.ts +2 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js +6 -0
- package/dist-runtime/workflow/lib/deploymentInfo.js.map +1 -1
- package/dist-runtime/workflow/lib/deploymentRecords.d.ts +2 -0
- package/dist-runtime/workflow/lib/deploymentRecords.js +1 -1
- package/dist-runtime/workflow/lib/deploymentRecords.js.map +1 -1
- package/dist-runtime/workflow/lib/deployments.d.ts +5 -5
- package/dist-runtime/workflow/lib/deployments.js +5 -13
- package/dist-runtime/workflow/lib/deployments.js.map +1 -1
- package/dist-runtime/workflow/lib/evidencePorts.d.ts +55 -0
- package/dist-runtime/workflow/lib/evidencePorts.js +3 -0
- package/dist-runtime/workflow/lib/evidencePorts.js.map +1 -0
- package/dist-runtime/workflow/lib/executionPlan.d.ts +4 -42
- package/dist-runtime/workflow/lib/executionPlan.js +15 -210
- package/dist-runtime/workflow/lib/executionPlan.js.map +1 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js +2 -1
- package/dist-runtime/workflow/lib/externalExecutionScanner.js.map +1 -1
- package/dist-runtime/workflow/lib/gateTool.d.ts +6 -2
- package/dist-runtime/workflow/lib/gateTool.js +22 -12
- package/dist-runtime/workflow/lib/gateTool.js.map +1 -1
- package/dist-runtime/workflow/lib/gateToolSync.d.ts +4 -1
- package/dist-runtime/workflow/lib/gateToolSync.js +8 -2
- package/dist-runtime/workflow/lib/gateToolSync.js.map +1 -1
- package/dist-runtime/workflow/lib/operationNames.d.ts +3 -0
- package/dist-runtime/workflow/lib/operationNames.js +34 -0
- package/dist-runtime/workflow/lib/operationNames.js.map +1 -0
- package/dist-runtime/workflow/lib/parameters.d.ts +1 -1
- package/dist-runtime/workflow/lib/parameters.js +11 -22
- package/dist-runtime/workflow/lib/parameters.js.map +1 -1
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js +18 -52
- package/dist-runtime/workflow/lib/pendingDeploymentReuse.js.map +1 -1
- package/dist-runtime/workflow/lib/pendingUupsBinding.d.ts +42 -0
- package/dist-runtime/workflow/lib/pendingUupsBinding.js +39 -0
- package/dist-runtime/workflow/lib/pendingUupsBinding.js.map +1 -0
- package/dist-runtime/workflow/lib/plan.d.ts +55 -0
- package/dist-runtime/workflow/lib/plan.js +324 -0
- package/dist-runtime/workflow/lib/plan.js.map +1 -0
- package/dist-runtime/workflow/lib/planCli.d.ts +14 -0
- package/dist-runtime/workflow/lib/planCli.js +279 -0
- package/dist-runtime/workflow/lib/planCli.js.map +1 -0
- package/dist-runtime/workflow/lib/preparationEvidence.d.ts +4 -0
- package/dist-runtime/workflow/lib/preparationEvidence.js +19 -0
- package/dist-runtime/workflow/lib/preparationEvidence.js.map +1 -0
- package/dist-runtime/workflow/lib/proxy.d.ts +4 -2
- package/dist-runtime/workflow/lib/proxy.js +3 -4
- package/dist-runtime/workflow/lib/proxy.js.map +1 -1
- package/dist-runtime/workflow/lib/runtime.d.ts +6 -0
- package/dist-runtime/workflow/lib/runtime.js +48 -0
- package/dist-runtime/workflow/lib/runtime.js.map +1 -0
- package/dist-runtime/workflow/lib/signer.d.ts +3 -2
- package/dist-runtime/workflow/lib/signer.js +18 -18
- package/dist-runtime/workflow/lib/signer.js.map +1 -1
- package/dist-runtime/workflow/lib/simulation.d.ts +13 -6
- package/dist-runtime/workflow/lib/simulation.js +39 -31
- package/dist-runtime/workflow/lib/simulation.js.map +1 -1
- package/dist-runtime/workflow/lib/state.js +3 -3
- package/dist-runtime/workflow/lib/state.js.map +1 -1
- package/dist-runtime/workflow/lib/staticValidation.d.ts +28 -0
- package/dist-runtime/workflow/lib/staticValidation.js +54 -10
- package/dist-runtime/workflow/lib/staticValidation.js.map +1 -1
- package/dist-runtime/workflow/lib/transactionPlanner.d.ts +62 -0
- package/dist-runtime/workflow/lib/transactionPlanner.js +258 -0
- package/dist-runtime/workflow/lib/transactionPlanner.js.map +1 -0
- package/dist-runtime/workflow/lib/typedValue.d.ts +3 -0
- package/dist-runtime/workflow/lib/typedValue.js +76 -0
- package/dist-runtime/workflow/lib/typedValue.js.map +1 -0
- package/dist-runtime/workflow/lib/validation.d.ts +23 -0
- package/dist-runtime/workflow/lib/validation.js +15 -0
- package/dist-runtime/workflow/lib/validation.js.map +1 -0
- package/dist-runtime/workflow/planAdd.d.ts +1 -0
- package/dist-runtime/workflow/planAdd.js +11 -0
- package/dist-runtime/workflow/planAdd.js.map +1 -0
- package/dist-runtime/workflow/planRead.d.ts +1 -0
- package/dist-runtime/workflow/planRead.js +11 -0
- package/dist-runtime/workflow/planRead.js.map +1 -0
- package/dist-runtime/workflow/planStatus.d.ts +1 -0
- package/dist-runtime/workflow/planStatus.js +11 -0
- package/dist-runtime/workflow/planStatus.js.map +1 -0
- package/dist-runtime/workflow/planWrite.d.ts +1 -0
- package/dist-runtime/workflow/planWrite.js +11 -0
- package/dist-runtime/workflow/planWrite.js.map +1 -0
- package/dist-runtime/workflow/run.d.ts +1 -40
- package/dist-runtime/workflow/run.js +69 -139
- package/dist-runtime/workflow/run.js.map +1 -1
- package/dist-runtime/workflow/staticValidate.js +8 -3
- package/dist-runtime/workflow/staticValidate.js.map +1 -1
- package/dist-runtime/workflow/steps/call.d.ts +1 -1
- package/dist-runtime/workflow/steps/check.d.ts +1 -1
- package/dist-runtime/workflow/steps/custom.d.ts +1 -1
- package/dist-runtime/workflow/steps/deploy.d.ts +1 -1
- package/dist-runtime/workflow/steps/deploy.js +110 -55
- package/dist-runtime/workflow/steps/deploy.js.map +1 -1
- package/dist-runtime/workflow/steps/upgrade.d.ts +1 -1
- package/dist-runtime/workflow/steps/upgrade.js +84 -49
- package/dist-runtime/workflow/steps/upgrade.js.map +1 -1
- package/dist-runtime/workflow/steps/view.d.ts +1 -1
- package/docs/compiler-qualification.md +38 -0
- package/docs/configuration-runtime-observation.md +29 -0
- package/docs/create2-miner.md +100 -0
- package/docs/delivery-aggregate.md +29 -0
- package/docs/delivery-calldata.md +27 -0
- package/docs/delivery-custom-input-closure.md +51 -0
- package/docs/delivery-development.md +38 -0
- package/docs/delivery-eoa.md +46 -0
- package/docs/delivery-evm-manifest.md +20 -0
- package/docs/delivery-execution-store.md +33 -0
- package/docs/delivery-inputs.md +95 -0
- package/docs/delivery-parameters.md +65 -0
- package/docs/delivery-planning.md +140 -0
- package/docs/delivery-release.md +119 -0
- package/docs/delivery-safe.md +75 -0
- package/docs/delivery-setup.md +198 -0
- package/docs/delivery-source.md +67 -0
- package/docs/direct-package-acceptance.md +2 -0
- package/docs/openzeppelin-acceptance.md +86 -0
- package/docs/openzeppelin-baseline.json +27 -0
- package/docs/openzeppelin-integration.md +115 -0
- package/docs/plans/2026-10-28-openzeppelin-toolkit-consolidation.md +396 -0
- package/docs/plans/2026-11-02-transparent-proxy-delivery.md +78 -0
- package/docs/superpowers/plans/2026-08-17-custody-hardhat-signers.md +1 -1
- package/docs/superpowers/plans/2026-09-24-scheme-aware-static-validation.md +193 -0
- package/docs/superpowers/plans/2026-10-28-create2-miner.md +82 -0
- package/docs/workflow-reference.md +12 -4
- package/docs/workflow-runtime.md +6 -0
- package/package.json +148 -10
- package/resources/create2/LICENSE +21 -0
- package/resources/create2/README.md +9 -0
- package/resources/create2/darwin-arm64/smartflow_miner +0 -0
- package/resources/create2/darwin-x64/smartflow_miner +0 -0
- package/resources/create2/manifest.json +27 -0
- package/runtime/config/hardhatAdapters.ts +2 -1
- package/runtime/config/openzeppelin.ts +3 -21
- package/runtime/delivery/abi.ts +225 -0
- package/runtime/delivery/aggregate-bootstrap.ts +31 -0
- package/runtime/delivery/aggregate-channel.ts +88 -0
- package/runtime/delivery/aggregate-diagnostics.ts +63 -0
- package/runtime/delivery/aggregate-inputs.ts +39 -0
- package/runtime/delivery/aggregate-source.ts +57 -0
- package/runtime/delivery/aggregate-worker.ts +143 -0
- package/runtime/delivery/aggregate.ts +139 -0
- package/runtime/delivery/bindings.ts +37 -0
- package/runtime/delivery/business-extension.ts +33 -0
- package/runtime/delivery/calldata-archive.ts +25 -0
- package/runtime/delivery/calldata-details.ts +90 -0
- package/runtime/delivery/calldata-format.ts +14 -0
- package/runtime/delivery/calldata-preparations.ts +76 -0
- package/runtime/delivery/calldata-review.ts +126 -0
- package/runtime/delivery/check-code.ts +38 -0
- package/runtime/delivery/closure-format.ts +350 -0
- package/runtime/delivery/codec-pin.ts +3 -0
- package/runtime/delivery/codec.ts +50 -0
- package/runtime/delivery/compiler-dependency-pins.ts +1685 -0
- package/runtime/delivery/compiler-files.ts +181 -0
- package/runtime/delivery/compiler-io.ts +10 -0
- package/runtime/delivery/compiler-pins.ts +143 -0
- package/runtime/delivery/compiler.ts +701 -0
- package/runtime/delivery/config.ts +116 -0
- package/runtime/delivery/configuration-definition.ts +160 -0
- package/runtime/delivery/configuration-hre.ts +130 -0
- package/runtime/delivery/configuration-runtime.ts +163 -0
- package/runtime/delivery/configuration.ts +67 -0
- package/runtime/delivery/contract-source.ts +112 -0
- package/runtime/delivery/create2.ts +57 -0
- package/runtime/delivery/custom-closure.ts +993 -0
- package/runtime/delivery/custom-format.ts +479 -0
- package/runtime/delivery/custom.ts +219 -0
- package/runtime/delivery/data.ts +94 -0
- package/runtime/delivery/development.ts +264 -0
- package/runtime/delivery/engine.ts +29 -0
- package/runtime/delivery/eoa-observation.ts +106 -0
- package/runtime/delivery/eoa-signed.ts +55 -0
- package/runtime/delivery/eoa.ts +288 -0
- package/runtime/delivery/execution-db.ts +131 -0
- package/runtime/delivery/execution-files.ts +135 -0
- package/runtime/delivery/execution-identity.ts +32 -0
- package/runtime/delivery/execution-model.ts +102 -0
- package/runtime/delivery/execution-store.ts +411 -0
- package/runtime/delivery/existing-code.ts +45 -0
- package/runtime/delivery/export.ts +99 -0
- package/runtime/delivery/forkAudit.ts +620 -0
- package/runtime/delivery/hardhat.ts +38 -0
- package/runtime/delivery/history-registration.ts +10 -0
- package/runtime/delivery/identities.ts +132 -0
- package/runtime/delivery/input-files.ts +46 -0
- package/runtime/delivery/inputs.ts +204 -0
- package/runtime/delivery/journal.ts +205 -0
- package/runtime/delivery/manifest.ts +54 -0
- package/runtime/delivery/materialization.ts +53 -0
- package/runtime/delivery/observations.ts +60 -0
- package/runtime/delivery/parameter-defaults.ts +75 -0
- package/runtime/delivery/parameters.ts +367 -0
- package/runtime/delivery/pending.ts +98 -0
- package/runtime/delivery/plan.ts +337 -0
- package/runtime/delivery/planning.ts +411 -0
- package/runtime/delivery/policy.ts +9 -0
- package/runtime/delivery/preparation.ts +240 -0
- package/runtime/delivery/production-environment.ts +7 -0
- package/runtime/delivery/production-finalization.ts +181 -0
- package/runtime/delivery/production-intent.ts +14 -0
- package/runtime/delivery/production.ts +415 -0
- package/runtime/delivery/project-files.ts +63 -0
- package/runtime/delivery/project-rpc.ts +116 -0
- package/runtime/delivery/project.ts +129 -0
- package/runtime/delivery/protocol.ts +94 -0
- package/runtime/delivery/public-calldata.ts +74 -0
- package/runtime/delivery/references.ts +106 -0
- package/runtime/delivery/release-graph.ts +79 -0
- package/runtime/delivery/release-history-capture.ts +32 -0
- package/runtime/delivery/release-history.ts +178 -0
- package/runtime/delivery/release-inputs.ts +107 -0
- package/runtime/delivery/release.ts +166 -0
- package/runtime/delivery/safe-manifest.ts +11 -0
- package/runtime/delivery/safe-observation.ts +626 -0
- package/runtime/delivery/safe-prepare.ts +101 -0
- package/runtime/delivery/safe.ts +355 -0
- package/runtime/delivery/same-fork-baseline.ts +17 -0
- package/runtime/delivery/setup.ts +184 -0
- package/runtime/delivery/source.ts +130 -0
- package/runtime/delivery/target-fields.ts +7 -0
- package/runtime/delivery/task-identity.ts +85 -0
- package/runtime/delivery/toolchain.ts +48 -0
- package/runtime/delivery/validation.ts +252 -0
- package/runtime/delivery/verification.ts +47 -0
- package/runtime/migrate.ts +1 -0
- package/runtime/miner/binary.ts +41 -0
- package/runtime/miner/cli.ts +87 -0
- package/runtime/miner/index.ts +5 -0
- package/runtime/miner/request.ts +54 -0
- package/runtime/miner/runner.ts +90 -0
- package/runtime/miner/types.ts +71 -0
- package/runtime/miner/verify.ts +61 -0
- package/runtime/vendor/plan-codec/index.cjs +897 -0
- package/runtime/vendor/plan-codec/index.d.cts +38 -0
- package/runtime/vendor/plan-codec/provenance.json +25 -0
- package/runtime/workflow/engine.ts +174 -0
- package/runtime/workflow/lib/authority.ts +3 -3
- package/runtime/workflow/lib/calls.ts +47 -37
- package/runtime/workflow/lib/canonicalData.ts +45 -0
- package/runtime/workflow/lib/checkCodeRunner.ts +7 -3
- package/runtime/workflow/lib/config.ts +1 -1
- package/runtime/workflow/lib/context.ts +77 -0
- package/runtime/workflow/lib/create2.ts +18 -121
- package/runtime/workflow/lib/deploymentInfo.ts +8 -0
- package/runtime/workflow/lib/deploymentRecords.ts +3 -1
- package/runtime/workflow/lib/deployments.ts +6 -14
- package/runtime/workflow/lib/evidencePorts.ts +20 -0
- package/runtime/workflow/lib/executionPlan.ts +17 -268
- package/runtime/workflow/lib/externalExecutionScanner.ts +2 -1
- package/runtime/workflow/lib/gateTool.ts +22 -10
- package/runtime/workflow/lib/gateToolSync.ts +11 -3
- package/runtime/workflow/lib/operationNames.ts +32 -0
- package/runtime/workflow/lib/parameters.ts +8 -21
- package/runtime/workflow/lib/pendingDeploymentReuse.ts +4 -56
- package/runtime/workflow/lib/pendingUupsBinding.ts +43 -0
- package/runtime/workflow/lib/plan.ts +334 -0
- package/runtime/workflow/lib/planCli.ts +279 -0
- package/runtime/workflow/lib/preparationEvidence.ts +14 -0
- package/runtime/workflow/lib/proxy.ts +6 -3
- package/runtime/workflow/lib/runtime.ts +46 -0
- package/runtime/workflow/lib/signer.ts +8 -5
- package/runtime/workflow/lib/simulation.ts +41 -17
- package/runtime/workflow/lib/state.ts +3 -3
- package/runtime/workflow/lib/staticValidation.ts +92 -11
- package/runtime/workflow/lib/transactionPlanner.ts +314 -0
- package/runtime/workflow/lib/typedValue.ts +46 -0
- package/runtime/workflow/lib/validation.ts +50 -0
- package/runtime/workflow/planAdd.ts +8 -0
- package/runtime/workflow/planRead.ts +8 -0
- package/runtime/workflow/planStatus.ts +8 -0
- package/runtime/workflow/planWrite.ts +8 -0
- package/runtime/workflow/run.ts +42 -176
- package/runtime/workflow/staticValidate.ts +8 -3
- package/runtime/workflow/steps/call.ts +1 -1
- package/runtime/workflow/steps/check.ts +1 -1
- package/runtime/workflow/steps/custom.ts +1 -1
- package/runtime/workflow/steps/deploy.ts +99 -58
- package/runtime/workflow/steps/upgrade.ts +88 -57
- package/runtime/workflow/steps/view.ts +1 -1
- package/bin/workflow.cjs +0 -19
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/** Actual-file source binding only. This API grants no host approval or execution authority. */
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { deliveryProjectMarker, projectRoot, confinedFile } from './project-files';
|
|
5
|
+
import { object, parseDeliveryRequest, validateDeliveryRpc, type DeliveryRequest, type ChainIdProvider, type ProjectNetworkSnapshot } from './protocol';
|
|
6
|
+
import { loadPlanCodec } from './codec';
|
|
7
|
+
import type { Plan, PlanTask, DefinitionSelection, DefinitionSnapshot, DeepReadonly } from '../vendor/plan-codec/index.cjs';
|
|
8
|
+
export type { DefinitionSelection, DefinitionSnapshot, DeepReadonly } from '../vendor/plan-codec/index.cjs';
|
|
9
|
+
|
|
10
|
+
export interface DeliverySourceOptions {
|
|
11
|
+
workspaceRoot: string;
|
|
12
|
+
/** Workspace-relative path or '.'. */
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
request: unknown;
|
|
15
|
+
/** Explicit upstream roots, independent of the invocation sourceRef task. */
|
|
16
|
+
sourceRoots: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface DeliverySourceBinding {
|
|
19
|
+
request: DeliveryRequest;
|
|
20
|
+
workspaceRoot: string;
|
|
21
|
+
projectRoot: string;
|
|
22
|
+
observation: { path: string; sha256: string };
|
|
23
|
+
invocation: { lane: string; task: PlanTask };
|
|
24
|
+
sourceDefinition: DefinitionSnapshot;
|
|
25
|
+
sourceDefinitionBytes: string;
|
|
26
|
+
sourceDefinitionHash: string;
|
|
27
|
+
prodTaskGraph?: DefinitionSnapshot;
|
|
28
|
+
prodTaskGraphBytes?: string;
|
|
29
|
+
prodTaskGraphHash?: string;
|
|
30
|
+
}
|
|
31
|
+
const sha256 = (bytes: string | Buffer): string => createHash('sha256').update(bytes).digest('hex');
|
|
32
|
+
function freeze<T>(value: T): DeepReadonly<T> {
|
|
33
|
+
if (value && typeof value === 'object') { Object.values(value).forEach(freeze); Object.freeze(value); }
|
|
34
|
+
return value as DeepReadonly<T>;
|
|
35
|
+
}
|
|
36
|
+
export function parseCanonicalPlan(text: string): Plan { return loadPlanCodec().parsePlan(text); }
|
|
37
|
+
export function projectCanonicalDefinitions(text: string, selection: DefinitionSelection): ReturnType<ReturnType<typeof loadPlanCodec>['projectDefinitions']> {
|
|
38
|
+
return loadPlanCodec().projectDefinitions(text, selection);
|
|
39
|
+
}
|
|
40
|
+
export function deploymentPurpose(task: Pick<PlanTask, 'step' | 'scope'>) {
|
|
41
|
+
return loadPlanCodec().deploymentPurpose(task);
|
|
42
|
+
}
|
|
43
|
+
function sameRelease(actual: unknown, expected: DeliveryRequest['releaseRef']): boolean {
|
|
44
|
+
if (expected === undefined) return actual === undefined;
|
|
45
|
+
if (!actual || typeof actual !== 'object' || Array.isArray(actual)) return false;
|
|
46
|
+
const ref = actual as Record<string, unknown>;
|
|
47
|
+
return Object.keys(ref).length === 3 && ref.path === expected.path && ref.releaseId === expected.releaseId && ref.inputsHash === expected.inputsHash;
|
|
48
|
+
}
|
|
49
|
+
function actualSource(workspace: string, relative: string): Buffer {
|
|
50
|
+
const file = confinedFile(workspace, relative);
|
|
51
|
+
const fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
|
|
52
|
+
try {
|
|
53
|
+
const before = fs.fstatSync(fd);
|
|
54
|
+
if (!before.isFile() || before.nlink !== 1) throw new Error('Unsafe handoff file type');
|
|
55
|
+
const bytes = fs.readFileSync(fd);
|
|
56
|
+
const after = fs.fstatSync(fd);
|
|
57
|
+
// Fail if the observed file was replaced or changed during reading.
|
|
58
|
+
confinedFile(workspace, relative);
|
|
59
|
+
const current = fs.lstatSync(file);
|
|
60
|
+
if (before.dev !== current.dev || before.ino !== current.ino || before.size !== after.size
|
|
61
|
+
|| before.mtimeMs !== after.mtimeMs || before.ctimeMs !== after.ctimeMs) throw new Error('Handoff changed while reading');
|
|
62
|
+
return bytes;
|
|
63
|
+
} finally { fs.closeSync(fd); }
|
|
64
|
+
}
|
|
65
|
+
/** Read one confined handoff snapshot and bind the current invocation to it before any RPC work. */
|
|
66
|
+
export function readDeliverySource(input: DeliverySourceOptions): DeepReadonly<DeliverySourceBinding> {
|
|
67
|
+
object(input, 'source options', ['workspaceRoot', 'projectRoot', 'request', 'sourceRoots']);
|
|
68
|
+
return readSource(input);
|
|
69
|
+
}
|
|
70
|
+
/** Owned business selection derives upstream roots from the same actual invocation bytes. */
|
|
71
|
+
export function readOwnedDeliverySource(input: Omit<DeliverySourceOptions, 'sourceRoots'>): DeepReadonly<DeliverySourceBinding> {
|
|
72
|
+
object(input, 'owned source options', ['workspaceRoot', 'projectRoot', 'request']);
|
|
73
|
+
return readSource(input);
|
|
74
|
+
}
|
|
75
|
+
function readSource(input: Omit<DeliverySourceOptions, 'sourceRoots'> & { sourceRoots?: string[] }): DeepReadonly<DeliverySourceBinding> {
|
|
76
|
+
const request = parseDeliveryRequest(input.request);
|
|
77
|
+
const workspace = projectRoot(input.workspaceRoot, '.');
|
|
78
|
+
const root = projectRoot(workspace, input.projectRoot);
|
|
79
|
+
deliveryProjectMarker(root);
|
|
80
|
+
const bytes = actualSource(workspace, request.sourceRef.path);
|
|
81
|
+
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
82
|
+
if (input.sourceRoots === undefined) (require('./input-files') as typeof import('./input-files')).assertUnambiguousHandoff(text);
|
|
83
|
+
const codec = loadPlanCodec();
|
|
84
|
+
const plan = codec.parsePlan(text);
|
|
85
|
+
if (plan.taskId !== request.sourceRef.taskId) throw new Error('sourceRef.taskId does not match actual handoff');
|
|
86
|
+
const entries = Object.entries(plan.tasks).flatMap(([lane, tasks]) => tasks.map(task => ({ lane, task })));
|
|
87
|
+
const invocation = entries.find(({ task }) => task.planKey === request.sourceRef.planKey);
|
|
88
|
+
if (!invocation || invocation.task.rev !== request.sourceRef.rev) throw new Error('sourceRef planKey/rev does not match actual handoff');
|
|
89
|
+
if (plan.lanes[invocation.lane].state !== 'enabled' || invocation.task.status === 'cancelled') throw new Error('Invocation task is disabled or cancelled');
|
|
90
|
+
const requirementIssue = codec.deploymentRequirementIssue(plan, invocation.task);
|
|
91
|
+
if (requirementIssue) throw new Error(requirementIssue);
|
|
92
|
+
const deployment = object(invocation.task.scope?.deployment, 'invocation scope.deployment');
|
|
93
|
+
if (deployment.projectRoot !== input.projectRoot) throw new Error('Invocation projectRoot mismatch');
|
|
94
|
+
if (deployment.chainFamily !== 'evm' || deployment.framework !== 'hardhat2') throw new Error('Invocation requires an EVM Hardhat2 deployment');
|
|
95
|
+
if (deploymentPurpose(invocation.task) !== request.purpose) throw new Error('Invocation purpose mismatch');
|
|
96
|
+
if (deployment.environment !== request.environment || deployment.targetNetwork !== request.network) throw new Error('Invocation environment/targetNetwork mismatch');
|
|
97
|
+
if (!Array.isArray(deployment.allowedActions) || !deployment.allowedActions.includes(request.mode)) throw new Error('Invocation mode is not in allowedActions');
|
|
98
|
+
if (!sameRelease(deployment.releaseRef, request.releaseRef)) throw new Error('Invocation releaseRef mismatch');
|
|
99
|
+
const sourceRoots = input.sourceRoots ?? (request.purpose === 'prod-execution'
|
|
100
|
+
? entries.filter(({ task }) => deploymentPurpose(task) === 'prod-qualification'
|
|
101
|
+
&& (task.scope?.deployment as Record<string, unknown> | undefined)?.projectRoot === input.projectRoot
|
|
102
|
+
&& (task.scope?.deployment as Record<string, unknown> | undefined)?.deploymentId === deployment.deploymentId).map(({ task }) => task.planKey)
|
|
103
|
+
: [invocation.task.planKey]);
|
|
104
|
+
if (!sourceRoots.length) throw new Error('Owned source requires an upstream qualification definition');
|
|
105
|
+
const source = codec.projectDefinitions(text, { roots: sourceRoots, mode: 'upstream' });
|
|
106
|
+
for (const task of source.snapshot.tasks) {
|
|
107
|
+
const selectedDeployment = task.scope?.deployment as Readonly<Record<string, unknown>> | undefined;
|
|
108
|
+
if (selectedDeployment && selectedDeployment.projectRoot !== input.projectRoot) throw new Error(`Selected upstream deployment projectRoot mismatch: ${task.planKey}`);
|
|
109
|
+
}
|
|
110
|
+
let production: ReturnType<typeof codec.projectDefinitions> | undefined;
|
|
111
|
+
if (request.purpose === 'prod-execution') {
|
|
112
|
+
const roots = entries.filter(({ task }) => deploymentPurpose(task) === 'prod-execution'
|
|
113
|
+
&& task.scope?.deployment && (task.scope.deployment as Record<string, unknown>).projectRoot === input.projectRoot
|
|
114
|
+
&& sameRelease((task.scope.deployment as Record<string, unknown>).releaseRef, request.releaseRef)).map(({ task }) => task.planKey);
|
|
115
|
+
production = codec.projectDefinitions(text, { roots, mode: 'full' });
|
|
116
|
+
}
|
|
117
|
+
// All values came from detached request parsing and actual handoff text; freeze before exposing.
|
|
118
|
+
return freeze({ request, workspaceRoot: workspace, projectRoot: root, observation: { path: request.sourceRef.path, sha256: sha256(bytes) },
|
|
119
|
+
invocation, sourceDefinition: source.snapshot, sourceDefinitionBytes: source.bytes, sourceDefinitionHash: sha256(source.bytes),
|
|
120
|
+
...(production ? { prodTaskGraph: production.snapshot, prodTaskGraphBytes: production.bytes, prodTaskGraphHash: sha256(production.bytes) } : {}),
|
|
121
|
+
}) as DeepReadonly<DeliverySourceBinding>;
|
|
122
|
+
}
|
|
123
|
+
/** Read/validate actual source before a provider can be loaded; still not host authorization. */
|
|
124
|
+
export async function validateDeliverySourceRpc(input: DeliverySourceOptions, snapshot: ProjectNetworkSnapshot,
|
|
125
|
+
loadProvider: (snapshot: ProjectNetworkSnapshot) => Promise<ChainIdProvider>,
|
|
126
|
+
): Promise<DeepReadonly<DeliverySourceBinding & { chainId: number }>> {
|
|
127
|
+
const binding = readDeliverySource(input);
|
|
128
|
+
const { chainId } = await validateDeliveryRpc(binding.request, snapshot, loadProvider);
|
|
129
|
+
return freeze({ ...binding, chainId }) as DeepReadonly<DeliverySourceBinding & { chainId: number }>;
|
|
130
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Complete scalar public target boundary shared by native references and custom ports. */
|
|
2
|
+
export const PUBLIC_TARGET_FIELDS = new Set([
|
|
3
|
+
'version', 'id', 'network', 'environment', 'chainId', 'admin',
|
|
4
|
+
'finality.confirmations', 'openzeppelin.manifestDir',
|
|
5
|
+
'create2.scheme', 'create2.factory', 'create2.leadingZeroBytes', 'create2.caller',
|
|
6
|
+
'uups.placeholderImplementation', 'multicall.controlledMulticall',
|
|
7
|
+
]);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** Allocate a round only after its concrete requirement revision is confirmed. */
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { randomBytes } from 'node:crypto';
|
|
4
|
+
import { parseCanonicalPlan, projectCanonicalDefinitions, deploymentPurpose } from './source';
|
|
5
|
+
import { projectRoot, deliveryProjectMarker, confinedFile, stat } from './project-files';
|
|
6
|
+
import { readInputBytes, assertUnambiguousHandoff } from './input-files';
|
|
7
|
+
import { withDevelopmentFileLock, atomicDevelopmentWrite, fileBytes } from './materialization';
|
|
8
|
+
import { exactObject, semanticHash, canonicalJson } from '../workflow/lib/canonicalData';
|
|
9
|
+
import { safeId, portablePath, object } from './protocol';
|
|
10
|
+
|
|
11
|
+
export interface DeploymentRequirementRef { planKey: string; rev: number }
|
|
12
|
+
export function parseDeploymentRequirementRef(raw: unknown): DeploymentRequirementRef {
|
|
13
|
+
const ref = exactObject(raw, ['planKey', 'rev'], 'requirementRef');
|
|
14
|
+
safeId(ref.planKey, 'requirementRef.planKey');
|
|
15
|
+
if (!Number.isSafeInteger(ref.rev) || (ref.rev as number) < 1) throw Error('Invalid requirement revision');
|
|
16
|
+
return { planKey: ref.planKey as string, rev: ref.rev as number };
|
|
17
|
+
}
|
|
18
|
+
export interface CreateDeliveryTaskOptions {
|
|
19
|
+
workspaceRoot: string; projectRoot: string; handoff: string; taskId: string;
|
|
20
|
+
requirementRef: DeploymentRequirementRef; businessSlug: string; referenceDeploymentId?: string;
|
|
21
|
+
}
|
|
22
|
+
/** A reservation creates metadata only. The deployment Agent supplies executable content afterwards. */
|
|
23
|
+
export async function createDeliveryTask(input: CreateDeliveryTaskOptions) {
|
|
24
|
+
object(input, 'create deployment task', ['workspaceRoot', 'projectRoot', 'handoff', 'taskId', 'requirementRef', 'businessSlug', 'referenceDeploymentId']);
|
|
25
|
+
const root = projectRoot(input.workspaceRoot, input.projectRoot), workspace = projectRoot(input.workspaceRoot, '.');
|
|
26
|
+
deliveryProjectMarker(root);
|
|
27
|
+
portablePath(input.handoff, 'handoff'); safeId(input.taskId, 'taskId');
|
|
28
|
+
const ref = parseDeploymentRequirementRef(input.requirementRef);
|
|
29
|
+
if (typeof input.businessSlug !== 'string' || !/^[a-z0-9][a-z0-9-]{0,63}$/.test(input.businessSlug)) throw Error('businessSlug must be a short lowercase business name');
|
|
30
|
+
if (input.referenceDeploymentId !== undefined) safeId(input.referenceDeploymentId, 'referenceDeploymentId');
|
|
31
|
+
return withDevelopmentFileLock(root, async () => {
|
|
32
|
+
const text = readInputBytes(workspace, input.handoff).toString(); assertUnambiguousHandoff(text);
|
|
33
|
+
const plan = parseCanonicalPlan(text);
|
|
34
|
+
if (plan.taskId !== input.taskId) throw Error('Requirement taskId mismatch');
|
|
35
|
+
const requirement = Object.values(plan.tasks).flat().find(t => t.planKey === ref.planKey);
|
|
36
|
+
if (!requirement || requirement.rev !== ref.rev || requirement.requirementConfirmation?.rev !== ref.rev
|
|
37
|
+
|| requirement.status === 'cancelled' || deploymentPurpose(requirement) !== 'analysis'
|
|
38
|
+
|| (requirement.scope?.deployment as any)?.projectRoot !== input.projectRoot) throw Error('Deployment requirement is unconfirmed or stale');
|
|
39
|
+
const d = requirement.scope!.deployment as any;
|
|
40
|
+
if (!d.requiredOperations?.length || !d.developmentNetwork || !Array.isArray(d.releaseTargetNetworks)) throw Error('Confirmed requirement scope is incomplete');
|
|
41
|
+
const identity = semanticHash({ taskId: input.taskId, projectRoot: input.projectRoot, requirementRef: ref });
|
|
42
|
+
const requirementHash = semanticHash(projectCanonicalDefinitions(text, { roots: [ref.planKey], mode: 'upstream' }).snapshot);
|
|
43
|
+
const registry = `.gate-delivery/deployment-requests/${identity}.json`;
|
|
44
|
+
const requestIdentity = { taskId: input.taskId, requirementRef: ref, requirementHash,
|
|
45
|
+
referenceDeploymentId: input.referenceDeploymentId ?? null };
|
|
46
|
+
let record: any;
|
|
47
|
+
const existing = fileBytes(root, registry);
|
|
48
|
+
if (existing !== null) {
|
|
49
|
+
record = JSON.parse(existing);
|
|
50
|
+
if (canonicalJson(record.requestIdentity) !== canonicalJson(requestIdentity)) throw Error('Confirmed requirement identity conflict');
|
|
51
|
+
safeId(record.deploymentId, 'reserved deploymentId');
|
|
52
|
+
} else {
|
|
53
|
+
const known = new Set(Object.values(plan.tasks).flat().map(t => (t.scope?.deployment as any)?.deploymentId).filter(Boolean));
|
|
54
|
+
const history = fileBytes(workspace, input.handoff.includes('/') ? `${input.handoff.slice(0, input.handoff.lastIndexOf('/'))}/handoff-ledger.jsonl` : 'handoff-ledger.jsonl');
|
|
55
|
+
if (history) for (const line of history.split('\n').filter(Boolean)) {
|
|
56
|
+
const item = JSON.parse(line);
|
|
57
|
+
for (const entry of item.tasks ?? []) { const id = entry.task?.scope?.deployment?.deploymentId; if (id) known.add(id); }
|
|
58
|
+
}
|
|
59
|
+
const date = new Date().toISOString().slice(0, 10).replaceAll('-', '');
|
|
60
|
+
let deploymentId: string;
|
|
61
|
+
do { deploymentId = `${input.businessSlug}-${date}-${randomBytes(4).toString('hex')}`; }
|
|
62
|
+
while (known.has(deploymentId) || stat(confinedFile(root, `scripts/tasks/${deploymentId}`, 'directory')));
|
|
63
|
+
record = { version: 1, deploymentId, releaseId: `${deploymentId}-release`, requestIdentity, state: 'reserved' };
|
|
64
|
+
// Publish reservation before creating the package, so a retry uses the same ID.
|
|
65
|
+
atomicDevelopmentWrite(root, registry, canonicalJson(record) + '\n');
|
|
66
|
+
}
|
|
67
|
+
const businessRoot = `scripts/tasks/${record.deploymentId}`;
|
|
68
|
+
const directory = confinedFile(root, businessRoot, 'directory');
|
|
69
|
+
const marker = `${businessRoot}/.request.json`;
|
|
70
|
+
const markerBytes = canonicalJson({ identity }) + '\n';
|
|
71
|
+
const previousMarker = fileBytes(root, marker);
|
|
72
|
+
if (stat(directory) && previousMarker !== markerBytes && fs.readdirSync(directory).length) throw Error('Reserved deployment directory is occupied; refusing to overwrite');
|
|
73
|
+
if (previousMarker !== null && previousMarker !== markerBytes) throw Error('Deployment reservation ownership mismatch');
|
|
74
|
+
if (previousMarker === null) atomicDevelopmentWrite(root, marker, markerBytes);
|
|
75
|
+
const metadata = { version: 1, id: record.deploymentId, requirementRef: ref,
|
|
76
|
+
developmentNetwork: d.developmentNetwork, releaseTargetNetworks: d.releaseTargetNetworks,
|
|
77
|
+
...(input.referenceDeploymentId ? { referenceDeploymentId: input.referenceDeploymentId } : {}) };
|
|
78
|
+
const taskPath = `${businessRoot}/task.yaml`, bytes = canonicalJson(metadata) + '\n';
|
|
79
|
+
const previous = fileBytes(root, taskPath);
|
|
80
|
+
if (previous !== null && previous !== bytes) throw Error('Reserved task metadata changed; refusing to overwrite');
|
|
81
|
+
if (previous === null) atomicDevelopmentWrite(root, taskPath, bytes);
|
|
82
|
+
if (record.state !== 'complete') atomicDevelopmentWrite(root, registry, canonicalJson({ ...record, state: 'complete' }) + '\n');
|
|
83
|
+
return { status: 'created' as const, deploymentId: record.deploymentId as string, releaseId: record.releaseId as string, businessRoot, specPath: taskPath, requirementRef: ref };
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { compilerDependencyPins } from './compiler-dependency-pins';
|
|
2
|
+
|
|
3
|
+
/** Reviewed compiler adapter dependency selections; payload checks remain authoritative.
|
|
4
|
+
* Range-scoped entries preserve distinct dependency majors. Setup never overrides a conflicting project choice. */
|
|
5
|
+
export const REVIEWED_DELIVERY_OVERRIDES: Record<string, string> = {
|
|
6
|
+
"axios": "1.20.0",
|
|
7
|
+
"@aws-sdk/client-lambda": "3.1152.0",
|
|
8
|
+
"@aws-sdk/core": "3.978.3",
|
|
9
|
+
"@aws-sdk/credential-provider-env": "3.972.74",
|
|
10
|
+
"@aws-sdk/credential-provider-http": "3.972.76",
|
|
11
|
+
"@aws-sdk/credential-provider-ini": "3.973.19",
|
|
12
|
+
"@aws-sdk/credential-provider-login": "3.972.81",
|
|
13
|
+
"@aws-sdk/credential-provider-node": "3.972.86",
|
|
14
|
+
"@aws-sdk/credential-provider-process": "3.972.74",
|
|
15
|
+
"@aws-sdk/credential-provider-sso": "3.973.18",
|
|
16
|
+
"@aws-sdk/credential-provider-web-identity": "3.972.80",
|
|
17
|
+
"@aws-sdk/nested-clients": "3.997.48",
|
|
18
|
+
"@aws-sdk/signature-v4-multi-region": "3.996.48",
|
|
19
|
+
"@aws-sdk/token-providers": "3.1150.0",
|
|
20
|
+
"@aws-sdk/types": "3.974.6",
|
|
21
|
+
"@smithy/types": "4.19.0",
|
|
22
|
+
"@smithy/signature-v4": "5.7.4",
|
|
23
|
+
"@smithy/fetch-http-handler": "5.8.0",
|
|
24
|
+
"@smithy/credential-provider-imds": "4.5.2",
|
|
25
|
+
"@smithy/core": "3.36.0",
|
|
26
|
+
"@smithy/node-http-handler": "4.12.1",
|
|
27
|
+
"bowser": "2.14.1",
|
|
28
|
+
"follow-redirects": "1.16.1",
|
|
29
|
+
"undici@>=5 <6": "5.29.0",
|
|
30
|
+
"undici@>=6 <7": "6.29.0",
|
|
31
|
+
"tslib@>=1 <2": "1.14.1",
|
|
32
|
+
"tslib@>=2 <3": "2.7.0",
|
|
33
|
+
"semver@>=5 <6": "5.7.2",
|
|
34
|
+
"semver@>=6 <7": "6.3.1",
|
|
35
|
+
"semver@>=7 <8": "7.8.5",
|
|
36
|
+
"ansi-regex@>=6 <7": "6.4.0"
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// OZ's compiler adapter follows floating AWS/Smithy ranges. Freeze that reviewed
|
|
40
|
+
// family closure so a fresh npm resolution cannot select unqualified payloads.
|
|
41
|
+
// Other project dependencies keep their original constraints and payload checks.
|
|
42
|
+
for (const key of Object.keys(compilerDependencyPins)) {
|
|
43
|
+
if (!key.startsWith('@aws-sdk/') && !key.startsWith('@smithy/')) continue;
|
|
44
|
+
const at = key.lastIndexOf('@'), name = key.slice(0, at), version = key.slice(at + 1);
|
|
45
|
+
const existing = REVIEWED_DELIVERY_OVERRIDES[name];
|
|
46
|
+
if (existing && existing !== version) throw new Error('Ambiguous reviewed compiler dependency: ' + name);
|
|
47
|
+
REVIEWED_DELIVERY_OVERRIDES[name] = version;
|
|
48
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { validateCreate2Fields } from "./create2";
|
|
2
|
+
import { canonicalCreate2Hashes } from "../workflow/lib/create2Hashes";
|
|
3
|
+
import { ParamType, getCreate2Address } from "ethers";
|
|
4
|
+
import type { WorkflowContext } from "../workflow/lib/context";
|
|
5
|
+
import type { WorkflowStep } from "../workflow/lib/parameters";
|
|
6
|
+
import type { WorkflowValidationPort } from "../workflow/lib/validation";
|
|
7
|
+
import { strictData } from "./data";
|
|
8
|
+
import {
|
|
9
|
+
resolveBusinessValue,
|
|
10
|
+
containsDeferred,
|
|
11
|
+
type ReferenceObservation,
|
|
12
|
+
} from "./references";
|
|
13
|
+
import {
|
|
14
|
+
validateAbiArguments,
|
|
15
|
+
validateAbiValue,
|
|
16
|
+
validateTransactionValue,
|
|
17
|
+
validateAbiResult,
|
|
18
|
+
compareAbiResults,
|
|
19
|
+
stringifyRuntimeValue,
|
|
20
|
+
} from "./abi";
|
|
21
|
+
import {
|
|
22
|
+
deliveryArtifact,
|
|
23
|
+
deliveryPreparationData,
|
|
24
|
+
validatePreparationSemantics,
|
|
25
|
+
ERC1967_PROXY,
|
|
26
|
+
} from "./preparation";
|
|
27
|
+
import { parseNativeOperation } from "./custom";
|
|
28
|
+
import { deepFreeze } from "../workflow/lib/canonicalData";
|
|
29
|
+
import { ownedDeliveryCompiler, compilerPreparationHooks, validateCompilerPreparationPlan, verifyCompilerSameForkUpgrade } from './compiler';
|
|
30
|
+
|
|
31
|
+
export interface DeliveryValidation extends WorkflowValidationPort {
|
|
32
|
+
preflight(steps: readonly WorkflowStep[]): Promise<void>;
|
|
33
|
+
observations(): readonly ReferenceObservation[];
|
|
34
|
+
}
|
|
35
|
+
export function createDeliveryValidation(
|
|
36
|
+
context: WorkflowContext,
|
|
37
|
+
): DeliveryValidation {
|
|
38
|
+
if (context.target.create2?.scheme && context.target.create2.scheme !== "evm")
|
|
39
|
+
throw new Error("Delivery validation requires EVM");
|
|
40
|
+
const observations: ReferenceObservation[] = [];
|
|
41
|
+
const compiler = ownedDeliveryCompiler(context.runtime.hre);
|
|
42
|
+
const params = deepFreeze(strictData(context.targetParams));
|
|
43
|
+
const resolve = (value: unknown, deferState = false): unknown => {
|
|
44
|
+
const result = resolveBusinessValue(
|
|
45
|
+
value,
|
|
46
|
+
{ params, target: context.target, state: () => context.state.snapshot() },
|
|
47
|
+
{ deferState },
|
|
48
|
+
);
|
|
49
|
+
observations.push(...result.observations);
|
|
50
|
+
return result.value;
|
|
51
|
+
};
|
|
52
|
+
// Artifact reader is an explicit runtime capability, never an address/contract resolver.
|
|
53
|
+
const read = async (name: string) => {
|
|
54
|
+
if (!context.runtime.hre.artifacts?.readArtifact)
|
|
55
|
+
throw new Error(
|
|
56
|
+
"Delivery validation requires explicit runtime artifact reader",
|
|
57
|
+
);
|
|
58
|
+
return deliveryArtifact(
|
|
59
|
+
await context.runtime.hre.artifacts.readArtifact(name),
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
const argumentsFor = async (
|
|
63
|
+
name: string,
|
|
64
|
+
method: string | null,
|
|
65
|
+
args: unknown,
|
|
66
|
+
deferState = false,
|
|
67
|
+
) =>
|
|
68
|
+
validateAbiArguments(
|
|
69
|
+
(await read(name)).abi,
|
|
70
|
+
method,
|
|
71
|
+
resolve(args, deferState),
|
|
72
|
+
{ allowDeferred: deferState },
|
|
73
|
+
);
|
|
74
|
+
const call = async (
|
|
75
|
+
name: string,
|
|
76
|
+
method: string,
|
|
77
|
+
args: unknown,
|
|
78
|
+
value?: unknown,
|
|
79
|
+
) => {
|
|
80
|
+
validateAbiArguments((await read(name)).abi, method, args);
|
|
81
|
+
if (value !== undefined) validateTransactionValue(value);
|
|
82
|
+
};
|
|
83
|
+
const preflight = async (steps: readonly WorkflowStep[]) => {
|
|
84
|
+
const data = strictData(steps);
|
|
85
|
+
for (const step of data) {
|
|
86
|
+
// Internal operation IDs can exceed the source parser's 200-character limit.
|
|
87
|
+
parseNativeOperation({ ...step, id: "validation" });
|
|
88
|
+
resolve(step, true); // Parse every reference without reading future state.
|
|
89
|
+
if (step.address !== undefined)
|
|
90
|
+
validateAbiValue(
|
|
91
|
+
ParamType.from("address"),
|
|
92
|
+
resolve(step.address, true),
|
|
93
|
+
"operation address",
|
|
94
|
+
true,
|
|
95
|
+
);
|
|
96
|
+
if (["call", "view", "check"].includes(step.kind)) {
|
|
97
|
+
for (const c of step.calls as Array<Record<string, unknown>>) {
|
|
98
|
+
await argumentsFor(
|
|
99
|
+
String(step.abi ?? step.contract),
|
|
100
|
+
c.method as string,
|
|
101
|
+
c.args === undefined ? [] : c.args,
|
|
102
|
+
true,
|
|
103
|
+
);
|
|
104
|
+
if (step.kind === "check")
|
|
105
|
+
validateAbiResult(
|
|
106
|
+
(await read(String(step.abi ?? step.contract))).abi,
|
|
107
|
+
c.method as string,
|
|
108
|
+
resolve(c.expect, true),
|
|
109
|
+
true,
|
|
110
|
+
);
|
|
111
|
+
if (c.value !== undefined)
|
|
112
|
+
validateTransactionValue(resolve(c.value, true), true);
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
const first = step.firstUpgrade as Record<string, unknown> | undefined;
|
|
116
|
+
const proxy = step.proxy as Record<string, unknown> | undefined;
|
|
117
|
+
const name = first?.contract ?? step.contract;
|
|
118
|
+
const args = first
|
|
119
|
+
? (first.constructorArgs ?? [])
|
|
120
|
+
: step.kind === "deploy"
|
|
121
|
+
? (proxy ? (proxy.constructorArgs ?? []) : (step.args ?? []))
|
|
122
|
+
: (step.constructorArgs ??
|
|
123
|
+
(typeof proxy === "object"
|
|
124
|
+
? proxy?.constructorArgs
|
|
125
|
+
: undefined) ??
|
|
126
|
+
[]);
|
|
127
|
+
await argumentsFor(name as string, null, args, true);
|
|
128
|
+
if (step.kind === "deploy" && proxy?.kind === "transparent" && proxy.initializer !== false) {
|
|
129
|
+
await argumentsFor(name as string, String(proxy.initializer), step.args ?? [], true);
|
|
130
|
+
}
|
|
131
|
+
const init = (first?.call ?? step.call) as
|
|
132
|
+
| Record<string, unknown>
|
|
133
|
+
| undefined;
|
|
134
|
+
if (init)
|
|
135
|
+
await argumentsFor(
|
|
136
|
+
name as string,
|
|
137
|
+
(init.method ?? init.fn) as string,
|
|
138
|
+
init.args ?? [],
|
|
139
|
+
true,
|
|
140
|
+
);
|
|
141
|
+
if (first)
|
|
142
|
+
await argumentsFor(
|
|
143
|
+
ERC1967_PROXY,
|
|
144
|
+
null,
|
|
145
|
+
[context.target.uups?.placeholderImplementation, "0x"],
|
|
146
|
+
true,
|
|
147
|
+
);
|
|
148
|
+
const fields = (value: unknown, kind: Parameters<typeof validateCreate2Fields>[1]) =>
|
|
149
|
+
validateCreate2Fields(resolve(value === undefined ? {} : value, true), kind, true);
|
|
150
|
+
const targetCreate2 = fields(context.target.create2, "target");
|
|
151
|
+
fields(context.target.uups, "uups");
|
|
152
|
+
const targetMulticall = fields(context.target.multicall, "multicall");
|
|
153
|
+
if (
|
|
154
|
+
step.kind === "upgrade" &&
|
|
155
|
+
(targetCreate2.factory === undefined || targetMulticall.controlledMulticall === undefined)
|
|
156
|
+
)
|
|
157
|
+
throw new Error(`Upgrade step ${step.id} requires target create2 factory and controlledMulticall`);
|
|
158
|
+
const declaredCreate2 = step.create2 === undefined
|
|
159
|
+
? undefined
|
|
160
|
+
: fields(step.create2, "step");
|
|
161
|
+
const policy =
|
|
162
|
+
context.existingDeploymentPolicies?.[String(step.saveAs)];
|
|
163
|
+
const create2 =
|
|
164
|
+
declaredCreate2 && policy?.mode === "redeploy"
|
|
165
|
+
? validateCreate2Fields(
|
|
166
|
+
{
|
|
167
|
+
...declaredCreate2,
|
|
168
|
+
salt: policy.salt,
|
|
169
|
+
expectedAddress: policy.expectedAddress,
|
|
170
|
+
},
|
|
171
|
+
"step",
|
|
172
|
+
true,
|
|
173
|
+
)
|
|
174
|
+
: declaredCreate2;
|
|
175
|
+
// Transparent proxy prediction depends on the prepared implementation salt/address.
|
|
176
|
+
// Its actual constructor and policies are independently checked by preparation semantics.
|
|
177
|
+
if (step.kind === "deploy" && create2 && proxy?.kind !== "transparent") {
|
|
178
|
+
const a = await read(first ? ERC1967_PROXY : (name as string));
|
|
179
|
+
const constructor = resolve(
|
|
180
|
+
first
|
|
181
|
+
? [context.target.uups?.placeholderImplementation, "0x"]
|
|
182
|
+
: args,
|
|
183
|
+
true,
|
|
184
|
+
);
|
|
185
|
+
const factory = create2.factory ?? targetCreate2.factory,
|
|
186
|
+
salt = create2.salt;
|
|
187
|
+
if (factory === undefined)
|
|
188
|
+
throw new Error("CREATE2 requires a factory address");
|
|
189
|
+
if (!containsDeferred([constructor, factory, salt])) {
|
|
190
|
+
const hashes = canonicalCreate2Hashes({
|
|
191
|
+
scheme: "evm",
|
|
192
|
+
artifact: a,
|
|
193
|
+
args: constructor as unknown[],
|
|
194
|
+
});
|
|
195
|
+
if (hashes.scheme !== "evm")
|
|
196
|
+
throw new Error("Invalid CREATE2 scheme");
|
|
197
|
+
const predicted = getCreate2Address(
|
|
198
|
+
factory as string,
|
|
199
|
+
salt as string,
|
|
200
|
+
hashes.initCodeHash,
|
|
201
|
+
).toLowerCase();
|
|
202
|
+
if (create2.expectedAddress !== undefined) {
|
|
203
|
+
const expected = create2.expectedAddress;
|
|
204
|
+
if (
|
|
205
|
+
!containsDeferred(expected) &&
|
|
206
|
+
(typeof expected !== "string" ||
|
|
207
|
+
predicted !== expected.toLowerCase())
|
|
208
|
+
)
|
|
209
|
+
throw new Error(
|
|
210
|
+
"Actual CREATE2 predicted address differs from expectedAddress",
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
const zeroes =
|
|
214
|
+
create2.leadingZeroBytes ??
|
|
215
|
+
targetCreate2.leadingZeroBytes;
|
|
216
|
+
if (
|
|
217
|
+
zeroes !== undefined &&
|
|
218
|
+
!containsDeferred(zeroes) &&
|
|
219
|
+
!predicted.slice(2).startsWith("00".repeat(Number(zeroes)))
|
|
220
|
+
)
|
|
221
|
+
throw new Error("Actual CREATE2 violates leadingZeroBytes");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
return {
|
|
228
|
+
resolve,
|
|
229
|
+
create2Fields: validateCreate2Fields,
|
|
230
|
+
call,
|
|
231
|
+
address: (value) =>
|
|
232
|
+
validateAbiValue(ParamType.from("address"), value, "operation address"),
|
|
233
|
+
callInterface: validateAbiArguments,
|
|
234
|
+
check: validateAbiResult,
|
|
235
|
+
compare: compareAbiResults,
|
|
236
|
+
stringify: stringifyRuntimeValue,
|
|
237
|
+
preparation: {
|
|
238
|
+
data: deliveryPreparationData,
|
|
239
|
+
artifact: (name, raw) => deepFreeze(deliveryArtifact(compiler ? compiler.artifact(name, raw) : raw)),
|
|
240
|
+
arguments: (artifact, method, args) =>
|
|
241
|
+
validateAbiArguments(artifact.abi, method, args),
|
|
242
|
+
...compilerPreparationHooks(context.runtime.hre),
|
|
243
|
+
},
|
|
244
|
+
preparationPlan: async (request, plan) => {
|
|
245
|
+
await validatePreparationSemantics(request, plan, read);
|
|
246
|
+
await validateCompilerPreparationPlan(context.runtime.hre,request,plan);
|
|
247
|
+
},
|
|
248
|
+
sameForkUpgrade: proxy => verifyCompilerSameForkUpgrade(context.runtime.hre,context.targetId,proxy,context.simulation.snapshot?.blockNumber),
|
|
249
|
+
preflight,
|
|
250
|
+
observations: () => deepFreeze(strictData(observations)),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { canonicalData, canonicalJson, deepFreeze, exactObject, nonempty } from '../workflow/lib/canonicalData';
|
|
2
|
+
import { parseTypedValue } from '../workflow/lib/typedValue';
|
|
3
|
+
import type { VerificationObservation, VerificationSink } from '../workflow/lib/evidencePorts';
|
|
4
|
+
export interface ExpectedAssertion { stepId: string; callIndex: number; assertionId: string }
|
|
5
|
+
export function parseVerificationObservation(raw: unknown): VerificationObservation {
|
|
6
|
+
const v = exactObject(raw, ['stepId', 'callIndex', 'assertionId', 'contract', 'abiName', 'abi', 'address', 'method', 'args', 'definition', 'actual', 'expected'], 'verification observation');
|
|
7
|
+
for (const key of ['stepId', 'assertionId', 'contract', 'abiName', 'method']) nonempty(v[key], key);
|
|
8
|
+
if (!Number.isSafeInteger(v.callIndex) || (v.callIndex as number) < 0 || v.assertionId !== `${v.stepId}:${v.callIndex}`) throw new Error('Invalid assertion identity');
|
|
9
|
+
if (typeof v.address !== 'string' || !/^0x[\da-fA-F]{40}$/.test(v.address)) throw new Error('Invalid verification address');
|
|
10
|
+
if (!Array.isArray(v.abi) || v.abi.length === 0 || v.abi.some(item => typeof item !== 'string' || !item)) throw new Error('Invalid verification ABI');
|
|
11
|
+
const definition = exactObject(v.definition, ['method', 'args', 'expect'], 'check definition');
|
|
12
|
+
nonempty(definition.method, 'definition method');
|
|
13
|
+
if (definition.method !== v.method) throw new Error('Check definition method mismatch');
|
|
14
|
+
parseTypedValue(definition.args); parseTypedValue(definition.expect);
|
|
15
|
+
parseTypedValue(v.args); parseTypedValue(v.actual); parseTypedValue(v.expected);
|
|
16
|
+
return deepFreeze(canonicalData(v) as unknown as VerificationObservation);
|
|
17
|
+
}
|
|
18
|
+
export class VerificationJournal implements VerificationSink {
|
|
19
|
+
private readonly expected: ExpectedAssertion[];
|
|
20
|
+
private readonly observations: VerificationObservation[] = [];
|
|
21
|
+
private sealed = false;
|
|
22
|
+
constructor(expected: readonly ExpectedAssertion[]) {
|
|
23
|
+
this.expected = [];
|
|
24
|
+
this.declare(expected);
|
|
25
|
+
}
|
|
26
|
+
declare(expected: readonly ExpectedAssertion[]): void {
|
|
27
|
+
if (this.sealed) throw new Error("verification journal sealed");
|
|
28
|
+
this.expected.push(...deepFreeze(canonicalData(expected) as ExpectedAssertion[]));
|
|
29
|
+
if (new Set(this.expected.map(e => e.assertionId)).size !== this.expected.length) throw new Error('Duplicate expected assertion');
|
|
30
|
+
for (const e of this.expected) {
|
|
31
|
+
exactObject(e, ['stepId', 'callIndex', 'assertionId'], 'expected assertion');
|
|
32
|
+
if (!Number.isSafeInteger(e.callIndex) || e.callIndex < 0 || e.assertionId !== `${e.stepId}:${e.callIndex}`) throw new Error('Invalid expected assertion');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
record(raw: VerificationObservation): void {
|
|
36
|
+
if (this.sealed) throw new Error('verification journal sealed');
|
|
37
|
+
const observation = parseVerificationObservation(raw), expected = this.expected[this.observations.length];
|
|
38
|
+
if (!expected || canonicalJson(expected) !== canonicalJson({ stepId: observation.stepId, callIndex: observation.callIndex, assertionId: observation.assertionId })) throw new Error('Unexpected verification step/call mapping');
|
|
39
|
+
this.observations.push(observation);
|
|
40
|
+
}
|
|
41
|
+
seal(): VerificationObservation[] {
|
|
42
|
+
if (this.expected.length !== this.observations.length) throw new Error('missing expected verification observations');
|
|
43
|
+
this.sealed = true;
|
|
44
|
+
// Empty is valid collection, never business acceptance or qualification authority.
|
|
45
|
+
return deepFreeze([...this.observations]);
|
|
46
|
+
}
|
|
47
|
+
}
|
package/runtime/migrate.ts
CHANGED
|
@@ -12,6 +12,7 @@ const commands: Record<string, string> = {
|
|
|
12
12
|
create2Hashes: 'create2-hashes', releaseFinalize: 'release-finalize',
|
|
13
13
|
importState: 'import-state', reconcileExternal: 'reconcile-external',
|
|
14
14
|
commitContractInfo: 'commit-contract-info',
|
|
15
|
+
planRead: 'plan-read', planWrite: 'plan-write', planAdd: 'plan-add', planStatus: 'plan-status',
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
/** Plan first; preserve custom files/state. Only known sources/shims are removable. */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { accessSync, constants, readFileSync, statSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import type { Create2MinerBinaryOptions } from "./types";
|
|
5
|
+
|
|
6
|
+
// These trusted pins are compiled into the runtime. A mutable manifest alone is not a trust anchor.
|
|
7
|
+
const bundled: Record<string, { sha256: string; bytes: number }> = {
|
|
8
|
+
"darwin-arm64": { sha256: "9611c1ca900c24f9b14924a144b7a3ab431111b855e676f2e145e7ab8c05f954", bytes: 1297616 },
|
|
9
|
+
"darwin-x64": { sha256: "a38279143658a8849db484e248c62af6ae2db78de4251021f195efd9bf987d82", bytes: 1306112 },
|
|
10
|
+
};
|
|
11
|
+
function executable(file: string): void {
|
|
12
|
+
try {
|
|
13
|
+
if (!statSync(file).isFile()) throw new Error("not a regular file");
|
|
14
|
+
accessSync(file, constants.X_OK);
|
|
15
|
+
if (process.platform !== "win32" && (statSync(file).mode & 0o111) === 0) throw new Error("missing executable permission");
|
|
16
|
+
} catch (cause) {
|
|
17
|
+
throw new Error(`CREATE2 miner is not an executable file: ${file}`, { cause });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function resolveCreate2MinerBinary(options: Create2MinerBinaryOptions = {}): string {
|
|
21
|
+
const override = options.binaryPath !== undefined ? options.binaryPath : process.env.GATE_TOOL_CREATE2_MINER_BIN;
|
|
22
|
+
if (override !== undefined) {
|
|
23
|
+
if (typeof override !== "string" || override.trim().length === 0) throw new Error("CREATE2 miner binaryPath override must be a non-empty path");
|
|
24
|
+
const file = resolve(override);
|
|
25
|
+
executable(file);
|
|
26
|
+
return file;
|
|
27
|
+
}
|
|
28
|
+
const host = `${process.platform}-${process.arch}`;
|
|
29
|
+
const pin = bundled[host];
|
|
30
|
+
if (!pin) throw new Error(`No bundled CREATE2 miner for ${host}. Build a compatible smartflow_miner and set GATE_TOOL_CREATE2_MINER_BIN or binaryPath to its executable path.`);
|
|
31
|
+
const directory = resolve(__dirname, "../../resources/create2");
|
|
32
|
+
const file = resolve(directory, host, "smartflow_miner");
|
|
33
|
+
executable(file);
|
|
34
|
+
const bytes = readFileSync(file);
|
|
35
|
+
if (bytes.length !== pin.bytes || createHash("sha256").update(bytes).digest("hex") !== pin.sha256) throw new Error(`Bundled CREATE2 miner SHA-256 mismatch: ${file}; reinstall the package or supply a trusted binaryPath`);
|
|
36
|
+
let entry: { sha256?: unknown; bytes?: unknown } | undefined;
|
|
37
|
+
try { entry = JSON.parse(readFileSync(resolve(directory, "manifest.json"), "utf8")).binaries?.[host]; }
|
|
38
|
+
catch (cause) { throw new Error("Bundled CREATE2 miner manifest is invalid", { cause }); }
|
|
39
|
+
if (!entry || entry.sha256 !== pin.sha256 || entry.bytes !== pin.bytes) throw new Error(`Bundled CREATE2 miner manifest mismatch for ${host}`);
|
|
40
|
+
return file;
|
|
41
|
+
}
|