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

Create a versioned KernelStateValue which is only partially accessible from user space #1163

Merged
merged 31 commits into from
Nov 20, 2023

Conversation

preston-evans98
Copy link
Member

Description

This PR makes two related changes:

  1. Add a slot_height method to Context. This simple change accounts for almost all of the lines changed
  2. Introduce a new KernelStateValue type which appears as a map from slot_number to value when accessed from the kernel, but appears as a regular state value (which may be absent) when accessed from user space. To support this value, two new variants of WorkingSet are introduced - a KernelWorkingSet which can only be constructed by a Kernel, and a VersionedWorkingSet, which is constructed from the context and allows access to only the current version of a Kernel Value.

Testing

Tests have been added to cover the new KernelStateValue's behavior

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Merging #1163 (029cf03) into nightly (b29e9c2) will decrease coverage by 0.7%.
The diff coverage is 50.1%.

❗ Current head 029cf03 differs from pull request most recent head 114cae4. Consider uploading reports for the commit 114cae4 to get more accurate results

Additional details and impacted files
Files Coverage Δ
full-node/sov-sequencer/src/batch_builder.rs 96.9% <100.0%> (+<0.1%) ⬆️
...tions/integration-tests/src/chain_state/helpers.rs 77.2% <ø> (ø)
...m/module-implementations/sov-accounts/src/tests.rs 99.4% <100.0%> (ø)
...mplementations/sov-attester-incentives/src/call.rs 86.8% <100.0%> (-0.2%) ⬇️
...plementations/sov-blob-storage/src/capabilities.rs 87.7% <ø> (ø)
...implementations/sov-prover-incentives/src/tests.rs 100.0% <100.0%> (ø)
...odule-system/sov-modules-api/src/containers/mod.rs 100.0% <ø> (ø)
module-system/sov-modules-api/src/lib.rs 97.6% <ø> (ø)
...ule-system/sov-modules-rollup-blueprint/src/lib.rs 91.9% <ø> (ø)
module-system/sov-modules-stf-blueprint/src/lib.rs 89.8% <ø> (ø)
... and 6 more

... and 15 files with indirect coverage changes

@preston-evans98 preston-evans98 added this pull request to the merge queue Nov 20, 2023
Merged via the queue into nightly with commit 1f87cc0 Nov 20, 2023
14 checks passed
@preston-evans98 preston-evans98 deleted the preston/kernel-state branch November 20, 2023 22:13
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.

3 participants