From c8276a78c93c131fea2680e14391dfcc691682b0 Mon Sep 17 00:00:00 2001 From: gordsport Date: Mon, 5 Feb 2024 15:02:50 +0000 Subject: [PATCH] chore: add teams spam protection Copies the changes made to the Colosseo branch here: - https://github.com/vegaprotocol/specs/pull/2156 --- protocol/0062-SPAM-spam_protection.md | 6 ++++-- protocol/features.json | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/protocol/0062-SPAM-spam_protection.md b/protocol/0062-SPAM-spam_protection.md index eadf53d96..a9a5da152 100644 --- a/protocol/0062-SPAM-spam_protection.md +++ b/protocol/0062-SPAM-spam_protection.md @@ -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`). @@ -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. (0062-PALAZZO-001) - A party staking less than `referralProgram.minStakedVegaTokens` should have any `CreateReferralSet` transactions **pre-block** rejected (0062-SPAM-026). - A party staking less than `referralProgram.minStakedVegaTokens` should have any `UpdateReferral` transactions **pre-block** rejected (0062-SPAM-027). +- A party holding less than `spam.protection.referralProgram.min.funds x quantum` should have any `CreateReferralSet` transactions **pre-block** rejected (0062-SPAM-033). +- A party holding no less than `spam.protection.referralProgram.min.funds x quantum` should not have any `CreateReferralSet` transactions **pre-block** rejected (0062-SPAM-035). - 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. (0062-SPAM-028). - 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 (0062-SPAM-029). - 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 (0062-SPAM-032). diff --git a/protocol/features.json b/protocol/features.json index eea74613c..9d42b9c14 100644 --- a/protocol/features.json +++ b/protocol/features.json @@ -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"