-
Notifications
You must be signed in to change notification settings - Fork 319
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
Transaction tests for EIP-3860: Limit and meter initcode #1012
Conversation
410e09f
to
00d2a74
Compare
src/TransactionTestsFiller/ttData/DataTestInitCodeTooBigFiller.yml
Outdated
Show resolved
Hide resolved
Is this one an updated version of #990? |
No, this is a follow-up to #990 (independent of it), here it's only transaction tests, testing specifically new rules for when transactions are invalid. (Not that we have not updated EIP text yet to make transactions with too big initcode invalid, sorry. |
EIP is updated now. ethereum/EIPs#4757 |
Ah yes this makes sense, we are not (yet) using the TransactionTests directory in JS, we should do that rather soon especially with these transactions. Thanks for the updates! 😄 |
Note: TransactionTests only supports LegacyTransactions ATM, so #990 should also include state tests or blockchain tests for situations where (1) initcode of Tx (legacy/2929/1559) is longer than max initcode and (2) sender does not pay the upfront cost of initcode analysis. |
It might be possible to add TransactionTests with different transaction types, I'll check. But adding them as state tests is also a good idea. |
@gumb0 do these tests include tests regarding EDIT: nvm, these are TxTests |
# Creation transaction with gas limit not enough to cover initcode charge of EIP-3860 | ||
DataTestNotEnoughGasInitCode: | ||
expectException: | ||
London: "" |
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.
Is there an exception on London?
@@ -0,0 +1,15 @@ | |||
# Creation transaction with initcode with max size allowed by EIP-3860 | |||
DataTestInitCodeLimit: | |||
expectException: {} |
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.
Is this field (expecException) required if its empty?
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.
Update fork Merge+3860
Put EIP3860 in the test name or a new folder ttEIP3860
London: ""
in expectException can be deleted
expectException: {}
can be deleted
00d2a74
to
6d42c6a
Compare
- Merge+3860 | ||
expectException: | ||
Merge: "" | ||
Merge+3860: "TR_InitCodeLimitExceeded" |
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.
This requires a new mapping in retesteth config:
"TR_InitCodeLimitExceeded" : "init code size limit exceeded",
I would leave |
6d42c6a
to
0f3681d
Compare
DataTestNotEnoughGasInitCode: | ||
expectException: | ||
Merge: "" | ||
Merge+3860: "TR_IntrinsicGas" |
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.
add Merge+3860 in additionalForks
section that is missing here. the test is not generated for this fork.
@@ -0,0 +1,15 @@ | |||
# Creation transaction with initcode with max size allowed by EIP-3860 | |||
DataTestInitCodeLimit: | |||
expectException: {} |
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.
additionalforks Merge+3860
@@ -0,0 +1,18 @@ | |||
# Creation transaction with gas limit just enough to cover initcode charge of EIP-3860 | |||
DataTestEnoughGasInitCode: | |||
expectException: {} |
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.
additional forks Merge+3860
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.
by default tests are generated for each fork in progression of Forks.
but since you use fork+eip here, need to specify in the test that it should also be generated using fork+eip by defining it in additionalForks section in the test.
retesteth config change no needed.
good to have small trasaction unit tests here. very clear.
0f3681d
to
e8d5364
Compare
e8d5364
to
e13a1f0
Compare
additionalForks: | ||
- Merge+3860 | ||
expectException: | ||
Merge: "" |
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.
if it is empty, then record not needed
These tests check transaction validity rules change of https://eips.ethereum.org/EIPS/eip-3860
Geth implementation in ethereum/go-ethereum#23847