Skip to content

Conversation

@pdobacz
Copy link
Member

@pdobacz pdobacz commented Feb 1, 2024

the end game should be:

  1. Initcode beginning with 0xEF00 in legacy creation tx (in data) - invalid tx
  2. Code beginning with 0xEF deploy from legacy creation tx - abort (eip-3541)
  3. Initcode beginning with 0xEF00 sent to CREATE / CREATE2 - soft fail
  4. Code beginning with 0xEF returned from CREATE / CREATE2 - abort (eip-3541)

I think now the megaspec covers all these cases

@pdobacz pdobacz requested a review from gumb0 February 1, 2024 19:46
@pdobacz pdobacz self-assigned this Feb 1, 2024
@gumb0
Copy link
Member

gumb0 commented Feb 2, 2024

  1. Initcode beginning with 0xEF00 in legacy creation tx (in data) - invalid tx

Where is this case covered?

@pdobacz
Copy link
Member Author

pdobacz commented Feb 5, 2024

  1. Initcode beginning with 0xEF00 in legacy creation tx (in data) - invalid tx

Where is this case covered?

This one has already been covered, line 132 https://github.com/ipsilon/eof/pull/53/files#diff-2d261f5a273360a59dd4eb4fe19a4d09bab338cfb2b65660d4a2e3e428c175f1R132

- If instructions `CREATE` and `CREATE2` have EOF code as initcode (starting with `EF00` magic)
- deployment fails (returns 0 on the stack)
- caller's nonce is not updated and gas for initcode execution is not consumed
- `DELEGATECALL` from an EOF contract to a legacy contract is disallowed, and it returns 0 to signal failure. We allow legacy to EOF path for existing proxy contracts to be able to use EOF upgrades.
Copy link
Member

Choose a reason for hiding this comment

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

I would maybe either move the rule about the legacy tx with EOF initcode being invalid here from Transaction Types section, or even duplicate it here, but up to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, it's not that much related to the new tx type

Copy link
Member Author

Choose a reason for hiding this comment

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

I've also moved the note on EIP-3541 out of the list to a NOTE, as it is not a modification of behavior

@pdobacz pdobacz force-pushed the eof-legacy-initcode branch from 8d31dab to be1c5dd Compare February 7, 2024 08:59
@pdobacz pdobacz force-pushed the eof-legacy-initcode branch from be1c5dd to 66cf1cf Compare February 7, 2024 09:26
@pdobacz pdobacz merged commit 7638f5e into main Feb 7, 2024
@pdobacz pdobacz deleted the eof-legacy-initcode branch February 7, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants