-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fast Bridge Canonical Guard #2833
Comments
Implementation Steps for RFQ Guard
References/services/rfq/relayer/service/handlers.go
|
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: