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

spawn host function should return program address #82

Closed
lrettig opened this issue Aug 5, 2024 · 1 comment · Fixed by #100
Closed

spawn host function should return program address #82

lrettig opened this issue Aug 5, 2024 · 1 comment · Fixed by #100

Comments

@lrettig
Copy link
Contributor

lrettig commented Aug 5, 2024

Spawn host function was implemented (#75) without a return value. The assumption was that the spawn would either fail, in which case the call would revert, or it would succeed, in which case the newly-created program address would be returned in ExecutionResult.create_address.

However, it's possible for a single execution thread to call spawn multiple times, and in this case, the address of the programs created by all but the final spawn would be lost. I'm pretty sure we instead need the spawn call to return the newly-created program address. This also simplifies a few things.

Look into the EVM dynamics to understand how it's done there:

This may depend on #81.

@lrettig
Copy link
Contributor Author

lrettig commented Aug 15, 2024

In EVM, the spawn opcodes simply put the newly-created contract address onto the stack. We should probably have the spawn host call return it in like fashion.

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 a pull request may close this issue.

1 participant