Skip to content

Commit 8cb80da

Browse files
committed
chore: remove enableTransientStorage from EDR config
This property was needed in Hardhat 2 but is no longer used. Resolves #6182.
1 parent 3fb0925 commit 8cb80da

File tree

5 files changed

+7
-111
lines changed

5 files changed

+7
-111
lines changed

v-next/hardhat/src/internal/builtin-plugins/network-manager/config-resolution.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,13 @@ export function resolveEdrNetwork(
8686
networkConfig.allowUnlimitedContractSize ?? false,
8787
blockGasLimit: BigInt(networkConfig.blockGasLimit ?? 30_000_000n),
8888
coinbase: resolveCoinbase(networkConfig.coinbase),
89-
enableTransientStorage: networkConfig.enableTransientStorage ?? false,
89+
9090
forking: resolveForkingConfig(
9191
networkConfig.forking,
9292
cachePath,
9393
resolveConfigurationVariable,
9494
),
95-
hardfork: resolveHardfork(
96-
networkConfig.hardfork,
97-
networkConfig.chainType,
98-
networkConfig.enableTransientStorage,
99-
),
95+
hardfork: resolveHardfork(networkConfig.hardfork, networkConfig.chainType),
10096
initialBaseFeePerGas: resolveInitialBaseFeePerGas(
10197
networkConfig.initialBaseFeePerGas,
10298
),
@@ -275,7 +271,6 @@ export async function resolveChainDescriptors(
275271
export function resolveHardfork(
276272
hardfork: string | undefined,
277273
chainType: ChainType | undefined = GENERIC_CHAIN_TYPE,
278-
_enableTransientStorage: boolean | undefined,
279274
): string {
280275
if (hardfork !== undefined) {
281276
return hardfork;

v-next/hardhat/src/internal/builtin-plugins/network-manager/type-extensions/config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ declare module "../../../../types/config.js" {
108108
allowUnlimitedContractSize?: boolean;
109109
blockGasLimit?: number | bigint;
110110
coinbase?: string;
111-
enableTransientStorage?: boolean;
112111
forking?: EdrNetworkForkingUserConfig;
113112
hardfork?: string;
114113
initialBaseFeePerGas?: number | bigint;
@@ -248,7 +247,6 @@ declare module "../../../../types/config.js" {
248247
allowUnlimitedContractSize: boolean;
249248
blockGasLimit: bigint;
250249
coinbase: Uint8Array;
251-
enableTransientStorage: boolean;
252250
forking?: EdrNetworkForkingConfig;
253251
hardfork: string;
254252
initialBaseFeePerGas?: bigint;

v-next/hardhat/src/internal/builtin-plugins/network-manager/type-validation.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ const edrNetworkUserConfigSchema = z.object({
304304
allowUnlimitedContractSize: z.optional(z.boolean()),
305305
blockGasLimit: z.optional(gasUnitUserConfigSchema),
306306
coinbase: z.optional(z.string()),
307-
enableTransientStorage: z.optional(z.boolean()),
308307
forking: z.optional(edrNetworkForkingUserConfigSchema),
309308
hardfork: z.optional(z.string()),
310309
initialBaseFeePerGas: z.optional(gasUnitUserConfigSchema),
@@ -334,7 +333,6 @@ function refineEdrNetworkUserConfig(
334333
hardfork,
335334
minGasPrice,
336335
initialBaseFeePerGas,
337-
enableTransientStorage,
338336
} = networkConfig;
339337

340338
if (hardfork !== undefined && !isValidHardforkName(hardfork, chainType)) {
@@ -366,25 +364,6 @@ function refineEdrNetworkUserConfig(
366364
});
367365
}
368366
}
369-
370-
if (
371-
!hardforkGte(resolvedHardfork, L1HardforkName.CANCUN, chainType) &&
372-
enableTransientStorage === true
373-
) {
374-
ctx.addIssue({
375-
code: z.ZodIssueCode.custom,
376-
message: `'enableTransientStorage' is not supported for hardforks before 'cancun'. Please use a hardfork from 'cancun' onwards to enable this feature.`,
377-
});
378-
}
379-
if (
380-
hardforkGte(resolvedHardfork, L1HardforkName.CANCUN, chainType) &&
381-
enableTransientStorage === false
382-
) {
383-
ctx.addIssue({
384-
code: z.ZodIssueCode.custom,
385-
message: `'enableTransientStorage' must be enabled for hardforks 'cancun' or later. To disable this feature, use a hardfork before 'cancun'.`,
386-
});
387-
}
388367
}
389368

390369
if (

v-next/hardhat/test/internal/builtin-plugins/network-manager/config-resolution.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ describe("config-resolution", () => {
123123
allowBlocksWithSameTimestamp: true,
124124
allowUnlimitedContractSize: true,
125125
blockGasLimit: 20_000_000,
126-
enableTransientStorage: true,
127126
initialDate: new Date(),
128127
loggingEnabled: true,
129128
minGasPrice: 10,
@@ -157,10 +156,6 @@ describe("config-resolution", () => {
157156
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- cast for testing
158157
BigInt(userConfig.blockGasLimit as number),
159158
);
160-
assert.equal(
161-
edrNetworkConfig.enableTransientStorage,
162-
userConfig.enableTransientStorage,
163-
);
164159
assert.equal(edrNetworkConfig.initialDate, userConfig.initialDate);
165160
assert.equal(edrNetworkConfig.loggingEnabled, userConfig.loggingEnabled);
166161
assert.equal(
@@ -200,7 +195,6 @@ describe("config-resolution", () => {
200195
assert.equal(edrNetworkConfig.allowBlocksWithSameTimestamp, false);
201196
assert.equal(edrNetworkConfig.allowUnlimitedContractSize, false);
202197
assert.equal(edrNetworkConfig.blockGasLimit, 30_000_000n);
203-
assert.equal(edrNetworkConfig.enableTransientStorage, false);
204198
const initialDate = new Date(edrNetworkConfig.initialDate);
205199
assert.ok(
206200
Math.abs(initialDate.getTime() - now.getTime()) < 1000,
@@ -770,25 +764,21 @@ describe("config-resolution", () => {
770764

771765
describe("resolveHardfork", () => {
772766
it("should return the hardfork if it is provided", () => {
773-
let hardfork = resolveHardfork(
774-
L1HardforkName.LONDON,
775-
L1_CHAIN_TYPE,
776-
true,
777-
);
767+
let hardfork = resolveHardfork(L1HardforkName.LONDON, L1_CHAIN_TYPE);
778768
assert.equal(hardfork, L1HardforkName.LONDON);
779769

780-
hardfork = resolveHardfork(L1HardforkName.LONDON, L1_CHAIN_TYPE, false);
770+
hardfork = resolveHardfork(L1HardforkName.LONDON, L1_CHAIN_TYPE);
781771
assert.equal(hardfork, L1HardforkName.LONDON);
782772
});
783773

784774
it("should return the current hardfork if no hardfork is provided", () => {
785-
let hardfork = resolveHardfork(undefined, L1_CHAIN_TYPE, true);
775+
let hardfork = resolveHardfork(undefined, L1_CHAIN_TYPE);
786776
assert.equal(hardfork, getCurrentHardfork(L1_CHAIN_TYPE));
787777

788-
hardfork = resolveHardfork(undefined, undefined, true);
778+
hardfork = resolveHardfork(undefined, undefined);
789779
assert.equal(hardfork, getCurrentHardfork(L1_CHAIN_TYPE));
790780

791-
hardfork = resolveHardfork(undefined, OPTIMISM_CHAIN_TYPE, true);
781+
hardfork = resolveHardfork(undefined, OPTIMISM_CHAIN_TYPE);
792782
assert.equal(hardfork, getCurrentHardfork(OPTIMISM_CHAIN_TYPE));
793783
});
794784
});

v-next/hardhat/test/internal/builtin-plugins/network-manager/network-manager.ts

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,72 +1878,6 @@ describe("NetworkManagerImplementation", () => {
18781878
});
18791879
});
18801880

1881-
describe("enableTransientStorage", () => {
1882-
describe("edr config", () => {
1883-
it("should validate a valid network config", async () => {
1884-
let validationErrors = await validateNetworkUserConfig(
1885-
edrConfig({ enableTransientStorage: true }),
1886-
);
1887-
1888-
assertValidationErrors(validationErrors, []);
1889-
1890-
validationErrors = await validateNetworkUserConfig(
1891-
edrConfig({ enableTransientStorage: false, hardfork: "berlin" }),
1892-
);
1893-
1894-
assertValidationErrors(validationErrors, []);
1895-
});
1896-
1897-
it("should not validate an invalid network config", async () => {
1898-
let validationErrors = await validateNetworkUserConfig(
1899-
edrConfig({ enableTransientStorage: true, hardfork: "berlin" }),
1900-
);
1901-
1902-
assertValidationErrors(validationErrors, [
1903-
{
1904-
path: ["networks", "hardhat"],
1905-
message:
1906-
"'enableTransientStorage' is not supported for hardforks before 'cancun'. Please use a hardfork from 'cancun' onwards to enable this feature.",
1907-
},
1908-
]);
1909-
1910-
validationErrors = await validateNetworkUserConfig(
1911-
edrConfig({ enableTransientStorage: false, hardfork: "cancun" }),
1912-
);
1913-
1914-
assertValidationErrors(validationErrors, [
1915-
{
1916-
path: ["networks", "hardhat"],
1917-
message:
1918-
"'enableTransientStorage' must be enabled for hardforks 'cancun' or later. To disable this feature, use a hardfork before 'cancun'.",
1919-
},
1920-
]);
1921-
1922-
validationErrors = await validateNetworkUserConfig(
1923-
edrConfig({ enableTransientStorage: "incorrect" }),
1924-
);
1925-
1926-
assertValidationErrors(validationErrors, [
1927-
{
1928-
path: ["networks", "hardhat", "enableTransientStorage"],
1929-
message: "Expected boolean, received string",
1930-
},
1931-
]);
1932-
1933-
validationErrors = await validateNetworkUserConfig(
1934-
edrConfig({ enableTransientStorage: "incorrect" }),
1935-
);
1936-
1937-
assertValidationErrors(validationErrors, [
1938-
{
1939-
path: ["networks", "hardhat", "enableTransientStorage"],
1940-
message: "Expected boolean, received string",
1941-
},
1942-
]);
1943-
});
1944-
});
1945-
});
1946-
19471881
describe("forking", () => {
19481882
describe("edr config", () => {
19491883
it("should validate a valid network config", async () => {

0 commit comments

Comments
 (0)