Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

neo-cli: tune MaxTransactionsPerBlock for testnet #850

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

roman-khimov
Copy link

Allow to flush the mempool in just 10 blocks.

Allow to flush the mempool in just 10 blocks.
roman-khimov added a commit to roman-khimov/neo-modules that referenced this pull request Feb 6, 2022
Follow ExecFeeFactor changes for MaxBlockSystemFee and make it possible to fit
5K transactions into the block. Related to neo-project/neo-node#850.
@Jim8y
Copy link
Contributor

Jim8y commented Feb 6, 2022

Do we have an approximate maximum execution time of a single transction, just in case of Resource Exhaustion Attack?

@roman-khimov
Copy link
Author

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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1803322398

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 14.936%

Totals Coverage Status
Change from base Build 1582407624: 0.0%
Covered Lines: 107
Relevant Lines: 694

💛 - Coveralls

@Jim8y
Copy link
Contributor

Jim8y commented Feb 7, 2022

@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.

@roman-khimov
Copy link
Author

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.

@Jim8y
Copy link
Contributor

Jim8y commented Feb 7, 2022

I understand. You can keep working on this pr, I will do a thorough benchmark on opcodes in another work.

@roman-khimov
Copy link
Author

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.

@Jim8y
Copy link
Contributor

Jim8y commented Feb 7, 2022

Take a look at neo-project/neo#1875

Thank you.

@superboyiii
Copy link
Member

@roman-khimov Could you push it to develop branch? We'd like to keep master clear before next release.

@roman-khimov roman-khimov changed the base branch from master to develop February 8, 2022 09:21
@roman-khimov
Copy link
Author

@roman-khimov Could you push it to develop branch?

Sure, done.

@superboyiii superboyiii merged commit d1bc7d1 into neo-project:develop Feb 10, 2022
superboyiii added a commit to neo-project/neo-modules that referenced this pull request Mar 17, 2022
Follow ExecFeeFactor changes for MaxBlockSystemFee and make it possible to fit
5K transactions into the block. Related to neo-project/neo-node#850.

Co-authored-by: Owen Zhang <38493437+superboyiii@users.noreply.github.com>
erikzhang pushed a commit that referenced this pull request Apr 19, 2022
* neo-cli: tune MaxTransactionsPerBlock for testnet (#850)

* Add new testnet network id (#852)

* typo, comment (#847)

* Install plugin and dependencies. (#807)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants