Skip to content
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

Merged
merged 7 commits into from
Oct 17, 2023

Conversation

nikurt
Copy link
Contributor

@nikurt nikurt commented Oct 16, 2023

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:

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

@nikurt nikurt requested a review from a team as a code owner October 16, 2023 14:37
@nikurt nikurt requested a review from wacban October 16, 2023 14:37
nikurt and others added 4 commits October 16, 2023 16:39
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
wacban
wacban previously approved these changes Oct 17, 2023
Copy link
Contributor

@wacban wacban left a 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(
Copy link
Contributor

Choose a reason for hiding this comment

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

Seem unrelated, merge artifact?

Copy link
Contributor Author

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 })
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@nikurt
Copy link
Contributor Author

nikurt commented Oct 17, 2023

Thanks @wacban
Rebased, added a TODO, please take a look.

Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

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

Thanks!

@nikurt nikurt added this pull request to the merge queue Oct 17, 2023
Merged via the queue into master with commit 93ebfb6 Oct 17, 2023
10 checks passed
@nikurt nikurt deleted the nikurt-protocol-config branch October 17, 2023 14:32
nikurt added a commit that referenced this pull request Oct 18, 2023
…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>
nikurt added a commit that referenced this pull request Oct 20, 2023
…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>
nikurt added a commit that referenced this pull request Oct 20, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong genesis config in EXPEIMENTAL_protocol_config
3 participants