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

refactor: make partial kernels possible #1941

Merged
merged 2 commits into from
Dec 10, 2023
Merged

Conversation

Stebalien
Copy link
Member

This change has two parts:

  1. Remove most (all except gas) "ops" from the base kernel trait, allowing kernels to implement only some operations.
  2. Make syscalls declare the ops they actually need instead of depending on the entire kernel.

This should make it possible to implement custom kernels that expose fewer operations.

It also removes the LimiterOps trait as that's not really an "op".

@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2023

Codecov Report

Merging #1941 (3d5571d) into master (6867921) will decrease coverage by 0.02%.
The diff coverage is 80.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1941      +/-   ##
==========================================
- Coverage   75.70%   75.68%   -0.02%     
==========================================
  Files         157      157              
  Lines       15473    15483      +10     
==========================================
+ Hits        11714    11719       +5     
- Misses       3759     3764       +5     
Files Coverage Δ
fvm/src/kernel/filecoin.rs 22.65% <100.00%> (+0.60%) ⬆️
fvm/src/kernel/mod.rs 90.00% <ø> (-0.91%) ⬇️
fvm/src/syscalls/crypto.rs 100.00% <100.00%> (ø)
fvm/src/syscalls/event.rs 95.83% <100.00%> (ø)
fvm/src/syscalls/ipld.rs 100.00% <100.00%> (ø)
fvm/src/syscalls/mod.rs 97.39% <ø> (+0.52%) ⬆️
fvm/src/syscalls/network.rs 42.85% <100.00%> (ø)
fvm/src/syscalls/sself.rs 100.00% <100.00%> (ø)
fvm/src/syscalls/vm.rs 62.16% <100.00%> (+2.16%) ⬆️
fvm/src/syscalls/actor.rs 89.91% <85.71%> (ø)
... and 4 more

... and 5 files with indirect coverage changes

@Stebalien Stebalien force-pushed the feat/narrow-trait-req branch 2 times, most recently from 645c625 to b95f44b Compare December 8, 2023 08:37
Copy link
Contributor

@maciejwitowski maciejwitowski left a comment

Choose a reason for hiding this comment

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

These changes are all compiler-checked so I'm happy to approve them.

Base automatically changed from fix/delegate-with-prelude to master December 10, 2023 01:35
This brings us one step closer to making the syscalls more configurable.
This makes the kernel more customizable as it no longer "assumes" that
all of these operations will be available.

Also, remove the `LimiterOps` trait entirely, this isn't actually an
"op" (i.e., not a user-invokable operation). The gas ops will get moved
around in a future commit as many of them aren't really "ops" either.
@Stebalien Stebalien merged commit 8f4d31b into master Dec 10, 2023
14 checks passed
@Stebalien Stebalien deleted the feat/narrow-trait-req branch December 10, 2023 01:56
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