Companion for pallet-mmr: generate historical proofs (#6061)

* BEEFY: generate historical proofs

Signed-off-by: Serban Iorga <serban@parity.io>

* cargo update -p sp-io

* Properly set max proof size for runtimes

* Properly set max proof size for mocks

* cargo fmt

* Set appropriate UMP service total proof size weight

* Disable zombienet-tests-parachains-disputes CI

* Add comment explaining weight math

* Use MAX_POV_SIZE for max proof size

* Cast to u64

* Remove comment

Signed-off-by: Serban Iorga <serban@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Serban Iorga
2022-10-02 12:42:24 +03:00
committed by GitHub
parent f45a8de8ae
commit 5458406927
18 changed files with 256 additions and 197 deletions
+8 -1
View File
@@ -1740,6 +1740,13 @@ sp_api::impl_runtime_apis! {
Err(mmr::Error::PalletNotIncluded)
}
fn generate_historical_batch_proof(
_leaf_indices: Vec<u64>,
_leaves_count: u64,
) -> Result<(Vec<mmr::EncodableOpaqueLeaf>, mmr::BatchProof<Hash>), mmr::Error> {
Err(mmr::Error::PalletNotIncluded)
}
fn verify_batch_proof(_leaves: Vec<mmr::EncodableOpaqueLeaf>, _proof: mmr::BatchProof<Hash>)
-> Result<(), mmr::Error>
{
@@ -2101,7 +2108,7 @@ mod multiplier_tests {
BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap();
// if the min is too small, then this will not change, and we are doomed forever.
// the weight is 1/100th bigger than target.
run_with_system_weight(target * 101 / 100, || {
run_with_system_weight(target.saturating_mul(101) / 100, || {
let next = SlowAdjustingFeeUpdate::<Runtime>::convert(minimum_multiplier);
assert!(next > minimum_multiplier, "{:?} !>= {:?}", next, minimum_multiplier);
})