Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
22b8699
validation extension in sp_io
cheme Jan 27, 2021
4de9f7a
need paths
cheme Jan 27, 2021
f0ea2af
arc impl
cheme Jan 27, 2021
71202a9
missing host function in executor
cheme Jan 28, 2021
f848b44
io to pkdot
cheme Feb 1, 2021
1979b6a
decode function.
cheme Feb 1, 2021
927a096
encode primitive.
cheme Feb 1, 2021
b034ec0
trailing tab
cheme Feb 1, 2021
757ff30
multiple patch
cheme Feb 1, 2021
7dba01b
fix child trie logic
cheme Feb 2, 2021
1a2a637
Merge branch 'master' into validation_io, and revert skip value specific
cheme Apr 8, 2021
c948254
Merge branch 'master' into validation_io
cheme Apr 8, 2021
7ef5a41
restore master versionning
cheme Apr 8, 2021
360c324
bench compact proof size
cheme Apr 8, 2021
4edc38a
trie-db 22.3 is needed
cheme Apr 8, 2021
6f899c0
line width
cheme Apr 8, 2021
d3eb91c
split line
cheme Apr 8, 2021
4475edd
fixes for bench (additional root may not be needed as original issue was
cheme Apr 9, 2021
e6e4682
Merge branch 'master' into validation_io
cheme May 3, 2021
dba397c
Merge branch 'validation_io' of github.com:cheme/substrate into valid…
cheme May 3, 2021
c0fc8fd
revert compact from block size calculation.
cheme May 3, 2021
8f353dd
Merge branch 'master' into validation_io
cheme May 28, 2021
7ebb54d
Merge branch 'master' into validation_io
cheme Jun 4, 2021
bf91187
New error type for compression.
cheme Jun 4, 2021
c37046e
Adding test (incomplete (failing)).
cheme Jun 4, 2021
7daabb3
Merge branch 'master' into validation_io
cheme Jun 4, 2021
cfd923a
There is currently no proof recording utility in sp_trie, removing
cheme Jun 4, 2021
f25fc34
small test of child root in proof without a child proof.
cheme Jun 4, 2021
19c132e
remove empty test.
cheme Jun 6, 2021
515c2fd
remove non compact proof size
cheme Jun 6, 2021
8aadbf1
Merge branch 'master' into validation_io
cheme Jun 6, 2021
f867d7f
Missing revert.
cheme Jun 6, 2021
d639940
proof method to encode decode.
cheme Jun 7, 2021
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
Prev Previous commit
Next Next commit
remove non compact proof size
  • Loading branch information
cheme committed Jun 6, 2021
commit 515c2fd666154a83a8bb945793448bbc1a04168d
8 changes: 3 additions & 5 deletions client/db/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,12 @@ impl<B: BlockT> StateBackend<HashFor<B>> for BenchmarkingState<B> {
self.state.borrow().as_ref().map_or(sp_state_machine::UsageInfo::empty(), |s| s.usage_info())
}

fn proof_size(&self) -> Option<(u32, u32)> {
fn proof_size(&self) -> Option<u32> {
self.proof_recorder.as_ref().map(|recorder| {
let proof_size = recorder.estimate_encoded_size() as u32;
let proof = recorder.to_storage_proof();
let proof_recorder_root = self.proof_recorder_root.get();
let compact_size = if proof_recorder_root == Default::default() || proof_size == 1 {
if proof_recorder_root == Default::default() || proof_size == 1 {
// empty trie
proof_size
} else {
Expand All @@ -543,9 +543,7 @@ impl<B: BlockT> StateBackend<HashFor<B>> for BenchmarkingState<B> {
proof_size,
);
}
};

(proof_size, compact_size)
}
})
}
}
Expand Down
5 changes: 0 additions & 5 deletions frame/benchmarking/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ pub enum BenchmarkSelector {
Reads,
Writes,
ProofSize,
CompactProofSize,
}

#[derive(Debug)]
Expand Down Expand Up @@ -89,7 +88,6 @@ impl Analysis {
BenchmarkSelector::Reads => result.reads.into(),
BenchmarkSelector::Writes => result.writes.into(),
BenchmarkSelector::ProofSize => result.proof_size.into(),
BenchmarkSelector::CompactProofSize => result.compact_proof_size.into(),
}
).collect();

Expand Down Expand Up @@ -131,7 +129,6 @@ impl Analysis {
BenchmarkSelector::Reads => result.reads.into(),
BenchmarkSelector::Writes => result.writes.into(),
BenchmarkSelector::ProofSize => result.proof_size.into(),
BenchmarkSelector::CompactProofSize => result.compact_proof_size.into(),
};
(result.components[i].1, data)
})
Expand Down Expand Up @@ -197,7 +194,6 @@ impl Analysis {
BenchmarkSelector::Reads => result.reads.into(),
BenchmarkSelector::Writes => result.writes.into(),
BenchmarkSelector::ProofSize => result.proof_size.into(),
BenchmarkSelector::CompactProofSize => result.compact_proof_size.into(),
})
}

Expand Down Expand Up @@ -379,7 +375,6 @@ mod tests {
writes,
repeat_writes: 0,
proof_size: 0,
compact_proof_size: 0,
}
}

Expand Down
8 changes: 2 additions & 6 deletions frame/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,8 @@ macro_rules! impl_benchmark {

// Calculate the diff caused by the benchmark.
let elapsed_extrinsic = finish_extrinsic.saturating_sub(start_extrinsic);
let (diff_pov, compact_diff_pov) = match (start_pov, end_pov) {
(Some((start, compact_start)), Some((end, compact_end))) => (
end.saturating_sub(start),
compact_end.saturating_sub(compact_start),
),
let diff_pov = match (start_pov, end_pov) {
(Some(start), Some(end)) => end.saturating_sub(start),
_ => Default::default(),
};

Expand Down Expand Up @@ -836,7 +833,6 @@ macro_rules! impl_benchmark {
writes: read_write_count.2,
repeat_writes: read_write_count.3,
proof_size: diff_pov,
compact_proof_size: compact_diff_pov,
});
}

Expand Down
3 changes: 1 addition & 2 deletions frame/benchmarking/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ pub struct BenchmarkResults {
pub writes: u32,
pub repeat_writes: u32,
pub proof_size: u32,
pub compact_proof_size: u32,
}

/// Configuration used to setup and run runtime benchmarks.
Expand Down Expand Up @@ -166,7 +165,7 @@ pub trait Benchmarking {
}

/// Get current estimated proof size.
fn proof_size(&self) -> Option<(u32, u32)> {
fn proof_size(&self) -> Option<u32> {
self.proof_size()
}
}
Expand Down
2 changes: 1 addition & 1 deletion primitives/externalities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ pub trait Externalities: ExtensionStore {
///
/// Returns estimated proof size for the state queries so far.
/// Proof is reset on commit and wipe.
fn proof_size(&self) -> Option<(u32, u32)> {
fn proof_size(&self) -> Option<u32> {
None
}
}
Expand Down
2 changes: 1 addition & 1 deletion primitives/state-machine/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub trait Backend<H: Hasher>: sp_std::fmt::Debug {
fn set_whitelist(&self, _: Vec<TrackedStorageKey>) {}

/// Estimate proof size
fn proof_size(&self) -> Option<(u32, u32)> {
fn proof_size(&self) -> Option<u32> {
unimplemented!()
}
}
Expand Down
2 changes: 1 addition & 1 deletion primitives/state-machine/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ where
self.backend.set_whitelist(new)
}

fn proof_size(&self) -> Option<(u32, u32)> {
fn proof_size(&self) -> Option<u32> {
self.backend.proof_size()
}
}
Expand Down
3 changes: 1 addition & 2 deletions utils/frame/benchmarking-cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ impl BenchmarkCmd {
let parameters = &result.components;
parameters.iter().for_each(|param| print!("{:?},", param.1));
// Print extrinsic time and storage root time
print!("{:?},{:?},{:?},{:?},{:?},{:?},{:?},{:?}\n",
print!("{:?},{:?},{:?},{:?},{:?},{:?},{:?}\n",
result.extrinsic_time,
result.storage_root_time,
result.reads,
result.repeat_reads,
result.writes,
result.repeat_writes,
result.proof_size,
result.compact_proof_size,
);
});

Expand Down
1 change: 0 additions & 1 deletion utils/frame/benchmarking-cli/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ mod test {
writes: (base + slope * i).into(),
repeat_writes: 0,
proof_size: 0,
compact_proof_size: 0,
}
)
}
Expand Down