Skip to content

Require script/predicate ABI when creating loaders #1633

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

Open
segfault-magnet opened this issue Mar 31, 2025 · 0 comments
Open

Require script/predicate ABI when creating loaders #1633

segfault-magnet opened this issue Mar 31, 2025 · 0 comments

Comments

@segfault-magnet
Copy link
Contributor

segfault-magnet commented Mar 31, 2025

When we build a loader, the Rust SDK only needs the compiled script or predicate binary. Because of this we’re forced to peek inside the binary header to locate the data/configurables section. Since the Sway compiler’s header format isn’t fixed, our code today includes fragile hacks that guess the compiler version and, from there, infer the metadata layout.

After chatting with @green.baneling, it became clear that there’s no realistic scenario where someone has only the binary but not its ABI file and still needs a loader. So, to make the behavior more robust, we should require the ABI file when creating loaders.

@netrome netrome added the refine label Apr 10, 2025 — with Linear
@segfault-magnet segfault-magnet changed the title ABI to be needed when creating loaders Require script/predicate ABI when creating loaders Apr 17, 2025
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

No branches or pull requests

3 participants