-
Notifications
You must be signed in to change notification settings - Fork 113
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
Move all DA layer information into Kernel. Prevent user-space access to Kernel State #1251
Conversation
This reverts commit 1e8326d.
Codecov ReportAttention:
Additional details and impacted files
|
2a45de6
to
eb9e213
Compare
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.
Non-blocking; Consider implementing a "KernelContext" without the mutable reference to a "WorkingSet." Instead, make this context accessible under the "Context" umbrella. When initiating a kernel call, pass the desired WorkingSet to the context, which will subsequently forward it to the KernelContext. This design can also be scaled for new hook implementations.
The proposed KernelContext would solely store height data internally and be functional regarding working set state modifications (accepting its mutable state as an argument). By implementing this abstraction, module developers will gain the ability to invoke specific kernel functions while being confined by the safeguards built into the context itself. Consequently, we establish a clear separation between user space and kernel space.
This is an interesting idea. It's a bit out of scope for this PR, but it might solve some problems in the next one where we try to remove KernelWorkingSet entirely. |
Description
This PR moves the chain-state module and related functionality into the kernel, and makes a handful of tweaks to ensure that the kernel values are inaccessible:
KernelModule
trait analagous toModule
, but with noCallMessage
#[derive(ModuleInfo)]
can only be called on structs that implementModule
orKernelModule
#[derive(KernelModuleInfo)]
macro that allows structs to use the#[kernel_module]
attribute in addition to the existing attributes like#[module]
,#[state]
. This macro implementsModuleInfo
forKernelModules
. Modules referenced by#[kernel_module]
are required to implement theKernelModule
trait.After this PR, the Kernel is now...
KernelWorkingSet
s. TheKernelWorkingSet
and related functionality will be removed in a follow up PR.KernelSlotHooks
, which are invoked by theStfBlueprint
BlobSelector
. The runtime no longer has this functionality.Remaining work:
module-system/module-implementations/integration-tests/src/chain_state/tests.rs
andmodule-system/module-implementations/sov-chain-state/tests/all_tests.rs
)KernelWorkingSet
and related types/functionalityKernel
and it's responsibilitiesLinked Issues
Testing
These changes are largely covered by existing tests. Improved integration tests will be added in a follow up.