@@ -14,8 +14,11 @@ use e2store::{
14
14
utils:: get_e2hs_files,
15
15
} ;
16
16
use ethportal_api:: {
17
+ consensus:: historical_summaries:: HistoricalSummaries ,
17
18
types:: {
18
- execution:: header_with_proof:: HeaderWithProof , network:: Subnetwork , portal_wire:: OfferTrace ,
19
+ execution:: header_with_proof:: { BlockHeaderProof , HeaderWithProof } ,
20
+ network:: Subnetwork ,
21
+ portal_wire:: OfferTrace ,
19
22
} ,
20
23
BlockBody , ContentValue , HistoryContentKey , HistoryContentValue , OverlayContentKey ,
21
24
RawContentValue , Receipts ,
@@ -95,7 +98,9 @@ impl E2HSBridge {
95
98
Ok ( Self {
96
99
gossiper,
97
100
block_semaphore,
98
- header_validator : HeaderValidator :: new ( ) ,
101
+ header_validator : HeaderValidator :: new_with_historical_summaries (
102
+ HistoricalSummaries :: default ( ) ,
103
+ ) ,
99
104
block_range,
100
105
random_fill,
101
106
e2hs_files,
@@ -171,7 +176,7 @@ impl E2HSBridge {
171
176
continue ;
172
177
}
173
178
}
174
- if let Err ( err) = self . validate_block_tuple ( & block_tuple) {
179
+ if let Err ( err) = self . validate_block_tuple ( & block_tuple) . await {
175
180
error ! ( "Failed to validate block tuple: {err:?}" ) ;
176
181
continue ;
177
182
}
@@ -206,10 +211,19 @@ impl E2HSBridge {
206
211
. unwrap_or_else ( |err| panic ! ( "unable to read e2hs file at path: {e2hs_path:?} : {err}" ) )
207
212
}
208
213
209
- fn validate_block_tuple ( & self , block_tuple : & BlockTuple ) -> anyhow:: Result < ( ) > {
214
+ async fn validate_block_tuple ( & self , block_tuple : & BlockTuple ) -> anyhow:: Result < ( ) > {
210
215
let header_with_proof = & block_tuple. header_with_proof . header_with_proof ;
211
- self . header_validator
212
- . validate_header_with_proof ( header_with_proof) ?;
216
+ // The E2HS bridge doesn't have access to a provider so it can't validate historical summary
217
+ // Header with Proofs
218
+ if !matches ! (
219
+ header_with_proof. proof,
220
+ BlockHeaderProof :: HistoricalSummariesCapella ( _)
221
+ | BlockHeaderProof :: HistoricalSummariesDeneb ( _)
222
+ ) {
223
+ self . header_validator
224
+ . validate_header_with_proof ( header_with_proof)
225
+ . await ?;
226
+ }
213
227
let body = & block_tuple. body . body ;
214
228
body. validate_against_header ( & header_with_proof. header ) ?;
215
229
let receipts = & block_tuple. receipts . receipts ;
0 commit comments