darwinia-network / darwinia-common

Darwinia Runtime Pallet Library and Pangolin/Pangoro Testnet
https://rust-docs.darwinia.network/darwinia-common
GNU General Public License v3.0
30 stars 9 forks source link

Darwinia balance precise migration checklist(In case we will do it) #1055

Closed hackfisher closed 2 years ago

hackfisher commented 2 years ago

I would suggest modify the event in substrate side to avoid fork of smart contract in Ethereum side. (Anyway it will be deprecated soon, and could be batch processed in one time)

https://github.com/darwinia-network/darwinia-common/blob/ca11138c82c9bf9c12832fe3cc3ed8ae99b85bbf/frame/wormhole/backing/ethereum/src/lib.rs?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L361

https://github.com/darwinia-network/darwinia-bridge-sol/blob/b2f8940fbb1caba6ce9b38fa90d8083dfc05b060/contracts/deprecated/issuing-backing/contracts/ethereum/TokenIssuing.sol#L115

hackfisher commented 2 years ago
hackfisher commented 2 years ago
                                        ┌────────────────────────┐
                                        │                        │
          ┌─────────────────────────────┤   CEX                  │
          │                             │                        │
          │                             │                        │
          │                             └────────────────────────┘
┌─────────▼──────────┐
│                    │
│Darwinia Precision  │
│                    │
│ 9 -> 18            │
└──────────▲─────────┘                  ┌─────────────────────────┐           ┌───────────────────────┐
           │                            │                         │           │                       │
           │                            │ Darwinia Support        │           │  BSC Message Pallet   │
           └────────────────────────────┤                         ◄───────────┤                       │
                                        │     DVM                 │           │      & Wormhole       │
                                        └─────────────────────────┘           └───────────────────────┘

I'm not convinced before we finally test the solution in Pangoro, but if we want it, we should give it a try, the order and priority should before DVM, and maybe after the Balance pallet replacement. darwinia-network/darwinia-2.0#8

hackfisher commented 2 years ago

https://docs.binance.org/smart-chain/developer/cross-chain-transfer.html

Like BC and BSC also have different precisions, this is also acceptable.

hackfisher commented 2 years ago

After considering the complexity and scope of engineering and infrastructure integration, and the engineering arrangement of tasks with higher priories, from a pragmatic point of view, I decide not to make the change finally.

The concept elaboration borrow from BC and BSC is enough for education and docs. Only Dispatch precompile which is calling from Darwinia Smart Chain to native chain(Darwinia Chain) requires attention of precision conversion.

And changing only Darwinia will cause different practice between Crab and Darwinia, which is not good for Crab in this part as canary role.