config: apply default value for Eth.Miner option in config.toml#3022
Merged
zzzckck merged 1 commit intobnb-chain:developfrom Apr 14, 2025
Merged
config: apply default value for Eth.Miner option in config.toml#3022zzzckck merged 1 commit intobnb-chain:developfrom
zzzckck merged 1 commit intobnb-chain:developfrom
Conversation
MatusKysel
approved these changes
Apr 14, 2025
zlacfzy
approved these changes
Apr 14, 2025
galaio
approved these changes
Apr 14, 2025
buddh0
approved these changes
Apr 14, 2025
zzzckck
added a commit
to zzzckck/bsc
that referenced
this pull request
Apr 14, 2025
…ml (bnb-chain#3022)" This reverts commit 84feb02.
forcodedancing
pushed a commit
to forcodedancing/bsc
that referenced
this pull request
Apr 21, 2025
forcodedancing
pushed a commit
to forcodedancing/bsc
that referenced
this pull request
Apr 21, 2025
…ml (bnb-chain#3022)" (bnb-chain#3024) This reverts commit 84feb02.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
To simplify the configuration of config.toml file, node operators can just leave some options empty if they just want the default value.
For more background, pls refer: #2986
The above 2 new files are generated by:
Rationale
R1: Why use pointer instead of zero value check
Generally, pointer value is preferable to avoid initialising unset variable. It will be nil pointer, instead of a zero-value.
Sometime we just can't tell if the zero-value decoded from the TOML file was set by user specifically or not.
For example, Alice sets the "maxPoolSize" to "0" in config.toml to disable the pool, it's better not to be taken as Alice want the default value.
Example
a.Current Problem
case 1:
DelayLeftOverof[Eth.Miner]in config.tomlDelayLeftOverhas default value of50000000, before the PR, it has to be configured specifically, like:If user creates the
[Eth.Miner], withoutDelayLeftOver, like:then
DelayLeftOverwill be set to 0, which is unexpected.case 2:
NoInterruptLeftOverof[Eth.Miner.Mev]in config.tomlNoInterruptLeftOverhas the default value of400000000, before the PR, it has to be configured specifically, like:If user creates the
[Eth.Miner.Mev], withoutDelayLeftOver, like:then
NoInterruptLeftOverwill be set to 0, which is unexpected.b.After this PR
DelayLeftOverandNoInterruptLeftOvercan be skipped and they will have the default value respectively.Changes
NA