movementlabsxyz / movement

The Movement Network is a Move-based L2 on Ethereum.
Apache License 2.0
82 stars 66 forks source link

Bridge Refund Policy #804

Open andygolay opened 3 weeks ago

andygolay commented 3 weeks ago

Is your feature request related to a problem? Please describe. Currently there's no clear refund policy for the bridge.

RFC-40 mentions automatically refunding transactions after the time lock expires: https://github.com/movementlabsxyz/rfcs/blob/main/0040-atomic-bridge/rfc-0040-atomic-bridge.md?plain=1#L13

Related, there's an inconsistency where on the ETH side, refundBridgeTransfer is onlyOwner but on the Move side refund_bridge_transfer can be called by anyone.

Describe the solution you'd like

Proposed solution:

  1. Because users must wait until the time lock expires, I propose changing the default counterparty time lock from 24 hours to 12 hours and the default initiator time lock from 48 hours to 24 hours. That way there's only a maximum 24-hour waiting window before a user can refund their own transfer.

  2. Make the bridge relayer automatically refund transactions after the time lock expires.

  3. Allow anyone to refund a bridge transfer when time lock expires, as a fallback in case the bridge fails. This means removing the onlyOwner restriction in the Eth-side refundBridgeTransfer function.