noble-assets / noble-cctp-relayer

Apache License 2.0
15 stars 9 forks source link

redundancy mode should allow for delayed relaying. #67

Closed 2dpetkov closed 6 months ago

2dpetkov commented 8 months ago

Goal

Allow a second CCTP relayer to operate alongside the main one, without them racing for broadcasting all messages (and wasting gas for failed transactions), in order to broadcast delayed messages in the rare cases when the main relayer experiences RPC issues, or any other type of downtime.

Suggested approach

TheCCTP relayer could be made able to withhold broadcasting a message, until a certain configurable interval is reached. In case the configuration contains the new parameter, and upon reaching the timeout for a message, the CCTP relayer should first check if it's already acted on (e.g. by the main relayer).

Context

The dYdX Operations subDAO is exploring the possibility to operate such "redundancy mode" relayer for the needs of dYdX Chain.

joelsmith-2019 commented 7 months ago

I will be implementing a flush only mode for the noble-cctp-relayer. This mode will not have active listening but will occasionally scan a range of blocks for missed transactions. It will run about 3 or 4 hours behind chain height to ensure the primary relayer has time to process it. Please note the primary relayer will handle a transaction immediately for up to 1 hour and then retry it 1-2 hours afterwards.