-
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
Istanbul holiman #627
Istanbul holiman #627
Conversation
@holiman's tests these were derived from: https://github.com/holiman/IstanbulTests/tree/3c34f2c1a24175f5f4424b64b5e7ed6d822dc6af/GeneralStateTests |
Good job, hats off!
|
f374fc7
to
ae4c9c4
Compare
502a10c
to
ae4c9c4
Compare
"1000000000000000000000000000000000000000": { | ||
"balance": "", | ||
"//code": "record the gas, run the operation, then record the gas again. Drop output, subtract 2 for GAS, what is left is the cost of the operation, store in storage 0x01.", | ||
"//codeLLL": "(asm GAS CHAINID GAS SWAP1 POP SWAP1 SUB 5 SWAP1 SUB 0x01 SSTORE)", |
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.
substract 2 or 5 ?
looks a good asm code template for gasCost checkup for each opcode
@@ -0,0 +1,84 @@ | |||
{ | |||
"sloadGasCost": { |
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 has a very good post condition!
"pre": { | ||
"1000000000000000000000000000000000000000": { | ||
"balance": "0x01f4", | ||
"//code": "{ [[ 1 ]] (EQ (BALANCE (ADDRESS)) (SELFBALANCE)) }", |
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.
really need to add lllc support for new opcodes
"pre": { | ||
"1000000000000000000000000000000000000000": { | ||
"balance": "0x01f4", | ||
"//code": "{ [[ 1 ]] (SELFBALANCE) }", |
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.
have some more ideas:
Test selfbalance inside codecall delegatecall staticcall ordinary calls
Test selfbalance in create opcode in inicode
Test selfbalance in tr init code
Suicide then test selfbalance return value
Selfbalance after revert operations. And after oog operations in a subcall that doesn't break the whole transaction execution
Selfbalance on different calldepth levels
* this are also to be added to a template for any kind of opcode
This are very good tests, @shemnon. thanks! |
latest solidity works again. try out this PR it support CHAINID and SELFBALANCE |
update to new CHAINID opcode for LLL Also, the calculation for GAS and target value of CHAINID needed an update (offsetting off by 1 errors)
Update to use SELFBALANCE ASM from new LLLC Also, there was another offsetting off by 1 error pair in the data and the raw bytecode
Updated. Old raw bytecode removed from fillers. |
geth passes this tests |
Adaptations of @holiman's istanbul tests as state test fillers.
TODO:
refill with latest solidity