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

ECLIP-?: Byzantium EVM upgrades (and Tx Receipt status) #2

Open
wants to merge 10 commits into
base: master
from

Conversation

@meowsbits
Copy link
Member

meowsbits commented Feb 11, 2019

Abstract

Add support for a subset of protocol-impacting changes introduced in the Ethereum Foundation (ETH) network via the Byzantium hardfork. The proposed changes include:

  • Byzantium EVM opcodes and precompiled contracts, namely opcodes REVERT (EIP 206/140), RETURNDATASIZE (EIP 211), RETURNDATACOPY (EIP 211), and STATICCALL (EIP 214/116); and precompiled contracts for modular exponentiation, elliptic curve addition, scalar multiplication, and pairing (EIPs 198, 212/197, 213/196)
  • Replacing the intermediate state root field in transaction receipts with the contract return status (EIP 658).

This document proposes block X,XXX,XXX as the upcoming block height at which to implement these changes in the network, placing the expected date of protocol hardfork date on XXXX-XX-XX.


ECLIP document rendered view: https://github.com/etclabscore/ECLIPs/blob/55c44609b989781ec198855eabeb347c3fc6f2b6/ECLIPs/ECLIP-etcbyz.md

See here for background comments around this idea: ethereumproject/ECIPs#95. But keep in mind that that proposal specs Constantinople EVM changes as well, while those features of that proposal have been dropped here for reasons.

  • TODO: Assign a number
  • TODO: Cooperate w/ other stakeholding dev teams to determine an agreeable timeline
    • parity-tech/parity-ethereum
    • IOHK (Mantis), deprecated?
    • ethereumclassic/go-ethereum
    • ethereumproject/go-ethereum
    • etclabscore/go-ethereum
  • TODO: Internal: define priorities for ethoxy/multi-geth rollout readiness
  • TODO: Internal: define priorities for evm-rs (SputnikVM) readiness
  • TODO: Come up w/ a codename for the fork?

meowsbits added some commits Feb 11, 2019

Remove Constantinople specs and undefine ETA
Along w/ a few other minor grammatical tweaks
@BelfordZ

This comment has been minimized.

Copy link
Member

BelfordZ commented Feb 11, 2019

how about we switch to calling forks numbers, and start with this one being zero.

:)

@meowsbits

This comment has been minimized.

Copy link
Member Author

meowsbits commented Feb 11, 2019

oh i like where your heads at. what about about 2019.1? (first fork this year))

Show resolved Hide resolved ECLIPs/ECLIP-etcbyz.md Outdated
Show resolved Hide resolved ECLIPs/ECLIP-etcbyz.md Outdated

__On Immutability__: Introducing new opcodes in the VM has the potential to change behavior of existing contracts; in the case where previously an arbitrary invalid bytecode series (yielding _invalid opcode_) would now be assigned a meaning, and thus could generate or return a value other than _invalid_. In essence, this means "making music where there was only noise before." There is a concern that this behavior change contradicts an essential promise of Immutability, since an existing failing smart contract is liable to become a succeeding (not failing) contract. In counterargument to this concern are two critical points:

1. account states remain changed

This comment has been minimized.

@zmitton

zmitton Feb 12, 2019

Do you mean "unchanged"? Like this is not a DAO refund scenario?

Otherwise I dont think I follow. Also whats the connection with DELEGATECALL? just the fact that they added an unused opcode?

This comment has been minimized.

@meowsbits

meowsbits Feb 12, 2019

Author Member

lol, yeap, __un__changed

and yea, just sayin that there's a precedent for this kind of change, so an argument against this kind of change should have been taken up with vitalik 4 months before the dao fork

1. account states remain changed
2. the "Homestead" hardfork established a precedent for this type of change, having introduced the `DELEGATECALL` opcode at block 1,150,000.

With these arguments in place, along with precedence and expectation for other continuing and varied consensus-impacting protocol upgrades (eg soft- and hard-forks), it follows that the definition of Immutability is not extended to guarantee perfect consistency for future _behavior_ of historical account states, but only to only to guarantee the immutability of the account states themselves.

This comment has been minimized.

@zmitton

zmitton Feb 12, 2019

From a semantic prospective adding an opcode would be classified as a "non-breaking-change". A feature upgrade. Might be worth pointing out. You do a good job of highlighting the cons to your own ECLIP but I think they all have good pro counter arguments.

This comment has been minimized.

@sorpaas

sorpaas Mar 4, 2019

That's false. Adding an opcode would always be a "breaking change", no matter if you consider old contracts that already contain this opcode, or consider hard fork as a whole.

This comment has been minimized.

@zmitton

zmitton Mar 4, 2019

It's a hard fork yes. But considering old contracts. This would be a feature upgrade not a major version change (i.e 0.1.0 not 1.0.0). Any new feature of software will always technically change behavior. But it's only when you look at extreme, un-supported, ways of using it.

Thats even true with the versioning proposal. Adding a 00 byte in front of a contract had a behavior before, it will have a different behavior now

This comment has been minimized.

@sorpaas

sorpaas Mar 4, 2019

Using semantic versioning to consider something as fragile as consensus upgrade is totally unhealthy. Ethereum community's experience tells us that we must consider all upgrades as breaking, regardless how small or how big you think it is. On top of that, we consider what invariant we want to preserve, and what doesn't matter. Otherwise it can easily bring in disaster. You need to especially look out for "extreme, un-supported, ways of using it" and consider them to make sure everything's okay.

Thats even true with the versioning proposal. Adding a 00 byte in front of a contract had a behavior before, it will have a different behavior now

Sure, but do I miss some points you try to claim? Account versioning would of course be a breaking change.

This comment has been minimized.

@zmitton

zmitton Mar 5, 2019

@sorpaas I'm all for being careful 👍. Im just saying that adding useful opcodes likely does not break any intended contract behavior. But I agree that as with any major changes, we should tread lightly and test well.

Show resolved Hide resolved ECLIPs/ECLIP-etcbyz.md Outdated

meowsbits added a commit that referenced this pull request Feb 12, 2019

Revise motivation section
Prioritize the actual outcomes of the proposed features, not
first the case of interoperability.

Rel #2 (comment)

zmitton and others added some commits Feb 12, 2019

Update ECLIPs/ECLIP-etcbyz.md
Fixes EIP658 name; Tx status code -> receipt status code

Co-Authored-By: meowsbits <45600330+meowsbits@users.noreply.github.com>
Revise motivation section
Prioritize the actual outcomes of the proposed features, not
first the case of interoperability.

Rel #2 (comment)

@meowsbits meowsbits force-pushed the prop/etc-byzantium-upgrade branch from 0ea3bc8 to 2108940 Feb 12, 2019

@classiclab
Copy link

classiclab left a comment

A couple of comments about the stakeholders:
-This will require careful planning and outreach to different members of the ecosystem, and input from bus dev and marketing. Let's address this on a parallel track so that the core team can focus on the code.
-The move to multi-geth is a big change, which will likely generate resistance from some corners of the community. Nevertheless, we will lead the effort. When it comes to ethereumclassic, we don't have a basis for cooperating with them on this project at this stage. They are welcome to follow our lead, but we're not going to be dependent upon them.
-We will have to include ethereumproject, as it is remains the canonical client. I think over time, there will be a way to do this.

Show resolved Hide resolved ECLIPs/ECLIP-etcbyz.md Outdated
__On Immutability__: Introducing new opcodes in the VM has the potential to change behavior of existing contracts; in the case where previously an arbitrary invalid bytecode series (yielding _invalid opcode_) would now be assigned a meaning, and thus could generate or return a value other than _invalid_. In essence, this means "possibly making music where there was only noise before." There is a concern that this behavior change contradicts an essential promise of Immutability, since an existing failing smart contract is liable to become a succeeding (not failing) contract, albeit in a hypothetical case of extreme coincidence and gross misuse of an opcode. In counterargument to this concern are two critical points:

1. account states remain unchanged
2. the "Homestead" hardfork established a precedent for this type of change, having introduced the `DELEGATECALL` opcode at block 1,150,000.

This comment has been minimized.

@BelfordZ

BelfordZ Feb 18, 2019

Member
Suggested change
2. the "Homestead" hardfork established a precedent for this type of change, having introduced the `DELEGATECALL` opcode at block 1,150,000.
2. if a person used one of the unimplemented opcodes originally, the behaviour was undefined. In this right - the immutability property remains since the behaviour will be equally undefined once the op code is implemented.

This comment has been minimized.

@BelfordZ

BelfordZ Feb 18, 2019

Member

what if we make another ECLIP and propose that transactions using invalid / unused opcodes are to be deemed invalid transactions and never included in blocks.

Show resolved Hide resolved ECLIPs/ECLIP-etcbyz.md Outdated
@BelfordZ

This comment has been minimized.

Copy link
Member

BelfordZ commented Feb 18, 2019

Great work and thanks @meowsbits for putting this together. Lets build some bridges and slurp in some awesome features long the way :)

@BelfordZ

This comment has been minimized.

Copy link
Member

BelfordZ commented Feb 18, 2019

Assign a number - 6969, naturally.
Come up w/ a codename for the fork? zero

BelfordZ and others added some commits Feb 19, 2019

Update ECLIPs/ECLIP-etcbyz.md
Fixes typo.

Co-Authored-By: meowsbits <45600330+meowsbits@users.noreply.github.com>
Update ECLIPs/ECLIP-etcbyz.md
Makes sentence more assertive.

Co-Authored-By: meowsbits <45600330+meowsbits@users.noreply.github.com>
@meowsbits

This comment has been minimized.

Copy link
Member Author

meowsbits commented Feb 19, 2019

Just want to give everyone this information that we've found a edge case scenario related to the new EXTCODEHASH opcode that can cause geth, aleth and parity to disagree on consensus execution. This edge case can only be triggered when an empty account is present.

• Because EIP-161 is applied on ETH, no empty account can be present during execution, so it's not an issue for the upcoming Constantinople hard fork.
• However, because EIP-161 is not enabled on ETC, it means that a contract execution can meet an empty account. Therefore, it means that applying EXTCODEHASH alone on ETC is not safe.

So a heads up to everyone -- please do not apply EIP-1052 without EIP-161!

@sorpaas

This will require changes to the ECLIP. Either we'll have to include EIP161 (State Trie Clearing) or remove EIP1052. I would recommend the former.

@sorpaas

This comment has been minimized.

Copy link

sorpaas commented Feb 19, 2019

@meowsbits Many in ETH community would even admit that EIP-161 is not really a well-defined specification, and it has caused a lot of troubles for Byzantium and Constantinople because of the definition of "empty". So please be careful with this choice.

I would rather advice let's fix the client or the spec to make sure things work without EIP-161. Or let's fix EIP-161 before deploying it on ETC.

@YazzyYaz

This comment has been minimized.

Copy link

YazzyYaz commented Feb 19, 2019

Trying to understand, is the plan to support three versions of geth and multi-geth? Or will multi-geth be the main focus? You are referring to the ethereumproject/go-ethereum client so not sure which one is being supported.

Also, for such a major upgrade, it's important to coordinate with Parity and IOHK. Mantis isn't deprecated yet.

@BelfordZ

This comment has been minimized.

Copy link
Member

BelfordZ commented Feb 19, 2019

@sorpaas What problems are we inviting down the road if we deviate from how EIP161 was done?

As nice as it would be to have this HF happen sooner than later, exploring ways of gently upgrading eip161 before proceeding sounds like a good plan to me.

@zmitton

This comment has been minimized.

Copy link

zmitton commented Feb 20, 2019

one thing Im confused is why 161 wouldnt be applied on multigeth. If it's in geth woudn't it be in multigeth by default? Unless you and wei activly took it out

@meowsbits

This comment has been minimized.

Copy link
Member Author

meowsbits commented Feb 21, 2019

@zmitton the feature exists in multi-geth, it's just whether to enable it

@meowsbits

This comment has been minimized.

Copy link
Member Author

meowsbits commented Feb 21, 2019

To summarize, it seems the options are:

  1. Leave out EIP161 and leave out EIP1052.
  2. Leave out EIP161, but fix EIP1052->EIP1052.1 to handle cases when contract execution would meet an "empty" (which w/o EIP161 will not have been removed) account, allowing inclusion of EIP1052.1 in the HF.
  3. Fix EIP161->EIP161.1 to be better defined and include it in the PR as a 'dependency' for EIP1052, which could then be optionally "fixed" -> EIP1052.1 or not.

My humble opinion at this point is that 2 seems the most enticing; EIP161 may be contentious anyways for asymptotic-immutablists since it modifies state.

@meowsbits

This comment has been minimized.

Copy link
Member Author

meowsbits commented Feb 21, 2019

lol, wait just a damn second.

This proposal doesn't include EIP1052 or EIP161. EIP1052 is for Constantinople. This prop is for Byzantium-related changes only, leaving this concern for another proposal and another time.

EDIT: I've updated the OP comment to include the document Abstract.

BelfordZ referenced this pull request in BelfordZ/starIPs Mar 2, 2019

__On Immutability__: Introducing new opcodes in the VM has the potential to change behavior of existing contracts; in the case where previously an arbitrary invalid bytecode series (yielding _invalid opcode_) would now be assigned a meaning, and thus could generate or return a value other than _invalid_. In essence, this means "possibly making music where there was only noise before." There is a concern that this behavior change contradicts an essential promise of Immutability, since an existing failing smart contract is liable to become a succeeding (not failing) contract, albeit in a hypothetical case of extreme coincidence and gross misuse of an opcode. In counterargument to this concern are two critical points:

1. account states remain unchanged
2. the "Homestead" hardfork established a precedent for this type of change, having introduced the `DELEGATECALL` opcode at block 1,150,000.

This comment has been minimized.

@DonaldMcIntyre

DonaldMcIntyre Mar 5, 2019

fwiw...i think there is an unavoidable risk that upgrades with hard forks may break some past smart contracts. If this is the case I think that "no hard forks" or "no innovation" isn't a solution either. If there is a "best practices" way for smart contract devs to keep them within a safe boundary that is their responsibility, similar to the responsibility of exchanges of using more confirmations to minimize double spend risks.

Having said that, the goal of ETC devs should still be to minimize such risk in changes and prioritize "backward compatibility" over change just for the sake of change.

Because this is largely subjective, I guess the ECIP (or new starIP) process, and then deployment by node operators and miners, is a good filter to judge that.

@chunfu-yang

This comment has been minimized.

Copy link

chunfu-yang commented Mar 13, 2019

should we take EIP100 into account?

- Byzantium EVM opcodes and precompiled contracts, namely opcodes `REVERT` (EIP 206/140), `RETURNDATASIZE` (EIP 211), `RETURNDATACOPY` (EIP 211), and `STATICCALL` (EIP 214/116); and precompiled contracts for modular exponentiation, elliptic curve addition, scalar multiplication, and pairing (EIPs 198, 212/197, 213/196)
- Replacing the intermediate state root field in transaction receipts with the contract return status (EIP 658).

This document proposes block `X,XXX,XXX` as the upcoming block height at which to implement these changes in the network, placing the expected date of protocol hardfork date on _XXXX-XX-XX_.

This comment has been minimized.

@soc1c

soc1c Mar 18, 2019

Member

This needs some thought. The release process should allow for a hard-fork on the testnets (Morden, Kotti) at least 4 weeks prior to the mainnet activation. Assuming Byzantium is well tested on Ethereum Foundation network, we can just rephrase this like

Suggested change
This document proposes block `X,XXX,XXX` as the upcoming block height at which to implement these changes in the network, placing the expected date of protocol hardfork date on _XXXX-XX-XX_.
This document proposes blocks:
- `X_XXX_XXX` on Ethereum Classic mainnet
- `X_XXX_XXX` on Morden Classic testnet
- `X_XXX_XXX` on Kotti Classic testnet

Edit: date should not be part of the proposal as it is a moving target naturally.

This comment has been minimized.

@soc1c

soc1c Mar 18, 2019

Member

That said,

  • Ethereum Classic block 8_750_000 will be around Wed, Sept 18, 2019
  • Morden Classic block 4_723_000 will be around Wed, Aug 7, 2019
  • Kotti Classic block 1_039_000 will be around Wed, Aug 7, 2019

This comment has been minimized.

@BelfordZ

BelfordZ Mar 18, 2019

Member

@soc1c can you make this as a suggestion? (cmd+g in the comment box)

This comment has been minimized.

@soc1c

soc1c Mar 19, 2019

Member

Done.

This comment has been minimized.

@meowsbits

meowsbits Mar 19, 2019

Author Member

Edit: date should not be part of the proposal as it is a moving target naturally.

Proposing:

Suggested change
This document proposes block `X,XXX,XXX` as the upcoming block height at which to implement these changes in the network, placing the expected date of protocol hardfork date on _XXXX-XX-XX_.

or?

This comment has been minimized.

@soc1c

soc1c Mar 19, 2019

Member

No. I said date.

@meowsbits

This comment has been minimized.

Copy link
Member Author

meowsbits commented Mar 18, 2019

should we take EIP100 into account?

@chunfu-yang We certainly could consider it.

The reason it was not originally included in this spec was because the original impetus for this upgrade set was EVM compatibility, so we had filtered included EIPs according to whether or not they were EVM related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.