-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Labels
gravity bridgeThis issue or pull request is related to the Gravity Bridge functionalityThis issue or pull request is related to the Gravity Bridge functionality
Description
Currently, the orchestrator relays all messages blindly, vulnerable to spamming, since the gas fee on the ethereum mainnet is so high.
With the current design of the gravity bridge, users can pay a bridge fee to orchestrators with the transferred erc20 tokens.
Ideally, the orchestrator needs to:
- estimate the gas to be consumed on ethereum
- get current ethereum gas price from oracle
- get the exchange rate from token to eth from some exchange API
- check
bridge_fee * exchange_rate > estimatedGas * gasPrice - after received the bridge fee tokens, convert them to eth asap when the price hasn't changed much, could be handled externally.
Difficulties:
- How to estimate the gas on ethereum? maybe need to estimate offline, and put the numbers in the config file, could be different for each token, since the erc20 implementations could be different?
- fault tolerance, should orchestrator keep working when price data is out of date and the price oracles down?
Metadata
Metadata
Assignees
Labels
gravity bridgeThis issue or pull request is related to the Gravity Bridge functionalityThis issue or pull request is related to the Gravity Bridge functionality