From 3e3fe6cae6fa58eaac040bbaaaa3887190234c85 Mon Sep 17 00:00:00 2001 From: Simon B Date: Thu, 29 Mar 2018 17:56:46 +0200 Subject: [PATCH] Testnet2 small fixes (#899) * add hint for gcc-5 for building CUDA plugin * add N_BLOCks comment for >=6GB GPU cards * minor logging cleanup * mark to be kept + reformat as "@ height [hash]" * show CuckooNN + better wording --- chain/src/pipe.rs | 8 ++++---- chain/src/txhashset.rs | 2 +- core/src/core/block.rs | 2 +- grin.toml | 8 +++++++- grin/src/miner.rs | 6 +++++- p2p/src/peers.rs | 6 +++--- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index 0ca8b2b0..3200dd7e 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -169,10 +169,10 @@ pub fn sync_block_header( pub fn process_block_header(bh: &BlockHeader, mut ctx: BlockContext) -> Result<(), Error> { debug!( LOGGER, - "pipe: process_block_header: {} at {}", - bh.hash(), - bh.height - ); + "pipe: process_block_header at {} [{}]", + bh.height, + bh.hash() + ); // keep this check_header_known(bh.hash(), &mut ctx)?; validate_header(&bh, &mut ctx) diff --git a/chain/src/txhashset.rs b/chain/src/txhashset.rs index 41844aff..62c7929c 100644 --- a/chain/src/txhashset.rs +++ b/chain/src/txhashset.rs @@ -502,7 +502,7 @@ impl<'a> Extension<'a> { pub fn rewind(&mut self, block_header: &BlockHeader) -> Result<(), Error> { let hash = block_header.hash(); let height = block_header.height; - debug!(LOGGER, "Rewind to header {} at {}", hash, height); + debug!(LOGGER, "Rewind to header at {} [{}]", height, hash); // keep this // rewind each MMR let (out_pos_rew, kern_pos_rew) = self.commit_index.get_block_marker(&hash)?; diff --git a/core/src/core/block.rs b/core/src/core/block.rs index 8b408662..d1d78033 100644 --- a/core/src/core/block.rs +++ b/core/src/core/block.rs @@ -414,7 +414,7 @@ impl Block { /// Hydrate a block from a compact block. /// Note: caller must validate the block themselves, we do not validate it here. pub fn hydrate_from(cb: CompactBlock, txs: Vec) -> Block { - debug!( + trace!( LOGGER, "block: hydrate_from: {}, {} txs", cb.hash(), diff --git a/grin.toml b/grin.toml index f51b4a56..c90970d2 100644 --- a/grin.toml +++ b/grin.toml @@ -219,11 +219,17 @@ NUM_THREADS = 1 #[mining.miner_plugin_config.device_parameters.0] #NUM_THREADS = 1 -#CUDA Miner (Included here for integration only, Not ready for use) +#CUDA Miner +# +# Note! 4+ GB GPU cards only! +# If you have 6GB GPU RAM, set N_BLOCKS = 128 +# Docs: https://github.com/tromp/cuckoo/blob/master/GPU.md +# #Can currently be used only in Production (30) Mode #This plugin is not built by default. To build: #1) Ensure the latest cuda toolkit is installed # (nvcc should be in your PATH) +# Wrong gcc? install gcc-5 g++-5; export CC=`which gcc-5`; # then build #2) Uncomment the 'build-cuda-plugin' feature # in pow/Cargo.toml # diff --git a/grin/src/miner.rs b/grin/src/miner.rs index cc89c301..0ebf4af1 100644 --- a/grin/src/miner.rs +++ b/grin/src/miner.rs @@ -221,7 +221,11 @@ impl Miner { } } } - info!(LOGGER, "Mining at {} graphs per second", sps_total); + info!( + LOGGER, + "Mining: Cuckoo{} at {} gps (graphs per second)", + cuckoo_size, + sps_total); if sps_total.is_finite() { let mut mining_stats = mining_stats.write().unwrap(); mining_stats.combined_gps = sps_total; diff --git a/p2p/src/peers.rs b/p2p/src/peers.rs index 42ee96f1..b17fc48a 100644 --- a/p2p/src/peers.rs +++ b/p2p/src/peers.rs @@ -280,10 +280,10 @@ impl Peers { } debug!( LOGGER, - "broadcast_block: {}, {} at {}, to {} peers, done.", - b.hash(), + "broadcast_block: {} @ {} [{}] was sent to {} peers.", b.header.total_difficulty, b.header.height, + b.hash(), count, ); } @@ -594,7 +594,7 @@ impl NetAdapter for Peers { /// addresses. fn find_peer_addrs(&self, capab: Capabilities) -> Vec { let peers = self.find_peers(State::Healthy, capab, MAX_PEER_ADDRS as usize); - debug!(LOGGER, "Got {} peer addrs to send.", peers.len()); + trace!(LOGGER, "find_peer_addrs: {} healthy peers picked", peers.len()); map_vec!(peers, |p| p.addr) }