Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The init script does not process the override parameter, which may cause inconsistent configuration variables between internal modules.

オープン
#109 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
shell
領域
devops

調査の方向性

まず init script の geth init コマンドと run script の override パラメータを比較し、次にエントリポイント initGenesis を読んで、それらの値がどのように保存されるかを確認します。関連する override が一貫して処理されるように初期化フローを更新し、genesis 設定がノードの実行時に使用される値と一致することを検証します。

索引モデルが issue の本文から書いたものです。

説明

The init script is below:

if  [ $i -eq 0 ] ; then
                ${workspace}/bin/geth --datadir ${workspace}/.local/node${i} init --state.scheme ${stateScheme} --db.engine ${dbEngine} ${workspace}/genesis/genesis.json  > "${initLog}" 2>&1
        elif  [ $i -eq 1 ] ; then
            ${workspace}/bin/geth --datadir ${workspace}/.local/node${i} init --state.scheme path --db.engine pebble --multidatabase ${workspace}/genesis/genesis.json  > "${initLog}" 2>&1
        else
            ${workspace}/bin/geth --datadir ${workspace}/.local/node${i} init --state.scheme path --db.engine pebble ${workspace}/genesis/genesis.json  > "${initLog}" 2>&1
        fi

The run script is below:

nohup  ${workspace}/.local/node${i}/geth${i} --config ${workspace}/.local/node${i}/config.toml \
            --mine --vote --password ${workspace}/.local/node${i}/password.txt --unlock ${cons_addr} --miner.etherbase ${cons_addr} --blspassword ${workspace}/.local/node${i}/password.txt \
            --datadir ${workspace}/.local/node${i} \
           ...
            --rialtohash ${rialtoHash} **--override.passedforktime ${PassedForkTime} --override.lorentz ${PassedForkTime} --override.maxwell** ${LastHardforkTime} \
            --override.immutabilitythreshold ${FullImmutabilityThreshold} --override.breatheblockinterval ${BreatheBlockInterval} \
            --override.minforblobrequest ${MinBlocksForBlobRequests} --override.defaultextrareserve ${DefaultExtraReserveForBlobRequests} \
            >> ${workspace}/.local/node${i}/bsc-node.log 2>&1 &

The initGenesis code is below:

// initGenesis will initialise the given JSON format genesis file and writes it as
// the zero'd block (i.e. genesis) or will fail hard if it can't succeed.
func initGenesis(ctx *cli.Context) error {
	if ctx.Args().Len() != 1 {
		utils.Fatalf("need genesis.json file as the only argument")
	}
       ...

	var overrides core.ChainOverrides
	if ctx.IsSet(utils.OverridePassedForkTime.Name) {
		v := ctx.Uint64(utils.OverridePassedForkTime.Name)
		overrides.OverridePassedForkTime = &v
	}
	if ctx.IsSet(utils.OverrideLorentz.Name) {
		v := ctx.Uint64(utils.OverrideLorentz.Name)
		overrides.OverrideLorentz = &v
	}
	if ctx.IsSet(utils.OverrideMaxwell.Name) {
		v := ctx.Uint64(utils.OverrideMaxwell.Name)
		overrides.OverrideMaxwell = &v
	}
	if ctx.IsSet(utils.OverrideFermi.Name) {
		v := ctx.Uint64(utils.OverrideFermi.Name)
		overrides.OverrideFermi = &v
	}
	if ctx.IsSet(utils.OverrideVerkle.Name) {
		v := ctx.Uint64(utils.OverrideVerkle.Name)
		overrides.OverrideVerkle = &v
	}
       ...

	_, hash, _, err := core.SetupGenesisBlockWithOverride(chaindb, triedb, genesis, &overrides)
	if err != nil {
		utils.Fatalf("Failed to write genesis block: %v", err)
	}
	log.Info("Successfully wrote genesis state", "database", name, "hash", hash.String())
	return nil
}

This method handles the override parameter, but it is not passed in the script.The init script will write the configuration to the genesis block. When the node is running, if some modules read the genesis block configuration in the db, and some modes use the configuration in the running parameters, it may cause inconsistent data reading and writing.

主要言語
Shell
スター
70
フォーク
62
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bnb-chain/node-deploy のほかの issue

bnb-chain/node-deploy の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。