-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Should adjust some opcode price #1863
Labels
Discussion
Initial issue state - proposed but not yet accepted
Comments
Qiao-Jin
added
the
Discussion
Initial issue state - proposed but not yet accepted
label
Aug 21, 2020
We charge for CPU time and storage only. Memory usage is limited, but not charging. |
Is 1 second per GAS price standard by design? Maybe this is somehow too cheap to prevent attack by malfactors. |
Yes. |
Closed as these are by design |
Then 1 GAS should cost something close to 0.0000166667 USD? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary or problem description
Price of some opcodes should be adjusted to prevent DoS attack as shown below:
(1) EQUAL
Opcode EQUAL can be severely time exhausting for ByteString. Detailed info can be seen in #1855 .
(2) REVERSEN & REVERSEITEMS
Currently price of Opcode.REVERSEN is 400 GasFactor. After testing, it shows running
EvaluationStack.Reverse(2048)
on a 2048-sized context for 250,000 times (which means 1 GAS) will assume 1 second, which is somehow too long for 1 Gas.(3) NEWBUFFER
Currently the maximum size of a buffer is defined to be 1Mb. As the MaxStackSize = 2048, that means by NEWBUFFER as much as 2GB's RAM can be exhausted with merely 1.64 GAS.
(4) NEWARRAY & NEWARRAY_T
Similiar with NEWBUFFER, here as much as 2GB's RAM can be exhausted with merely 0.3 GAS.
Neo Version
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: