Skip to content

Remove unconditional OrderCreation clone in post_order_handler#4410

Draft
ashleychandy wants to merge 1 commit into
cowprotocol:mainfrom
ashleychandy:post-order-avoid-clone
Draft

Remove unconditional OrderCreation clone in post_order_handler#4410
ashleychandy wants to merge 1 commit into
cowprotocol:mainfrom
ashleychandy:post-order-avoid-clone

Conversation

@ashleychandy
Copy link
Copy Markdown
Contributor

Summary

Eliminates the order.clone() call in post_order_handler by extracting a subset of fields
before consuming the order into add_order.

Opening as draft not confident the current field subset provides sufficient debugging context
on failure. Looking for input before marking ready.

Changes

  • Replace the chained .map(...).inspect_err(...).into_response() flow with an explicit match
  • Extract Copy fields before moving order into add_order:
    from, sell_token, buy_token, kind, sell_amount, buy_amount
  • Log extracted fields on error instead of the full OrderCreation struct
  • Remove the unconditional order.clone()
  • Preserve existing API behavior and response semantics

@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 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant