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

Update eof.md - RETURNCODE #164

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update eof.md - RETURNCODE #164

wants to merge 1 commit into from

Conversation

pdobacz
Copy link
Member

@pdobacz pdobacz commented Sep 9, 2024

Documenting an idea surfaced in discord

Idea surfaced in discord
@pdobacz pdobacz mentioned this pull request Sep 9, 2024
4 tasks
@gumb0
Copy link
Contributor

gumb0 commented Sep 9, 2024

Not sure what's the benefit.

@pdobacz
Copy link
Member Author

pdobacz commented Sep 9, 2024

Not sure what's the benefit.

It seemed to have support in the discord convo, so I posted here for tracking. I'm personally fine with RETURNCONTRACT, even if RETURNCODE is nicer. CODE is more to-the-point and EVM-specific, while CONTRACT is a bit vague and more on a different level of abstraction.

@gumb0
Copy link
Contributor

gumb0 commented Nov 7, 2024

I don't love RETURNCODE, because it's not a code that is being returned, but a container.
(consider for example, if data-only containers are allowed at some point, this will be able to return a container with only data and no code).

How about EOFRETURN or RETURNEOF?

@pdobacz
Copy link
Member Author

pdobacz commented Nov 7, 2024

I don't love RETURNCODE, because it's not a code that is being returned...

Fair point. I understand RETURNCONTAINER is just too long?

Advantage of RETURNCODE is that it aligns with HASCODE (which cannot be HASCONTAINER/HASEOF, because it works for legacy targets), as well as previously relevant CODECOPY etc, to which everyone is used to. Also I imagine that, when speaking about accounts, everyone will keep on saying "the account has code" not "has container".

EOFRETURN would match up with EOFCREATE, but might be interpreted as the EOF replacement of RETURN, which it isn't, contrary to EOFCREATE being the EOF replacement of CREATE (:exploding_head:). Then, maybe it is the "RETURN" which is the problem? EOFDEPLOY?

BTW, I realized recently that naming is weird. We're defining EVM Object format, but we are calling these containers, not objects. RETURNOBJECT? ECF? neither seems likely.

Going back to the data containers - would we still be using the same opcode for these? a specialized RETURNDATA, which doesn't have the immediate arg and doesn't require a subcontainer might be more appropriate.

I still think RETURNCODE is optimal, just because it lines up with the meaning "code" has from POV of accounts, is familiar with RETURN from legacy creation (but is at the same time clearly distinct), and mainly avoids "CONTRACT" word.

@frangio
Copy link

frangio commented Nov 7, 2024

I don't love RETURNCODE, because it's not a code that is being returned, but a container.

The term "code" is overloaded in EOF, it could refer to "EOF code section" or to the "account code" in the state trie, which is a container. All of the opcodes with "code" in their names are removed in EOF, and HASCODE hasn't been accepted yet, so it's hard to find an analogy.

EOFDEPLOY is not bad. RETURNCODE seems okay too and I prefer it to RETURNCONTRACT. I like these arguments by @pdobacz:

it lines up with the meaning "code" has from POV of accounts, is familiar with RETURN from legacy creation (but is at the same time clearly distinct)

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