Skip to content

Emit covenant state tracking metadata#130

Open
Manyfestation wants to merge 1 commit into
kaspanet:masterfrom
Manyfestation:state-tracking-markers
Open

Emit covenant state tracking metadata#130
Manyfestation wants to merge 1 commit into
kaspanet:masterfrom
Manyfestation:state-tracking-markers

Conversation

@Manyfestation

Copy link
Copy Markdown
Collaborator

Emit covenant state-tracking metadata

This PR records bytecode offsets for covenant output-state validation points.

For regular validateOutputState, the compiler records where the next state and output index are available on the stack. For "with template" validation via validateOutputStateWithTemplate, it also records the template prefix, suffix, and hash positions.

These offsets are first tracked per entrypoint using an explicit pending-marker structure, then adjusted after the compiler stitches the final contract script. The resulting artifact metadata lets state decoders replay script execution and capture the exact values needed to verify expected P2SH outputs.

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 this pull request may close these issues.

1 participant