-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: EXPERIMENTAL_protocol_config applies overrides from EpochConfig #9692
Conversation
People with M1 Macs run the neard node too, not just the test suites. Unfortunately a proper regression test for this is not obvious… I’ll think about it. (Possibly) Fixes #9665
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase or merge first.
LGTM
@@ -39,10 +39,9 @@ impl RuntimeConfig { | |||
|
|||
pub fn test() -> Self { | |||
let config_store = super::config_store::RuntimeConfigStore::new(None); | |||
let mut wasm_config = near_vm_runner::logic::Config::clone( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seem unrelated, merge artifact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, resolved by rebasing.
epoch_config.validator_selection_config.minimum_validators_per_shard; | ||
genesis_config.minimum_stake_ratio = | ||
epoch_config.validator_selection_config.minimum_stake_ratio; | ||
|
||
let runtime_config = | ||
self.runtime_config_store.get_config(protocol_version).as_ref().clone(); | ||
Ok(ProtocolConfig { genesis_config, runtime_config }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just return the epoch config? It doesn't make much sense to copy all of the fields over from one struct to another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return the epoch config
That would probably be a better RPC design 🤔
I'd like to keep the scope of this PR to be a bug fix.
Added a TODO in the code to consider a backwards-incompatible change of ProtocolConfigView
.
Thanks @wacban |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…9692) Testing this PR on a testnet node, the diff with results from an rpc node is the following. Both changes look good to me. ``` 10c10 < "chunk_producer_kickout_threshold": 90, --- > "chunk_producer_kickout_threshold": 80, 28c28 < "num_block_producer_seats": 200, --- > "num_block_producer_seats": 100, ``` Proofs: * https://github.com/near/nearcore/blob/a5238cc70e268fe6da218c8367b053d53711ac6f/core/primitives/src/epoch_manager.rs#L134 * https://github.com/near/nearcore/blob/6f324e84a7a7162956f0b9985094ee146919f5ae/core/primitives/src/epoch_manager.rs#L149 Fix #9553 Also adds new fields to the response: * shard_layout * num_chunk_only_producer_seats * minimum_validators_per_shard * minimum_stake_ratio * max_kickout_stake_perc --------- Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me>
…9692) Testing this PR on a testnet node, the diff with results from an rpc node is the following. Both changes look good to me. ``` 10c10 < "chunk_producer_kickout_threshold": 90, --- > "chunk_producer_kickout_threshold": 80, 28c28 < "num_block_producer_seats": 200, --- > "num_block_producer_seats": 100, ``` Proofs: * https://github.com/near/nearcore/blob/a5238cc70e268fe6da218c8367b053d53711ac6f/core/primitives/src/epoch_manager.rs#L134 * https://github.com/near/nearcore/blob/6f324e84a7a7162956f0b9985094ee146919f5ae/core/primitives/src/epoch_manager.rs#L149 Fix #9553 Also adds new fields to the response: * shard_layout * num_chunk_only_producer_seats * minimum_validators_per_shard * minimum_stake_ratio * max_kickout_stake_perc --------- Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me>
…9692) Testing this PR on a testnet node, the diff with results from an rpc node is the following. Both changes look good to me. ``` 10c10 < "chunk_producer_kickout_threshold": 90, --- > "chunk_producer_kickout_threshold": 80, 28c28 < "num_block_producer_seats": 200, --- > "num_block_producer_seats": 100, ``` Proofs: * https://github.com/near/nearcore/blob/a5238cc70e268fe6da218c8367b053d53711ac6f/core/primitives/src/epoch_manager.rs#L134 * https://github.com/near/nearcore/blob/6f324e84a7a7162956f0b9985094ee146919f5ae/core/primitives/src/epoch_manager.rs#L149 Fix #9553 Also adds new fields to the response: * shard_layout * num_chunk_only_producer_seats * minimum_validators_per_shard * minimum_stake_ratio * max_kickout_stake_perc --------- Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me>
Testing this PR on a testnet node, the diff with results from an rpc node is the following. Both changes look good to me.
Proofs:
nearcore/core/primitives/src/epoch_manager.rs
Line 134 in a5238cc
nearcore/core/primitives/src/epoch_manager.rs
Line 149 in 6f324e8
Fix #9553
Also adds new fields to the response: