Repository navigation
Feat: stacks abi interface - #7905
Open
brice-stacks wants to merge 3 commits into
Open
brice-stacks wants to merge 3 commits into
brice-stacks wants to merge 3 commits into
Conversation
Define the host interface of the chain ABI as one table: for each of the 66 host functions its group, parameters in the kinds of ABI 6.1, result, status codes and charge formula. Deploy validation, linking, the fuel schedule and the tools derive from it. Tests check the Wasm types against ABI 6.1 and the rules every signature and charge formula must keep.
Add the parts of a deploy that need no Wasm parser: - The `abi.interface` section (ABI 4.1): encode, decode and validation, accepting exactly the one encoding of an interface, and its hash, `sha512/256` of the bytes. - The rules for a module's custom sections (ABI 3.4). - The reasons a deploy is rejected, each with the string a receipt carries. Vectors cover every rejection rule of ABI 4.1 and 3.4.
brice-stacks
force-pushed
the
feat/stacks-abi-interface
branch
from
November 30, 2026 22:33
21da83b to
1a37725
Compare
2 of 5 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds to
stacks-abithe parts of a deploy that need no Wasm parser: theabi.interfacecodec, the rules for a module's custom sections, and the reasons a deploy is rejected (chain ABI 3.4, 4.1, 11).Closes #7876. Builds on the host-interface table of #7904 (issue #7877) and so should be reviewed after that one (currently just the last commit is new here).
What is in it
interface::Interface: the contents of theabi.interfacesection (ABI 4.1).decodeaccepts exactly the one encoding of an interface and reports the first field that is missing or invalid;encodewrites it;hashissha512/256of the bytes.Interface::newbuilds one from lists and rejects a list that is not in strictly ascending order.interface::ABI_VERSION: the version a module's interface and its import module name must both state (ABI 11).decodeaccepts any version, because a version mismatch is its own rejection reason: the deploy pipeline comparesInterface::abi_versionwith this constant.deploy::check_custom_sections: a module carriesabi.interfaceand optionallyabi.typesandabi.provenance, each at most once, and no other custom section (ABI 3.4).deploy::DeployRejection: the nine reasons a deploy is rejected, each with the string a receipt carries. It is defined withdefine_named_enum!ofstacks-common, asErrorClassis.Tests
vectors/interfaces.txt: 75 vectors, covering every rejection rule of ABI 4.1 and 3.4, including which rule decides when more than one is broken. Every accepted interface encodes back to the same bytes.stacks-abi-vfollowed byABI_VERSION.The tests run natively and on
wasm32-unknown-unknownthrough the existingstacks-abiCI steps.