File tree Expand file tree Collapse file tree
light-clients/ics10-grandpa/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9292 ) )
9393 . into ( ) )
9494 }
95+ if header. finality_proof . unknown_headers . len ( ) >= client_state. session_length ( ) {
96+ return Err ( Error :: Custom ( format ! (
97+ "Number of unknown headers submitted exceeds max number of blocks in a session: max {}, got {}" ,
98+ client_state. session_length( ) , header. finality_proof. unknown_headers. len( )
99+ ) )
100+ . into ( ) )
101+ }
95102 let headers_with_finality_proof = ParachainHeadersWithFinalityProof {
96103 finality_proof : header. finality_proof ,
97104 parachain_header : header. parachain_header ,
Original file line number Diff line number Diff line change @@ -146,6 +146,14 @@ impl<H> ClientState<H> {
146146 elapsed > self . relay_chain . trusting_period ( )
147147 }
148148
149+ pub fn session_length ( & self ) -> usize {
150+ match self . relay_chain {
151+ RelayChain :: Polkadot => 2400 ,
152+ RelayChain :: Kusama => 600 ,
153+ RelayChain :: Rococo => 600 ,
154+ }
155+ }
156+
149157 pub fn with_frozen_height ( self , h : Height ) -> Result < Self , Error > {
150158 if h == Height :: zero ( ) {
151159 return Err ( Error :: Custom (
You can’t perform that action at this time.
0 commit comments