mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-05-17 07:09:57 +00:00
small changes
This commit is contained in:
parent
9d8facc5a0
commit
d16d5f76b2
@ -65,7 +65,9 @@ impl IndexerCore {
|
|||||||
&self.config.channel_id,
|
&self.config.channel_id,
|
||||||
).collect::<Vec<_>>();
|
).collect::<Vec<_>>();
|
||||||
|
|
||||||
info!("Parsed {} L2 blocks", l2_blocks_parsed.len());
|
let mut l2_blocks_parsed_ids: Vec<_> = l2_blocks_parsed.iter().map(|block| block.header.block_id).collect();
|
||||||
|
l2_blocks_parsed_ids.sort();
|
||||||
|
info!("Parsed {} L2 blocks with ids {:?}", l2_blocks_parsed.len(), l2_blocks_parsed_ids);
|
||||||
|
|
||||||
for l2_block in l2_blocks_parsed {
|
for l2_block in l2_blocks_parsed {
|
||||||
// State modification, will be updated in future
|
// State modification, will be updated in future
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"is_genesis_random": true,
|
"is_genesis_random": true,
|
||||||
"max_num_tx_in_block": 20,
|
"max_num_tx_in_block": 20,
|
||||||
"mempool_max_size": 1000,
|
"mempool_max_size": 1000,
|
||||||
"block_create_timeout_millis": 2000,
|
"block_create_timeout_millis": 15000,
|
||||||
"retry_pending_blocks_timeout_millis": 500,
|
"retry_pending_blocks_timeout_millis": 500,
|
||||||
"port": 3040,
|
"port": 3040,
|
||||||
"bedrock_config": {
|
"bedrock_config": {
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
use std::{net::SocketAddr, path::PathBuf, sync::Arc, time::Duration};
|
use std::{
|
||||||
|
net::SocketAddr,
|
||||||
|
path::PathBuf,
|
||||||
|
sync::Arc,
|
||||||
|
time::{Duration, Instant},
|
||||||
|
};
|
||||||
|
|
||||||
use actix_web::dev::ServerHandle;
|
use actix_web::dev::ServerHandle;
|
||||||
use anyhow::{Context as _, Result};
|
use anyhow::{Context as _, Result};
|
||||||
@ -12,7 +17,6 @@ use sequencer_core::{
|
|||||||
};
|
};
|
||||||
use sequencer_rpc::new_http_server;
|
use sequencer_rpc::new_http_server;
|
||||||
use tokio::{sync::Mutex, task::JoinHandle};
|
use tokio::{sync::Mutex, task::JoinHandle};
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
pub const RUST_LOG: &str = "RUST_LOG";
|
pub const RUST_LOG: &str = "RUST_LOG";
|
||||||
|
|
||||||
@ -164,7 +168,7 @@ async fn retry_pending_blocks_loop(
|
|||||||
loop {
|
loop {
|
||||||
tokio::time::sleep(retry_pending_blocks_timeout).await;
|
tokio::time::sleep(retry_pending_blocks_timeout).await;
|
||||||
|
|
||||||
let (pending_blocks, block_settlement_client) = {
|
let (mut pending_blocks, block_settlement_client) = {
|
||||||
let sequencer_core = seq_core.lock().await;
|
let sequencer_core = seq_core.lock().await;
|
||||||
let client = sequencer_core.block_settlement_client();
|
let client = sequencer_core.block_settlement_client();
|
||||||
let pending_blocks = sequencer_core
|
let pending_blocks = sequencer_core
|
||||||
@ -173,7 +177,11 @@ async fn retry_pending_blocks_loop(
|
|||||||
(pending_blocks, client)
|
(pending_blocks, client)
|
||||||
};
|
};
|
||||||
|
|
||||||
for block in &pending_blocks {
|
let k = 50;
|
||||||
|
if pending_blocks.len() > k {
|
||||||
|
pending_blocks.select_nth_unstable_by_key(k, |b| b.header.block_id);
|
||||||
|
}
|
||||||
|
for block in pending_blocks.iter().take(k) {
|
||||||
info!(
|
info!(
|
||||||
"Resubmitting pending block with id {}",
|
"Resubmitting pending block with id {}",
|
||||||
block.header.block_id
|
block.header.block_id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user