@@ -29,72 +29,68 @@ export const PrepareLidoCore = command.cli({
2929 const { constants } = lidoCore . config ;
3030 const { deployer, secondDeployer } = await state . getNamedWallet ( ) ;
3131
32- const filePath = constants . NETWORK_STATE_DEFAULTS_FILE ;
33- const networkStateDefaults = await lidoCore . readJson ( filePath ) ;
32+ const filePath = constants . SCRATCH_DEPLOY_CONFIG ;
33+ const tomlObj : any = await lidoCore . readToml ( filePath ) ;
3434
35- const {
36- vestingParams,
37- daoInitialSettings,
38- oracleDaemonConfig,
39- hashConsensusForAccountingOracle,
40- hashConsensusForValidatorsExitBusOracle,
41- } = networkStateDefaults ;
42- assert ( vestingParams ?. holders , "Missing vestingParams.holders" ) ;
43- assert ( daoInitialSettings ?. voting , "Missing daoInitialSettings.voting" ) ;
44- assert ( oracleDaemonConfig , "Missing oracleDaemonConfig" ) ;
45- assert (
46- hashConsensusForAccountingOracle ,
47- "Missing hashConsensusForAccountingOracle" ,
48- ) ;
49- assert (
50- hashConsensusForValidatorsExitBusOracle ,
51- "Missing hashConsensusForValidatorsExitBusOracle" ,
52- ) ;
35+ const vestingParams = tomlObj . vesting || { } ;
36+ const daoObj = tomlObj . dao || { } ;
37+ const initialSettings = daoObj . initialSettings || { } ;
38+ const daoVoting = initialSettings . voting || { } ;
39+ const oracleDaemonConfig = tomlObj . oracleDaemonConfig || { } ;
40+ const hashConsensusAO = tomlObj . hashConsensusForAccountingOracle || { } ;
41+ const hashConsensusVEBO = tomlObj . hashConsensusForValidatorsExitBusOracle || { } ;
42+
43+ assert ( vestingParams . holders !== undefined , "Missing vestingParams.holders" ) ;
44+ assert ( initialSettings . voting !== undefined , "Missing initialSettings.voting" ) ;
45+ assert ( oracleDaemonConfig !== undefined , "Missing oracleDaemonConfig" ) ;
46+ assert ( oracleDaemonConfig . hashConsensusForAccountingOracle !== undefined , "Missing oracleDaemonConfig.hashConsensusForAccountingOracle" ) ;
47+ assert ( oracleDaemonConfig . hashConsensusForValidatorsExitBusOracle !== undefined , "Missing oracleDaemonConfig.hashConsensusForValidatorsExitBusOracle" ) ;
5348
54- Object . assign ( vestingParams . holders , {
49+ vestingParams . holders = {
50+ ...vestingParams . holders ,
5551 [ deployer . publicKey ] : vesting ,
5652 [ secondDeployer . publicKey ] : vesting ,
57- } ) ;
53+ } ;
5854
59- Object . assign ( daoInitialSettings . voting , {
60- voteDuration,
61- objectionPhaseDuration,
62- } ) ;
55+ daoVoting . voteDuration = voteDuration ;
56+ daoVoting . objectionPhaseDuration = objectionPhaseDuration ;
6357
64- Object . assign ( oracleDaemonConfig , {
65- deployParameters : {
66- NORMALIZED_CL_REWARD_PER_EPOCH : 64 ,
67- NORMALIZED_CL_REWARD_MISTAKE_RATE_BP : 1000 ,
68- REBASE_CHECK_NEAREST_EPOCH_DISTANCE : 1 ,
69- REBASE_CHECK_DISTANT_EPOCH_DISTANCE : 2 ,
70- VALIDATOR_DELAYED_TIMEOUT_IN_SLOTS : 7200 ,
71- VALIDATOR_DELINQUENT_TIMEOUT_IN_SLOTS : 28_800 ,
72- NODE_OPERATOR_NETWORK_PENETRATION_THRESHOLD_BP : 100 ,
73- PREDICTION_DURATION_IN_SLOTS : 50_400 ,
74- FINALIZATION_MAX_NEGATIVE_REBASE_EPOCH_SHIFT : 1350 ,
75- EXIT_EVENTS_LOOKBACK_WINDOW_IN_SLOTS : 100_800
76- } ,
77- } ) ;
58+ oracleDaemonConfig . deployParameters = {
59+ NORMALIZED_CL_REWARD_PER_EPOCH : 64 ,
60+ NORMALIZED_CL_REWARD_MISTAKE_RATE_BP : 1000 ,
61+ REBASE_CHECK_NEAREST_EPOCH_DISTANCE : 1 ,
62+ REBASE_CHECK_DISTANT_EPOCH_DISTANCE : 2 ,
63+ VALIDATOR_DELAYED_TIMEOUT_IN_SLOTS : 7200 ,
64+ VALIDATOR_DELINQUENT_TIMEOUT_IN_SLOTS : 28_800 ,
65+ NODE_OPERATOR_NETWORK_PENETRATION_THRESHOLD_BP : 100 ,
66+ PREDICTION_DURATION_IN_SLOTS : 50_400 ,
67+ FINALIZATION_MAX_NEGATIVE_REBASE_EPOCH_SHIFT : 1350 ,
68+ EXIT_EVENTS_LOOKBACK_WINDOW_IN_SLOTS : 100_800 ,
69+ } ;
7870
7971 const {
8072 HASH_CONSENSUS_AO_EPOCHS_PER_FRAME ,
8173 HASH_CONSENSUS_VEBO_EPOCHS_PER_FRAME ,
8274 } = oracle . config . constants ;
8375
84- Object . assign ( hashConsensusForAccountingOracle , {
85- deployParameters : {
86- fastLaneLengthSlots : 10 ,
87- epochsPerFrame : HASH_CONSENSUS_AO_EPOCHS_PER_FRAME ,
88- } ,
89- } ) ;
76+ hashConsensusAO . deployParameters = {
77+ fastLaneLengthSlots : 10 ,
78+ epochsPerFrame : HASH_CONSENSUS_AO_EPOCHS_PER_FRAME ,
79+ } ;
80+
81+ hashConsensusVEBO . deployParameters = {
82+ fastLaneLengthSlots : 10 ,
83+ epochsPerFrame : HASH_CONSENSUS_VEBO_EPOCHS_PER_FRAME ,
84+ } ;
9085
91- Object . assign ( hashConsensusForValidatorsExitBusOracle , {
92- deployParameters : {
93- fastLaneLengthSlots : 10 ,
94- epochsPerFrame : HASH_CONSENSUS_VEBO_EPOCHS_PER_FRAME ,
95- } ,
96- } ) ;
86+ tomlObj . vesting = vestingParams ;
87+ tomlObj . dao = daoObj ;
88+ tomlObj . dao . initialSettings = initialSettings ;
89+ tomlObj . dao . initialSettings . voting = daoVoting ;
90+ tomlObj . oracleDaemonConfig = oracleDaemonConfig ;
91+ tomlObj . hashConsensusForAccountingOracle = hashConsensusAO ;
92+ tomlObj . hashConsensusForValidatorsExitBusOracle = hashConsensusVEBO ;
9793
98- await lidoCore . writeJson ( filePath , networkStateDefaults , true ) ;
94+ await lidoCore . writeToml ( filePath , tomlObj ) ;
9995 } ,
10096} ) ;
0 commit comments