Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD-14 #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

MD-14 #14

wants to merge 3 commits into from

Conversation

0xPrimata
Copy link

@0xPrimata 0xPrimata commented Sep 5, 2024

Summary

MD-14

@0xPrimata 0xPrimata changed the title MD-8 MD-14 Sep 5, 2024
4. Remove dependency of the Bridge Relayer on processing the desired timelock.

### D1: Initiator Contract Timelock is a constant or a modifiable state with a minimum time
**User Journey**: Whenever Timelock is consumed, it is consumed as `timelock * 2`. If a modifiable state, it should be at least 12 hours.
Copy link
Contributor

Choose a reason for hiding this comment

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

So, the idea here is to not relay any timestamp information in, right?

Instead we simply assume the bridge relay has sent the time-lock information over as quickly as it can and use the timestamp from the destination chain when the relay transaction is received.

This removes the trust on any clock in the bridge service, thus making it harder to manipulate.

The tradeoff is perhaps that the attacker can now attack by forcing delays on the bridge. But, these could be easier to detect than lock manipulations.

Copy link
Author

Choose a reason for hiding this comment

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

This is one reason why we need a minimum time bound. Maybe an upper bound might be necessary just so that a user couldn't have funds stuck in the bridge for type(uint).max time

Copy link
Contributor

Choose a reason for hiding this comment

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

As in the difference between the reported timestamp and the timestamp at the time the relay transaction is received?

Copy link
Author

@0xPrimata 0xPrimata Sep 5, 2024

Choose a reason for hiding this comment

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

timelock = 20
initiator receiving a bridge at time 0
counterparty lock is called at 5
initiator completes at 10
counterparty completes at 15

It would be an issue if:
iinitiator receiving a bridge at time 0
counterparty lock is called at 21
counterparty completes at 40
initiator cancels at 41

This is already an issue with the current implementation if the Bridge Relayer fails at some certain levels.

Copy link
Contributor

Choose a reason for hiding this comment

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

minimum time bound

Only makes sense when you have quite short timelocks and the actual act of calling over the network could cause them to expire incorrectly.

MD/md-14/README.md Show resolved Hide resolved
MD/md-14/README.md Show resolved Hide resolved
MD/md-14/README.md Outdated Show resolved Hide resolved
@l-monninger
Copy link
Contributor

@0xPrimata

For D1 and D2, you want to essentially make an assumption about the liveness of the bridge as opposed to the infallibility of the relayed time-lock, right?

@l-monninger
Copy link
Contributor

right now we also have an issue where the timelock on both sides NEED to be different, that was in the original design, to prevent racing conditions. That’s not present in the current implementation.

@0xPrimata this would not be call for an MIP though. This would be an issue with the current implementation as opposed to the proposed design.

@0xPrimata
Copy link
Author

@0xPrimata

For D1 and D2, you want to essentially make an assumption about the liveness of the bridge as opposed to the infallibility of the relayed time-lock, right?

Well, both make an assumption about the liveness of the bridge, I'm just removing the infallibility of the relayed time-lock

@l-monninger
Copy link
Contributor

@0xPrimata

Well, both make an assumption about the liveness of the bridge, I'm just removing the infallibility of the relayed time-lock

Not really. If you make an assumption about the relayed timestamp being trustworthy, then that timestamp will always reflect the correct time from which to offset the lock s.t. will have enough time for the counterparty to claim.

If you don't have that timestamp, you're assuming that the bridge relayed the lock quickly s.t. the counterparty has enough time to claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants