mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-02-18 20:33:13 +00:00
wip
This commit is contained in:
parent
f1293ec77b
commit
9d8facc5a0
@ -28,6 +28,7 @@ pub trait BlockSettlementClientTrait: Clone {
|
||||
/// Create and sign a transaction for inscribing data.
|
||||
fn create_inscribe_tx(&self, block: &Block) -> Result<(SignedMantleTx, MsgId)> {
|
||||
let inscription_data = borsh::to_vec(block)?;
|
||||
log::info!("The size of the block {} is {} bytes", block.header.block_id, inscription_data.len());
|
||||
let verifying_key_bytes = self.bedrock_signing_key().public_key().to_bytes();
|
||||
let verifying_key =
|
||||
Ed25519PublicKey::from_bytes(&verifying_key_bytes).expect("valid ed25519 public key");
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
"is_genesis_random": true,
|
||||
"max_num_tx_in_block": 20,
|
||||
"mempool_max_size": 1000,
|
||||
"block_create_timeout_millis": 12000,
|
||||
"retry_pending_blocks_timeout_millis": 6000,
|
||||
"block_create_timeout_millis": 2000,
|
||||
"retry_pending_blocks_timeout_millis": 500,
|
||||
"port": 3040,
|
||||
"bedrock_config": {
|
||||
"backoff": {
|
||||
|
||||
@ -5,13 +5,14 @@ use anyhow::{Context as _, Result};
|
||||
use clap::Parser;
|
||||
use common::rpc_primitives::RpcConfig;
|
||||
use futures::{FutureExt as _, never::Never};
|
||||
use log::{error, info, warn};
|
||||
use log::{debug, error, info, warn};
|
||||
use sequencer_core::{
|
||||
SequencerCore, block_settlement_client::BlockSettlementClientTrait as _,
|
||||
config::SequencerConfig,
|
||||
};
|
||||
use sequencer_rpc::new_http_server;
|
||||
use tokio::{sync::Mutex, task::JoinHandle};
|
||||
use std::time::Instant;
|
||||
|
||||
pub const RUST_LOG: &str = "RUST_LOG";
|
||||
|
||||
@ -172,20 +173,21 @@ async fn retry_pending_blocks_loop(
|
||||
(pending_blocks, client)
|
||||
};
|
||||
|
||||
if let Some(block) = pending_blocks
|
||||
.iter()
|
||||
.min_by_key(|block| block.header.block_id)
|
||||
{
|
||||
for block in &pending_blocks {
|
||||
info!(
|
||||
"Resubmitting pending block with id {}",
|
||||
block.header.block_id
|
||||
);
|
||||
// TODO: We could cache the inscribe tx for each pending block to avoid re-creating it
|
||||
// on every retry.
|
||||
let now = Instant::now();
|
||||
let (tx, _msg_id) = block_settlement_client
|
||||
.create_inscribe_tx(block)
|
||||
.context("Failed to create inscribe tx for pending block")?;
|
||||
|
||||
debug!(">>>> Create inscribe: {:?}", now.elapsed());
|
||||
|
||||
let now = Instant::now();
|
||||
if let Err(e) = block_settlement_client
|
||||
.submit_inscribe_tx_to_bedrock(tx)
|
||||
.await
|
||||
@ -195,6 +197,7 @@ async fn retry_pending_blocks_loop(
|
||||
block.header.block_id
|
||||
);
|
||||
}
|
||||
debug!(">>>> Post: {:?}", now.elapsed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user