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

Agharta/EIP1052 - extCodeHash #4

Closed
wants to merge 14 commits into from

Conversation

steviezhang
Copy link
Contributor

@steviezhang steviezhang commented Jul 5, 2019

Implemented extCodeHash.

Note that we are now skipping a large amount of tests due to this being opened before Create2 has been implemented on development. All the below tests use the Create2 opcode and we will have to revisit them when Create2 is merged/on the Create2 branch:

	skipTests["codeCopyZero.json"] = "Create2 unimplemented"
	skipTests["dynamicAccountOverwriteEmpty.json"] = "Create2 unimplemented"
	skipTests["extCodeHashNewAccount.json"] = "Create2 unimplemented"
	skipTests["extCodeHashSelfInInit.json"] = "Create2 unimplemented"
	skipTests["extCodeHashSubcallOOG.json/ConstantinopleFix/0"] = "Create2 unimplemented"
	skipTests["extCodeHashSubcallOOG.json/ConstantinopleFix/1"] = "Create2 unimplemented"
	skipTests["extCodeHashSubcallOOG.json/ConstantinopleFix/2"] = "Create2 unimplemented"
	skipTests["extCodeHashCreatedAndDeletedAccount.json"] = "Create2 unimplemented"
	skipTests["extCodeHashCreatedAndDeletedAccountCall.json"] = "Create2 unimplemented"
	skipTests["extCodeHashCreatedAndDeletedAccountRecheckInOuterCall.json"] = "Create2 unimplemented"
	skipTests["extCodeHashCreatedAndDeletedAccountStaticCall.json"] = "Create2 unimplemented"
	skipTests["extCodeHashDeletedAccount3.json"] = "Create2 unimplemented"
	skipTests["extCodeHashDeletedAccount4.json"] = "Create2 unimplemented"
	skipTests["extCodeHashInInitCode.json/ConstantinopleFix/1"] = "Create2 unimplemented"
	skipTests["extCodeHashInInitCode.json/Constantinople/1"] = "Create2 unimplemented"	

Additionally, we are skipping many Constantinople specific tests:

	skipTests["extCodeHashAccountWithoutCode.json/Constantinople/0"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashDynamicArgument.json/Constantinople/0"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashDynamicArgument.json/Constantinople/1"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashDynamicArgument.json/Constantinople/2"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashDynamicArgument.json/Constantinople/3"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashDynamicArgument.json/Constantinople/4"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashNonExistingAccount.json/Constantinople/0"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/0"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/1"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/2"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/3"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/4"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/5"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/6"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/7"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashPrecompiles.json/Constantinople/8"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashSubcallOOG.json/Constantinople/0"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashSubcallOOG.json/Constantinople/1"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashSubcallOOG.json/Constantinople/2"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashSubcallOOG.json/Constantinople/3"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashSubcallOOG.json/Constantinople/4"] = "Unsupported Gas Calculations"
	skipTests["extCodeHashSubcallOOG.json/Constantinople/5"] = "Unsupported Gas Calculations"
	skipTests["extCodeCopyBounds.json/Constantinople/0"] = "Unsupported Gas Calculations"
	

EDIT: We now skip Constantinople altogether

This is because we never underwent the revoked Constantinople fork, and so our calculations will only match up with post-St. Petersburg calculations

cmd/evm/main.go Show resolved Hide resolved
core/vm/gas.go Outdated Show resolved Hide resolved
core/vm/instructions.go Outdated Show resolved Hide resolved
tests/state_test.go Outdated Show resolved Hide resolved
@steviezhang steviezhang changed the base branch from development to agharta/development July 5, 2019 16:40
@soc1c soc1c removed their request for review July 5, 2019 16:40
@noot
Copy link
Contributor

noot commented Jul 5, 2019

@steviezhang build fails

# github.com/eth-classic/go-ethereum/cmd/evm
cmd/evm/main.go:238:5: undefined: r
cmd/evm/main.go:238:31: undefined: num
cmd/evm/main.go:238:53: undefined: r

austinabell
austinabell previously approved these changes Jul 9, 2019
@GregTheGreek
Copy link
Contributor

Lets merge #5 before this one.

dziabko and others added 3 commits July 10, 2019 17:51
* Created branch & added new opcode into opcode.go file

* Added create2 function

* Implemented create function for Create2 contracts

* Created branch & added new opcode into opcode.go file

* Added create2 function

* Implemented create function for Create2 contracts

* Finished Create2 opcode & cleaned up comments

* Created branch & added new opcode into opcode.go file

* Added create2 function

* Atlantis config (#50)

* Added Atlantis fork in builtin mainnet and morden config

* Fixed difficulty test at 10_000_000 block (Atlantis)

* Added tests for Atlantis difficulty transition

* cmd/geth rename client (#52)

* Added error handling for precompiles and removed skipped tests (#54)

* Makefile and README updates (#49)

* wip makefile updates

* Fixed makefile and updated README

* Fixed readme changes

* Added go module documentation and fixed wiki links to EP

* Added go modules on for makefile commands and documentation

* makefile: fix version string (#57)

* Dockerfile configuration (#56)

* Added Dockerfile setup

* Added Dockerfile setup

* Fixed build command

* Removed private repo authentication in Dockerfile

* Enforced go modules on for every part of the test command (#60)

* docs: update readme (#59)

* docs: update readme

* Update README.md

* Update README.md

* ci: prepare assets for release (#64)

* ci: prepare assets for release

* ci: fix indentation

* ci: fix indentation

* ci: fix indentation

* ci: fix indentation

* ci: release in build step

* ci: calculate sha256sums

* ci: store artifacts

* ci: do a reverse copy

* ci: fix bash syntax

* ci: indicate os in release

* ci: pushd and pop'd ;)

* Receipt fixes and state trie clearing detail (#62)

* receipt and state trie clearing changes

* Fixed receipt storage and added backward compatible decoding

* Implemented create function for Create2 contracts

* Created branch & added new opcode into opcode.go file

* Added create2 function

* Implemented create function for Create2 contracts

* Finished Create2 opcode & cleaned up comments

* Created branch & added new opcode into opcode.go file

* Added create2 function

* Atlantis config (#50)

* Added Atlantis fork in builtin mainnet and morden config

* Fixed difficulty test at 10_000_000 block (Atlantis)

* Added tests for Atlantis difficulty transition

* cmd/geth rename client (#52)

* Added error handling for precompiles and removed skipped tests (#54)

* Makefile and README updates (#49)

* wip makefile updates

* Fixed makefile and updated README

* Fixed readme changes

* Added go module documentation and fixed wiki links to EP

* Added go modules on for makefile commands and documentation

* makefile: fix version string (#57)

* Dockerfile configuration (#56)

* Added Dockerfile setup

* Added Dockerfile setup

* Fixed build command

* Removed private repo authentication in Dockerfile

* Enforced go modules on for every part of the test command (#60)

* docs: update readme (#59)

* docs: update readme

* Update README.md

* Update README.md

* ci: prepare assets for release (#64)

* ci: prepare assets for release

* ci: fix indentation

* ci: fix indentation

* ci: fix indentation

* ci: fix indentation

* ci: release in build step

* ci: calculate sha256sums

* ci: store artifacts

* ci: do a reverse copy

* ci: fix bash syntax

* ci: indicate os in release

* ci: pushd and pop'd ;)

* Receipt fixes and state trie clearing detail (#62)

* receipt and state trie clearing changes

* Fixed receipt storage and added backward compatible decoding

* Implemented create function for Create2 contracts

* Created branch & added new opcode into opcode.go file

* Added create2 function

* Implemented create function for Create2 contracts

* Finished Create2 opcode & cleaned up comments

* Created branch & added new opcode into opcode.go file

* Added create2 function

* Added error handling for precompiles and removed skipped tests (#54)

* Created branch & added new opcode into opcode.go file

* Implemented create function for Create2 contracts

* Added create2 function

* Implemented create function for Create2 contracts

* Rebased with development 2nd

* Cleaned up code/comments & removed print statements.

* Cleaned up comments & reverted go.mod & go.sum to original

* Removed Constantinople tests & some tests involving non-implemented opcodes (EIP 145/1052) to pass CI.

* Fixed removal of stBugs, stShift & stExtCodeHash tests

* Fixed instructions_test salt parameter passed to CreateAddress2.

* Changed local vars to camel case

* Fixed error refactor.

* Cleaned up comments. Skipped tests involving EIP684 (Collision).

* Fixed error checking for evm.Run().
@@ -713,6 +713,23 @@ func TestAllETH(t *testing.T) {
// EIP 158/161 skipped tests
skipTests["RevertPrefoundEmptyOOG.json"] = "State trie clearing unimplemented"
skipTests["FailedCreateRevertsDeletion.json"] = "State trie clearing unimplemented"

//Create2 related skipped tests, all these tests use Create2 opcode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove these now, if they are related to Create2, since that is in now

jumpTable[EXTCODEHASH] = jumpPtr{
fn: opExtCodeHash,
valid: true,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@soc1c soc1c changed the base branch from agharta/development to development August 2, 2019 07:47
@soc1c
Copy link
Contributor

soc1c commented Aug 2, 2019

changed base to development, waiting for reapplyication of #5 and #7

@soc1c soc1c added this to the 6.1 Agharta milestone Aug 12, 2019
@GregTheGreek GregTheGreek changed the title EIP1052 - extCodeHash Agharta/EIP1052 - extCodeHash Aug 12, 2019
@steviezhang
Copy link
Contributor Author

looks like the create2 rebase completely broke extcodehash, including previously passing tests, I'll sort through that in a bit

@austinabell austinabell changed the base branch from development to agharta/dev August 22, 2019 15:40
@austinabell austinabell changed the base branch from agharta/dev to development September 5, 2019 16:30
@GregTheGreek
Copy link
Contributor

Let's get everything else merged & then do a re-base

@GregTheGreek
Copy link
Contributor

Closing in favour of #55

@soc1c soc1c deleted the stephanie/EIP1052-ExtCodeHash branch November 4, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants