Skip to content

Commit 9784c82

Browse files
authored
chore: modify custom components for custom start (#71)
* upgrade process * clippy * fix: reorder mint_admin field in ChainspecEvolveConfig and EvolvePayloadBuilderConfig for consistency * feat: add mint precompile admin and activation height to genesis config
1 parent 28a825d commit 9784c82

File tree

12 files changed

+405
-58
lines changed

12 files changed

+405
-58
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ Add an `evolve` stanza to your chainspec under the `config` section:
223223
"config": {
224224
...,
225225
"evolve": {
226-
"baseFeeSink": "0xYourRecipientAddressHere"
226+
"baseFeeSink": "0xYourRecipientAddressHere",
227+
"baseFeeRedirectActivationHeight": 0
227228
}
228229
}
229230
```
@@ -233,13 +234,18 @@ Rebuild (or restart) the node with the updated chainspec so the payload builder
233234
You can see a working example in `etc/ev-reth-genesis.json`, which routes the base fee to
234235
`0x00000000000000000000000000000000000000fe` by default.
235236

237+
Set `baseFeeRedirectActivationHeight` to the block where the new behavior should begin. Leave it at
238+
`0` for fresh chains that enable the redirect from genesis.
239+
236240
What it does:
241+
237242
- Intercepts the base fee during EVM execution (via the ev-revm handler)
238243
- Credits `base_fee_per_gas * gas_used` to the specified recipient for each transaction
239244
- The redirect happens at the EVM handler level, ensuring the state root reflects the credited balance
240245
- This effectively "unburns" the base fee on your network (Ethereum mainnet keeps burning the base fee by protocol design)
241246

242247
Implementation details:
248+
243249
- Uses the `ev-revm` crate to wrap the EVM with a custom handler
244250
- The handler intercepts the `reward_beneficiary` hook to redirect base fees
245251
- No runtime environment variables are required; the chainspec carries the policy alongside other fork settings
@@ -260,10 +266,12 @@ The txpool RPC extension can be configured with:
260266
- `max_txpool_gas`: Maximum cumulative gas for transactions to return (default: 30,000,000)
261267

262268
Notes:
269+
263270
- Both limits apply together. Selection stops when either cap is reached.
264271
- Set a limit to `0` to disable that constraint.
265272

266273
CLI/env overrides:
274+
267275
- None for txpool gas. The RPC follows the current block gas automatically.
268276

269277
### Gas Limits: Block vs Txpool
@@ -273,6 +281,7 @@ CLI/env overrides:
273281
- Relationship: These limits are aligned by default. Overriding the txpool cap makes them independent again; exact packing still depends on real execution.
274282

275283
Changing limits on a running chain:
284+
276285
- Per-block gas: Set `gasLimit` in Engine API payload attributes to change the block’s gas limit for that payload. Subsequent payloads will default to that new parent header gas limit unless overridden again.
277286
- Txpool gas cap: Follows the head block’s gas limit automatically. There is no fixed-cap override; change your block gas and the RPC alignment follows.
278287

crates/ev-precompiles/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,17 @@ The mint admin is configured in the chain specification. See `crates/node/src/co
133133
"config": {
134134
"chainId": 1234,
135135
"evolve": {
136-
"mintAdmin": "0x1234567890123456789012345678901234567890"
136+
"mintAdmin": "0x1234567890123456789012345678901234567890",
137+
"mintPrecompileActivationHeight": 0
137138
}
138139
}
139140
}
140141
```
141142

142143
If no mint admin is specified, the precompile is still available but will reject all calls.
144+
Set `mintPrecompileActivationHeight` to the block where the precompile should become callable. For
145+
new networks keep it at `0` so the admin is active from genesis; existing chains can use a higher
146+
value to stage upgrades safely.
143147

144148
### Allowlist Management
145149

0 commit comments

Comments
 (0)