@@ -280,9 +280,22 @@ pub trait ChainWithGrandpa: Chain {
280
280
/// headers that aren't changing the set.
281
281
///
282
282
/// This isn't a strict limit. The relay may submit justifications with larger headers in its
283
+ /// ancestry and the pallet will accept the call. The limit is only used to compute fee, paid
284
+ /// by the user at the sending chain. It covers most of cases, but if the actual header,
285
+ /// submitted with the messages transaction will be larger than the
286
+ /// `AVERAGE_HEADER_SIZE_IN_JUSTIFICATION`, the difference (`WORST_HEADER_SIZE_IN_JUSTIFICATION`
287
+ /// - `AVERAGE_HEADER_SIZE_IN_JUSTIFICATION`) must be covered by the sending chain.
288
+ const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION : u32 ;
289
+
290
+ /// Worst-case size of the chain header from justification ancestry. We don't expect to see
291
+ /// there headers that change GRANDPA authorities set (GRANDPA will probably be able to finalize
292
+ /// at least one additional header per session on non test chains), so this is the worst-case
293
+ /// size of headers that aren't changing the set.
294
+ ///
295
+ /// This isn't a strict limit. The relay may submit justifications with larger headers in its
283
296
/// ancestry and the pallet will accept the call. The limit is only used to compute maximal
284
297
/// refund amount and doing calls which exceed the limit, may be costly to submitter.
285
- const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION : u32 ;
298
+ const WORST_HEADER_SIZE_IN_JUSTIFICATION : u32 ;
286
299
}
287
300
288
301
impl < T > ChainWithGrandpa for T
@@ -298,4 +311,6 @@ where
298
311
const MAX_HEADER_SIZE : u32 = <T :: Chain as ChainWithGrandpa >:: MAX_HEADER_SIZE ;
299
312
const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION : u32 =
300
313
<T :: Chain as ChainWithGrandpa >:: AVERAGE_HEADER_SIZE_IN_JUSTIFICATION ;
314
+ const WORST_HEADER_SIZE_IN_JUSTIFICATION : u32 =
315
+ <T :: Chain as ChainWithGrandpa >:: WORST_HEADER_SIZE_IN_JUSTIFICATION ;
301
316
}
0 commit comments