Skip to content
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

Set the gas parameter in the native function. #748

Merged

Conversation

stevenlaw123
Copy link
Contributor

Create an initialize GasParameter for native functions using rooch_framework::natives::GasParameters::initial();.

Later, there is a plan to refactor this approach as the current method hardcodes the GasParameter in the code.

The plan is to use a configuration file to automatically generate GasParameter objects.

@vercel
Copy link

vercel bot commented Sep 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Sep 4, 2023 8:30am

@stevenlaw123 stevenlaw123 force-pushed the native_function_gas_parameter branch 2 times, most recently from eb7f5e7 to f332a56 Compare September 3, 2023 10:19
use moveos_stdlib::natives::moveos_stdlib::move_module::GasParameters;

crate::natives::gas_parameter::native::define_gas_parameters_for_natives!(GasParameters, "move_module", [
[.module_name_inner.base, "module_name_inner.base", (5 + 1) * MUL],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do the numbers 5 and 1 represent in (5 + 1) * MUL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation method of (5 + 1) * MUL is borrowed from Starcoin, and if needed, it can be changed to something else.

@stevenlaw123 stevenlaw123 force-pushed the native_function_gas_parameter branch from f332a56 to 3333682 Compare September 3, 2023 13:26
Copy link
Contributor

@jolestar jolestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The detailed value of every native function needs to be reviewed and adjusted.

@stevenlaw123 stevenlaw123 force-pushed the native_function_gas_parameter branch 2 times, most recently from 3db7c03 to 5a8a168 Compare September 4, 2023 06:24
add license info

add missed license info

remove unused code

update the git version of the Move library

cargo fmt

update Cargo.lock
@stevenlaw123 stevenlaw123 force-pushed the native_function_gas_parameter branch from 3c5fd75 to 8a12eaa Compare September 4, 2023 08:29
@stevenlaw123 stevenlaw123 merged commit 91229a8 into rooch-network:main Sep 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants