silence sigverify disabled, make disabling sigverify easier (#3901)

* silence sigverify disabled, make disabling sigverify easier

* fixup
This commit is contained in:
Rob Walker 2019-04-19 14:18:19 -07:00 committed by GitHub
parent 4abe95abec
commit c3155a6e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 92 deletions

View File

@ -238,6 +238,11 @@ impl Fullnode {
&leader_schedule_cache,
&exit,
);
if config.sigverify_disabled {
warn!("signature verification disabled");
}
let tpu = Tpu::new(
&id,
&cluster_info,

View File

@ -101,11 +101,6 @@ fn verify_packet(packet: &Packet) -> u8 {
1
}
fn verify_packet_disabled(_packet: &Packet) -> u8 {
warn!("signature verification is disabled");
1
}
fn batch_size(batches: &[Packets]) -> usize {
batches.iter().map(|p| p.packets.len()).sum()
}
@ -195,7 +190,7 @@ pub fn ed25519_verify_disabled(batches: &[Packets]) -> Vec<Vec<u8>> {
debug!("disabled ECDSA for {}", batch_size(batches));
let rv = batches
.into_par_iter()
.map(|p| p.packets.par_iter().map(verify_packet_disabled).collect())
.map(|p| vec![1u8; p.packets.len()])
.collect();
inc_new_counter_info!("ed25519_verify_disabled", count);
rv

View File

@ -14,39 +14,8 @@ if [[ $1 = -h ]]; then
fullnode_usage "$@"
fi
extra_fullnode_args=()
while [[ ${1:0:1} = - ]]; do
if [[ $1 = --blockstream ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --enable-rpc-exit ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --init-complete-file ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --public-address ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --no-voting ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --rpc-port ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --dynamic-port-range ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
else
echo "Unknown argument: $1"
exit 1
fi
done
if [[ -n $3 ]]; then
fullnode_usage "$@"
fi
# shellcheck source=multinode-demo/extra-fullnode-args.sh
source "$here"/extra-fullnode-args.sh
[[ -f "$SOLANA_CONFIG_DIR"/bootstrap-leader-id.json ]] || {

View File

@ -0,0 +1,66 @@
# |source| this file
#
# handle arguments for bootstrap leader and validator fullnodes
#
# The following directive disable complaints about unused variables in this
# file:
# shellcheck disable=2034
#
if [[ $1 = -h ]]; then
fullnode_usage "$@"
fi
extra_fullnode_args=()
stake=43 # number of lamports to assign as stake (plus transaction fee to setup the stake)
poll_for_new_genesis_block=0
label=
while [[ ${1:0:1} = - ]]; do
if [[ $1 = --label ]]; then
label="-$2"
shift 2
elif [[ $1 = --poll-for-new-genesis-block ]]; then
poll_for_new_genesis_block=1
shift
elif [[ $1 = --blockstream ]]; then
stake=0
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --enable-rpc-exit ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --init-complete-file ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --public-address ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --stake ]]; then
stake="$2"
shift 2
elif [[ $1 = --no-voting ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --no-sigverify ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --rpc-port ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --dynamic-port-range ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --gossip-port ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
else
echo "Unknown argument: $1"
exit 1
fi
done
if [[ -n $3 ]]; then
fullnode_usage "$@"
fi

View File

@ -9,59 +9,8 @@ source "$here"/common.sh
# shellcheck source=scripts/oom-score-adj.sh
source "$here"/../scripts/oom-score-adj.sh
if [[ $1 = -h ]]; then
fullnode_usage "$@"
fi
extra_fullnode_args=()
stake=43 # number of lamports to assign as stake (plus transaction fee to setup the stake)
poll_for_new_genesis_block=0
label=
while [[ ${1:0:1} = - ]]; do
if [[ $1 = --label ]]; then
label="-$2"
shift 2
elif [[ $1 = --poll-for-new-genesis-block ]]; then
poll_for_new_genesis_block=1
shift
elif [[ $1 = --blockstream ]]; then
stake=0
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --enable-rpc-exit ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --init-complete-file ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --stake ]]; then
stake="$2"
shift 2
elif [[ $1 = --public-address ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --no-voting ]]; then
extra_fullnode_args+=("$1")
shift
elif [[ $1 = --gossip-port ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --rpc-port ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
elif [[ $1 = --dynamic-port-range ]]; then
extra_fullnode_args+=("$1" "$2")
shift 2
else
echo "Unknown argument: $1"
exit 1
fi
done
if [[ -n $3 ]]; then
fullnode_usage "$@"
fi
# shellcheck source=multinode-demo/extra-fullnode-args.sh
source "$here"/extra-fullnode-args.sh
find_leader() {
declare leader leader_address