You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RFQ Guard is a mechanism designed to ensure the integrity of the prove() function call on the FastBridge contract. It will monitor the prove() calls made by relayers on the origin chain and verify that the corresponding event occurred on the destination chain. If a relayer attempts to call prove() for an event that did not happen on the destination chain, the guard will call the dispute() function on the FastBridge contract to dispute the proof.
Components
Guard Command: A separate command that can be run independently to monitor and validate prove() calls.
Optional Guard Functionality: RFQ relayers can optionally enable the guard functionality so they too can act as guards.
Both of these commands should (optionally) check if the relayer has guard role at boot time.
Detailed Specification
Guard Command
Name: rfq-guard
Functionality:
Monitor prove() calls on the origin chain.
Verify the existence of the corresponding event on the origin chain.
Call dispute() on the FastBridge contract if the event does not exist on the origin chain.
Optional Guard Functionality for RFQ Relayers
Configuration:
A configuration option in the relayer's settings to enable or disable the guard functionality.
Integration:
When enabled, the relayer will run the a guard at the same time as it relays.
Workflow
Initialization:
The rfq-guard command is initialized with the necessary parameters.
The guard starts monitoring prove() calls on the origin chain.
Monitoring:
The guard listens for prove() events emitted by the FastBridge contract on the origin chain.
For each prove() event, the guard extracts the transaction details.
Verification:
The guard verifies the existence of the corresponding event on the destination chain.
This involves querying the destination chain for the event using the transaction details.
Dispute:
If the event does not exist on the destination chain, the guard calls the dispute() function on the FastBridge contract.
The dispute() function is called with the transactionId of the invalid prove() call.
Other Notes
Some of these are your design decisions, but how I'd do it
Since the guard is it's own module, it should use its own database. Unlike the current relayer, this can basically consist of a pending_proven table with txidtxhashstatus
ProveCalled - a relayer has called Prove() on on a contract we are monitoring
Validated - getBridgeTransaction() is called on the destination chain. If the request was relayed we get this status
DisputePending - getBridgeTransaction() is called on the destination chain and the tx doesn't actually exist. At this point we've submitted dispute() but it has not been confirmed on chain yet
Disputeddispute has been confirmed on chain
I'd pursue the same event structure we currently have now w/ listener & db sourcing.
Other things to do:
Add a guard page to docs/bridge/rfq
update relayer page w/ a guard section (which is optional) & a lnik to guard page
Add metrics:
txes by status (I'd honestly recommend making this generic to any table w/ a status column and a dbcommon.Enum as status, than periodically trigger it into an observable.
add tracing: wherever you think appropriate
The text was updated successfully, but these errors were encountered:
Specification for RFQ Guard
Overview
The RFQ Guard is a mechanism designed to ensure the integrity of the
prove()
function call on theFastBridge
contract. It will monitor theprove()
calls made by relayers on the origin chain and verify that the corresponding event occurred on the destination chain. If a relayer attempts to callprove()
for an event that did not happen on the destination chain, the guard will call thedispute()
function on theFastBridge
contract to dispute the proof.Components
prove()
calls.Both of these commands should (optionally) check if the relayer has guard role at boot time.
Detailed Specification
Guard Command
rfq-guard
prove()
calls on the origin chain.dispute()
on theFastBridge
contract if the event does not exist on the origin chain.Optional Guard Functionality for RFQ Relayers
Workflow
Initialization:
rfq-guard
command is initialized with the necessary parameters.prove()
calls on the origin chain.Monitoring:
prove()
events emitted by theFastBridge
contract on the origin chain.prove()
event, the guard extracts the transaction details.Verification:
Dispute:
dispute()
function on theFastBridge
contract.dispute()
function is called with thetransactionId
of the invalidprove()
call.Other Notes
Some of these are your design decisions, but how I'd do it
Since the guard is it's own module, it should use its own database. Unlike the current relayer, this can basically consist of a
pending_proven
table withtxid
txhash
status
status
is adbcommon.Enum
of:ProveCalled
- a relayer has calledProve()
on on a contract we are monitoringValidated
-getBridgeTransaction()
is called on the destination chain. If the request was relayed we get this statusDisputePending
-getBridgeTransaction()
is called on the destination chain and the tx doesn't actually exist. At this point we've submitted dispute() but it has not been confirmed on chain yetDisputed
dispute
has been confirmed on chainI'd pursue the same event structure we currently have now w/ listener & db sourcing.
Other things to do:
docs/bridge/rfq
status
column and adbcommon.Enum
as status, than periodically trigger it into an observable.The text was updated successfully, but these errors were encountered: