Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

EIP161, State Trie Clearing #28

Merged
merged 10 commits into from May 21, 2019

Conversation

steviezhang
Copy link
Contributor

@steviezhang steviezhang commented May 16, 2019

Implementation of EIP161 passing most tests.

The following are the tests that have been skipped that are failing either due to a precondition not being implemented or require more looking into.

See the tracking issue #29 for more details.


    // EIP 684 Implementations
    skipTests["TransactionCollisionToEmptyButCode.json"] = "Not Implemented"
    skipTests["TransactionCollisionToEmpty.json"] = "Not Implemented"
    skipTests["TransactionCollisionToEmptyButNonce.json"] = "Not Implemented"
    skipTests["CreateCollisionToEmpty.json"] = "Not Implemented"
    skipTests["CreateHashCollision.json"] = "Not Implemented"
    skipTests["createJS_ExampleContract.json"] = "Not Implemented"

    // StaticCall implementations
    skipTests["staticcall_createfails.json"] = "STATICCALL Not Implemented"

    // Revert Implementations
    skipTests["FailedCreateRevertsDeletion.json"] = "REVERT Not Implemented"
    skipTests["CreateOOGafterInitCodeRevert.json"] = "REVERT Not Implemented"
    skipTests["CreateOOGafterInitCodeRevert2.json"] = "REVERT Not Implemented"

    // EIP 211 Implementations
    skipTests["CreateOOGafterInitCodeReturndataSize.json"] = "REVERT Not Implemented"
    skipTests["CreateOOGafterInitCodeReturndata2.json"] = "REVERT Not Implemented"

    // Random Test failures (REVISIT)
    skipTests["randomStatetest642.json"] = "random unimplemented"
    skipTests["randomStatetest644.json"] = "random unimplemented"
    skipTests["randomStatetest645.json"] = "random unimplemented"
    skipTests["Opcodes_TransactionInit.json/Byzantium/37"] = "random unimplemented"
    skipTests["Opcodes_TransactionInit.json/Byzantium/38"] = "random unimplemented"
    skipTests["Opcodes_TransactionInit.json/Byzantium/125"] = "random unimplemented"
    skipTests["Opcodes_TransactionInit.json/Byzantium/126"] = "random unimplemented"
    skipTests["CREATE_ContractRETURNBigOffset.json"] = "random unimplemented"`

@steviezhang steviezhang requested a review from noot as a code owner May 16, 2019 18:18
@steviezhang steviezhang changed the title Stephanie/eip161 state trie clearing EIP161, State Trie Clearing May 16, 2019
@steviezhang steviezhang force-pushed the stephanie/EIP161-StateTrieClearing branch from 98938d1 to be30f28 Compare May 16, 2019 18:53
core/state/statedb.go Outdated Show resolved Hide resolved
core/vm/vm.go Show resolved Hide resolved
core/vm/vm.go Show resolved Hide resolved
@steviezhang steviezhang force-pushed the stephanie/EIP161-StateTrieClearing branch from be30f28 to 1f1237b Compare May 16, 2019 19:57
@steviezhang
Copy link
Contributor Author

@soc1c Is it fine that the circleCI tests are failing or does that indicate that I need to fix something, they seem to be failing on account of not being able to find the packages.

@GregTheGreek GregTheGreek mentioned this pull request May 16, 2019
@soc1c
Copy link
Contributor

soc1c commented May 17, 2019

failing tests are unrelated. someone should sit down and go through them

Copy link

@GregTheGreek GregTheGreek left a comment

Choose a reason for hiding this comment

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

Please look into the failing errors

@austinabell
Copy link
Contributor

austinabell commented May 17, 2019

Please look into the failing errors

I forgot to note, these errors have been around since we changed namespaces and switched to go modules.

TestHeader{1,2}ErrorLog is because the header was formed by trimming the gopath from the current filepath, but since we are using go modules, this test will fail. We can rewrite the header logic for the logger but it is out of the scope of this PR (unless we want to do with this one).

as for the bindings not working, I can look more into it but a comment in the Bind function defines the reason for it as:

// Bind generates a Go wrapper around a contract ABI. This wrapper isn't meant
// to be used as is in client code, but rather as an intermediate struct which
// enforces compile time type safety and naming convention opposed to having to
// manually maintain hard coded strings that break on runtime.

I can't find where the bindings are being generated (on my machine it is referencing ethereum/go-ethereum instead of our renamed namespace)

@austinabell austinabell merged commit 61b178b into development May 21, 2019
@austinabell austinabell deleted the stephanie/EIP161-StateTrieClearing branch May 21, 2019 15:17
noot pushed a commit that referenced this pull request Jun 6, 2019
* Removed research and moved to wiki (#2)

* changed import paths from ethereumproject to eth-classic (#4)

* changed import paths from ethereumproject to eth-classic

* add bn256 package; begin adding bn256add

* fix syntax errors; tests package passes

* fix import path

* change all import paths to eth-classic after forking needed repos

* go: initialized modules (#10)

* init gomodules

* remove vendor

* update modules

* Fixed dependency references to allow build to run without sputnikvm (#14)

* Testing framework (#12)

* Removed coverage file accidentally commited

* Set up testing framework for eth tests

* go: initialized modules (#10)

* init gomodules

* remove vendor

* update modules

* Updated struct formatting for unmarshalling

* Updated format of eth test struct and updated test files (were replaced with generated files)

* Using ethereum tests submodule and updated framework for testing

* Updated hashing of logs comparison and logging of tests

* Removed error checking on state execution because expected error in some tests

* Updated testing structure into subtests for better reporting and so that all test cases are tested even when one fails

* Changed subtest name from full filepath to just the json file

* Restructured and added light documentation

* Added homestead specific state test

* Updated framework to be able to delete empty objects in trie for tests>EIP158

* Changed conditional for when state objects are deleted and removed logging statement

* Changed folder back to intended from testing

* Changed conditional to not skip EIP158 fork tests

* Added functionality to skip tests

* Removed commented out code

* Create CODEOWNERS (#17)

* Config and refactor (#21)

* Refactor and add config for Atlantis chain config

* Typo fix

* Refactor jump table setup

* Changed fork config skipping functionality and removed unused configuration mappings

* Fixed null pointer error with test configs

* Added definitions of other blocks for correctly mapping gas table

* Implemented IsAtlantis interface for vm runtime

* Added fix for testing some fork subtests EIP150 and Frontier (#27)

* ci: create basic circle-ci config (#26)

* ci: create basic circle-ci config

* ci: lower parallelism

* ci: rename jobs

* ci: rename jobs

* EIP161, State Trie Clearing (#28)

* implemented EIP 161 logic

* implemented EIP 161 logic

* fixed bug

* no more segfaults

* Byzantium Tests Passing. Certain Homestead Failing

* Fixed implementation to pass (almost) all tests

* Updated testing framework to run all ETH directories

* Reimpl EIP161 SUICIDE and CALL edge cases

* Skip unimplemented functionality tests

* proper indentation

* Elizabeth/fix bindings test (#30)

* add go mods to bind package

* attempt to fix mods

* revert some dependencies

* fixed trimToImportPath for outside of go path (#33)

* fixed trimToImportPath for outside of go path

* is this how working_directory works?

* is this how working_directory works?

* is this how working_directory works?

* is THIS how working_directory works?

* is THIS how working_directory works?

* working_directory

* working_directory

* EIP 140 REVERT (#34)

* Implemented EIP 140 op code framework to be tested

* Added required parameters and moved protocol parameters into their own file

* Removed coverage file accidentally commited

* Set up testing framework for eth tests

* Updated struct formatting for unmarshalling

* Updated format of eth test struct and updated test files (were replaced with generated files)

* Using ethereum tests submodule and updated framework for testing

* Updated testing structure into subtests for better reporting and so that all test cases are tested even when one fails

* Fix merge error

* Removed indirect reference to ethereum/go-ethereum during rebase

* Implemented EIP 140 op code framework to be tested

* Added required parameters and moved protocol parameters into their own file

* Removed coverage file accidentally commited

* Set up testing framework for eth tests

* Updated struct formatting for unmarshalling

* Updated format of eth test struct and updated test files (were replaced with generated files)

* Using ethereum tests submodule and updated framework for testing

* Updated testing structure into subtests for better reporting and so that all test cases are tested even when one fails

* Fix merge error

* Removed indirect reference to ethereum/go-ethereum during rebase

* WIP fixed some implementations of REVERT

* Fixed more implementation details

* Skipped unrelated and unimplemented tests

* Implemented EIP 140 op code framework to be tested

* Added required parameters and moved protocol parameters into their own file

* Removed coverage file accidentally commited

* Set up testing framework for eth tests

* Updated struct formatting for unmarshalling

* Updated format of eth test struct and updated test files (were replaced with generated files)

* Using ethereum tests submodule and updated framework for testing

* Updated testing structure into subtests for better reporting and so that all test cases are tested even when one fails

* Fix merge error

* Removed indirect reference to ethereum/go-ethereum during rebase

* Implemented EIP 140 op code framework to be tested

* Added required parameters and moved protocol parameters into their own file

* Removed coverage file accidentally commited

* Set up testing framework for eth tests

* Updated struct formatting for unmarshalling

* Updated format of eth test struct and updated test files (were replaced with generated files)

* Using ethereum tests submodule and updated framework for testing

* Updated testing structure into subtests for better reporting and so that all test cases are tested even when one fails

* Fix merge error

* Removed indirect reference to ethereum/go-ethereum during rebase

* WIP fixed some implementations of REVERT

* Fixed more implementation details

* Skipped unrelated and unimplemented tests

* Revert modules changes from development

* Removed last gas cost variable used previously to save recalculation

* EIP 170, contract size limit (#23)

* added contract size limit

* added maxCodeSizeExceeded error

* fixed some tests failing due to not checking for creation of contract in the OR

* added IsAtlantis condition for max code size to apply. We now fail tests

* removed TestETHCodeSizeLimit

* EIP 100 Difficulty adjustment and testing (#36)

* Set up testing framework for difficulty

* Set up framework for testing difficulty

* Implemented EIP 100 and set up testing config

* Set up testing framework for difficulty

* Set up framework for testing difficulty

* Implemented EIP 100 and set up testing config

* Cleaned up and moved params to file

* Fixed usages of CalcDifficulty

* Moved parsing of hex or decimal strings functions to common package

* EIP 211 and refactor (#37)

* set up framework for returndata and refactor

* Refactored pc operation

* Refactored nil function jumptable lookups (why was it like that to begin with)

* Finished refactoring jump operations

* Implemented 211 functionality, but state tests not passing

* Fixed returndatasize

* Refactor memory and gas stack accesses

* Fixed a few small details for the implementation

* Fixed incorrect implementation of returndatacopy and revert edge case

* Removed unused instruction parameter since refactor

* Removed commented out printing from debugging

* EIP 196, 197, 198 (#24)

* implement bn256 precompiles

* implement bigModExp

* add comments and test

* run precompile tests

* skip failing tests for now

* add distinction between atlantis and pre-atlantis precompiles

* refactor precompiles to separate pre and post atlantis

* implement bn256 precompiles

* implement bigModExp

* add comments and test

* run precompile tests

* skip failing tests for now

* add distinction between atlantis and pre-atlantis precompiles

* refactor precompiles to separate pre and post atlantis

* fix ecrecover edge case

* implement bn256 precompiles

* implement bigModExp

* add comments and test

* run precompile tests

* skip failing tests for now

* add distinction between atlantis and pre-atlantis precompiles

* refactor precompiles to separate pre and post atlantis

* implement bn256 precompiles

* implement bigModExp

* add comments and test

* run precompile tests

* fix ecrecover edge case

* update go.mod

* remove skip for previously failing tests

* attempt to fix go.mod

* attempt to fix go.mod

* fix go.mod termiu version

* EIP 214 STATICCALL (#40)

* Cherry pick STATICALL commit

* Removed implemented skipped tests

* Removed implemented tests
@soc1c soc1c mentioned this pull request Jun 17, 2019
16 tasks
soc1c added a commit that referenced this pull request Aug 13, 2019
* Replace repository reference for accounts/abi/bind (#29)

* docs: update badges (#34)

* docs: add gitter badge

* docs: add circle-ci badge

* Update README.md

* Update README.md

* Update README.md

* docs: update repository path

* Update README.md

* Tx Encoding and decoding fix (#33)

* Added test for decoding old encoding function

* Fixed decoding issue and improved tests to handle all cases including previous client

* Add compatibility with previous version

* Rename receipt storage variable

* Storage and edge case fixes (#28)

* Applied storage fixes and updates

* Minor execution refactor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants