Closed roman-khimov closed 2 years ago
Do we have an approximate maximum execution time of a single transction, just in case of Resource Exhaustion Attack?
It's strongly correlated with GAS cost and we have MaxBlockSystemFee limit (somewhat optimistic I'd say, but still). We also know that C# node can handle several thousands of NEO transfers per second, so with 15s block time 5K doesn't seem to be a lot of transactions.
Totals | |
---|---|
Change from base Build 1582407624: | 0.0% |
Covered Lines: | 107 |
Relevant Lines: | 694 |
@roman-khimov I know the awesome benchmark u made on neo N3. Actually I always wanna know what exactly makes C# slower than go node. But anyway, benchmark won't stop resource exhaustion attack, strict gas restrictions may work, I will check it out.
DoS scenarios are always limited by GAS, sending lots of transactions costs something and it's not hard to calculate the cost of the attack. Actually, this change raises the cost of the attack because to cause some noticeable delays one would need to send more transactions and spend more GAS.
As for computational overhead of big blocks, MaxBlockSystemFee
is big enough already to be noticeable and if someone has enough GAS to spend he might keep the nodes somewhat busy even with a single transaction (just ask @vang1ong7ang). But then again, the attacker is limited by the amount of GAS (money) he has for attack.
I understand. You can keep working on this pr, I will do a thorough benchmark on opcodes in another work.
I will do a thorough benchmark on opcodes in another work.
Take a look at neo-project/neo#1875 also, although both VMs have improved since then I think.
Take a look at neo-project/neo#1875
Thank you.
@roman-khimov Could you push it to develop
branch? We'd like to keep master
clear before next release.
@roman-khimov Could you push it to
develop
branch?
Sure, done.
Allow to flush the mempool in just 10 blocks.