Skip to content

fix(deploy): pass fork override flags to geth init - #135

Open
mavis-codee wants to merge 1 commit into
bnb-chain:mainfrom
mavis-codee:fix/init-override-params
Open

mavis-codee wants to merge 1 commit into
bnb-chain:mainfrom
mavis-codee:fix/init-override-params

Conversation

@mavis-codee

Copy link
Copy Markdown

Root cause

The five geth ... init invocations did not pass the fork --override.* flags that the run commands use, so initGenesis could 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 ... init calls. Flag order and variables match the run side.

# File Line (after patch) Site
1 bsc_cluster.sh L173 validator0 init (--state.scheme ${stateScheme} --db.engine ${dbEngine})
2 bsc_cluster.sh L175 validator>0 init (--state.scheme path --db.engine pebble)
3 bsc_cluster.sh L182 sentry init
4 bsc_cluster.sh L190 fullnode0 init
5 bsc_fullnode.sh L46 standalone fullnode init

Flags added:

--override.passedforktime ${PassedForkTime}
--override.lorentz ${PassedForkTime}
--override.maxwell ${PassedForkTime}
--override.fermi ${PassedForkTime}
--override.osaka ${PassedForkTime}
--override.mendel ${PassedForkTime}
--override.pasteur ${PassedForkTime}
--override.jenner ${LastHardforkTime}

bsc_cluster.sh initNetwork() now sources PassedForkTime / LastHardforkTime the same way as native_start() (node0/hardforkTime.txt + LAST_FORK_MORE_DELAY). bsc_fullnode.sh already 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 init subcommand:

  • initCommand.Flags in cmd/geth/chaincmd.go (bnb-chain/bsc origin/master 4bd1c73, local checkout identical) registers only OverridePassedForkTime, OverrideLorentz, OverrideMaxwell, OverrideFermi, OverrideOsaka, OverrideMendel, OverridePasteur, OverrideJenner, OverrideBPO1, OverrideBPO2, OverrideUBT, plus utils.DatabaseFlags.
  • initGenesis reads only those fork overrides into core.ChainOverrides; the four runtime flags are applied in SetEthConfig / makeFullNode and are not written into genesis.
  • Passing them after init fails with flag provided but not defined (urfave/cli v2.27.5).

Verification

  • bash -n bsc_cluster.sh → exit 0
  • bash -n bsc_fullnode.sh → exit 0
  • Diff limited to the two scripts; only the five init lines plus the two variable-source lines in initNetwork().
  • Not run on a real machine (no Linux/geth runtime available). Genesis-level effect was not executed.

Refs #109

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
@hashdit-bot

hashdit-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

Pull Request Review

This 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 PassedForkTime and derives LastHardforkTime in bsc_cluster.sh before initializing validator, sentry, and full-node databases, preventing initialization and runtime chain configurations from diverging.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant