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

Minor fixes to "separate cached from call cost" #2430

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arbitrator/prover/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl<'a> WasmBinary<'a> {

let mut init: u64 = 0;
if compile.version == 1 {
init = cached_init; // in version 1 cached cost is part of call cost
init = cached_init; // in version 1 cached cost is part of init cost
}
init = init.saturating_add(funcs.saturating_mul(8252) / 1000);
init = init.saturating_add(type_len.saturating_mul(1059) / 1000);
Expand Down
2 changes: 1 addition & 1 deletion arbos/programs/programs.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (p Programs) CallProgram(

// pay for program init
cached := program.cached || statedb.GetRecentWasms().Insert(codeHash, params.BlockCacheSize)
if cached || params.Version > 1 { // in version 1 cached cost is part of called cost
if cached || program.version > 1 { // in version 1 cached cost is part of init cost
callCost = am.SaturatingUAdd(callCost, program.cachedGas(params))
}
if !cached {
Expand Down
Loading