diff --git a/Cargo.lock b/Cargo.lock index 86346e93..a8c3e0da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -654,6 +654,7 @@ dependencies = [ "dandelion-tower", "futures", "monero-p2p", + "monero-serai", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index 4a8b7bd1..5f5936ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ resolver = "2" members = [ + "binaries/cuprated", "consensus", "consensus/rules", "cryptonight", @@ -19,7 +20,7 @@ members = [ "storage/database", "pruning", "test-utils", - "types", "binaries/cuprated", + "types", ] [profile.release] diff --git a/binaries/cuprated/Cargo.toml b/binaries/cuprated/Cargo.toml index 3161dea9..f2614081 100644 --- a/binaries/cuprated/Cargo.toml +++ b/binaries/cuprated/Cargo.toml @@ -16,6 +16,7 @@ cuprate-blockchain = { path = "../../storage/cuprate-blockchain" } # Consensus cuprate-consensus = { path = "../../consensus" } +monero-serai = { workspace = true } # Async tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } diff --git a/binaries/cuprated/src/main.rs b/binaries/cuprated/src/main.rs index 9397949e..6d1b81d7 100644 --- a/binaries/cuprated/src/main.rs +++ b/binaries/cuprated/src/main.rs @@ -1,6 +1,7 @@ mod network; mod p2p_request_handler; mod syncer; +mod tx_pool; fn main() { println!("Hello, world!"); diff --git a/binaries/cuprated/src/p2p_request_handler.rs b/binaries/cuprated/src/p2p_request_handler.rs index e69de29b..4a0e269a 100644 --- a/binaries/cuprated/src/p2p_request_handler.rs +++ b/binaries/cuprated/src/p2p_request_handler.rs @@ -0,0 +1,7 @@ +use cuprate_blockchain::service::DatabaseReadHandle; + +pub struct P2PRequestHandler { + database: DatabaseReadHandle, + + txpool: (), +} diff --git a/binaries/cuprated/src/syncer.rs b/binaries/cuprated/src/syncer.rs index 7fc13dad..93912e9f 100644 --- a/binaries/cuprated/src/syncer.rs +++ b/binaries/cuprated/src/syncer.rs @@ -2,3 +2,20 @@ //! //! The syncer is the part of Cuprate that handles keeping the blockchain state, it handles syncing if //! we have fallen behind, and it handles incoming blocks. +use monero_serai::{block::Block, transaction::Transaction}; + +use monero_p2p::handles::ConnectionHandle; + +pub struct IncomingFluffyBlock { + block: Block, + included_txs: Vec, + peer_handle: ConnectionHandle, +} + +/// A response to an [`IncomingFluffyBlock`] +pub enum IncomingFluffyBlockResponse { + /// We are missing these transactions from the block. + MissingTransactions(Vec<[u8; 32]>), + /// A generic ok response. + Ok, +} diff --git a/binaries/cuprated/src/tx_pool.rs b/binaries/cuprated/src/tx_pool.rs new file mode 100644 index 00000000..317b0c8f --- /dev/null +++ b/binaries/cuprated/src/tx_pool.rs @@ -0,0 +1,2 @@ +//! # Transaction Pool +//!