Skip to content

types: keep the builtin alias in ResolvedType - #443

Merged
apoelstra merged 3 commits into
BlockstreamResearch:masterfrom
LesterEvSe:feat/original-builtin-type
Oct 17, 2026
Merged

apoelstra merged 3 commits into
BlockstreamResearch:masterfrom
LesterEvSe:feat/original-builtin-type

Conversation

@LesterEvSe

@LesterEvSe LesterEvSe commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

When types are resolved, builtin aliases turn into their underlying types: Pubkey, Fe and Scalar become u256, and Point becomes (u1, u256). So AbiMeta can't tell a public key from an arbitrary 256-bit number.

Simplex needs this information for correct, strongly typed include_simf expansion and simplified fuzz value generation. Its entire inner structure depends on values derived from the ResolvedTypes in AbiMeta.

Note: the tag is metadata, not part of the type. PartialEq, Eq and Hash are now implemented by hand and ignore it, so Pubkey and u256 stay interchangeable and type checking is unchanged.

Also added minor refactoring in types/README.md missing from ast refactoring

Checklist

  • If this PR adds or changes a language feature, it is used in
    examples/kitchen_sink.simf, and test-data/kitchen_sink.json is
    regenerated.

@LesterEvSe
LesterEvSe requested a review from KyrylR October 15, 2026 13:44
@LesterEvSe
LesterEvSe requested a review from delta1 as a code owner October 15, 2026 13:44

@KyrylR KyrylR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK d600cac; successfully ran local tests

note on metadata retention: when a parameter's first analysed use carries the plain structural annotation, a later Pubkey-typed or jet-inferred use does not update the stored tag, including nested array elements

There are two small follow-ups from what I can see:

  1. Fix a note above, it is non-blocking for this PR imo
  2. Also noticed that we have a stale README nominal-typing sentence in src/types/README.md:20, also can be fixed later

@apoelstra apoelstra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK d600cac; successfully ran local tests; this is fine.

@apoelstra
apoelstra merged commit ec8eca7 into BlockstreamResearch:master Oct 17, 2026
14 checks passed
@LesterEvSe
LesterEvSe deleted the feat/original-builtin-type branch October 19, 2026 10:47
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.

3 participants