dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

fix: avoid voting for the same trigger multiple times #6155

Closed UdjinM6 closed 1 month ago

UdjinM6 commented 2 months ago

Issue being fixed or feature implemented

We just had a sb voting period and I noticed that the network is way too spammy and produces too many votes (10x+ the expected numbers). It turns out that relying on ProcessVoteAndRelay on mainnet is not enough because rate-check expires too soon and MNs are able to vote again and again. On testnet it was never an issue because the voting period there is really short.

What was done?

Check known votes to make sure we never voted earlier.

How Has This Been Tested?

Run tests, run a MN on mainnet and check logs.

Breaking Changes

n/a

Checklist:

PastaPastaPasta commented 2 months ago

because rate-check expires too soon

why not increase this timeout?

UdjinM6 commented 1 month ago

ping @knst