omnilaboratory / obd

OmniBOLT daemon, a golang implementation of OmniBOLT spec, the smart assets lightning network.
MIT License
213 stars 21 forks source link

The data sync mechanism between obd and tracker need update. #58

Open neocarmack opened 2 years ago

neocarmack commented 2 years ago

This issue is the bug 12 and 13 in issue 53

  1. (fixed) obd/service/user.go line 60 calls noticeTrackerUserLogin().sendMsgToTracker() . https://github.com/omnilaboratory/obd/blob/58293151d0122daf331a518cea5105bd2e619374/service/user.go#L20-L76

    • issue 1: if some err occurs ,we MUST not invoke it (L60). If it noticeTrackerUserLogin just record a audit-log, we can ignore the err and invoke it.
    • issue 2: obd/service is just a database/data operation module, it MUST not call sendMsgToTracker to send async message; obd/lightclient module is async message center, now 95% async messages are recieved and sent here, all the client-websocket-conn p2p-conn are initialized here; obd/service/htlc_tx_forward.go PayerRequestFindPath invoke "sendMsgToTracker(enum.MsgType_Tracker_GetHtlcPath_351, pathRequest)" have the same probolem.
    • now i have fixed the two issue, and obd/service.sendMsgToTracker have disbled, and below messages submit by grpc-conn now,no need to sync userInfo/channelInfo/htlcInfo to tracker with complex async message Goroutines. the old msgList:
    • MsgType_Tracker_UpdateChannelInfo_350
    • MsgType_Tracker_UserLogin_304
    • MsgType_Tracker_UserLogout_305
    • MsgType_Tracker_UpdateHtlcTxState_352
  2. (to to) may be we should design the obd-tracker info sync-mode and security first. Maybe new mechanism won't need the above work.