Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Genesis config patch#9

Draft
mercepluka wants to merge 28 commits intomasterfrom
genesis-config-patch
Draft

Genesis config patch#9
mercepluka wants to merge 28 commits intomasterfrom
genesis-config-patch

Conversation

@mercepluka
Copy link

@mercepluka mercepluka commented Jun 13, 2023

This is tested on localnet and the patch is applied correctly for the gas_limit and num_block_producer_seats field, other fields that are not mentioned stayed the same. Also, when omitting the "--patch-config" flag or passing false as a value patching of the genesis is skipped.

This PR is published like this just for internal review before publishing it to near nearcore github.

The chain config store will be implemented in the next PR and will be published to near nearcore separately.

@mercepluka mercepluka self-assigned this Jun 13, 2023
@mercepluka mercepluka requested a review from medicz June 13, 2023 18:39
Comment on lines +16 to +51
pub num_block_producer_seats: Option<NumSeats>,
pub num_block_producer_seats_per_shard: Option<Vec<NumSeats>>,
pub avg_hidden_validator_seats_per_shard: Option<Vec<NumSeats>>,
pub dynamic_resharding: Option<bool>,
pub protocol_upgrade_stake_threshold: Option<Rational32>,
pub epoch_length: Option<BlockHeightDelta>,
pub gas_limit: Option<Gas>,
#[serde(with = "dec_format")]
#[serde(default)]
pub min_gas_price: Option<Balance>,
#[serde(with = "dec_format")]
#[serde(default)]
pub max_gas_price: Option<Balance>,
pub block_producer_kickout_threshold: Option<u8>,
pub chunk_producer_kickout_threshold: Option<u8>,
pub online_min_threshold: Option<Rational32>,
pub online_max_threshold: Option<Rational32>,
pub gas_price_adjustment_rate: Option<Rational32>,
pub validators: Option<Vec<AccountInfo>>,
pub transaction_validity_period: Option<NumBlocks>,
pub protocol_reward_rate: Option<Rational32>,
pub max_inflation_rate: Option<Rational32>,
#[serde(with = "dec_format")]
#[serde(default)]
pub total_supply: Option<Balance>,
pub num_blocks_per_year: Option<NumBlocks>,
pub protocol_treasury_account: Option<AccountId>,
#[serde(with = "dec_format")]
#[serde(default)]
pub fishermen_threshold: Option<Balance>,
pub minimum_stake_divisor: Option<u64>,
pub shard_layout: Option<ShardLayout>,
pub num_chunk_only_producer_seats: Option<NumSeats>,
pub minimum_validators_per_shard: Option<NumSeats>,
pub max_kickout_stake_perc: Option<u8>,
pub minimum_stake_ratio: Option<Rational32>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: order properties alphabetically by name to improve readability

Btw, some of the fields from initial GenesisConfig are ommitted, how did you choose which to include in the patch?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the order, I would prefer that order is the same as in the original genesis config struct. I do not have any preferences in fields being in alphabetical or current order. I can change it in both structs, but my guess is that they are ok with the current order of fields. Probably @mhalambek would know more about this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have omitted the first 4 fields from the original genesis config struct (protocol_version, genesis_time, chain_id, and genesis_height).

I have omitted them because it seemed to me that Calimero (or similar Near forks) would not use override of those fields as discussed earlier with Hala. I have no strong preference here, I can also include all fields for the simplicity

@mercepluka mercepluka requested a review from ijerkovic June 14, 2023 09:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants