Skip to content

Commit

Permalink
chore: add teams spam protection
Browse files Browse the repository at this point in the history
Copies the changes made to the Colosseo branch here:

- #2156
  • Loading branch information
gordsport committed Feb 5, 2024
1 parent 2c7d4c5 commit c8276a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions protocol/0062-SPAM-spam_protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ The [on-chain referral program](./0083-RFPR-on_chain_referral_program.md) adds t
- `UpdateReferralSet`
- `ApplyReferralCode`

To avoid spamming of `CreateReferralSet` and `UpdateReferralSet` transactions, a party must meet the staked governance tokens ($VEGA) threshold set by the network parameter `referralProgram.minStakedVegaTokens`. A party who does not meet this requirement should have any transactions of the aforementioned types pre-block rejected.
To avoid spamming of `CreateReferralSet` and `UpdateReferralSet` transactions, a party must meet the staked governance tokens ($VEGA) threshold set by the network parameter `referralProgram.minStakedVegaTokens`. A party also must meet the balance holding threshold set by the network parameter `spam.protection.referralProgram.min.funds`. All assets count towards this threshold and balances should be scaled appropriately by the assets quantum. A party who does not meet this requirements should have any transactions of the aforementioned types pre-block rejected.

To avoid spamming of `ApplyReferralCode`, a party must meet the deposited funds threshold set by the network parameter `spam.protection.applyReferral.min.funds`. All assets count towards this threshold and balances should be scaled appropriately by the assets quantum. A party who does not meet this requirement should have any transactions of the aforementioned type pre-block rejected. This requirement will be checked against snapshots of account balances taken at a frequency determined by the network parameter `spam.protection.balanceSnapshotFrequency`. This network parameter is a duration (e.g. `5s`, `1m5s`).
To avoid spamming of `ApplyReferralCode`, a party must meet the deposited funds threshold set by the network parameter `spam.protection.applyReferral.min.funds`. All assets count towards this threshold and balances should be scaled appropriately by the assets quantum. A party who does not meet this requirement should have any transactions of the aforementioned type pre-block rejected. This requirement will be checked against snapshots of account balances taken at a frequency determined by the network parameter `spam.protection.balanceSnapshotFrequency`. This network parameter is a duration (e.g. `5s`, `1m5s`).

Further, each party is allowed to submit up to `n` transactions per epoch where `n` is controlled by the respective network parameter for that transaction type (`spam.protection.max.CreateReferralSet`, `spam.protection.max.UpdateReferralSet`, `spam.protection.max.ApplyReferralCode`).

Expand Down Expand Up @@ -112,6 +112,8 @@ More than 360 delegation changes in one epoch (or, respectively, the value of `s
- Issue a valid withdrawal bundle. Increase `spam.protection.minimumWithdrawalQuantumMultiple` to a value that would no longer allow the creation of the bundle. Ask for the bundle to be re-issued and verify that it's not rejected. (<a name="0062-PALAZZO-001" href="#0062-PALAZZO-001">0062-PALAZZO-001</a>)
- A party staking less than `referralProgram.minStakedVegaTokens` should have any `CreateReferralSet` transactions **pre-block** rejected (<a name="0062-SPAM-026" href="#0062-SPAM-026">0062-SPAM-026</a>).
- A party staking less than `referralProgram.minStakedVegaTokens` should have any `UpdateReferral` transactions **pre-block** rejected (<a name="0062-SPAM-027" href="#0062-SPAM-027">0062-SPAM-027</a>).
- A party holding less than `spam.protection.referralProgram.min.funds x quantum` should have any `CreateReferralSet` transactions **pre-block** rejected (<a name="0062-SPAM-033" href="#0062-SPAM-033">0062-SPAM-033</a>).
- A party holding no less than `spam.protection.referralProgram.min.funds x quantum` should not have any `CreateReferralSet` transactions **pre-block** rejected (<a name="0062-SPAM-035" href="#0062-SPAM-035">0062-SPAM-035</a>).
- Given longer than `spam.protection.balanceSnapshotFrequency` has elapsed since a party deposited or transferred funds, a party who has less then `spam.protection.applyReferral.min.funds` in their accounts should have any `ApplyReferralCode` transactions **pre-block** rejected. All assets count towards this threshold and balances should be scaled appropriately by the assets quantum. (<a name="0062-SPAM-028" href="#0062-SPAM-028">0062-SPAM-028</a>).
- A party who has submitted strictly more than `spam.protection.max.CreateReferralSet` `CreateReferralSet` transactions in an epoch should have any future `CreateReferralSet` transactions in that epoch **pre-block** rejected (<a name="0062-SPAM-029" href="#0062-SPAM-029">0062-SPAM-029</a>).
- A party who has submitted more than `spam.protection.max.CreateReferralSet` transactions in the current epoch plus in the current block, should have their transactions submitted in the current block **pre-block** rejected (<a name="0062-SPAM-032" href="#0062-SPAM-032">0062-SPAM-032</a>).
Expand Down
2 changes: 2 additions & 0 deletions protocol/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"0088-PPRF-003",
"0088-PPRF-004",
"0088-PPRF-005",
"0062-SPAM-033",
"0062-SPAM-035",
"0062-SPAM-037",
"0062-SPAM-038",
"0062-SPAM-039"
Expand Down

0 comments on commit c8276a7

Please sign in to comment.