movementlabsxyz / movement

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

Bridge: Update relayer utils crate + state logic #891

Closed musitdev closed 1 day ago

musitdev commented 1 day ago

Summary

First PR for the new Bridge protocol transition. Remove the old type and define a new one. Update relayer logic with new protocol. It's WIP. The PR breaks the bridge code.

Changelog

Update the utils crate for the new bridge protocol: Remove all preimage, hashlock, and timelock struct. Cut the BridgeContract trait into 2 traits: BridgeClientContract and BridgeRelayerContract to reflect the 2 roles between USer and Relayer. Update the state and transition WIP Update relayer logic in service. I remove some module and crate like indexeddb and chain to help to build. They will be added little by little with the refactoring.

Testing

Outstanding issues

By merging this PR it will break all the relayer code.

musitdev commented 1 day ago

If we want to work in // on the code we need to merge fast even if it doesn't compile. The other way is I do everything then we merge.

0xmovses commented 1 day ago

Let's comment out the code that doesn't compile then, that will be useful to see at a glance also.

musitdev commented 1 day ago

If we do that we're going to comment a lot of code and in the end, it will be difficult to go back. If we let the compiler show us where there are issues it's easier to update instead of un commenting code to see if it builds. I think it's the role of the feature branch to not build at the beginning.

0xmovses commented 1 day ago

Alright, so is this now ready to go into feature branch? I checked the code looks fine.