mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-13 06:29:25 +00:00
Only recheck blocks with non-fatal inherent transaction errors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use std::{
|
||||
sync::{Arc, RwLock},
|
||||
time::{UNIX_EPOCH, SystemTime, Duration},
|
||||
collections::HashSet,
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
@@ -318,8 +319,7 @@ impl<T: TendermintValidator> Network for TendermintAuthority<T> {
|
||||
origin: None,
|
||||
allow_missing_state: false,
|
||||
skip_execution: false,
|
||||
// TODO: Only set to true if block was rejected due to its inherents
|
||||
import_existing: true,
|
||||
import_existing: self.import.recheck.read().unwrap().contains(&hash),
|
||||
state: None,
|
||||
}],
|
||||
);
|
||||
@@ -354,6 +354,9 @@ impl<T: TendermintValidator> Network for TendermintAuthority<T> {
|
||||
.map_err(|_| Error::InvalidJustification)
|
||||
.unwrap();
|
||||
|
||||
// Clear any blocks for the previous height we were willing to recheck
|
||||
*self.import.recheck.write().unwrap() = HashSet::new();
|
||||
|
||||
let number: u64 = match (*block.header().number()).try_into() {
|
||||
Ok(number) => number,
|
||||
Err(_) => panic!("BlockNumber exceeded u64"),
|
||||
|
||||
Reference in New Issue
Block a user