mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-23 03:59:31 +00:00
sort imports
This commit is contained in:
parent
cc5a980f18
commit
b8e50eb96d
2 changed files with 16 additions and 20 deletions
|
@ -22,23 +22,18 @@ use tower::{Service, ServiceExt};
|
|||
use tracing::{instrument, Instrument, Span};
|
||||
|
||||
use async_buffer::{BufferAppender, BufferStream};
|
||||
use cuprate_helper::asynch::rayon_spawn_async;
|
||||
use fixed_bytes::ByteArrayVec;
|
||||
use monero_p2p::{
|
||||
client::InternalPeerID,
|
||||
handles::ConnectionHandle,
|
||||
services::{PeerSyncRequest, PeerSyncResponse},
|
||||
NetworkZone, PeerRequest, PeerResponse, PeerSyncSvc,
|
||||
NetworkZone, PeerSyncSvc,
|
||||
};
|
||||
use monero_pruning::{PruningSeed, CRYPTONOTE_MAX_BLOCK_HEIGHT};
|
||||
use monero_wire::protocol::{ChainRequest, ChainResponse};
|
||||
|
||||
use crate::{
|
||||
client_pool::{ClientPool, ClientPoolDropGuard},
|
||||
constants::{
|
||||
BLOCK_DOWNLOADER_REQUEST_TIMEOUT, EMPTY_CHAIN_ENTRIES_BEFORE_TOP_ASSUMED,
|
||||
INITIAL_CHAIN_REQUESTS_TO_SEND, LONG_BAN, MAX_BLOCKS_IDS_IN_CHAIN_ENTRY,
|
||||
MAX_BLOCK_BATCH_LEN, MAX_DOWNLOAD_FAILURES, MEDIUM_BAN,
|
||||
BLOCK_DOWNLOADER_REQUEST_TIMEOUT, EMPTY_CHAIN_ENTRIES_BEFORE_TOP_ASSUMED, LONG_BAN,
|
||||
MAX_BLOCK_BATCH_LEN, MAX_DOWNLOAD_FAILURES,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -1,37 +1,38 @@
|
|||
use cuprate_helper::asynch::rayon_spawn_async;
|
||||
use fixed_bytes::ByteArrayVec;
|
||||
use monero_p2p::handles::ConnectionHandle;
|
||||
use monero_p2p::{NetworkZone, PeerRequest, PeerResponse};
|
||||
use monero_serai::block::Block;
|
||||
use monero_serai::transaction::Transaction;
|
||||
use monero_wire::protocol::{GetObjectsRequest, GetObjectsResponse};
|
||||
use rayon::prelude::*;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use monero_serai::{block::Block, transaction::Transaction};
|
||||
use rayon::prelude::*;
|
||||
use tokio::time::timeout;
|
||||
use tower::{Service, ServiceExt};
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::block_downloader::BlockDownloadTaskResponse;
|
||||
use monero_p2p::{NetworkZone, PeerRequest, PeerResponse, handles::ConnectionHandle};
|
||||
use monero_wire::protocol::{GetObjectsRequest, GetObjectsResponse};
|
||||
use cuprate_helper::asynch::rayon_spawn_async;
|
||||
use fixed_bytes::ByteArrayVec;
|
||||
|
||||
use crate::{
|
||||
block_downloader::{BlockBatch, BlockDownloadError},
|
||||
block_downloader::{BlockBatch, BlockDownloadError, BlockDownloadTaskResponse},
|
||||
client_pool::ClientPoolDropGuard,
|
||||
constants::{BLOCK_DOWNLOADER_REQUEST_TIMEOUT, MAX_TRANSACTION_BLOB_SIZE, MEDIUM_BAN},
|
||||
};
|
||||
|
||||
|
||||
/// Attempts to request a batch of blocks from a peer, returning [`BlockDownloadTaskResponse`].
|
||||
#[instrument(
|
||||
level = "debug",
|
||||
name = "download_batch",
|
||||
skip_all,
|
||||
fields(
|
||||
start_height = expected_start_height,
|
||||
attempt
|
||||
attempt = _attempt
|
||||
)
|
||||
)]
|
||||
pub async fn download_batch_task<N: NetworkZone>(
|
||||
client: ClientPoolDropGuard<N>,
|
||||
ids: ByteArrayVec<32>,
|
||||
expected_start_height: u64,
|
||||
attempt: usize,
|
||||
_attempt: usize,
|
||||
) -> BlockDownloadTaskResponse<N> {
|
||||
BlockDownloadTaskResponse {
|
||||
start_height: expected_start_height,
|
||||
|
|
Loading…
Reference in a new issue