darwinia-network / bridger

Relayer client implementation for Darwinia LCMP protocols.
https://rust-docs.darwinia.network/bridger
GNU General Public License v3.0
12 stars 10 forks source link

A less cost header relay strategy: #488

Closed hackfisher closed 2 years ago

hackfisher commented 2 years ago

This strategy is good for test only. A less cost header relay strategy:

  1. If now_period == old_period. Bridger could relay best finalized block's sync_aggregate_header in now_period directly. https://github.com/darwinia-network/darwinia-messages-sol/blob/4a170944b844567a6cc897b264c0ade5084a3388/contracts/bridge/e2e/helper/bridge.js#L154
  2. If now_period == old_period + 1.
    • If next_sync_committee is relayed, Bridger could relay best finalized block in now_period.
    • If next_sync_committee have not been relayes. Bridger could relay next_sync_committee first, and then relay best finalized block in now_period.
  3. If now_period > old_period + 1. Bridger should relay old_period/old_period + 1 first, and then check 1,2,3

_Originally posted by @hujw77 in https://github.com/darwinia-network/bridger/pull/480#discussion_r919624181_