Stop pre-parsing Wasm bytecode in Python and storing Wasm ASTs in <code>#81
Merged
automergerpr-permission-manager[bot] merged 5 commits intoMay 14, 2026
Merged
Conversation
tothtamas28
reviewed
May 14, 2026
Contributor
tothtamas28
left a comment
There was a problem hiding this comment.
Is this extension still necessary, or can it be dropped?
syntax AccountCode ::= ModuleDecl
31 tasks
Member
Author
It is still necessary for |
tothtamas28
approved these changes
May 14, 2026
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.
This PR removes support for storing Stylus contract code as Wasm ASTs (
ModuleDecl) in the<code>cell.Background
In the EVM semantics, contract code is represented as raw bytecode:
Stylus semantics extended this with:
where
ModuleDeclrepresents Wasm modules, either in text form or abstract syntax form.The
<code>cell could contain:BytesModuleDecl.wasttests)Wasm text modules and abstract Wasm modules share the same ModuleDecl sort, so they cannot be distinguished at the sort level.
Previous behavior
Wasm AST storage existed primarily because the semantics could not directly parse Wasm bytecode, and there were no pyk hooks available for parsing.
As a workaround in
skribeandskribe-simulation:skribe-simulationAfter implementing pyk hooks, contracts created by the test contract started being stored as Wasm bytecode, with their parsed ASTs cached in
<parsedWasmCache>, but the main test contract still used Wasm ASTs directly.Changes in this PR
This PR removes the remaining usage of Wasm ASTs as contract code storage.
After this change:
.wasttests (which still use Wasm text format), contract code is always stored as bytecode (Bytes)<parsedWasmCache>To support this flow in the semantics, a
#parseAndCacheWasmstep is triggered aftersetContractinskribe.md.The
AccountCodesort is unchanged since Wasm text modules are still needed for.wasttests.Affected components
The following components are updated to stop injecting parsed Wasm ASTs directly:
skribe-simulationskribeInstead of pre-parsing Wasm in Python, they now rely on the parse-and-cache flow through the pyk hooks.