Skip to content

Commit

Permalink
Strip metadata fix (#1774)
Browse files Browse the repository at this point in the history
* Fix metadata stripping being too eager

closes #1659

---------

Co-authored-by: James Wilson <[email protected]>
Co-authored-by: Niklas Adolfsson <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent 9527165 commit ae0fce8
Show file tree
Hide file tree
Showing 7 changed files with 344 additions and 227 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added artifacts/regressions/1659.scale
Binary file not shown.
1 change: 0 additions & 1 deletion metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ hashbrown = { workspace = true }
bitvec = { workspace = true, features = ["alloc"] }
criterion = { workspace = true }
scale-info = { workspace = true, features = ["bit-vec"] }
assert_matches = { workspace = true }

[lib]
# Without this, libtest cli opts interfere with criteron benches:
Expand Down
5 changes: 4 additions & 1 deletion metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ impl Metadata {
MetadataHasher::new(self)
}

/// Filter out any pallets that we don't want to keep, retaining only those that we do.
/// Filter out any pallets and/or runtime_apis that we don't want to keep, retaining only those that we do.
/// Note:
/// only filter by `pallet`s will not lead to significant metadata size reduction because the return types are kept to ensure that those can be decoded.
///
pub fn retain<F, G>(&mut self, pallet_filter: F, api_filter: G)
where
F: FnMut(&str) -> bool,
Expand Down
Loading

0 comments on commit ae0fce8

Please sign in to comment.