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

Remove ban of EXTCODESIZE #147

Closed
wants to merge 1 commit into from
Closed

Remove ban of EXTCODESIZE #147

wants to merge 1 commit into from

Conversation

pdobacz
Copy link
Member

@pdobacz pdobacz commented Jul 29, 2024

Starting the move tentatively decided on during EOF implementers call.

Will proceed to EIPs/EEST/evmone next.

EXTCODEHASH unbanning was also discussed, but the decision was to start small and possibly expand in the next step.

@gumb0
Copy link
Contributor

gumb0 commented Jul 30, 2024

Main argument against would be: this breaks code unobservability guarantees.

In particular the danger can be in some contracts implementing logic conditional on code size (if EXCTODESIZE(addr)=...) and then this code being broken in case addr code is translated to a different version. (here in particular, if legacy code is ever translated to anything else)

And with EIP-7702 even legacy translation is not neeed: result of EXTCODESIZE changes when EOA is delegated to a contract or when delegation is updated. From the point of view of 7702 this is desired behavior.

All other considered solutions (EXT*CALL status codes, IS_CONTRACT etc.) introduce some level of observability, too (some logic depending on whether the contract is EOA or not may break if code assumes this is immutable). But EXTCODESIZE method raises this level up a notch, with more potential scenarios of breakage.

@gumb0
Copy link
Contributor

gumb0 commented Jul 30, 2024

Also general aesthetics / elegance argument: having to explain why with all the measures to prevent code observability. there was one exception for EXTCODESIZE. And why EOF can read legacy code size but not EOF code size.

@pdobacz
Copy link
Member Author

pdobacz commented Jul 31, 2024

Agreed to both comments, The only reason why this has been (tentatively) chosen is that it doesn't introduce yet another opcode.

I only have doubts whether this

some contracts implementing logic conditional on code size (if EXCTODESIZE(addr)=...)

pattern (with exact equality, and to a RHS not being zero) is worthwhile. To me the elegance and abstraction-based arguments are much more important.

If we can at this point have an IS_CONTRACT opcode, this would be definitely cleaner.

@pdobacz
Copy link
Member Author

pdobacz commented Aug 8, 2024

Per last EOF implementers call this is unlikely to happen, the EXTCODESIZE remaining banned has momentum. Will reopen if anything changes.

@pdobacz pdobacz closed this Aug 8, 2024
@pdobacz pdobacz deleted the unban-extcodesize branch August 19, 2024 11:55
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.

2 participants