-
Notifications
You must be signed in to change notification settings - Fork 92
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
Check the Gas Free function during the compilation of the Move module. #886
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Wait the v0.2 to release |
180bfae
to
4358e10
Compare
How do we test if the Gas is paid by contract, not the sender? |
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 will merge this PR first. We can discuss the solution and refactor it later.
true | ||
} | ||
|
||
fun gas_charge_post_function(_ctx: &mut Context, _gas_used: u128): bool { |
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.
Why _gas_used
at here is u128
?
} | ||
} | ||
} | ||
} | ||
|
||
fn execute_gas_validate( | ||
&self, | ||
session: &mut MoveOSSession<'_, '_, MoveOSResolverProxy<MoveOSStore>, MoveOSGasMeter>, |
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.
gas_validate
should be a read-only function, so the session also should &MoveOSSession
let mut can_pay_gas = None; | ||
let action_opt_cloned = action_opt.clone(); | ||
if let Some(action) = action_opt { | ||
can_pay_gas = self.execute_gas_validate(&mut session, &action)?; |
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.
execute_gas_validate
should execute in the validate stage, not in the execution_cleanup
stage. We need to redesign the gas-free solution and refactor it.
&self, | ||
session: &mut MoveOSSession<'_, '_, MoveOSResolverProxy<MoveOSStore>, MoveOSGasMeter>, | ||
action: &VerifiedMoveAction, | ||
) -> VMResult<Option<bool>> { |
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 function always returns None.
This is part of #839
Check the Gas Free function during the compilation of the Move module.
TODO: