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

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
338a9d7
heuristics tests are altered to panic with multiple results
Lazark0x Sep 23, 2024
ec9f02d
weights content have been moved to the tests
Lazark0x Sep 24, 2024
f69e521
fixed source file structure
Lazark0x Sep 24, 2024
2224bcc
Merge branch 'master' into 4248-refactor-tests-improve-ux-of-runtime-…
Lazark0x Sep 24, 2024
89c6432
Merge branch 'master' into 4248-refactor-tests-improve-ux-of-runtime-…
Lazark0x Oct 20, 2024
e1a566c
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
Lazark0x Nov 4, 2024
e79d1fa
post-review changes: added test for weights count
Lazark0x Nov 5, 2024
773e82d
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
Lazark0x Nov 5, 2024
a3e82e1
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
Lazark0x Nov 5, 2024
e825e99
post-review: code structure fix
Lazark0x Nov 5, 2024
9771df9
post-review fixes
Lazark0x Nov 13, 2024
b82d24a
post-review fixes
Lazark0x Nov 26, 2024
5994ee6
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
Lazark0x Nov 26, 2024
066fece
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
StackOverflowExcept1on Dec 7, 2024
f437ec6
fix submodules
StackOverflowExcept1on Dec 7, 2024
f215874
fix clippy
StackOverflowExcept1on Dec 7, 2024
395b22c
Merge branch 'master' into 4248-refactor-tests-improve-ux-of-runtime-…
Lazark0x Dec 12, 2024
9a20ae7
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
Lazark0x Dec 16, 2024
a49a3ae
reduced the amount of text in error messages
Lazark0x Dec 16, 2024
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
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