Skip to content

fix: decode OrderUid.validTo as big-endian in Autopilot#4404

Merged
jmg-duarte merged 4 commits into
cowprotocol:mainfrom
sunce86:fix/orderuid-validto-be
May 20, 2026
Merged

fix: decode OrderUid.validTo as big-endian in Autopilot#4404
jmg-duarte merged 4 commits into
cowprotocol:mainfrom
sunce86:fix/orderuid-validto-be

Conversation

@sunce86
Copy link
Copy Markdown
Contributor

@sunce86 sunce86 commented May 12, 2026

Fixes a bug in validTo decoding.

Correct decoding uses BE in gpv2 settlement, model crate, driver crate. Only in this place LE is used which is wrong.

Matches the on-chain layout per GPv2Order.packOrderUidParams (Solidity
uint32 is packed BE) and the canonical implementation in
model::OrderUid::parts. The previous from_le_bytes was dormant because
parts() is private and its sole caller, owner(), reads .1; switching
to BE prevents future callers from reading wrong validTo values.
@sunce86 sunce86 requested a review from a team as a code owner May 12, 2026 08:49
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the OrderUid decomposition logic in crates/autopilot/src/domain/auction/order.rs by changing the byte order conversion for the final 4 bytes from little-endian to big-endian. No review comments were provided for these changes, and I have no feedback to provide.

Comment thread crates/autopilot/src/domain/auction/order.rs
@github-actions
Copy link
Copy Markdown

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

@github-actions github-actions Bot added the stale label May 20, 2026
jmg-duarte and others added 2 commits May 20, 2026 11:37
@AryanGodara AryanGodara removed the stale label May 20, 2026
@jmg-duarte jmg-duarte added this pull request to the merge queue May 20, 2026
Merged via the queue into cowprotocol:main with commit 0f8ad3d May 20, 2026
20 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants