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: move send/upgrade out of the kernel #1952

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

Stebalien
Copy link
Member

Make them higher-level ops like everything else. I considered combining them into a single "call op" however, not all users may want to implement actor upgrading.

I've also moved the generic from the methods to the trait itself. This resolves anorth's comment on the TestKernel by allowing additional bounds to be specified by the implementer, instead of having all the bounds encoded on the trait itself:

Note that KK, the type of the kernel to crate for the receiving actor, is ignored, and Self is passed as the type parameter for the nested call. If we could find the correct bound to specify KK for the call, we would. This restricts the ability for the TestKernel to itself be wrapped by another kernel type.

@Stebalien Stebalien changed the title feat: move send/upgrade out of the kernel refactor: move send/upgrade out of the kernel Dec 14, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0b4a34f) 75.56% compared to head (7566332) 75.60%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1952      +/-   ##
==========================================
+ Coverage   75.56%   75.60%   +0.04%     
==========================================
  Files         157      157              
  Lines       15494    15473      -21     
==========================================
- Hits        11708    11699       -9     
+ Misses       3786     3774      -12     
Files Coverage Δ
fvm/src/kernel/default.rs 82.33% <100.00%> (-0.10%) ⬇️
fvm/src/kernel/filecoin.rs 19.94% <ø> (-3.91%) ⬇️
fvm/src/kernel/mod.rs 90.90% <100.00%> (+2.02%) ⬆️
fvm/src/syscalls/actor.rs 89.91% <100.00%> (ø)
fvm/src/syscalls/mod.rs 97.51% <ø> (+0.49%) ⬆️
fvm/src/syscalls/send.rs 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

@Stebalien
Copy link
Member Author

After this, the only parts remaining from #1933 are:

  1. Moving SyscallHandler to an associated type. I'm not actually sure if we want to do this (doesn't seem to matter in practice).
  2. Refactor the syscall layering per Syscall Refactor FIPs#845. But I'm not sure if I've gotten that layering right, so I'd rather take it one step at a time.

Copy link
Contributor

@fridrik01 fridrik01 left a comment

Choose a reason for hiding this comment

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

Only one minor comment, but otherwise lgtm.

Great to move the send/upgrade into these ops to make things more flexible (and remove boilerplate code)

fvm/src/kernel/filecoin.rs Outdated Show resolved Hide resolved
Base automatically changed from steb/cleanup-gas-ops to master December 19, 2023 17:14
Make them higher-level ops like everything else. I considered combining
them into a single "call op" however, not all users may want to
implement actor upgrading.

I've also moved the generic from the methods to the trait itself. This
resolves anorth's comment on the `TestKernel` by allowing additional
bounds to be specified by the _implementer_, instead of having all the
bounds encoded on the trait itself:

> Note that KK, the type of the kernel to crate for the receiving actor,
> is ignored, and Self is passed as the type parameter for the nested
> call. If we could find the correct bound to specify KK for the call,
> we would. This restricts the ability for the TestKernel to itself be
> wrapped by another kernel type.
@Stebalien Stebalien merged commit 43554ab into master Dec 19, 2023
12 checks passed
@Stebalien Stebalien deleted the steb/move-send-upgrade branch December 19, 2023 17:35
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