-
Notifications
You must be signed in to change notification settings - Fork 644
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: call create_end for all code paths #362
Conversation
crates/revm/src/evm_impl.rs
Outdated
interpreter.gas, | ||
bytes, | ||
) | ||
}; |
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 not exactly the pattern used elsewhere
revm/crates/revm/src/evm_impl.rs
Lines 405 to 412 in 5d6ecd0
if INSPECT { | |
let (ret, address, gas, out) = self.inspector.create(&mut self.data, inputs); | |
if ret != InstructionResult::Continue { | |
return self | |
.inspector | |
.create_end(&mut self.data, inputs, ret, address, gas, out); | |
} | |
} |
by default create_end
would return ::Continue
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.
Isn't Inspector::create_end supposed to be called for every possible reason the create function might end?
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.
by default
create_end
would return::Continue
And doesn't the default implementation of create_end
return ret
?
revm/crates/revm/src/inspector.rs
Lines 123 to 133 in 5d6ecd0
fn create_end( | |
&mut self, | |
_data: &mut EVMData<'_, DB>, | |
_inputs: &CreateInputs, | |
ret: InstructionResult, | |
address: Option<B160>, | |
remaining_gas: Gas, | |
out: Bytes, | |
) -> (InstructionResult, Option<B160>, Gas, Bytes) { | |
(ret, address, remaining_gas, out) | |
} |
I made sure |
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.
nice pattern!
No description provided.