Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Comply EIP-86 with the new definition #9140

Merged
merged 9 commits into from
Aug 1, 2018
Merged

Comply EIP-86 with the new definition #9140

merged 9 commits into from
Aug 1, 2018

Conversation

sorpaas
Copy link
Collaborator

@sorpaas sorpaas commented Jul 17, 2018

Fixes #9127

The current version of EIP-86 differs from the one when it was implemented in parity-ethereum in point 3 and point 4. For point 3, a new salt was added, allowing CREATE2 to create multiple contracts with the same init code. Point 4 is the same as EIP-684, which we have already implemented.

The default contract address scheme was also changed to be always the old one (sender and nonce), regardless of EIP-86.

Note that this is backward incompatible, with the assumption that none (or not many) working chains have attempted to set the eip86Transition flag, because it's not really useful by itself.

@sorpaas sorpaas added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. labels Jul 17, 2018
@sorpaas sorpaas added this to the 2.1 milestone Jul 17, 2018
@5chdn
Copy link
Contributor

5chdn commented Jul 17, 2018

Didn't we enable eip86 on kovan? Will this break existing networks that activated it?

@sorpaas
Copy link
Collaborator Author

sorpaas commented Jul 17, 2018

@5chdn From the chain spec it looks like we didn't enable it on Kovan.

Yes it will break existing networks if they activated it. I'm also okay if we want this to be backward compatible, but my rationale for writing this PR as right now is that:

  • The maintenance and support cost is probably high -- if we do it backward compatible, we would need another flag also called "eip86", two different versions of CREATE2, and an additional contract address scheme. We may also need to constantly explain why we have two EIP-86 meaning different things.
  • EIP-86 forms some a base for other use cases, but only enabling itself is not that useful. (We also lack a transaction pool implementation for null sender transactions.) So my assumption here is that probably none of the working chains have enabled it.

@sorpaas
Copy link
Collaborator Author

sorpaas commented Jul 17, 2018

I'm really hoping we can get the concept of "nightly" as in Rust compiler. In that way, we can define features where you cannot activate on stable/beta parity-ethereum and be able to change their definitions.

@5chdn
Copy link
Contributor

5chdn commented Jul 17, 2018

Yes, that's certainly the idea of the nightly track. Just asking because I'll be the one writing the release notes at some point :-p

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

LGTM. Can we add some tests? To make sure that CREATE2 picks the right address scheme and also that the new address scheme is calculated correctly.

Can you also update the comment for have_create2 in ethcore/vm/src/schedule.rs which mentions the old CREATE_P2SH opcode name?

@5chdn 5chdn modified the milestones: 2.1, 2.2 Jul 17, 2018
@sorpaas
Copy link
Collaborator Author

sorpaas commented Jul 18, 2018

I didn't find a good way to add tests in evm crate. I think for that, it may need new jsontests. But I added additional tests directly in ethcore::executive to test create and create2.

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

LGTM. I'm sure if this goes into a future HF we will get some JSON tests for this. I agree that it would be nice to have the concept of experimental features, but maybe just documenting that EIPs that aren't currently deployed are still experimental and not as thoroughly tested (although this is specific to EIP related features).

Copy link
Collaborator

@debris debris left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -172,9 +172,9 @@ impl RichRawTransaction {

impl Transaction {
/// Convert `LocalizedTransaction` into RPC Transaction.
pub fn from_localized(mut t: LocalizedTransaction, eip86_transition: u64) -> Transaction {
pub fn from_localized(mut t: LocalizedTransaction, _eip86_transition: u64) -> Transaction {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if it's unused, can we just remove it?

@@ -206,9 +206,9 @@ impl Transaction {
}

/// Convert `SignedTransaction` into RPC Transaction.
pub fn from_signed(t: SignedTransaction, block_number: u64, eip86_transition: u64) -> Transaction {
pub fn from_signed(t: SignedTransaction, block_number: u64, _eip86_transition: u64) -> Transaction {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 1, 2018
@debris debris merged commit 637883f into master Aug 1, 2018
@debris debris deleted the sp-eip86 branch August 1, 2018 11:17
ordian added a commit to ordian/parity that referenced this pull request Aug 2, 2018
…rp_sync_on_light_client

* 'master' of https://github.com/paritytech/parity:
  Propagate transactions for next 4 blocks. (openethereum#9265)
  decode block rlp less often (openethereum#9252)
  Fix eternalities tests can_create (missing parameter) (openethereum#9270)
  Update ref to `parity-common` and update `seek` behaviour (openethereum#9257)
  Comply EIP-86 with the new definition (openethereum#9140)
  Check if synced when using eth_getWork (openethereum#9193) (openethereum#9210)
@holiman
Copy link
Contributor

holiman commented Aug 22, 2018

How do I enalbe this in config? That is, what specific eipxxTransition name should I use in common/params ? Needed for hive.

@debris
Copy link
Collaborator

debris commented Aug 22, 2018

@holiman it is eip86Transition

andresilva pushed a commit that referenced this pull request Oct 9, 2018
* Comply EIP-86 with the new CREATE2 opcode

* Fix rpc compile

* Fix interpreter CREATE/CREATE2 stack pop difference

* Add unreachable! to fix compile

* Fix instruction_info

* Fix gas check due to new stack item

* Add new tests in executive

* Fix have_create2 comment

* Remove all unused references of eip86_transition and block_number
andresilva pushed a commit that referenced this pull request Oct 9, 2018
* Comply EIP-86 with the new CREATE2 opcode

* Fix rpc compile

* Fix interpreter CREATE/CREATE2 stack pop difference

* Add unreachable! to fix compile

* Fix instruction_info

* Fix gas check due to new stack item

* Add new tests in executive

* Fix have_create2 comment

* Remove all unused references of eip86_transition and block_number
andresilva pushed a commit that referenced this pull request Oct 10, 2018
* Comply EIP-86 with the new CREATE2 opcode

* Fix rpc compile

* Fix interpreter CREATE/CREATE2 stack pop difference

* Add unreachable! to fix compile

* Fix instruction_info

* Fix gas check due to new stack item

* Add new tests in executive

* Fix have_create2 comment

* Remove all unused references of eip86_transition and block_number
5chdn pushed a commit that referenced this pull request Oct 10, 2018
* ethash: implement EIP-1234 (#9187)

* Implement EIP-1052 (EXTCODEHASH) and fix several issues in state account cache (#9234)

* Implement EIP-1052 and fix several issues related to account cache

* Fix jsontests

* Merge two matches together

* Avoid making unnecessary Arc<Vec>

* Address grumbles

* Comply EIP-86 with the new definition (#9140)

* Comply EIP-86 with the new CREATE2 opcode

* Fix rpc compile

* Fix interpreter CREATE/CREATE2 stack pop difference

* Add unreachable! to fix compile

* Fix instruction_info

* Fix gas check due to new stack item

* Add new tests in executive

* Fix have_create2 comment

* Remove all unused references of eip86_transition and block_number

* Implement KIP4: create2 for wasm (#9277)

* Basic implementation for kip4

* Add KIP-4 config flags

* typo: docs fix

* Fix args offset

* Add tests for create2

* tests: evm

* Update wasm-tests and fix all gas costs

* Update wasm-tests

* Update wasm-tests and fix gas costs

* `gasleft` extern implemented for WASM runtime (kip-6) (#9357)

* Wasm gasleft extern added

* wasm_gasleft_activation_transition -> kip4_transition

* use kip-6 switch

* gasleft_panic -> gasleft_fail rename

* call_msg_gasleft test added and gas_left agustments because this openethereum/wasm-tests#52

* change .. to _

* fix comment for the have_gasleft param

* update tests (openethereum/wasm-tests@0edbf86)

* Add EIP-1014 transition config flag (#9268)

* Add EIP-1014 transition config flag

* Remove EIP-86 configs

* Change CREATE2 opcode index to 0xf5

* Move salt to the last item in the stack

* Change sendersaltandaddress scheme to comply with current EIP-1014

* Fix json configs

* Fix create2 test

* Fix deprecated comments

* EIP 1283: Net gas metering for SSTORE without dirty maps (#9319)

* Implement last_checkpoint_storage_at

* Add reverted_storage_at for externalities

* sstore_clears_count -> sstore_clears_refund

* Implement eip1283 for evm

* Add eip1283Transition params

* evm: fix tests

* jsontests: fix test

* Return checkpoint index when creating

* Comply with spec Version II

* Fix docs

* Fix jsontests feature compile

* Address grumbles

* Fix no-checkpoint-entry case

* Remove unnecessary expect

* Add test for State::checkpoint_storage_at

* Add executive level test for eip1283

* Hard-code transaction_checkpoint_index to 0

* Fix jsontests

* Add tests for checkpoint discard/revert

* Require checkpoint to be empty for kill_account and commit

* Get code coverage

* Use saturating_add/saturating_sub

* Fix issues in insert_cache

* Clear the state again

* Fix original_storage_at

* Early return for empty RLP trie storage

* Update comments

* Fix borrow_mut issue

* Simplify checkpoint_storage_at if branches

* Better commenting for gas handling code

* Address naming grumbles

* More tests

* Fix an issue in overwrite_with

* Add another test

* Fix comment

* Remove unnecessary bracket

* Move orig to inner if

* Remove test coverage for this PR

* Add tests for executive original value

* Add warn! for an unreachable cause

* Update state tests execution model (#9440)

* Update & fix JSON state tests.

* Update tests to be able to run ethtest at
021fe3d410773024cd5f0387e62db6e6ec800f32.

- Touch user in state
- Adjust transaction tests to new json format

* Switch to same commit for submodule ethereum/test as geth (next includes constantinople changes).
Added test `json_tests::trie::generic::TrieTests_trieanyorder` and a few
difficulty tests.

* Remove trietestnextprev as it would require to parse differently and
implement it.

* Support new (shitty) format of transaction tests.

* Ignore junk in ethereum/tests repo.

* Ignore incorrect test.

* Update to a later commit

* Move block number to a constant.

* Fix ZK2 test - touched account should also be cleared.

* Fix conflict resolution

* Fix checkpointing when creating contract failed (#9514)

* In create memory calculation is the same for create2 because the additional parameter was popped before. (#9522)

* Enable all Constantinople hard fork changes in constantinople_test.json (#9505)

* Enable all Constantinople hard fork changes in constantinople_test.json

* Address grumbles

* Remove EIP-210 activation

* 8m -> 5m

* Temporarily add back eip210 transition so we can get test passed

* Add eip210_test and remove eip210 transition from const_test

* Add constantinople conf to EvmTestClient. (#9570)

* Add constantinople conf to EvmTestClient.

* Skip some test to update submodule etheureum/tests submodule to latest.

* Put skipping 'under issue' test behind a feature.

* Change blockReward for const-test to pass ethereum/tests

* Update tests to new constantinple definition (change of reward at block
5).
Switch 'reference' to string, that way we can include issues from others
repo (more flexible)Update tests to new constantinple definition (change
of reward at block 5).
Switch 'reference' to string, that way we can include issues from others
repo (more flexible).

* Fix modexp and bn128_mul gas prices in chain config

* Changes `run_test_path` method to append its directory results (without
that it stop testing at the first file failure).
Add some missing tests.
Add skip for those (block create2 is one hundred percent false but on
hive we can see that geth and aleth got similar issue for this item).

* retab current.json

* Update reference to parity issue for failing tests.

* Hardfork the testnets (#9562)

* ethcore: propose hardfork block number 4230000 for ropsten

* ethcore: propose hardfork block number 9000000 for kovan

* ethcore: enable kip-4 and kip-6 on kovan

* etcore: bump kovan hardfork to block 9.2M

* ethcore: fix ropsten constantinople block number to 4.2M

* ethcore: disable difficulty_test_ropsten until ethereum/tests are updated upstream

* Don't hash the init_code of CREATE. (#9688)

* Implement CREATE2 gas changes and fix some potential overflowing (#9694)

* Implement CREATE2 gas changes and fix some potential overflowing

* Ignore create2 state tests

* Split CREATE and CREATE2 in gasometer

* Generalize rounding (x + 31) / 32 to to_word_size

* ethcore: delay ropsten hardfork (#9704)

* Add hardcoded headers (#9730)

* add foundation hardcoded header #6486017

* add ropsten hardcoded headers #4202497

* add kovan hardcoded headers #9023489

* gitlab ci: releasable_branches: change variables condition to schedule (#9729)

* HF in POA Core (2018-10-22) (#9724)

poanetwork/poa-chain-spec#87
@ordian ordian mentioned this pull request Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants