1
// Copyright 2025 Moonbeam foundation
2
// This file is part of Moonbeam.
3

            
4
// Moonbeam is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Moonbeam is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Moonbeam.  If not, see <http://www.gnu.org/licenses/>.
16

            
17
use crate::{Runtime, Weight};
18
use ::pallet_bridge_grandpa::WeightInfoExt as GrandpaWeightInfoExt;
19
use ::pallet_bridge_messages::WeightInfoExt as MessagesWeightInfoExt;
20
use ::pallet_bridge_parachains::WeightInfoExt as ParachainsWeightInfoExt;
21

            
22
impl GrandpaWeightInfoExt for super::pallet_bridge_grandpa::WeightInfo<Runtime> {
23
	fn submit_finality_proof_overhead_from_runtime() -> Weight {
24
		// stable2512 wraps bridge transactions in `StorageWeightReclaim`, and bridge
25
		// extrinsics now need a non-zero proof-size allowance for runtime-level
26
		// post-dispatch overhead. We conservatively mirror the legacy bridge-hub
27
		// relayer proof-size overhead here until reference-machine benchmarks are rerun.
28
		Weight::from_parts(0, 4_714)
29
	}
30
}
31

            
32
impl ParachainsWeightInfoExt for super::pallet_bridge_parachains::WeightInfo<Runtime> {
33
	fn expected_extra_storage_proof_size() -> u32 {
34
		::pallet_bridge_parachains::weights_ext::EXTRA_STORAGE_PROOF_SIZE
35
	}
36

            
37
	fn submit_parachain_heads_overhead_from_runtime() -> Weight {
38
		Weight::from_parts(0, 4_714)
39
	}
40
}
41

            
42
impl MessagesWeightInfoExt for super::pallet_bridge_messages::WeightInfo<Runtime> {
43
	fn expected_extra_storage_proof_size() -> u32 {
44
		::pallet_bridge_messages::EXTRA_STORAGE_PROOF_SIZE
45
	}
46

            
47
	fn receive_messages_proof_overhead_from_runtime() -> Weight {
48
		Weight::from_parts(0, 4_714)
49
	}
50

            
51
	fn receive_messages_delivery_proof_overhead_from_runtime() -> Weight {
52
		Weight::from_parts(0, 3_538)
53
	}
54
}