Dynamic network test changes (#795)

- No sigverify if feature sigverify_cpu_disable is used
- Purge validators in the test if lag count increases beyond
  SOLANA_DYNAMIC_NODES_PURGE_LAG environment variable
- Other useful log messages in the test
This commit is contained in:
pgarg66
2018-07-30 13:57:10 -07:00
committed by GitHub
parent fae9fff24c
commit 0c33c9e0d7
5 changed files with 76 additions and 7 deletions

12
src/sigverify.rs Normal file → Executable file
View File

@@ -6,8 +6,13 @@
use counter::Counter;
use packet::{Packet, SharedPackets};
#[cfg(not(feature = "sigverify_cpu_disable"))]
use std::mem::size_of;
use std::sync::atomic::AtomicUsize;
#[cfg(not(feature = "sigverify_cpu_disable"))]
use transaction::{PUB_KEY_OFFSET, SIGNED_DATA_OFFSET, SIG_OFFSET};
pub const TX_OFFSET: usize = 0;
@@ -42,6 +47,7 @@ pub fn init() {
}
#[cfg(not(feature = "cuda"))]
#[cfg(not(feature = "sigverify_cpu_disable"))]
fn verify_packet(packet: &Packet) -> u8 {
use ring::signature;
use signature::{PublicKey, Signature};
@@ -66,6 +72,12 @@ fn verify_packet(packet: &Packet) -> u8 {
).is_ok() as u8
}
#[cfg(feature = "sigverify_cpu_disable")]
fn verify_packet(_packet: &Packet) -> u8 {
warn!("signature verification is disabled");
return 1;
}
fn batch_size(batches: &[SharedPackets]) -> usize {
batches
.iter()