-
Notifications
You must be signed in to change notification settings - Fork 382
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
fix gasometer tracing #74
Conversation
Can you also add CI build for feature tracing? |
The command not working, so I create a new workspace. |
Why? What's the error? |
gasometer/src/lib.rs
Outdated
#[cfg(feature = "tracing")] | ||
pub fn snapshot(&self) -> Snapshot { | ||
match self.inner.as_ref() { | ||
Ok(inner) => Snapshot { |
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.
You can use ok().map(...).unwrap_or_default()
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.
Wait, but what's the meaning of Default
here? Shouldn't we propagate the error?
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.
Please also fix this. Either change it to expect
if you don't think errors will ever be returned, or properly handle the errors.
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 think should not handle errors in the event, otherwise, it will return a different result than without tracing
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.
Default
means an error, but ignore it and let other checks deal with 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.
Can you change the Snapshot
struct to an enum representing either the current value, or a specific OutOfGas
variant? You can also change all instances of Snapshot
to Option<Snapshot>
.
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.
Changed all instances of Snapshot to Option.
Does this satisfy the requirement?
Can you change the Snapshot struct to an enum representing either the current value, or a specific OutOfGas variant?
I'm not sure how to implement this
No error was returned, I feel it is a problem with the workspace. You can try this command. |
I can't reproduce the error at all. It works fine for me. |
Please try this:
|
You missed some feature declarations. This has nothing to do with workspaces. |
This reverts commit 4a18e10.
"evm-gasometer/tracing", | ||
"evm-runtime/tracing" |
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 have modified it.
But I think the original way is better. People can enable tracing for evm/evm-gasometer/evm-runtime
separately.
Closes: #73