Skip to content

Commit 1ac8d6c

Browse files
committed
fix(test-suite): gate tx-sender host-chain flag
1 parent 0c397f4 commit 1ac8d6c

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

test-suite/fhevm/docker-compose/coprocessor-docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ services:
225225
- transaction_sender
226226
- --database-url=${DATABASE_URL}
227227
- --gateway-url=${GATEWAY_WS_URL}
228-
- --host-chain-url=${RPC_HTTP_URL}
229228
- --private-key=${TX_SENDER_PRIVATE_KEY}
230229
- --ciphertext-commits-address=${CIPHERTEXT_COMMITS_ADDRESS}
231230
- --input-verification-address=${INPUT_VERIFICATION_ADDRESS}

test-suite/fhevm/src/artifacts.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ describe("serviceNameList", () => {
5959
});
6060

6161
describe("compose templates", () => {
62-
test("transaction sender passes host chain url", async () => {
62+
test("transaction sender does not hardcode host chain url", async () => {
6363
const template = await fs.readFile(
6464
path.join(TEMPLATE_COMPOSE_DIR, "coprocessor-docker-compose.yml"),
6565
"utf8",
6666
);
67-
expect(template.includes("--host-chain-url=${RPC_HTTP_URL}")).toBe(true);
67+
expect(template.includes("--host-chain-url")).toBe(false);
6868
});
6969

7070
test("coprocessor local builds are serialized", async () => {

test-suite/fhevm/src/cli.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,18 @@ describe("runtime invariants", () => {
231231
expect(compatPolicyForState(makeState("v0.11.0")).coprocessorArgs["sns-worker"]).toEqual([
232232
["--tenant-api-key", "TENANT_API_KEY"],
233233
]);
234+
expect(compatPolicyForState(makeState("v0.11.0")).coprocessorArgs["transaction-sender"]).toEqual([
235+
["--host-chain-url", "RPC_WS_URL"],
236+
]);
234237

235238
// v0.12.x: all legacy flags removed
236239
expect(compatPolicyForState(makeState("v0.12.0")).coprocessorArgs["host-listener"]).toBeUndefined();
237240
expect(compatPolicyForState(makeState("v0.12.0")).coprocessorArgs["sns-worker"]).toBeUndefined();
241+
expect(compatPolicyForState(makeState("v0.12.0")).coprocessorArgs["transaction-sender"]).toBeUndefined();
238242

239243
// latest-main SHAs stay modern-only once resolution enforces the floor
240244
expect(compatPolicyForState(makeState("58aebb0")).coprocessorArgs["host-listener"]).toBeUndefined();
245+
expect(compatPolicyForState(makeState("58aebb0")).coprocessorArgs["transaction-sender"]).toBeUndefined();
241246
});
242247

243248
test("coprocessor depends_on rewrite only renames cloned services", () => {

test-suite/fhevm/src/compat.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { State } from "./types";
22

33
type CompatSemver = readonly [number, number, number];
4-
type CompatService = "host-listener" | "host-listener-poller" | "sns-worker";
4+
type CompatService = "host-listener" | "host-listener-poller" | "sns-worker" | "transaction-sender";
55

66
export type CompatPolicy = {
77
coprocessorArgs: Partial<Record<CompatService, Array<readonly [string, string]>>>;
@@ -25,10 +25,19 @@ const COMPAT_PROFILES = {
2525
KMS_CONNECTOR_CHAIN_ID: "KMS_CONNECTOR_GATEWAY_CHAIN_ID",
2626
},
2727
},
28+
"legacy-tx-sender-host-chain-url": {
29+
coprocessorArgs: {
30+
"transaction-sender": [["--host-chain-url", "RPC_WS_URL"]],
31+
},
32+
connectorEnv: {},
33+
},
2834
} as const satisfies Record<string, CompatPolicy>;
2935

3036
const COMPAT_RULES = {
31-
coprocessor: [{ before: [0, 12, 0] as CompatSemver, profile: "legacy-coprocessor-api-keys" }],
37+
coprocessor: [
38+
{ before: [0, 12, 0] as CompatSemver, profile: "legacy-coprocessor-api-keys" },
39+
{ before: [0, 11, 1] as CompatSemver, profile: "legacy-tx-sender-host-chain-url" },
40+
],
3241
connector: [{ before: [0, 11, 0] as CompatSemver, profile: "legacy-connector-chain-id" }],
3342
} as const;
3443

0 commit comments

Comments
 (0)