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

Heuristics tests are altered to panic with multiple results #4252

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
10 changes: 10 additions & 0 deletions core/src/costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,16 @@ pub struct LazyPagesCosts {
pub host_func_write_after_read: CostOf<GearPagesAmount>,
/// Loading page data from storage cost.
pub load_page_storage_data: CostOf<GearPagesAmount>,
/// Loading from storage and moving it in program memory cost.
pub load_page_data: CostOf<GearPagesAmount>,
/// Uploading page data to storage cost.
pub upload_page_data: CostOf<GearPagesAmount>,
/// Memory grow cost.
pub mem_grow: CostOf<GearPagesAmount>,
/// Memory grow per page cost.
pub mem_grow_per_page: CostOf<GearPagesAmount>,
/// Parachain read heuristic cost.
pub parachain_read_heuristic: CostOf<GearPagesAmount>,
}

/// Holding in storages rent costs.
Expand Down
5 changes: 5 additions & 0 deletions core/src/gas_metering/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,11 @@ impl From<MemoryWeights> for LazyPagesCosts {
.saturating_add(val.parachain_read_heuristic)
.ref_time()
.into(),
load_page_data: val.load_page_data.ref_time().into(),
upload_page_data: val.upload_page_data.ref_time().into(),
mem_grow: val.mem_grow.ref_time().into(),
mem_grow_per_page: val.mem_grow_per_page.ref_time().into(),
parachain_read_heuristic: val.parachain_read_heuristic.ref_time().into(),
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions pallets/gear/src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,11 @@ impl<T: Config> From<MemoryWeights<T>> for LazyPagesCosts {
.saturating_add(val.parachain_read_heuristic)
.ref_time()
.into(),
load_page_data: val.load_page_data.ref_time().into(),
upload_page_data: val.upload_page_data.ref_time().into(),
mem_grow: val.mem_grow.ref_time().into(),
mem_grow_per_page: val.mem_grow_per_page.ref_time().into(),
parachain_read_heuristic: val.parachain_read_heuristic.ref_time().into(),
}
}
}
Expand Down
1 change: 0 additions & 1 deletion runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

mod apis;
pub mod constants;
pub mod weights;

use sp_runtime::traits::Get;

Expand Down
308 changes: 0 additions & 308 deletions runtime/common/src/weights.rs

This file was deleted.

Loading
Loading