-
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
Implement log initialisation inline in FVM runtime #1019
Conversation
@@ -259,8 +259,6 @@ where | |||
let state_cid = fvm::sself::root() | |||
.map_err(|_| actor_error!(illegal_argument; "failed to get actor root state CID"))?; | |||
|
|||
log::debug!("getting cid: {}", state_cid); |
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.
We can bring this kind of thing back as trace
, if needed. But it looks like just noisy remnants of early development.
This makes no sense. The SDK already has a shared implementation that can be used by non builtin actors, why are we trying to duplicate this here? |
@@ -552,14 +550,13 @@ where | |||
/// 5a. In case of error, aborts the execution with the emitted exit code, or | |||
/// 5b. In case of success, stores the return data as a block and returns the latter. | |||
pub fn trampoline<C: ActorCode>(params: u32) -> u32 { | |||
fvm::debug::init_logging(); |
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.
If you want to set the max log level to trace, you can do that here. init_logging
is designed to be unopinionated and just initialize the logging framework.
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.
The v2 SDK initialises it to discard messages! As someone not deeply familiar with Rust logging configuration, this was extremely frustrating to discover. Also it still doesn't work, for reasons I don't understand yet.
The v3 SDK does initialise it to tracing. Maybe it'll work, and maybe we'll want to switch to it when we upgrade.
init_logging
is opinionated about the format of the string that is logged, at least. We may well want to change 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 is such a tiny amount of plumbing being pulled in here that I don't understand the motivation for pushback.
@@ -552,14 +550,13 @@ where | |||
/// 5a. In case of error, aborts the execution with the emitted exit code, or | |||
/// 5b. In case of success, stores the return data as a block and returns the latter. | |||
pub fn trampoline<C: ActorCode>(params: u32) -> u32 { | |||
fvm::debug::init_logging(); |
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.
The v2 SDK initialises it to discard messages! As someone not deeply familiar with Rust logging configuration, this was extremely frustrating to discover. Also it still doesn't work, for reasons I don't understand yet.
The v3 SDK does initialise it to tracing. Maybe it'll work, and maybe we'll want to switch to it when we upgrade.
init_logging
is opinionated about the format of the string that is logged, at least. We may well want to change it.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1019 +/- ##
==========================================
- Coverage 89.20% 89.12% -0.08%
==========================================
Files 92 92
Lines 19580 19327 -253
==========================================
- Hits 17466 17226 -240
+ Misses 2114 2101 -13
|
77f5755
to
64f9f6d
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.
As noted by @anorth, this works around an issue in FVM v2. We'll remove this once we update to v3 (and backport any required bug fixes).
64f9f6d
to
908b3a0
Compare
I couldn't get logging to result in a syscall with the SDK (even with local patch to include filecoin-project/ref-fvm#1431)
This brings log initialisation for the builtin actors into their repo, which I think is entirely appropriate anyway. And I can verify that logging produces a syscall.