Skip to content

Add bytes_to_packed_u32_felts() function to utils module #2157

@partylikeits1983

Description

@partylikeits1983

Problem

The ethereum_address_to_felts() function manually converts bytes to packed u32 felts, but miden-vm already has a general helper function [bytes_to_packed_u32_felts()] that does exactly this conversion.

bytes_to_packed_u32_felts: https://github.com/0xMiden/miden-vm/blob/e37729eacdd56fc53aa372aa441ef835eb18bb45/crates/lib/core/src/handlers/mod.rs#L191

Context: #2023 (comment)

Solution

Add the bytes_to_packed_u32_felts() function to the utils module in miden-base and refactor ethereum_address_to_felts() to use this general helper instead of the current manual implementation.

Benefits

  • Reduces code duplication
  • Uses a proven, tested implementation
  • Makes the conversion logic more maintainable
  • Provides a reusable utility for other byte-to-felt conversions

Metadata

Metadata

Assignees

Labels

agglayerPRs or issues related to AggLayer bridging integrationrustIssues that affect or pull requests that update Rust code

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions