File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -332,8 +332,19 @@ where
332332 for ( raw_log, decoded_log, _) in group {
333333 let block_number =
334334 raw_log. block_number . ok_or ( FilterLogError :: MissingBlockNumber ) ?;
335- let block_timestamp =
336- raw_log. block_timestamp . ok_or ( FilterLogError :: MissingBlockTimestamp ) ?;
335+ let log_timestamp = raw_log. block_timestamp ;
336+ // if the log is missing the block timestamp, we need to fetch it.
337+ // the block timestamp is necessary in order to derive the beacon
338+ // slot and query the blobs.
339+ let block_timestamp = if log_timestamp. is_none ( ) {
340+ self . execution_provider
341+ . get_block ( block_number. into ( ) )
342+ . await ?
343+ . map ( |b| b. header . timestamp )
344+ . ok_or ( FilterLogError :: MissingBlockTimestamp ) ?
345+ } else {
346+ log_timestamp. expect ( "checked for Some(...)" )
347+ } ;
337348 let batch_index =
338349 decoded_log. batch_index . uint_try_to ( ) . expect ( "u256 to u64 conversion error" ) ;
339350
You can’t perform that action at this time.
0 commit comments