Skip to content

Commit

Permalink
Reduce the gas cost of Call/CallGeneric instructions and related inst…
Browse files Browse the repository at this point in the history
…ructions.
  • Loading branch information
steelgeek091 committed Jul 17, 2024
1 parent ea49b3e commit b79e562
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Binary file modified crates/rooch-genesis/released/test
Binary file not shown.
2 changes: 1 addition & 1 deletion moveos/moveos-types/src/moveos_std/gas_schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct GasScheduleConfig {
impl GasScheduleConfig {
pub const INITIAL_MAX_GAS_AMOUNT: u64 = 1_000_000_000u64;
/// The maximum gas amount that can be used for a read-only function call
pub const READONLY_MAX_GAS_AMOUNT: u64 = 5_000_000_000u64;
pub const READONLY_MAX_GAS_AMOUNT: u64 = 1_000_000_000u64;
}

impl MoveStructType for GasScheduleConfig {
Expand Down
14 changes: 7 additions & 7 deletions moveos/moveos/src/gas/parameters/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ crate::gas::native::define_gas_parameters_for_natives!(InstructionParameter, "in
[.move_loc_base, "move_loc_base", 441],
[.st_loc_base, "st_loc_base", 441],
// call
[.call_base, "call_base", 3676],
[.call_per_arg, "call_per_arg", 367],
[.call_per_local, "call_per_local", 367],
[.call_generic_base, "call_generic_base", 3676],
[.call_generic_per_ty_arg, "call_generic_per_ty_arg", 367],
[.call_generic_per_arg, "call_generic_per_arg", 367],
[.call_generic_per_local, "call_generic_per_local", 367],
[.call_base, "call_base", 167],
[.call_per_arg, "call_per_arg", 15],
[.call_per_local, "call_per_local", 15],
[.call_generic_base, "call_generic_base", 167],
[.call_generic_per_ty_arg, "call_generic_per_ty_arg", 15],
[.call_generic_per_arg, "call_generic_per_arg", 15],
[.call_generic_per_local, "call_generic_per_local", 15],
// struct
[.pack_base, "pack_base", 808],
[.pack_per_field, "pack_per_field", 147],
Expand Down

0 comments on commit b79e562

Please sign in to comment.