-
Notifications
You must be signed in to change notification settings - Fork 267
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
Feature/initcode size limit using transaction creations #2665
Feature/initcode size limit using transaction creations #2665
Conversation
3fd6e2d
to
8b74286
Compare
bcefff3
to
6ee3c68
Compare
rskj-core/src/main/java/org/ethereum/core/TransactionExecutor.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/core/TransactionExecutor.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/core/TransactionExecutor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be nice to add the test cases suggested by the EIP-3860:
Tests should include the following cases:
Creation transaction with gas limit enough to cover initcode cost
Creation transaction with gas limit enough to cover intrinsic cost except initcode cost
CREATE/CREATE2/creation transaction with len(initcode) at MAX_INITCODE_SIZE
CREATE/CREATE2/creation transaction with len(initcode) at MAX_INITCODE_SIZE+1
rskj-core/src/main/java/org/ethereum/core/TransactionExecutor.java
Outdated
Show resolved
Hide resolved
e561020
to
5a1ed48
Compare
8b74286
to
482204c
Compare
5a1ed48
to
f5dbbe0
Compare
In order to implement the verification of initcode size, necessary for the RSKIP438, we need the constant value with the max allowed value. So we can start to validate and use it on the logic of the verification
In order to implement the verification of initcode size, necessary for the RSKIP438, we need the constant value with the max allowed value. So we can start to validate and use it on the logic of the verification - Adding scenarios of test for the contract creation with DSL - The validation for the initCode size test was added - The validation is based on the RSKIP that enables it - Validation added for the contractCreation during transaction execution Finished the implementation of transactionCost and initcode size validation - All the logic related with transaction cost was changed to meet the new cost criteria - More tests were added to be sure that the flow is following the RSKIP438 - Tests were added to validate that this cost and validation doesn't impact before reach the activation height Applied some suggestions from review Adding tests to validate the failure if we don't have enough gas to cover initCode
f5dbbe0
to
25d1e0a
Compare
In order to have the exact same logic for the initcode cost calculation, we introduced some new classes that can be easily reused by the TransactionExecutor and VM classes. This way, if this logic change, we won't have to change the code in multiple places. It was also introduced an interface for it, so we can expand this idea and in the future, be able to calculate total transactions just calling a method to calculate it independent of the logic used.
In order to implement the verification of initcode size, necessary for the RSKIP438, we need the constant value with the max allowed value. So we can start to validate and use it on the logic of the verification
482204c
to
59943d6
Compare
rskj-core/src/main/java/org/ethereum/cost/InitcodeCostCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/cost/InitcodeCostCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/cost/InitcodeCostCalculator.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Nazaret García Revetria <[email protected]>
…tcode_size_limit_using_transaction_creations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Good documenting on the DSL files! 🚀
Other than the comment I left, LGTM! Great work on handling this complex task |
rskj-core/src/main/java/org/ethereum/cost/InitcodeCostCalculator.java
Outdated
Show resolved
Hide resolved
rskj-core/src/main/java/org/ethereum/cost/InitcodeCostCalculator.java
Outdated
Show resolved
Hide resolved
Applying suggestions from reviews Co-authored-by: Vovchyk <[email protected]>
f607c0f
to
91ea7d1
Compare
91ea7d1
to
3df1686
Compare
3df1686
to
dd3cee9
Compare
319d678
to
f5da98a
Compare
* Initcode validation for opcodes contract creation - Adding scenarios of test for the contract creation with DSL - The validation for the initCode size test was added - The validation is based on the RSKIP that enables it - Validation added for the contractCreation during transaction execution - In order to have the exact same logic for the initcode cost calculation, we introduced some new classes that can be easily reused by the TransactionExecutor and VM classes. This way, if this logic change, we won't have to change the code in multiple places. It was also introduced an interface for it, so we can expand this idea and in the future, be able to calculate total transactions just calling a method to calculate it independent of the logic used. - Adding scenarios of test for the contract creation with DSL - The validation is based on the RSKIP that enables it * Added the remaining test scenarios for contracts with opcode creation * Applying suggestions from review * Applying some more suggestions from review ---------
2a0a10b
to
5c25f3a
Compare
…tcode_size_limit_using_transaction_creations
5c25f3a
to
035b7d2
Compare
Quality Gate passedIssues Measures |
236401e
into
feature/introduce_initcode_size_limit
* Initial constants and config for the max initcode size In order to implement the verification of initcode size, necessary for the RSKIP438, we need the constant value with the max allowed value. So we can start to validate and use it on the logic of the verification - Adding scenarios of test for the contract creation with DSL - The validation for the initCode size test was added - The validation is based on the RSKIP that enables it - Validation added for the contractCreation during transaction execution Finished the implementation of transactionCost and initcode size validation - All the logic related with transaction cost was changed to meet the new cost criteria - More tests were added to be sure that the flow is following the RSKIP438 - Tests were added to validate that this cost and validation doesn't impact before reach the activation height Applied some suggestions from review Adding tests to validate the failure if we don't have enough gas to cover initCode * Refactor from the Initcode cost calculation In order to have the exact same logic for the initcode cost calculation, we introduced some new classes that can be easily reused by the TransactionExecutor and VM classes. This way, if this logic change, we won't have to change the code in multiple places. It was also introduced an interface for it, so we can expand this idea and in the future, be able to calculate total transactions just calling a method to calculate it independent of the logic used. * Applying some more suggestions from review Co-Authored-By: Nazaret García Revetria <[email protected]> Co-Authored-By: Vovchyk <[email protected]>
* Initial constants and config for the max initcode size In order to implement the verification of initcode size, necessary for the RSKIP438, we need the constant value with the max allowed value. So we can start to validate and use it on the logic of the verification - Adding scenarios of test for the contract creation with DSL - The validation for the initCode size test was added - The validation is based on the RSKIP that enables it - Validation added for the contractCreation during transaction execution Finished the implementation of transactionCost and initcode size validation - All the logic related with transaction cost was changed to meet the new cost criteria - More tests were added to be sure that the flow is following the RSKIP438 - Tests were added to validate that this cost and validation doesn't impact before reach the activation height Applied some suggestions from review Adding tests to validate the failure if we don't have enough gas to cover initCode * Refactor from the Initcode cost calculation In order to have the exact same logic for the initcode cost calculation, we introduced some new classes that can be easily reused by the TransactionExecutor and VM classes. This way, if this logic change, we won't have to change the code in multiple places. It was also introduced an interface for it, so we can expand this idea and in the future, be able to calculate total transactions just calling a method to calculate it independent of the logic used. * Applying some more suggestions from review Co-Authored-By: Nazaret García Revetria <[email protected]> Co-Authored-By: Vovchyk <[email protected]>
Adding the verification of initcode size limit for the contract creation during transaction execution
Description
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: