-
Notifications
You must be signed in to change notification settings - Fork 79
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
Runtime: Don't convert syscall errors #1024
Conversation
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.
I didn't see the introduction of send_generalised, but when this comes to master I will strongly argue for collapsing to a single send method (possibly with a trait helper with default impl that fills in the flags). I think different return types from different methods is technical debt we should not take. Instead, we should do the work to update existing callers to the new, better way. That will solve the duplication item.
Given the current package architecture, we should not add fvm_sdk as a dependency of crates that don't use the actual FVM. Instead, move the required types to fvm_shared, along with many similar. I could be convinced that a different package architecture would make sense in which the SDK is always a dependency, but then would want to see things moved back the other way so there's a consistent decision logic for what lives where.
test_vm/src/lib.rs
Outdated
params: Option<IpldBlock>, | ||
value: TokenAmount, | ||
) -> Result<Option<IpldBlock>, ActorError> { | ||
// TODO gas_limit is current ignored, what should we do about it? |
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.
This TODO isn't helpful - there's nothing concretely to do or a condition upon which to do it. It's fine that gas limit is ignored, just leave a comment without TODO.
That's how it's currently implemented: builtin-actors/runtime/src/runtime/mod.rs Lines 186 to 200 in 610f399
We wrote it this way to reduce the diff between the next branch and master and to avoid any unnecessary refactors while diverged. Once we merge, I'd be strongly in favor of removing the separate method and/or cleaning this up. However, I couldn't directly port these changes over to master because they rely on features that don't exist in FVM 2.0. |
3c41f6d
to
783231a
Compare
test_vm/src/lib.rs
Outdated
@@ -1030,7 +1027,10 @@ impl<'invocation, 'bs> Runtime for InvocationCtx<'invocation, 'bs> { | |||
subinvocs.push(invoc); | |||
subinvocs | |||
}); | |||
res | |||
Ok(Response { | |||
exit_code: res.clone().map_or_else(|e| e.exit_code(), |_| ExitCode::OK), |
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.
exit_code: res.clone().map_or_else(|e| e.exit_code(), |_| ExitCode::OK), | |
exit_code: res.as_ref().err().map(|e| e.exit_code()).unwrap_or(ExitCode::OK), |
test_vm/src/lib.rs
Outdated
res | ||
Ok(Response { | ||
exit_code: res.clone().map_or_else(|e| e.exit_code(), |_| ExitCode::OK), | ||
return_data: res.map_or_else(|mut e| e.take_data(), |r| r), |
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.
return_data: res.map_or_else(|mut e| e.take_data(), |r| r), | |
return_data: res.unwrap_or_else(|mut e| e.take_data()), |
783231a
to
15d0b2f
Compare
15d0b2f
to
5785d1d
Compare
filecoin-project/ref-fvm#1020
Open questions: