feat(eth,miner): wire miner gas tip updates from RPC #28933#2136
feat(eth,miner): wire miner gas tip updates from RPC #28933#2136gzliudan wants to merge 2 commits intoXinFinOrg:dev-upgradefrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Synchronizes miner gas tip (RPC miner_setGasPrice) updates across the txpool and miner, while refactoring mining configuration into a dedicated ethconfig.Config.Miner struct and removing the previous global gas limit target.
Changes:
- Wire RPC gas price updates to both
TxPool.SetGasTipand a new minerSetGasTippath. - Introduce
miner.Config(Etherbase/ExtraData/GasCeil/GasPrice), migrate CLI + TOML config toethconfig.Config.Miner, and sanitize miner config ineth.New. - Replace the removed
params.TargetGasLimitusage withMiner.GasCeilin block building/tests.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| params/protocol_params.go | Adjusts XDCGenesisGasLimit and removes TargetGasLimit global. |
| miner/worker.go | Refactors worker to use miner.Config, adds tip storage and setter, updates tx commit call signature. |
| miner/miner.go | Adds miner.Config + defaults; exposes Miner.SetGasTip. |
| eth/ethconfig/gen_config.go | Updates TOML marshal/unmarshal to include Config.Miner. |
| eth/ethconfig/config.go | Moves mining-related settings under Config.Miner; updates defaults and go:generate. |
| eth/backend.go | Uses Config.Miner.* and adds sanitization for miner gas ceil/price. |
| eth/api_miner.go | Updates RPC gas price setter to also notify the miner. |
| core/chain_makers.go | Replaces TargetGasLimit usage with XDCGenesisGasLimit. |
| core/bench_test.go | Replaces TargetGasLimit usage with XDCGenesisGasLimit. |
| console/console_test.go | Updates test config construction to set Miner.Etherbase. |
| cmd/utils/flags.go | Routes miner flags into cfg.Miner (new setMiner) and updates defaults. |
| cmd/XDC/main.go | Removes runtime mutation of params.TargetGasLimit. |
| accounts/abi/bind/v2/util_test.go | Adjusts test gas price offset to params.GWei. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fa6170e to
03e760e
Compare
Miner configuration is unified under [Eth.Miner] (GasCeil/GasPrice/Etherbase/ExtraData), replacing legacy top-level [Eth] miner keys. Operational impact: existing config files using [Eth].GasPrice/[Eth].Etherbase/[Eth].ExtraData must be migrated before upgrade. Behavior update: gasprice=0 remains valid; only negative gas prices are sanitized at startup. Default change: XDCGenesisGasLimit is reduced to 42,000,000 and now feeds miner default GasCeil (including default --miner-gaslimit), so nodes relying on defaults should review capacity expectations.
Synchronize miner gas tip updates across subsystems when RPC updates gas price. - update eth miner API to apply gas tip changes to both txpool and miner - add miner/worker SetGasTip path and initialize worker tip from config - adjust bind util test to use params.GWei over base fee Ref: ethereum#28933
03e760e to
533b383
Compare
Proposed changes
Synchronize miner gas tip updates across subsystems when RPC updates gas price.
Ref: ethereum#28933
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that