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:
12
src/sigverify.rs
Normal file → Executable file
12
src/sigverify.rs
Normal file → Executable 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()
|
||||
|
Reference in New Issue
Block a user