gate-evm-tools 1.2.1 → 1.2.2
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 +6 -2
- package/bin/cli.js +3 -0
- package/bin/delivery.cjs +11 -6
- package/bin/migration.js +38 -0
- package/dist/commands/prepare.d.ts.map +1 -1
- package/dist/commands/prepare.js +7 -1
- package/dist/commands/prepare.js.map +1 -1
- package/dist/core/BytecodeChecker.d.ts.map +1 -1
- package/dist/core/BytecodeChecker.js +27 -4
- package/dist/core/BytecodeChecker.js.map +1 -1
- package/dist/core/preparation/artifacts.d.ts.map +1 -1
- package/dist/core/preparation/artifacts.js +12 -5
- package/dist/core/preparation/artifacts.js.map +1 -1
- package/dist/core/preparation/index.d.ts +3 -0
- package/dist/core/preparation/index.d.ts.map +1 -1
- package/dist/core/preparation/index.js +9 -2
- package/dist/core/preparation/index.js.map +1 -1
- package/dist/core/preparation/zksync.d.ts.map +1 -1
- package/dist/core/preparation/zksync.js +5 -0
- package/dist/core/preparation/zksync.js.map +1 -1
- package/dist/core/validateAndGenerateCalldata.d.ts.map +1 -1
- package/dist/core/validateAndGenerateCalldata.js +3 -0
- package/dist/core/validateAndGenerateCalldata.js.map +1 -1
- package/dist/deployment-zksync/index.d.ts +40 -0
- package/dist/deployment-zksync/index.d.ts.map +1 -0
- package/dist/deployment-zksync/index.js +59 -0
- package/dist/deployment-zksync/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -12
- package/dist/index.js.map +1 -1
- package/dist/migration/index.d.ts +76 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +284 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist-cjs/core/BytecodeChecker.js +27 -4
- package/dist-cjs/core/BytecodeChecker.js.map +1 -1
- package/dist-cjs/core/preparation/artifacts.js +11 -4
- package/dist-cjs/core/preparation/artifacts.js.map +1 -1
- package/dist-cjs/core/preparation/index.js +47 -6
- package/dist-cjs/core/preparation/index.js.map +1 -1
- package/dist-cjs/core/preparation/zksync.js +5 -0
- package/dist-cjs/core/preparation/zksync.js.map +1 -1
- package/dist-cjs/deployment-zksync/index.js +67 -0
- package/dist-cjs/deployment-zksync/index.js.map +1 -0
- package/dist-cjs/migration/index.js +328 -0
- package/dist-cjs/migration/index.js.map +1 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js +3 -0
- package/dist-runtime/delivery/aggregate-diagnostics.js.map +1 -1
- package/dist-runtime/delivery/aggregate-inputs.d.ts +32 -6
- package/dist-runtime/delivery/aggregate-inputs.js +7 -3
- package/dist-runtime/delivery/aggregate-inputs.js.map +1 -1
- package/dist-runtime/delivery/aggregate-worker.js +3 -3
- package/dist-runtime/delivery/aggregate-worker.js.map +1 -1
- package/dist-runtime/delivery/aggregate.js +2 -2
- package/dist-runtime/delivery/aggregate.js.map +1 -1
- package/dist-runtime/delivery/cli-host.d.ts +17 -0
- package/dist-runtime/delivery/cli-host.js +118 -0
- package/dist-runtime/delivery/cli-host.js.map +1 -0
- package/dist-runtime/delivery/cli.d.ts +114 -0
- package/dist-runtime/delivery/cli.js +228 -0
- package/dist-runtime/delivery/cli.js.map +1 -0
- package/dist-runtime/delivery/compiler-dependency-pins.js +30 -1
- package/dist-runtime/delivery/compiler-dependency-pins.js.map +1 -1
- package/dist-runtime/delivery/configuration-definition.js +152 -11
- package/dist-runtime/delivery/configuration-definition.js.map +1 -1
- package/dist-runtime/delivery/configuration-hre.js +1 -1
- package/dist-runtime/delivery/configuration-hre.js.map +1 -1
- package/dist-runtime/delivery/configuration.js +7 -4
- package/dist-runtime/delivery/configuration.js.map +1 -1
- package/dist-runtime/delivery/custom-format.d.ts +2 -1
- package/dist-runtime/delivery/custom-format.js +15 -2
- package/dist-runtime/delivery/custom-format.js.map +1 -1
- package/dist-runtime/delivery/custom.d.ts +4 -0
- package/dist-runtime/delivery/custom.js +21 -0
- package/dist-runtime/delivery/custom.js.map +1 -1
- package/dist-runtime/delivery/development-inputs.d.ts +9 -0
- package/dist-runtime/delivery/development-inputs.js +41 -0
- package/dist-runtime/delivery/development-inputs.js.map +1 -1
- package/dist-runtime/delivery/development.d.ts +1 -1
- package/dist-runtime/delivery/development.js +5 -2
- package/dist-runtime/delivery/development.js.map +1 -1
- package/dist-runtime/delivery/execution-records.d.ts +16 -0
- package/dist-runtime/delivery/execution-records.js +48 -0
- package/dist-runtime/delivery/execution-records.js.map +1 -0
- package/dist-runtime/delivery/existing-code.d.ts +3 -0
- package/dist-runtime/delivery/existing-code.js +20 -0
- package/dist-runtime/delivery/existing-code.js.map +1 -1
- package/dist-runtime/delivery/input-files.d.ts +2 -0
- package/dist-runtime/delivery/input-files.js +5 -0
- package/dist-runtime/delivery/input-files.js.map +1 -1
- package/dist-runtime/delivery/inputs.js +11 -6
- package/dist-runtime/delivery/inputs.js.map +1 -1
- package/dist-runtime/delivery/materialization.js +20 -1
- package/dist-runtime/delivery/materialization.js.map +1 -1
- package/dist-runtime/delivery/planning.d.ts +1 -0
- package/dist-runtime/delivery/planning.js +10 -2
- package/dist-runtime/delivery/planning.js.map +1 -1
- package/dist-runtime/delivery/production-finalization.js +3 -2
- package/dist-runtime/delivery/production-finalization.js.map +1 -1
- package/dist-runtime/delivery/production.d.ts +2 -0
- package/dist-runtime/delivery/production.js +5 -4
- package/dist-runtime/delivery/production.js.map +1 -1
- package/dist-runtime/delivery/project-files.js +6 -1
- package/dist-runtime/delivery/project-files.js.map +1 -1
- package/dist-runtime/delivery/project-rpc.d.ts +1 -1
- package/dist-runtime/delivery/project-rpc.js +10 -4
- package/dist-runtime/delivery/project-rpc.js.map +1 -1
- package/dist-runtime/delivery/protocol.d.ts +6 -4
- package/dist-runtime/delivery/protocol.js +16 -5
- package/dist-runtime/delivery/protocol.js.map +1 -1
- package/dist-runtime/delivery/query.d.ts +21 -0
- package/dist-runtime/delivery/query.js +58 -0
- package/dist-runtime/delivery/query.js.map +1 -0
- package/dist-runtime/delivery/release-graph.d.ts +17 -0
- package/dist-runtime/delivery/release-graph.js +23 -0
- package/dist-runtime/delivery/release-graph.js.map +1 -1
- package/dist-runtime/delivery/release-history-capture.js +5 -2
- package/dist-runtime/delivery/release-history-capture.js.map +1 -1
- package/dist-runtime/delivery/release-history.js +19 -12
- package/dist-runtime/delivery/release-history.js.map +1 -1
- package/dist-runtime/delivery/release.d.ts +22 -0
- package/dist-runtime/delivery/release.js +13 -3
- package/dist-runtime/delivery/release.js.map +1 -1
- package/dist-runtime/delivery/scripts.d.ts +116 -0
- package/dist-runtime/delivery/scripts.js +289 -0
- package/dist-runtime/delivery/scripts.js.map +1 -0
- package/dist-runtime/delivery/setup.d.ts +1 -1
- package/dist-runtime/delivery/setup.js +26 -36
- package/dist-runtime/delivery/setup.js.map +1 -1
- package/dist-runtime/delivery/source.d.ts +5 -2
- package/dist-runtime/delivery/source.js +4 -3
- package/dist-runtime/delivery/source.js.map +1 -1
- package/dist-runtime/delivery/standalone-source.d.ts +40 -0
- package/dist-runtime/delivery/standalone-source.js +54 -0
- package/dist-runtime/delivery/standalone-source.js.map +1 -0
- package/dist-runtime/runtime-identity.json +2 -2
- package/dist-runtime/workflow/lib/calls.js +21 -1
- package/dist-runtime/workflow/lib/calls.js.map +1 -1
- package/docs/configuration-runtime-observation.md +4 -2
- package/docs/delivery-custom-input-closure.md +2 -0
- package/docs/delivery-development.md +2 -0
- package/docs/delivery-inputs.md +2 -0
- package/docs/delivery-release.md +3 -1
- package/docs/delivery-setup.md +25 -20
- package/docs/delivery-source.md +4 -2
- package/docs/migration.md +108 -0
- package/docs/script-execution.md +85 -0
- package/package.json +42 -19
- package/runtime/delivery/aggregate-diagnostics.ts +2 -0
- package/runtime/delivery/aggregate-inputs.ts +6 -5
- package/runtime/delivery/aggregate-worker.ts +3 -3
- package/runtime/delivery/aggregate.ts +2 -2
- package/runtime/delivery/cli-host.ts +55 -0
- package/runtime/delivery/cli.ts +124 -0
- package/runtime/delivery/compiler-dependency-pins.ts +30 -1
- package/runtime/delivery/configuration-definition.ts +80 -9
- package/runtime/delivery/configuration-hre.ts +1 -1
- package/runtime/delivery/configuration.ts +7 -5
- package/runtime/delivery/custom-format.ts +11 -3
- package/runtime/delivery/custom.ts +13 -0
- package/runtime/delivery/development-inputs.ts +31 -0
- package/runtime/delivery/development.ts +4 -3
- package/runtime/delivery/execution-records.ts +31 -0
- package/runtime/delivery/existing-code.ts +12 -1
- package/runtime/delivery/input-files.ts +5 -1
- package/runtime/delivery/inputs.ts +10 -6
- package/runtime/delivery/materialization.ts +8 -1
- package/runtime/delivery/planning.ts +10 -2
- package/runtime/delivery/production-finalization.ts +3 -2
- package/runtime/delivery/production.ts +5 -4
- package/runtime/delivery/project-files.ts +5 -1
- package/runtime/delivery/project-rpc.ts +10 -4
- package/runtime/delivery/protocol.ts +13 -5
- package/runtime/delivery/query.ts +34 -0
- package/runtime/delivery/release-graph.ts +17 -0
- package/runtime/delivery/release-history-capture.ts +2 -1
- package/runtime/delivery/release-history.ts +8 -3
- package/runtime/delivery/release.ts +7 -4
- package/runtime/delivery/scripts.ts +162 -0
- package/runtime/delivery/setup.ts +21 -31
- package/runtime/delivery/source.ts +7 -3
- package/runtime/delivery/standalone-source.ts +40 -0
- package/runtime/workflow/lib/calls.ts +19 -1
- package/dist-runtime/delivery/toolchain.d.ts +0 -3
- package/dist-runtime/delivery/toolchain.js +0 -52
- package/dist-runtime/delivery/toolchain.js.map +0 -1
- package/runtime/delivery/toolchain.ts +0 -48
|
@@ -4,7 +4,6 @@ import crypto from 'node:crypto';
|
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
5
|
import { spawnSync } from 'node:child_process';
|
|
6
6
|
import YAML from 'yaml';
|
|
7
|
-
import { REVIEWED_DELIVERY_OVERRIDES } from './toolchain';
|
|
8
7
|
import { object } from './protocol';
|
|
9
8
|
import { deliveryProjectMarker, projectRoot, readFile, confinedFile, stat, integratedConfig, readPublicProjectNetworkSnapshots, projectSourcesDirectory } from './project';
|
|
10
9
|
import { configDocument, parseDeliveryPublicTargets, validateDeliveryTarget, type DeliveryTarget } from './config';
|
|
@@ -13,11 +12,10 @@ export { loadDeliveryTarget } from './config';
|
|
|
13
12
|
export { configureDeliveryEnvironment } from './manifest';
|
|
14
13
|
export type { DeliveryTarget, DeliveryTargetConfig } from './config';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const DEPENDENCIES: Record<string, string> = { 'gate-evm-tools': toolIdentity.version, '@openzeppelin/hardhat-upgrades': '3.9.1', '@openzeppelin/upgrades-core': '1.44.2', '@openzeppelin/contracts': '5.4.0' };
|
|
15
|
+
// Setup checks locally available capabilities. The project owns dependency versions;
|
|
16
|
+
// compiler qualification separately validates the toolchain used for deployment.
|
|
17
|
+
const DEPENDENCIES = ['hardhat', 'ethers', '@nomicfoundation/hardhat-ethers', 'typescript', 'ts-node',
|
|
18
|
+
'gate-evm-tools', '@openzeppelin/hardhat-upgrades', '@openzeppelin/upgrades-core', '@openzeppelin/contracts'];
|
|
21
19
|
export interface DeliverySetupOptions {
|
|
22
20
|
workspaceRoot: string;
|
|
23
21
|
projectRoot: string;
|
|
@@ -73,10 +71,6 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
73
71
|
const before = new Map<string, string | undefined>();
|
|
74
72
|
for (const file of ['.gate-template.json', 'package.json', 'hardhat.config.ts', 'config.yaml', 'contractInfo.json']) before.set(file, readFile(root, file));
|
|
75
73
|
const pkg = object(JSON.parse(before.get('package.json') ?? 'null'), 'package.json');
|
|
76
|
-
const overrides = pkg.overrides === undefined ? {} : object(pkg.overrides, 'package overrides');
|
|
77
|
-
for (const [name, version] of Object.entries(REVIEWED_DELIVERY_OVERRIDES)) {
|
|
78
|
-
if (overrides[name] !== undefined && overrides[name] !== version) throw new Error(`Reviewed delivery dependency override conflict: ${name}`);
|
|
79
|
-
}
|
|
80
74
|
const declarations: Record<string, unknown> = {};
|
|
81
75
|
for (const section of ['dependencies', 'devDependencies']) {
|
|
82
76
|
const entries = pkg[section] === undefined ? {} : object(pkg[section], section);
|
|
@@ -85,18 +79,14 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
85
79
|
declarations[name] = value;
|
|
86
80
|
}
|
|
87
81
|
}
|
|
88
|
-
const required =
|
|
82
|
+
const required = [...DEPENDENCIES];
|
|
83
|
+
let toolDeclaration: string | undefined;
|
|
89
84
|
if (input.toolPackage !== undefined) {
|
|
90
85
|
if (!path.isAbsolute(input.toolPackage) || !input.toolPackage.endsWith('.tgz') || !stat(input.toolPackage)?.isFile() || stat(input.toolPackage)?.isSymbolicLink()) throw new Error('toolPackage must be an explicit absolute local tarball path');
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (businessUsesUpgradeable(root)) required['@openzeppelin/contracts-upgradeable'] = '5.4.0';
|
|
94
|
-
for (const [name, version] of Object.entries({ ...TOOLCHAIN, ...required })) {
|
|
95
|
-
const declared = declarations[name];
|
|
96
|
-
// Preserve an existing explicit local tarball declaration when rerunning after installation.
|
|
97
|
-
const localTool = name === 'gate-evm-tools' && input.toolPackage === undefined && typeof declared === 'string' && /^file:.*\.tgz$/.test(declared);
|
|
98
|
-
if ((name in TOOLCHAIN && declared === undefined) || (declared !== undefined && declared !== version && !localTool)) throw new Error(`Dependency declaration conflict for ${name}: expected ${version}`);
|
|
86
|
+
toolDeclaration = `file:${input.toolPackage}`;
|
|
87
|
+
if (declarations['gate-evm-tools'] !== undefined && declarations['gate-evm-tools'] !== toolDeclaration) throw new Error('Explicit toolPackage conflicts with the project gate-evm-tools declaration');
|
|
99
88
|
}
|
|
89
|
+
if (businessUsesUpgradeable(root)) required.push('@openzeppelin/contracts-upgradeable');
|
|
100
90
|
const networks = readPublicProjectNetworkSnapshots(root, targets.map(target => target.network));
|
|
101
91
|
const source = before.get('hardhat.config.ts')!;
|
|
102
92
|
const withPlugin = integratedConfig(source); // Check integration conflicts even when dependencies are missing.
|
|
@@ -120,12 +110,14 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
120
110
|
if (before.get('contractInfo.json') !== undefined) object(JSON.parse(before.get('contractInfo.json')!), 'contractInfo.json');
|
|
121
111
|
const dependencies: DeliveryInspection['dependencies'] = [];
|
|
122
112
|
const projectRequire = createRequire(path.join(root, 'package.json'));
|
|
123
|
-
for (const
|
|
113
|
+
for (const name of required) {
|
|
114
|
+
const requested = name === 'gate-evm-tools' && toolDeclaration !== undefined ? toolDeclaration : declarations[name];
|
|
115
|
+
const selection = typeof requested === 'string' ? requested : 'project-selected version';
|
|
116
|
+
if (requested === undefined) { dependencies.push({ name, required: selection, reason: 'not declared in the project' }); continue; }
|
|
124
117
|
const metadata = confinedFile(root, `node_modules/${name}/package.json`);
|
|
125
|
-
if (!stat(metadata)) { dependencies.push({ name, required:
|
|
118
|
+
if (!stat(metadata)) { dependencies.push({ name, required: selection, reason: 'not installed locally' }); continue; }
|
|
126
119
|
const installed = JSON.parse(fs.readFileSync(metadata, 'utf8'));
|
|
127
|
-
|
|
128
|
-
if (installed.name !== name || installed.version !== expected) throw new Error(`Installed dependency conflict for ${name}: expected ${expected}`);
|
|
120
|
+
if (installed.name !== name) throw new Error(`Installed dependency identity mismatch for ${name}`);
|
|
129
121
|
if (name !== 'gate-evm-tools') {
|
|
130
122
|
const entry = name === '@openzeppelin/contracts' ? `${name}/proxy/ERC1967/ERC1967Proxy.sol`
|
|
131
123
|
: name === '@openzeppelin/contracts-upgradeable' ? `${name}/package.json` : name;
|
|
@@ -133,7 +125,7 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
133
125
|
const resolved = fs.realpathSync(projectRequire.resolve(entry));
|
|
134
126
|
if (!stat(resolved)?.isFile() || !resolved.startsWith(path.join(root, 'node_modules') + path.sep)) throw new Error('nonlocal entry');
|
|
135
127
|
} catch {
|
|
136
|
-
dependencies.push({ name, required:
|
|
128
|
+
dependencies.push({ name, required: selection, reason: 'required entry point is missing or nonlocal' });
|
|
137
129
|
}
|
|
138
130
|
}
|
|
139
131
|
if (name === 'gate-evm-tools') {
|
|
@@ -142,7 +134,7 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
142
134
|
const resolved = projectRequire.resolve(`gate-evm-tools/${entry}`);
|
|
143
135
|
if (!resolved.startsWith(path.join(root, 'node_modules') + path.sep)) throw new Error('nonlocal API');
|
|
144
136
|
}
|
|
145
|
-
} catch { dependencies.push({ name, required:
|
|
137
|
+
} catch { dependencies.push({ name, required: selection, reason: 'installed package lacks delivery API exports; install a built delivery package' }); }
|
|
146
138
|
}
|
|
147
139
|
}
|
|
148
140
|
if (!dependencies.length) {
|
|
@@ -150,12 +142,10 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
150
142
|
if (reason) dependencies.push({ name: 'dependency-tree', required: 'complete local dependency graph', reason });
|
|
151
143
|
}
|
|
152
144
|
const writes = new Map<string, string>();
|
|
153
|
-
|
|
154
|
-
const missingOverrides = Object.entries(REVIEWED_DELIVERY_OVERRIDES).some(([name]) => overrides[name] === undefined);
|
|
155
|
-
if (missing.length || missingOverrides) {
|
|
145
|
+
if (toolDeclaration !== undefined && declarations['gate-evm-tools'] === undefined) {
|
|
156
146
|
const dev = { ...(pkg.devDependencies as Record<string, unknown> ?? {}) };
|
|
157
|
-
|
|
158
|
-
writes.set('package.json', JSON.stringify({ ...pkg, devDependencies: dev
|
|
147
|
+
dev['gate-evm-tools'] = toolDeclaration;
|
|
148
|
+
writes.set('package.json', JSON.stringify({ ...pkg, devDependencies: dev }, null, 2) + '\n');
|
|
159
149
|
}
|
|
160
150
|
if (changedYaml) writes.set('config.yaml', doc.toString());
|
|
161
151
|
if (before.get('contractInfo.json') === undefined) writes.set('contractInfo.json', '{}\n');
|
|
@@ -165,7 +155,7 @@ function preflight(input: DeliverySetupOptions): { result: DeliveryInspection; w
|
|
|
165
155
|
}
|
|
166
156
|
/** Read-only, never imports the project's config/HRE or contacts an RPC. */
|
|
167
157
|
export function inspectDeliveryProject(options: DeliverySetupOptions): DeliveryInspection { return preflight(options).result; }
|
|
168
|
-
/** Stage
|
|
158
|
+
/** Stage config; dependency selections remain project-owned except an explicit missing toolPackage. */
|
|
169
159
|
export function setupDeliveryProject(options: DeliverySetupOptions): DeliveryInspection {
|
|
170
160
|
const { result, writes, before } = preflight(options);
|
|
171
161
|
const root = projectRoot(options.workspaceRoot, options.projectRoot);
|
|
@@ -4,6 +4,7 @@ import { createHash } from 'node:crypto';
|
|
|
4
4
|
import { deliveryProjectMarker, projectRoot, confinedFile } from './project-files';
|
|
5
5
|
import { object, parseDeliveryRequest, validateDeliveryRpc, type DeliveryRequest, type ChainIdProvider, type ProjectNetworkSnapshot } from './protocol';
|
|
6
6
|
import { loadPlanCodec } from './codec';
|
|
7
|
+
import type { StandaloneDefinition } from './standalone-source';
|
|
7
8
|
import type { Plan, PlanTask, DefinitionSelection, DefinitionSnapshot, DeepReadonly } from '../vendor/plan-codec/index.cjs';
|
|
8
9
|
export type { DefinitionSelection, DefinitionSnapshot, DeepReadonly } from '../vendor/plan-codec/index.cjs';
|
|
9
10
|
|
|
@@ -20,8 +21,10 @@ export interface DeliverySourceBinding {
|
|
|
20
21
|
workspaceRoot: string;
|
|
21
22
|
projectRoot: string;
|
|
22
23
|
observation: { path: string; sha256: string };
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
kind: 'gateflow' | 'standalone';
|
|
25
|
+
scope: Readonly<Record<string, any>>;
|
|
26
|
+
invocation?: { lane: string; task: PlanTask };
|
|
27
|
+
sourceDefinition: DefinitionSnapshot | StandaloneDefinition;
|
|
25
28
|
sourceDefinitionBytes: string;
|
|
26
29
|
sourceDefinitionHash: string;
|
|
27
30
|
prodTaskGraph?: DefinitionSnapshot;
|
|
@@ -77,6 +80,7 @@ function readSource(input: Omit<DeliverySourceOptions, 'sourceRoots'> & { source
|
|
|
77
80
|
const workspace = projectRoot(input.workspaceRoot, '.');
|
|
78
81
|
const root = projectRoot(workspace, input.projectRoot);
|
|
79
82
|
deliveryProjectMarker(root);
|
|
83
|
+
if(request.sourceRef.kind==='standalone')return freeze((require('./standalone-source') as typeof import('./standalone-source')).standaloneSource(workspace,root,input.projectRoot,request)) as DeepReadonly<DeliverySourceBinding>;
|
|
80
84
|
const bytes = actualSource(workspace, request.sourceRef.path);
|
|
81
85
|
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
82
86
|
if (input.sourceRoots === undefined) (require('./input-files') as typeof import('./input-files')).assertUnambiguousHandoff(text);
|
|
@@ -116,7 +120,7 @@ function readSource(input: Omit<DeliverySourceOptions, 'sourceRoots'> & { source
|
|
|
116
120
|
}
|
|
117
121
|
// All values came from detached request parsing and actual handoff text; freeze before exposing.
|
|
118
122
|
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),
|
|
123
|
+
kind:'gateflow' as const, scope:deployment, invocation, sourceDefinition: source.snapshot, sourceDefinitionBytes: source.bytes, sourceDefinitionHash: sha256(source.bytes),
|
|
120
124
|
...(production ? { prodTaskGraph: production.snapshot, prodTaskGraphBytes: production.bytes, prodTaskGraphHash: sha256(production.bytes) } : {}),
|
|
121
125
|
}) as DeepReadonly<DeliverySourceBinding>;
|
|
122
126
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Native task-file adapter. No synthetic handoff, lanes, PlanTask or JSON approval. */
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { readInputBytes, parseInputDocument, inputDigest } from './input-files';
|
|
4
|
+
import { object, safeId, portablePath, type DeliveryRequest } from './protocol';
|
|
5
|
+
import { canonicalJson, deepFreeze, semanticHash } from '../workflow/lib/canonicalData';
|
|
6
|
+
export interface StandaloneDefinition {
|
|
7
|
+
schema: 'gate-delivery-standalone'; version: 1; deploymentId: string;
|
|
8
|
+
description: string; developmentNetwork: string; releaseTargetNetworks: string[];
|
|
9
|
+
referenceDeploymentId?: string;
|
|
10
|
+
script: string; selectedSteps: string[];
|
|
11
|
+
}
|
|
12
|
+
export function readStandaloneTask(root: string, relative: string): StandaloneDefinition {
|
|
13
|
+
portablePath(relative,'standalone task');
|
|
14
|
+
const t=object(parseInputDocument(readInputBytes(root,relative),'yaml'),'standalone task',
|
|
15
|
+
['version','id','source','description','developmentNetwork','releaseTargetNetworks','referenceDeploymentId','script','selectedSteps']);
|
|
16
|
+
if(t.version!==2 || t.source!=='standalone') throw Error('Native standalone task.yaml version 2 required');
|
|
17
|
+
const id=safeId(t.id,'deploymentId');
|
|
18
|
+
if(relative!==`scripts/tasks/${id}/task.yaml`)throw Error('Noncanonical standalone task path');
|
|
19
|
+
if(typeof t.description!=='string'||!t.description.trim())throw Error('Explicit operation description required');
|
|
20
|
+
safeId(t.developmentNetwork,'developmentNetwork');portablePath(t.script,'business script');
|
|
21
|
+
if(!Array.isArray(t.releaseTargetNetworks)||new Set(t.releaseTargetNetworks).size!==t.releaseTargetNetworks.length)throw Error('Invalid release targets');
|
|
22
|
+
for(const n of t.releaseTargetNetworks){safeId(n,'release target');if(n===t.developmentNetwork)throw Error('Development network cannot be a production target');}
|
|
23
|
+
if(!Array.isArray(t.selectedSteps)||!t.selectedSteps.length||new Set(t.selectedSteps).size!==t.selectedSteps.length)throw Error('Selected steps required');
|
|
24
|
+
t.selectedSteps.forEach(s=>safeId(s,'selected step'));
|
|
25
|
+
if(t.referenceDeploymentId!==undefined)safeId(t.referenceDeploymentId,'referenceDeploymentId');
|
|
26
|
+
return deepFreeze({schema:'gate-delivery-standalone' as const,version:1 as const,deploymentId:id,description:t.description,
|
|
27
|
+
developmentNetwork:t.developmentNetwork as string,releaseTargetNetworks:t.releaseTargetNetworks as string[],script:t.script as string,
|
|
28
|
+
selectedSteps:t.selectedSteps as string[],...(t.referenceDeploymentId?{referenceDeploymentId:t.referenceDeploymentId as string}:{})});
|
|
29
|
+
}
|
|
30
|
+
export function standaloneSource(workspace:string,root:string,relativeProject:string,request:DeliveryRequest) {
|
|
31
|
+
const relative=path.relative(root,path.resolve(workspace,request.sourceRef.path)).split(path.sep).join('/');
|
|
32
|
+
const definition=readStandaloneTask(root,relative);
|
|
33
|
+
if(definition.deploymentId!==request.sourceRef.deploymentId)throw Error('Standalone source deployment mismatch');
|
|
34
|
+
if(request.purpose==='dev-execution'?request.network!==definition.developmentNetwork:!definition.releaseTargetNetworks.includes(request.network))throw Error('Target outside standalone scope');
|
|
35
|
+
const scope={...definition,projectRoot:relativeProject,chainFamily:'evm',framework:'hardhat2'};
|
|
36
|
+
const bytes=canonicalJson(definition);
|
|
37
|
+
return {request,workspaceRoot:workspace,projectRoot:root,kind:'standalone' as const,scope,
|
|
38
|
+
observation:{path:request.sourceRef.path,sha256:inputDigest(readInputBytes(workspace,request.sourceRef.path))},
|
|
39
|
+
sourceDefinition:definition,sourceDefinitionBytes:bytes,sourceDefinitionHash:semanticHash(definition)};
|
|
40
|
+
}
|
|
@@ -350,21 +350,39 @@ export const runContractViewCalls = async (
|
|
|
350
350
|
const resolved = await resolveContract(context, step);
|
|
351
351
|
const calls = resolveStepCalls(step);
|
|
352
352
|
const results: Record<string, string> = {};
|
|
353
|
+
const typedResults: Record<string, unknown> = {};
|
|
354
|
+
const queries: unknown[] = [];
|
|
355
|
+
const provider=context.runtime.hre.network.provider;
|
|
356
|
+
const caller=context.signerAddress??await context.signer?.getAddress()??"0x0000000000000000000000000000000000000001";
|
|
357
|
+
const block:any=await provider.request({method:"eth_getBlockByNumber",params:["latest",false]});
|
|
358
|
+
const chainId=BigInt(await provider.request({method:"eth_chainId",params:[]}) as string).toString();
|
|
353
359
|
|
|
354
360
|
for (const [index, call] of calls.entries()) {
|
|
355
361
|
const args = resolveCallArgs(context, call);
|
|
356
362
|
await context.validation?.call(resolved.abiName, call.method, args, call.value === undefined ? undefined : resolveWorkflowValue(context, call.value));
|
|
357
363
|
context.validation?.callInterface(resolved.contract.interface.fragments, call.method, args);
|
|
358
|
-
const
|
|
364
|
+
const fn = resolved.contract.interface.getFunction(call.method);
|
|
365
|
+
let value: unknown;
|
|
366
|
+
if (fn && ["view", "pure"].includes(fn.stateMutability)) {
|
|
367
|
+
const query=await require("../../delivery/query").readScriptContract({address:resolved.address,abi:resolved.contract.interface.fragments.filter(f=>f.type==="function").map(f=>f.format("full")),method:call.method,args}, {request:(method:string,params:unknown[])=>provider.request({method,params}),chainId,block:{number:block.number,hash:block.hash},caller,source:{blockNumber:context.simulation.snapshot?.blockNumber??Number(BigInt(block.number)),blockHash:context.simulation.snapshot?.blockHash??block.hash}});
|
|
368
|
+
value=query.value;queries.push(query.evidence);
|
|
369
|
+
} else {
|
|
370
|
+
// Legacy view steps may statically inspect a non-view ABI. Keep that
|
|
371
|
+
// eth_call behavior without presenting it as a reusable view dependency.
|
|
372
|
+
value = await resolved.contract.getFunction(call.method).staticCall(...args);
|
|
373
|
+
}
|
|
359
374
|
results[resultKey(call, index, calls)] = context.validation ? context.validation.stringify(value) : stringifyCallResult(value);
|
|
375
|
+
typedResults[resultKey(call,index,calls)] = require("../../delivery/abi").normalizeRuntimeValue(value);
|
|
360
376
|
}
|
|
361
377
|
|
|
378
|
+
context.state.set(String(step.saveAs ?? step.id), { ...typedResults, values: Object.values(typedResults), value: Object.values(typedResults).length===1?Object.values(typedResults)[0]:Object.values(typedResults) });
|
|
362
379
|
context.reporter.result("view", {
|
|
363
380
|
stepId: step.id,
|
|
364
381
|
kind: step.kind,
|
|
365
382
|
contract: resolved.contractName,
|
|
366
383
|
address: resolved.address,
|
|
367
384
|
results,
|
|
385
|
+
queries,
|
|
368
386
|
});
|
|
369
387
|
};
|
|
370
388
|
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/** Reviewed compiler adapter dependency selections; payload checks remain authoritative.
|
|
2
|
-
* Range-scoped entries preserve distinct dependency majors. Setup never overrides a conflicting project choice. */
|
|
3
|
-
export declare const REVIEWED_DELIVERY_OVERRIDES: Record<string, string>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REVIEWED_DELIVERY_OVERRIDES = void 0;
|
|
4
|
-
const compiler_dependency_pins_1 = require("./compiler-dependency-pins");
|
|
5
|
-
/** Reviewed compiler adapter dependency selections; payload checks remain authoritative.
|
|
6
|
-
* Range-scoped entries preserve distinct dependency majors. Setup never overrides a conflicting project choice. */
|
|
7
|
-
exports.REVIEWED_DELIVERY_OVERRIDES = {
|
|
8
|
-
"axios": "1.20.0",
|
|
9
|
-
"@aws-sdk/client-lambda": "3.1152.0",
|
|
10
|
-
"@aws-sdk/core": "3.978.3",
|
|
11
|
-
"@aws-sdk/credential-provider-env": "3.972.74",
|
|
12
|
-
"@aws-sdk/credential-provider-http": "3.972.76",
|
|
13
|
-
"@aws-sdk/credential-provider-ini": "3.973.19",
|
|
14
|
-
"@aws-sdk/credential-provider-login": "3.972.81",
|
|
15
|
-
"@aws-sdk/credential-provider-node": "3.972.86",
|
|
16
|
-
"@aws-sdk/credential-provider-process": "3.972.74",
|
|
17
|
-
"@aws-sdk/credential-provider-sso": "3.973.18",
|
|
18
|
-
"@aws-sdk/credential-provider-web-identity": "3.972.80",
|
|
19
|
-
"@aws-sdk/nested-clients": "3.997.48",
|
|
20
|
-
"@aws-sdk/signature-v4-multi-region": "3.996.48",
|
|
21
|
-
"@aws-sdk/token-providers": "3.1150.0",
|
|
22
|
-
"@aws-sdk/types": "3.974.6",
|
|
23
|
-
"@smithy/types": "4.19.0",
|
|
24
|
-
"@smithy/signature-v4": "5.7.4",
|
|
25
|
-
"@smithy/fetch-http-handler": "5.8.0",
|
|
26
|
-
"@smithy/credential-provider-imds": "4.5.2",
|
|
27
|
-
"@smithy/core": "3.36.0",
|
|
28
|
-
"@smithy/node-http-handler": "4.12.1",
|
|
29
|
-
"bowser": "2.14.1",
|
|
30
|
-
"follow-redirects": "1.16.1",
|
|
31
|
-
"undici@>=5 <6": "5.29.0",
|
|
32
|
-
"undici@>=6 <7": "6.29.0",
|
|
33
|
-
"tslib@>=1 <2": "1.14.1",
|
|
34
|
-
"tslib@>=2 <3": "2.7.0",
|
|
35
|
-
"semver@>=5 <6": "5.7.2",
|
|
36
|
-
"semver@>=6 <7": "6.3.1",
|
|
37
|
-
"semver@>=7 <8": "7.8.5",
|
|
38
|
-
"ansi-regex@>=6 <7": "6.4.0"
|
|
39
|
-
};
|
|
40
|
-
// OZ's compiler adapter follows floating AWS/Smithy ranges. Freeze that reviewed
|
|
41
|
-
// family closure so a fresh npm resolution cannot select unqualified payloads.
|
|
42
|
-
// Other project dependencies keep their original constraints and payload checks.
|
|
43
|
-
for (const key of Object.keys(compiler_dependency_pins_1.compilerDependencyPins)) {
|
|
44
|
-
if (!key.startsWith('@aws-sdk/') && !key.startsWith('@smithy/'))
|
|
45
|
-
continue;
|
|
46
|
-
const at = key.lastIndexOf('@'), name = key.slice(0, at), version = key.slice(at + 1);
|
|
47
|
-
const existing = exports.REVIEWED_DELIVERY_OVERRIDES[name];
|
|
48
|
-
if (existing && existing !== version)
|
|
49
|
-
throw new Error('Ambiguous reviewed compiler dependency: ' + name);
|
|
50
|
-
exports.REVIEWED_DELIVERY_OVERRIDES[name] = version;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=toolchain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolchain.js","sourceRoot":"","sources":["../../runtime/delivery/toolchain.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE;mHACmH;AACtG,QAAA,2BAA2B,GAA2B;IACjE,OAAO,EAAE,QAAQ;IACjB,wBAAwB,EAAE,UAAU;IACpC,eAAe,EAAE,SAAS;IAC1B,kCAAkC,EAAE,UAAU;IAC9C,mCAAmC,EAAE,UAAU;IAC/C,kCAAkC,EAAE,UAAU;IAC9C,oCAAoC,EAAE,UAAU;IAChD,mCAAmC,EAAE,UAAU;IAC/C,sCAAsC,EAAE,UAAU;IAClD,kCAAkC,EAAE,UAAU;IAC9C,2CAA2C,EAAE,UAAU;IACvD,yBAAyB,EAAE,UAAU;IACrC,oCAAoC,EAAE,UAAU;IAChD,0BAA0B,EAAE,UAAU;IACtC,gBAAgB,EAAE,SAAS;IAC3B,eAAe,EAAE,QAAQ;IACzB,sBAAsB,EAAE,OAAO;IAC/B,4BAA4B,EAAE,OAAO;IACrC,kCAAkC,EAAE,OAAO;IAC3C,cAAc,EAAE,QAAQ;IACxB,2BAA2B,EAAE,QAAQ;IACrC,QAAQ,EAAE,QAAQ;IAClB,kBAAkB,EAAE,QAAQ;IAC5B,eAAe,EAAE,QAAQ;IACzB,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,OAAO;IACvB,eAAe,EAAE,OAAO;IACxB,eAAe,EAAE,OAAO;IACxB,eAAe,EAAE,OAAO;IACxB,mBAAmB,EAAE,OAAO;CAC7B,CAAC;AAEF,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,iDAAsB,CAAC,EAAE,CAAC;IACtD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,SAAS;IAC1E,MAAM,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACtF,MAAM,QAAQ,GAAG,mCAA2B,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,QAAQ,IAAI,QAAQ,KAAK,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,IAAI,CAAC,CAAC;IACzG,mCAA2B,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;AAC9C,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
}
|