Skip to content

chore: provide new_unchecked constructors for headers#232

Merged
Fraser999 merged 1 commit into
mainfrom
fraser/eng-2240/new-unchecked
May 8, 2026
Merged

chore: provide new_unchecked constructors for headers#232
Fraser999 merged 1 commit into
mainfrom
fraser/eng-2240/new-unchecked

Conversation

@Fraser999
Copy link
Copy Markdown
Contributor

@Fraser999 Fraser999 commented May 8, 2026

Summary

  • Add new_unchecked constructors to SignetHeaderV1 and SignetHeaderV2 that skip invariant validation, allowing infallible construction from trusted sources (e.g. headers already parsed and stored in the storage crates)
  • Bump workspace version to 0.17.1

Motivation

Storage crates store plain alloy::consensus::Header values. When reading these back and wrapping them as signet header types, the validation in TryFrom<Header> is redundant - the data has already been validated on the way in. The new_unchecked constructors allow direct construction without re-checking invariants, which is both simpler (infallible) and avoids unnecessary work.

Test plan

  • Existing signet-types tests pass (cargo t -p signet-types)
  • Clippy clean with --all-features and --no-default-features
  • Verify consuming crates can use new_unchecked to construct headers from stored data

@Fraser999 Fraser999 requested a review from a team as a code owner May 8, 2026 15:50
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Fraser999 Fraser999 changed the title provide new_unchecked constructors for headers chore: provide new_unchecked constructors for headers May 8, 2026
@Fraser999 Fraser999 merged commit 75763da into main May 8, 2026
8 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