solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Drop support for ancient EVM versions, i.e. for homestead

Open ekpyron opened this issue 4 years ago • 11 comments

Came up in https://github.com/ethereum/solidity/pull/12205/files#r743092422.

  • homestead in particular needs the canOverchargeGasForCall() workarounds, which complicate code (although to be fair it's not that bad)
  • the new Yul-EVM code transform currently cannot guarantee not to reorder the gas opcode (although to be fair it could probably be adjusted, s.t. it can, but that would probably mean some more invasive special case handling)

So while that's not an absolutely strong case, maybe it still makes sense to consider dropping support. For that the main consideration is probably: Are there any live chains that run homestead, resp. any users that may rely on new compiler versions to be able to generate homestead-compatible bytecode?

If not, there's little reason for not dropping the support.

ekpyron avatar Nov 05 '21 15:11 ekpyron

This would be breaking, right?

cameel avatar Nov 05 '21 19:11 cameel

This would be breaking, right?

Probably - although I guess there's no precedent and it might be fair to decide that it's not - I guess we'll only drop support, if we're reasonably sure that doing so in practice doesn't break anything anyways :-).

ekpyron avatar Nov 05 '21 19:11 ekpyron

The issue I see is that Solidity is used by many other chains and we want to avoid the need for various forks to emerge. I know that there is such differentiation between the various chains, mostly they may not implement some recent features from Berlin/London, or they implement features non existing on mainnet (however these are mostly in a way, like precompiles, which does not require a change in the compiler)

Now if we start dropping support for older mainnet releases, we may find ourselves in a spot where we drop support for some chains. I do not think this applies to homestead, as I'd imagine most chains are on Byzantium-compatibility (for revert/staticcall/returndata) or even Constantinople-compatibility (for create2).

In the end I think it is important to keep the above in mind.

axic avatar Nov 05 '21 19:11 axic

I don't think this is such a big problem. Currently the strategy to just have non--optimized code (or code with stack errors) for ancient versions works well enough in my opinion.

chriseth avatar Nov 08 '21 10:11 chriseth

If we switch to non-optimized code only, then it's really a non-issue. It would just both be annoying to have to adjust the new code transform to handle this, as well as having to keep the complexity of the stack optimizations in the old code transform because of this...

ekpyron avatar Nov 08 '21 10:11 ekpyron

New tendency: even drop everything below constantinople.

ekpyron avatar Nov 17 '22 11:11 ekpyron

Looks like Vyper will be dropping everything older than istanbul in the next release. The PR for that is even already merged: https://github.com/vyperlang/vyper/pull/3470.

cameel avatar Aug 07 '23 12:08 cameel

We did ask around at least a bit already, whether this would be a problem for anyone, but nobody weighed in so far? We could emit a "deprecated" warning soon to give people a chance to cry out.

ekpyron avatar Aug 07 '23 13:08 ekpyron

A deprecation warning sounds like a good idea.

Also, wouldn't hurt to announce on Twitter that we're planning to do that.

cameel avatar Aug 07 '23 13:08 cameel

Implementation note: also drop the old Yul->EVM transform (see https://github.com/ethereum/solidity/issues/15641#issuecomment-2587504944).

cameel avatar Jan 13 '25 15:01 cameel

I'm wondering if our support for pre-byzantium EVMs even works (in the sense that the produced bytecode would run on such an old EVM). Only that fork introduced REVERT (EIP-140: REVERT instruction), but we seem to be using it unconditionally on all versions. Even compiling something as simple as contract C {} produces bytecode that contains two reverts. That's still reproducible with --evm-version homestead and on compiler versions down to 0.5.0. Earlier ones either do not have the CLI flag or hang when I try to use it.

But if that's the case, I would have expected that to come up in tests and it never did. And we do have some semantic tests specifically for homestead, like return_dynamic_types_cross_call_out_of_range_1.sol. Just running it should have revealed the problem, assuming that evmone properly disables REVERT and from a quick look at its code it seems that this should be the case.

cameel avatar Sep 29 '25 18:09 cameel