Skip to content

Comments

feat(provider): add new_payload_v4_requests accepting RequestsOrHash#3556

Merged
mattsse merged 1 commit intomainfrom
matt/new-payload-v4-requests
Jan 20, 2026
Merged

feat(provider): add new_payload_v4_requests accepting RequestsOrHash#3556
mattsse merged 1 commit intomainfrom
matt/new-payload-v4-requests

Conversation

@mattsse
Copy link
Member

@mattsse mattsse commented Jan 20, 2026

Summary

Adds a new new_payload_v4_requests method that accepts RequestsOrHash instead of Vec<Bytes>, allowing callers to pass either the full requests or just a precomputed hash.

Changes

  • Add From<Vec<Bytes>> impl for Requests (zero-cost, no allocation)
  • Add Requests::from_requests for converting from iterators of Into<Bytes>
  • Add new_payload_v4_requests variant that accepts RequestsOrHash
  • Keep original new_payload_v4 unchanged for backwards compatibility

This mirrors the approach used for new_payload_v5 which already accepts RequestsOrHash.

- Add From<Vec<Bytes>> impl for Requests (zero-cost)
- Add Requests::from_requests for iterator conversion
- Add new_payload_v4_requests variant that accepts RequestsOrHash
- Keep original new_payload_v4 unchanged for backwards compatibility
@mattsse mattsse force-pushed the matt/new-payload-v4-requests branch from 4cccbd5 to b3c3e4c Compare January 20, 2026 19:04
@mattsse mattsse enabled auto-merge (squash) January 20, 2026 19:11
Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

LGTM - clean addition that mirrors the v5 API pattern. CI green.

@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Jan 20, 2026
@mattsse mattsse merged commit 998cf08 into main Jan 20, 2026
30 checks passed
@mattsse mattsse deleted the matt/new-payload-v4-requests branch January 20, 2026 19:13
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants