Repository navigation
fix(deploy): pass fork override flags to geth init - #135
Open
mavis-codee wants to merge 1 commit into
Open
mavis-codee wants to merge 1 commit into
mavis-codee wants to merge 1 commit into
Conversation
The five geth init invocations did not receive the fork --override.* flags that the run commands use, so the chain config written into the genesis database could diverge from the runtime chain config. Align init with the run-side fork override set: passedforktime, lorentz, maxwell, fermi, osaka, mendel, pasteur, jenner. Variables follow the run side (PassedForkTime from node0 hardforkTime.txt, LastHardforkTime = PassedForkTime + LAST_FORK_MORE_DELAY). The four runtime-only overrides (immutabilitythreshold, breatheblockinterval, minforblobrequest, defaultextrareserve) are not registered on the init subcommand in bnb-chain/bsc and are not consumed by initGenesis, so they are intentionally omitted. Refs bnb-chain#109
Pull Request ReviewThis PR updates BSC/geth deployment scripts so all five genesis initialization commands receive the same fork-time override flags used when running nodes. It also loads Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
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.
Root cause
The five
geth ... initinvocations did not pass the fork--override.*flags that the run commands use, soinitGenesiscould write a chain config into the genesis database that diverges from the runtime chain config (#109).Change
Add the run-side fork override set to all five
geth ... initcalls. Flag order and variables match the run side.bsc_cluster.shinit(--state.scheme ${stateScheme} --db.engine ${dbEngine})bsc_cluster.shinit(--state.scheme path --db.engine pebble)bsc_cluster.shinitbsc_cluster.shinitbsc_fullnode.shinitFlags added:
bsc_cluster.shinitNetwork()now sourcesPassedForkTime/LastHardforkTimethe same way asnative_start()(node0/hardforkTime.txt+LAST_FORK_MORE_DELAY).bsc_fullnode.shalready had both variables at script scope.Flags intentionally not added
The run side also passes
--override.immutabilitythreshold,--override.breatheblockinterval,--override.minforblobrequest, and--override.defaultextrareserve.These four are not accepted by the
initsubcommand:initCommand.Flagsincmd/geth/chaincmd.go(bnb-chain/bscorigin/master4bd1c73, local checkout identical) registers onlyOverridePassedForkTime,OverrideLorentz,OverrideMaxwell,OverrideFermi,OverrideOsaka,OverrideMendel,OverridePasteur,OverrideJenner,OverrideBPO1,OverrideBPO2,OverrideUBT, plusutils.DatabaseFlags.initGenesisreads only those fork overrides intocore.ChainOverrides; the four runtime flags are applied inSetEthConfig/makeFullNodeand are not written into genesis.initfails withflag provided but not defined(urfave/cli v2.27.5).Verification
bash -n bsc_cluster.sh→ exit 0bash -n bsc_fullnode.sh→ exit 0initlines plus the two variable-source lines ininitNetwork().Refs #109