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

Remove MockEpochManager #10634

Open
pugachAG opened this issue Feb 20, 2024 · 1 comment
Open

Remove MockEpochManager #10634

pugachAG opened this issue Feb 20, 2024 · 1 comment
Labels
C-housekeeping Category: Refactoring, cleanups, code quality

Comments

@pugachAG
Copy link
Contributor

pugachAG commented Feb 20, 2024

Related PRs:
#10598
#10597

@Longarithm
Copy link
Member

For more clarity why it is bad - MockEpochManager::get_epoch_and_valset assumes that it is called sequentially for all blocks on chain, and if it is not the case, it panics on some unwrap inside.

github-merge-queue bot pushed a commit that referenced this issue Feb 27, 2024
Put correct path to this test in nayduck... and comment this test for
now, because it doesn't work with resharding data and
`MockEpochManager`. cc #10634

Later, we either should remove resharding scenario or make add_block
scenario respect epoch manager.
github-merge-queue bot pushed a commit that referenced this issue Feb 28, 2024
This PR is a part of getting rid of `KeyValueRuntime` (#10678) and
`MockEpochManager` (#10634).

Currently `NightshadeRuntime` is part of `nearcore` which makes it
impossible to use it in `chain` since `chain` depends on `nearcore`. We
need to use `NightshadeRuntime` as a replacement for `KeyValueRuntime`
in `chain` tests. Ideally it would be great to move it to `node-runtime`
crate, but currently it has a lot of dependencies from `near_chain`
which makes it very challenging, so as the first step let's move it to
`chain`.

This PR includes:
* move `nearcore::runtime` to `near_chain::runtime`
* introduce `NightshadeRuntimeExt` to expose
`NightshadeRuntime::from_config` separately since `NearConfig` is part
of `nearcore`
* move `GenesisExt` test methods directly to `Genesis`, also duplicate
some constants for now (will be refactored separately to reduce size of
this PR).
* move the necessary migrations code to `chain`
github-merge-queue bot pushed a commit that referenced this issue Mar 4, 2024
…10694)

Part of #10678 and
#10634.

Tests are updated to reflect the actual behaviour of chain garbage
collection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

No branches or pull requests

2 participants