From 406e3d50abf7526beb0b695b24a1a0a4a7385235 Mon Sep 17 00:00:00 2001 From: Michael Assaf <94772640+snowmead@users.noreply.github.com> Date: Tue, 10 Feb 2026 13:41:06 -0500 Subject: [PATCH 1/2] Add `DecodeWithMemTracking` derive to `CompactProof` (#11028) # Description Add `DecodeWithMemTracking` derive to `CompactProof` in `substrate/primitives/trie/src/storage_proof.rs`. `StorageProof` already derived `DecodeWithMemTracking` but `CompactProof` in the same file was missed. ## Integration No integration changes required for downstream projects. `CompactProof` now implements `DecodeWithMemTracking`, which is a strictly additive trait implementation. Existing code using `CompactProof` will continue to work as before. ## Review Notes Single-line change adding `DecodeWithMemTracking` to the derive macro list on `CompactProof`: ```diff -#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub struct CompactProof { pub encoded_nodes: Vec>, } ``` `CompactProof` only contains `Vec>`, which already implements `DecodeWithMemTracking`, so the derive works without any manual implementation. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit fbddee8faabeadef47a375c71c1a8a11274e4e0d) --- prdoc/pr_11028.prdoc | 30 +++++++++++++++++++ .../primitives/trie/src/storage_proof.rs | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 prdoc/pr_11028.prdoc diff --git a/prdoc/pr_11028.prdoc b/prdoc/pr_11028.prdoc new file mode 100644 index 0000000000000..a6ddc5457149b --- /dev/null +++ b/prdoc/pr_11028.prdoc @@ -0,0 +1,30 @@ +title: Add `DecodeWithMemTracking` derive to `CompactProof` +doc: +- audience: Runtime Dev + description: |- + # Description + + Add `DecodeWithMemTracking` derive to `CompactProof` in `substrate/primitives/trie/src/storage_proof.rs`. + + `StorageProof` already derived `DecodeWithMemTracking` but `CompactProof` in the same file was missed. + + ## Integration + + No integration changes required for downstream projects. `CompactProof` now implements `DecodeWithMemTracking`, which is a strictly additive trait implementation. Existing code using `CompactProof` will continue to work as before. + + ## Review Notes + + Single-line change adding `DecodeWithMemTracking` to the derive macro list on `CompactProof`: + + ```diff + -#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, TypeInfo)] + +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo)] + pub struct CompactProof { + pub encoded_nodes: Vec>, + } + ``` + + `CompactProof` only contains `Vec>`, which already implements `DecodeWithMemTracking`, so the derive works without any manual implementation. +crates: +- name: sp-trie + bump: patch diff --git a/substrate/primitives/trie/src/storage_proof.rs b/substrate/primitives/trie/src/storage_proof.rs index 8bb6eb1da9c50..93a8bb4289584 100644 --- a/substrate/primitives/trie/src/storage_proof.rs +++ b/substrate/primitives/trie/src/storage_proof.rs @@ -172,7 +172,7 @@ impl From<&StorageProof> for crate::MemoryDB { } /// Storage proof in compact form. -#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub struct CompactProof { pub encoded_nodes: Vec>, } From c80784b2091ffc4c89c6baeea358fc772aeb1fc1 Mon Sep 17 00:00:00 2001 From: Egor_P Date: Wed, 11 Feb 2026 15:34:59 +0100 Subject: [PATCH 2/2] Add validate: false to the bump in prdoc --- prdoc/pr_11028.prdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/prdoc/pr_11028.prdoc b/prdoc/pr_11028.prdoc index a6ddc5457149b..443d5a00f10d7 100644 --- a/prdoc/pr_11028.prdoc +++ b/prdoc/pr_11028.prdoc @@ -28,3 +28,4 @@ doc: crates: - name: sp-trie bump: patch + validate: false