Skip to content

Commit 82337a8

Browse files
committed
Add enableRip7212 option to HH network config
1 parent 0281183 commit 82337a8

File tree

6 files changed

+11
-1
lines changed

6 files changed

+11
-1
lines changed

docs/src/content/hardhat-network/docs/reference/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ The `baseFeePerGas` of the first block. Note that when forking a remote network,
122122

123123
The address used as coinbase in new blocks. Default value: `"0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e"`.
124124

125+
#### `enableRip7212`
126+
127+
A flag indicating whether to enable [RIP-7212 (Precompile for secp256r1 Curve Support)](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md). Default value: `false`.
128+
125129
### Mining modes
126130

127131
You can configure the mining behavior under your Hardhat Network settings:

packages/hardhat-core/src/internal/core/providers/construction.ts

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export async function createProvider(
114114
paths !== undefined ? getForkCacheDirPath(paths) : undefined,
115115
enableTransientStorage:
116116
hardhatNetConfig.enableTransientStorage ?? false,
117+
enableRip7212: hardhatNetConfig.enableRip7212 ?? false,
117118
},
118119
{
119120
enabled: hardhatNetConfig.loggingEnabled,

packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ interface HardhatNetworkProviderConfig {
120120
forkConfig?: ForkConfig;
121121
forkCachePath?: string;
122122
enableTransientStorage: boolean;
123+
enableRip7212: boolean;
123124
}
124125

125126
export function getNodeConfig(
@@ -255,7 +256,7 @@ export class EdrProviderWrapper
255256
}),
256257
cacheDir: config.forkCachePath,
257258
coinbase: Buffer.from(coinbase.slice(2), "hex"),
258-
enableRip7212: false,
259+
enableRip7212: config.enableRip7212,
259260
fork,
260261
hardfork: ethereumsjsHardforkToEdrSpecId(hardforkName),
261262
genesisAccounts: config.genesisAccounts.map((account) => {

packages/hardhat-core/src/types/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export interface HardhatNetworkUserConfig {
5858
coinbase?: string;
5959
chains?: HardhatNetworkChainsUserConfig;
6060
enableTransientStorage?: boolean;
61+
enableRip7212?: boolean;
6162
}
6263

6364
export type HardhatNetworkAccountsUserConfig =
@@ -155,6 +156,7 @@ export interface HardhatNetworkConfig {
155156
chains: HardhatNetworkChainsConfig;
156157
allowBlocksWithSameTimestamp?: boolean;
157158
enableTransientStorage?: boolean;
159+
enableRip7212?: boolean;
158160
}
159161

160162
export type HardhatNetworkAccountsConfig =

packages/hardhat-core/test/internal/hardhat-network/helpers/useProvider.ts

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export function useProvider({
101101
coinbase,
102102
allowBlocksWithSameTimestamp,
103103
enableTransientStorage: false,
104+
enableRip7212: false,
104105
},
105106
{
106107
enabled: loggerEnabled,

packages/hardhat-core/test/internal/hardhat-network/stack-traces/execution.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export async function instantiateProvider(
5353
coinbase: "0x0000000000000000000000000000000000000000",
5454
initialBaseFeePerGas: 0,
5555
enableTransientStorage: false,
56+
enableRip7212: false,
5657
};
5758

5859
const provider = await EdrProviderWrapper.create(

0 commit comments

Comments
 (0)