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 KeyValueRuntime #10678

Open
pugachAG opened this issue Feb 28, 2024 · 0 comments
Open

Remove KeyValueRuntime #10678

pugachAG opened this issue Feb 28, 2024 · 0 comments
Labels
C-housekeeping Category: Refactoring, cleanups, code quality

Comments

@pugachAG
Copy link
Contributor

pugachAG commented Feb 28, 2024

From KeyValueRuntime rustdoc:

/// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/// WARNING: If you choose to use KeyValueRuntime for your tests, BE PREPARED TO
/// HAVE A BAD TIME. Use it only if you understand it to its entirety. It has
/// implicit behavior, very specific partially implemented logic, and is generally
/// incorrect. USE NightshadeRuntime WHENEVER POSSIBLE. YOU HAVE BEEN WARNED.
/// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@pugachAG pugachAG added the C-housekeeping Category: Refactoring, cleanups, code quality label Feb 28, 2024
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

1 participant