QuarkChain / go-ethereum

Official Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
6 stars 2 forks source link

metahub [master task]: cross-chain message transfer #17

Open ninjaahhh opened 2 years ago

ninjaahhh commented 2 years ago

scoping master task to enable cross-chain message transfer

  1. subscription management
    1. subscription initiation
      1. a system contract providing subscribe API and should emit a special subscribe event
      2. geth should monitor such events and start listening to specific events
      3. (future) because subscribe will cost full node resources, a proper fee mechanism should be designed to avoid spamming
    2. event monitoring
      1. geth should be aware of supported chains and corresponding JSONRPC API, and manage event monitoring accordingly
      2. geth should support "replaying" chain monitoring - in case a node crashes and restarts, it should be able to catch up the previous event subscription
        1. new system design required
    3. event delivery (emitTo)
      1. callback contract template should have a unified interface to receive delivery
      2. monitored events should be submitted to destination chain
        1. (?) exactly-once mechanism design required
          1. subscription termination
      3. system contract should have a terminate function to stop the event monitoring
      4. geth should stop monitoring and close the websocket after the special events
ninjaahhh commented 2 years ago

first smart contract proof-of-concept draft for subscription management can be found in QuarkChain/qkc2#2

ninjaahhh commented 2 years ago

cc @ping-ke @qizhou