Skip to content

Require script/predicate ABI when creating loaders #1633

@segfault-magnet

Description

@segfault-magnet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Low priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions