-
Notifications
You must be signed in to change notification settings - Fork 318
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
TransactionTests Update: ttGasLimit #955
Conversation
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.
I have some questions
and need a change
"expect" : [ | ||
{ | ||
"network" : ["EIP158", "Byzantium", ">=Constantinople"], | ||
"result" : "valid" |
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.
was gasLimit cap a retroactive change ?
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.
I am not sure why the original test contained selective forks, the uint64 limit applies to all forks it seems.
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "0x7fffffffffffffff", | ||
"gasLimit" : "0x7fffffffffffffff", |
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 test is identical to TransactionWithHihghGasLimit63m1Filler.json
better change to x, x-1, x+1(if x not fails) where x is gasLimit cap (pow(2,63)-1)
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935", |
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.
the goal of this test is to make gasLimit * gasPrice > 2**256-1, need to change. is there a cap on gasPrice?
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.
I am changing this test to be gasLimit=0xffffffffffffffff, gasPrice=0x1000000000000000100000000000000010000000000000002, where gasLimit is the highest uint64 value, and gasPrice is the lowest value such as the product is equal/higher than a 256bit value.
The test still does not produce an exception.
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.
Well the transaction technically valid.
Just that irl no account with enough balance exists.
Is int64max a limit of gasLimit field?
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.
Yes, it's unsigned so uint64 and 0xffffffffffffffff is the max.
I agree that the transaction is valid, I think is a good test to have just to see that no client does something funny when receiving the transaction.
Should I add a state test similar to the one I added for gasPrice in the other PR ?
I just checked the test case and is exactly this scenario, so no need to add another state test...
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.
what is the exception? GasLimitPriceProductOverflow
src/TransactionTestsFiller/ttGasLimit/TransactionWithGasLimitOverflowZeros64Filler.json
Show resolved
Hide resolved
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "0xffffffffffffffff", |
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.
why not 8000000 ?
why it passes, it overflows ?
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.
some exceptions are strange need to double chek
The limit is uint64, I will be renaming all tests which do not overflow (< 2^64) to HighGas instead of Overflow, to make it easier to identify them. |
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.
naming is wrong. did you change the names or is it a github issue?
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "0xffffffffffffffff", |
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 is 64-1
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "0x8000000000000001", |
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 is 63+1
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "0x7fffffffffffffff", |
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 is 63-1
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935", |
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.
what is the exception? GasLimitPriceProductOverflow
"transaction" : | ||
{ | ||
"data" : "", | ||
"gasLimit" : "0x10000000000000000", |
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 is 64
@winsvega I changed the naming to reference the number of bits instead of powers of two. It's a mistake, I will change it back. |
Fixed naming and TransactionWithGasLimitxPriceOverflow test now correctly fails with GasLimitPriceProductOverflow (gas * gasPrice exceeds 256 bits). |
Contains updated TransactionTests for category ttGasLimit.
Outstanding issues: