Skip to content

Runtime jet type check#361

Merged
apoelstra merged 1 commit intoBlockstreamResearch:masterfrom
ivanlele:feature/dyn-context-type-check
May 5, 2026
Merged

Runtime jet type check#361
apoelstra merged 1 commit intoBlockstreamResearch:masterfrom
ivanlele:feature/dyn-context-type-check

Conversation

@ivanlele
Copy link
Copy Markdown
Contributor

@ivanlele ivanlele commented May 4, 2026

This PR introduces a runtime jet type check in the Context to prevent unintended behavior.

@ivanlele
Copy link
Copy Markdown
Contributor Author

ivanlele commented May 4, 2026

@apoelstra At first I thought about returning a concrete error type, but the jet function is pretty low-level, so that would mean changing all callers to handle a Result. I can do that if you think it’s better.

The current approach is still better than what we had before, we catch type mismatches at construction time instead of during execution.

@apoelstra
Copy link
Copy Markdown
Collaborator

Yeah, I think panicking is fine. It's definitely a programming error if jets wind up getting mixed. We'll likely need some experience with the API to figure out what tools we need to provide to minimize chances of this error.

Copy link
Copy Markdown
Collaborator

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 24ce63a; successfully ran local tests

@apoelstra apoelstra merged commit fe1f888 into BlockstreamResearch:master May 5, 2026
24 checks passed
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.

2 participants