We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Based on the analysis from #1256 , I think (to be tested) that charge_gas could be cheaper by doing
func charge_gas{range_check_ptr}(self: model.EVM*, amount: felt) -> model.EVM* { let gas_left = self.gas_left - amount; let enough_gas = is_nn(gas_left); if (enough_gas != 0) { return new model.EVM( message=self.message, return_data_len=self.return_data_len, return_data=self.return_data, program_counter=self.program_counter, stopped=self.stopped, gas_left=gas_left, gas_refund=self.gas_refund, reverted=self.reverted, ); } let (revert_reason_len, revert_reason) = Errors.outOfGas(self.gas_left, amount); return new model.EVM( message=self.message, return_data_len=revert_reason_len, return_data=revert_reason, program_counter=self.program_counter, stopped=TRUE, gas_left=0, gas_refund=self.gas_refund, reverted=Errors.EXCEPTIONAL_HALT, ); }
The is_nn should also be inline to avoid the extra call steps
is_nn
call
The text was updated successfully, but these errors were encountered:
7112b36
obatirou
Successfully merging a pull request may close this issue.
Feature Request
Based on the analysis from #1256 , I think (to be tested) that charge_gas could be cheaper by doing
The
is_nn
should also be inline to avoid the extracall
stepsThe text was updated successfully, but these errors were encountered: