Skip to content
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

Merged
merged 10 commits into from
Sep 17, 2019
Merged

Istanbul holiman #627

merged 10 commits into from
Sep 17, 2019

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Aug 21, 2019

Adaptations of @holiman's istanbul tests as state test fillers.

TODO:
refill with latest solidity

@shemnon
Copy link
Contributor Author

shemnon commented Aug 21, 2019

@holiman
Copy link
Contributor

holiman commented Aug 21, 2019 via email

"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)",
Copy link
Collaborator

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": {
Copy link
Collaborator

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)) }",
Copy link
Collaborator

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) }",
Copy link
Collaborator

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

@winsvega
Copy link
Collaborator

winsvega commented Sep 2, 2019

This are very good tests, @shemnon. thanks!
would look into the update for lllc so you don't have to put the bytecode all the time

@winsvega
Copy link
Collaborator

winsvega commented Sep 2, 2019

latest solidity works again. try out this PR
ethereum/solidity#7327

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
@shemnon
Copy link
Contributor Author

shemnon commented Sep 16, 2019

Updated. Old raw bytecode removed from fillers.

@winsvega
Copy link
Collaborator

geth passes this tests

@winsvega winsvega merged commit fc44ab6 into ethereum:develop Sep 17, 2019
@shemnon shemnon deleted the istanbul-holiman branch November 5, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants