Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions data_structures/src/data_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use witnet_crypto::hash::calculate_sha256;
use crate::{
chain::{
tapi::ActiveWips, DataRequestInfo, DataRequestOutput, DataRequestStage, DataRequestState,
Epoch, Hash, Hashable, PublicKeyHash, ValueTransferOutput,
Environment, Epoch, Hash, Hashable, PublicKeyHash, ValueTransferOutput,
},
error::{DataRequestError, TransactionError},
get_protocol_version_activation_epoch,
get_environment, get_protocol_version_activation_epoch,
proto::versioning::{ProtocolVersion, VersionedHashable},
radon_report::{RadonReport, Stage, TypeLike},
transaction::{CommitTransaction, DRTransaction, RevealTransaction, TallyTransaction},
Expand Down Expand Up @@ -579,7 +579,10 @@ pub fn data_request_has_too_many_witnesses(
if ProtocolVersion::from_epoch_opt(epoch) < ProtocolVersion::V2_0 {
false
} else {
usize::from(dr_output.witnesses) > validator_count / 4
match get_environment() {
Environment::Mainnet => usize::from(dr_output.witnesses) > validator_count / 4,
_ => usize::from(dr_output.witnesses) > validator_count / 2,
}
Comment on lines +582 to +585
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
match get_environment() {
Environment::Mainnet => usize::from(dr_output.witnesses) > validator_count / 4,
_ => usize::from(dr_output.witnesses) > validator_count / 2,
}
let divider = if let Environment::Mainnet = get_environment() {
4
} else {
2
}
usize::from(dr_output.witnesses) > validator_count / divider

}
}

Expand Down
Loading