Fix enr loading from disk with cgc (#7754)

N/A


  During building an enr on startup, we weren't using the value in the custody context.
This was resulting in the enr value getting updated when the cgc updates, the change getting persisted, but getting set back to the default on restart.
This PR takes the value explicitly from the custody context.
This commit is contained in:
Pawan Dhananjay
2025-07-17 23:51:11 -05:00
committed by GitHub
parent d6de8a7484
commit 3f06e5dfba
4 changed files with 57 additions and 20 deletions

View File

@@ -38,8 +38,15 @@ pub fn run<E: EthSpec>(matches: &ArgMatches, spec: &ChainSpec) -> Result<(), Str
next_fork_version: genesis_fork_version,
next_fork_epoch: Epoch::max_value(), // FAR_FUTURE_EPOCH
};
let enr = build_enr::<E>(&enr_key, &config, &enr_fork_id, genesis_fork_digest, spec)
.map_err(|e| format!("Unable to create ENR: {:?}", e))?;
let enr = build_enr::<E>(
&enr_key,
&config,
&enr_fork_id,
None,
genesis_fork_digest,
spec,
)
.map_err(|e| format!("Unable to create ENR: {:?}", e))?;
fs::create_dir_all(&output_dir).map_err(|e| format!("Unable to create output-dir: {:?}", e))?;