mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 12:31:03 +00:00
[NPoS] Remove better solution threshold for unsigned submissions (#2694)
closes https://github.com/paritytech-secops/srlabs_findings/issues/78. Removes `BetterUnsignedThreshold` from pallet EPM. This will essentially mean any solution submitted by the validator that is strictly better than the current queued solution would be accepted. The reason for having these thresholds is to limit number of solutions submitted on-chain. However for unsigned submissions, the number of solutions that could be submitted on average is limited even without thresholding (calculation shown in the corresponding issue).
This commit is contained in:
@@ -301,7 +301,6 @@ parameter_types! {
|
||||
pub static SignedMaxWeight: Weight = BlockWeights::get().max_block;
|
||||
pub static MinerTxPriority: u64 = 100;
|
||||
pub static BetterSignedThreshold: Perbill = Perbill::zero();
|
||||
pub static BetterUnsignedThreshold: Perbill = Perbill::zero();
|
||||
pub static OffchainRepeat: BlockNumber = 5;
|
||||
pub static MinerMaxWeight: Weight = BlockWeights::get().max_block;
|
||||
pub static MinerMaxLength: u32 = 256;
|
||||
@@ -399,7 +398,6 @@ impl crate::Config for Runtime {
|
||||
type EstimateCallFee = frame_support::traits::ConstU32<8>;
|
||||
type SignedPhase = SignedPhase;
|
||||
type UnsignedPhase = UnsignedPhase;
|
||||
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
||||
type BetterSignedThreshold = BetterSignedThreshold;
|
||||
type OffchainRepeat = OffchainRepeat;
|
||||
type MinerTxPriority = MinerTxPriority;
|
||||
@@ -538,10 +536,7 @@ impl ExtBuilder {
|
||||
<BetterSignedThreshold>::set(p);
|
||||
self
|
||||
}
|
||||
pub fn better_unsigned_threshold(self, p: Perbill) -> Self {
|
||||
<BetterUnsignedThreshold>::set(p);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn phases(self, signed: BlockNumber, unsigned: BlockNumber) -> Self {
|
||||
<SignedPhase>::set(signed);
|
||||
<UnsignedPhase>::set(unsigned);
|
||||
|
||||
Reference in New Issue
Block a user