Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit delegator's tx count in tx pool #591

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

libotony
Copy link
Member

No description provided.

@libotony libotony marked this pull request as ready for review June 20, 2023 14:43
txpool/tx_object_map.go Outdated Show resolved Hide resolved
@libotony libotony merged commit 12a278e into vechain:master Jun 21, 2023
@libotony libotony deleted the limit-delegator branch June 21, 2023 03:46
@ifavo
Copy link
Contributor

ifavo commented Sep 5, 2023

@libotony May I ask what triggered this change?

And why is there a limit for 16 transactions per delegator paid tx/account in the pool?
I imagine an attacker could easily setup plenty of accounts dynamically to get around the limit?

Cheers,
Mario

@libotony
Copy link
Member Author

libotony commented Sep 6, 2023

@ifavo, the transaction pool operates on a decentralized basis, thus there is a limitation to its size. To prevent the dominance of a single address over the majority of transactions in the pool, we have implemented an account level limit, creating a unique queue for each account. We’ve discovered that this kind of limit should be imposed on a delegator as well.

While these measures are not intended as a definitive solution for potential DoS attacks, they add a layer of complexity that may deter such malicious activities. Given the assertion that ‘attackers could easily set up plenty of accounts’, it is important to remember that there are costs involved. For an attacker to monopolize the network’s bandwidth, each transaction fee must be paid, thereby making the undertaking costly.

As for the queue size, it stands at 16, which is a parameter we could adjust. Currently, we have adopted this value from Ethereum’s implementation.

@ifavo
Copy link
Contributor

ifavo commented Sep 6, 2023

@libotony thank you for taking time to explain! I understand.

Do I understand correctly that this prevents more than 16 transactions sponsored by the same delegator in a single block?

I believe this is relevant, because high throughput dApps might become throttled on a peak, if they use fee delegation and more than 16 users are active at the same time.

@libotony
Copy link
Member Author

libotony commented Sep 6, 2023

@libotony thank you for taking time to explain! I understand.

Do I understand correctly that this prevents more than 16 transactions sponsored by the same delegator in a single block?

I believe this is relevant, because high throughput dApps might become throttled on a peak, if they use fee delegation and more than 16 users are active at the same time.

You’re correct. We advise user-agents, such as wallets in web-based applications or server apps in a backend-based application, to establish a local transaction queue. This is essential because the decentralized transaction pool may unpredictably reject or drop a transaction when it reaches its capacity.

For high-throughput decentralized applications and those that are time-sensitive, we highly recommend the use of multi-clause transactions.

We apologize for any inconvenience the modifications to vechain.energy may have caused. We acknowledge that these might have a negative effect on your applications; however, these changes were imperative for security enhancement. Please feel free to reach out to any of us if you have any concerns.

@ifavo
Copy link
Contributor

ifavo commented Sep 6, 2023

For single applications that can control the transaction flow a queue or multi-claused transactions are easily to implement.

I was thinking more of a NFT Minting event where many users are going to mint simultaneously and more than 16 users could be actively participating at the same time. Fee Delegation creates a problem that situation. I will watch out for such situations, if this theoretical situations happens. Scaling to different delegation wallets or delaying transactions could be a simple solution.

It opens an attack vector to delegators as well I believe, that needs to be managed, if a malicious user spams a dApp delegator with more than 16 transactions per 10s. Thats not drastic, just needs to be noted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants