Skip to content

Commit f821e10

Browse files
committed
Generate and apply the fraud proof pre-check weights
Signed-off-by: linning <[email protected]>
1 parent 470a02c commit f821e10

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

crates/pallet-domains/src/extensions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ where
184184
<Runtime as Config>::WeightInfo::validate_submit_bundle()
185185
}
186186
Some(DomainsCall::submit_fraud_proof { .. }) => {
187-
// FIXME: proper weight
188-
Weight::zero()
187+
<Runtime as Config>::WeightInfo::fraud_proof_pre_check()
189188
}
190189
Some(DomainsCall::submit_receipt { .. }) => {
191190
<Runtime as Config>::WeightInfo::validate_singleton_receipt()

crates/pallet-domains/src/weights.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub trait WeightInfo {
5252
fn submit_receipt() -> Weight;
5353
fn validate_submit_bundle() -> Weight;
5454
fn validate_singleton_receipt() -> Weight;
55+
fn fraud_proof_pre_check() -> Weight;
5556
}
5657

5758
/// Weights for pallet_domains using the Substrate node and recommended hardware.
@@ -626,6 +627,25 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
626627
.saturating_add(T::DbWeight::get().reads(22))
627628
.saturating_add(T::DbWeight::get().writes(2))
628629
}
630+
/// Storage: `Domains::BlockTreeNodes` (r:2 w:0)
631+
/// Proof: `Domains::BlockTreeNodes` (`max_values`: None, `max_size`: None, mode: `Measured`)
632+
/// Storage: `Domains::HeadReceiptNumber` (r:1 w:0)
633+
/// Proof: `Domains::HeadReceiptNumber` (`max_values`: None, `max_size`: None, mode: `Measured`)
634+
/// Storage: `Domains::DomainRegistry` (r:1 w:0)
635+
/// Proof: `Domains::DomainRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`)
636+
/// Storage: `Domains::RuntimeRegistry` (r:1 w:0)
637+
/// Proof: `Domains::RuntimeRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`)
638+
/// Storage: `Domains::LatestConfirmedDomainExecutionReceipt` (r:1 w:0)
639+
/// Proof: `Domains::LatestConfirmedDomainExecutionReceipt` (`max_values`: None, `max_size`: None, mode: `Measured`)
640+
fn fraud_proof_pre_check() -> Weight {
641+
// Proof Size summary in bytes:
642+
// Measured: `2483056`
643+
// Estimated: `2488996`
644+
// Minimum execution time: 931_000_000 picoseconds.
645+
Weight::from_parts(976_000_000, 0)
646+
.saturating_add(Weight::from_parts(0, 2488996))
647+
.saturating_add(T::DbWeight::get().reads(6))
648+
}
629649
}
630650

631651
// For backwards compatibility and tests
@@ -1199,4 +1219,23 @@ impl WeightInfo for () {
11991219
.saturating_add(ParityDbWeight::get().reads(22))
12001220
.saturating_add(ParityDbWeight::get().writes(2))
12011221
}
1222+
/// Storage: `Domains::BlockTreeNodes` (r:2 w:0)
1223+
/// Proof: `Domains::BlockTreeNodes` (`max_values`: None, `max_size`: None, mode: `Measured`)
1224+
/// Storage: `Domains::HeadReceiptNumber` (r:1 w:0)
1225+
/// Proof: `Domains::HeadReceiptNumber` (`max_values`: None, `max_size`: None, mode: `Measured`)
1226+
/// Storage: `Domains::DomainRegistry` (r:1 w:0)
1227+
/// Proof: `Domains::DomainRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`)
1228+
/// Storage: `Domains::RuntimeRegistry` (r:1 w:0)
1229+
/// Proof: `Domains::RuntimeRegistry` (`max_values`: None, `max_size`: None, mode: `Measured`)
1230+
/// Storage: `Domains::LatestConfirmedDomainExecutionReceipt` (r:1 w:0)
1231+
/// Proof: `Domains::LatestConfirmedDomainExecutionReceipt` (`max_values`: None, `max_size`: None, mode: `Measured`)
1232+
fn fraud_proof_pre_check() -> Weight {
1233+
// Proof Size summary in bytes:
1234+
// Measured: `2483056`
1235+
// Estimated: `2488996`
1236+
// Minimum execution time: 931_000_000 picoseconds.
1237+
Weight::from_parts(976_000_000, 0)
1238+
.saturating_add(Weight::from_parts(0, 2488996))
1239+
.saturating_add(ParityDbWeight::get().reads(6))
1240+
}
12021241
}

0 commit comments

Comments
 (0)