Commit 30df413 1 parent 30f67f0 commit 30df413 Copy full SHA for 30df413
File tree 3 files changed +7
-10
lines changed
3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -157,10 +157,10 @@ fn execute_block_importer(
157
157
158
158
// re-execute (and import) block
159
159
batch_tx_len += block. transactions . len ( ) ;
160
- executor. execute_external_block ( block, & mut receipts) ?;
160
+ executor. execute_external_block ( block. clone ( ) , & mut receipts) ?;
161
161
162
162
// mine and save block
163
- miner. mine_external_and_commit ( ) ?;
163
+ miner. mine_external_and_commit ( block ) ?;
164
164
}
165
165
let batch_duration = before_block. elapsed ( ) ;
166
166
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ impl Importer {
180
180
let mut receipts = ExternalReceipts :: from ( receipts) ;
181
181
#[ cfg( feature = "metrics" ) ]
182
182
let receipts_len = receipts. len ( ) ;
183
- if let Err ( e) = executor. execute_external_block ( block, & mut receipts) {
183
+ if let Err ( e) = executor. execute_external_block ( block. clone ( ) , & mut receipts) {
184
184
let message = GlobalState :: shutdown_from ( TASK_NAME , "failed to reexecute external block" ) ;
185
185
return log_and_err ! ( reason = e, message) ;
186
186
} ;
@@ -200,7 +200,7 @@ impl Importer {
200
200
) ;
201
201
}
202
202
203
- if let Err ( e) = miner. mine_external_and_commit ( ) {
203
+ if let Err ( e) = miner. mine_external_and_commit ( block ) {
204
204
let message = GlobalState :: shutdown_from ( TASK_NAME , "failed to mine external block" ) ;
205
205
return log_and_err ! ( reason = e, message) ;
206
206
} ;
Original file line number Diff line number Diff line change @@ -237,17 +237,17 @@ impl Miner {
237
237
}
238
238
239
239
/// Same as [`Self::mine_external`], but automatically commits the block instead of returning it.
240
- pub fn mine_external_and_commit ( & self ) -> anyhow:: Result < ( ) > {
240
+ pub fn mine_external_and_commit ( & self , external_block : ExternalBlock ) -> anyhow:: Result < ( ) > {
241
241
let _mine_and_commit_lock = self . locks . mine_and_commit . lock ( ) . map_lock_error ( "mine_external_and_commit" ) ?;
242
242
243
- let block = self . mine_external ( ) ?;
243
+ let block = self . mine_external ( external_block ) ?;
244
244
self . commit ( block)
245
245
}
246
246
247
247
/// Mines external block and external transactions.
248
248
///
249
249
/// Local transactions are not allowed to be part of the block.
250
- pub fn mine_external ( & self ) -> anyhow:: Result < Block > {
250
+ pub fn mine_external ( & self , external_block : ExternalBlock ) -> anyhow:: Result < Block > {
251
251
// track
252
252
#[ cfg( feature = "tracing" ) ]
253
253
let _span = info_span ! ( "miner::mine_external" , block_number = field:: Empty ) . entered ( ) ;
@@ -258,9 +258,6 @@ impl Miner {
258
258
// mine block
259
259
let block = self . storage . finish_pending_block ( ) ?;
260
260
Span :: with ( |s| s. rec_str ( "block_number" , & block. header . number ) ) ;
261
- let Some ( external_block) = block. external_block else {
262
- return log_and_err ! ( "failed to mine external block because there is no external block being reexecuted" ) ;
263
- } ;
264
261
265
262
// mine transactions
266
263
let mut external_txs = Vec :: with_capacity ( block. transactions . len ( ) ) ;
You can’t perform that action at this time.
0 commit comments