Comments (4)
I like the idea about doing one transfer, then estimating the amount of time until the next expected change and repeat.
This will work fine for multi-hour transaction, and for fast transactions.
For transactions that depends on the event relayer finalizing them, we can do the same, since relayer is running in a loop, and it should be picking new tx as they appear. However it is possible for several reasons that relayer fails. To avoid oversaturating our endpoints we can exponentially increase the time we wait between calls up to a reasonable, but large amount. Start with 1 second and increase up to 10 minutes?
from rainbow-bridge-client.
I'm also towards 1.b solution! I know that the amount is crazy as I was able to reach those limits quite easily in Alchemy, for example, during some hard testing of the bridge.
I also like the idea that @mfornet mentioned, this is a quite popular solution to reduce the number of redundant calls. I.e. we estimate that TX will take up to 10 minutes to complete, then we multiply that time by some factor (e.g. 1.5 * 10 minutes = 15 minutes) and during this time we expect to have the constant time of checking, e.g. 30 seconds. When this time ends up but the TX is not yet finalized, we increase the interval twice. And then this interval increases up to some limit, e.g. 10 minutes.
from rainbow-bridge-client.
Currently during checkSync
(called every 5 secs) of Ethereum -> Aurora transfers, findEthProof
is called to check whether a transfer was finalized by the event relayer. So a proof is built every 5 secs and building a proof requires querying all the transaction receipts in a block individually:
This would explain the excess number of eth_getTransactionReceipt queries observed on infura.
For example if the event relayer is delayed by 1 hour, with 150 tx in the deposit block, that's 150 * 12 * 60 = 108k eth_getTransactionReceipt calls for checking a single user's transfer during 1 hour while the growth plan of infura is 5M calls per day for all users.
from rainbow-bridge-client.
This is less of an issue on bridgetonear.org because checkSync
will stop running if the event relayer didn't finalize within 10 blocks and fallback to the user's NEAR wallet to finalize the transfer. But on aurora.dev checkSync
will loop forever until the transfer is finalized by the event relayer.
from rainbow-bridge-client.
Related Issues (16)
- feat: multiple network/bridge support ? HOT 2
- Get the info from relayers on the NEAR->Ethereum syncing
- Proof calculation is not consistent against different browsers & wallets, which leads to failing `deposit` transactions HOT 4
- Add codeowner HOT 1
- Use latest height from NearOnEthClient to submit the unlock transaction HOT 1
- Rare bug with transfer initialization from NEAR. HOT 2
- View function to check used proofs in ethereum without changing contract HOT 7
- Used proofs in workflows (Ethereum -> NEAR) / (Ethereum -> Aurora) HOT 3
- Update near-api-js when https://github.com/near/near-api-js/pull/620 is released HOT 3
- Create function to update metadata in FT contracts HOT 3
- getBalance is not a generic ERC20 metadata
- Standardize connector APIs. HOT 5
- Remove `sourceTokenName` and `destinationTokenName`.
- Increase gas attached to `deploy_bridge_token` HOT 2
- BorshError: Expected buffer length 20 isn't within bounds: recipient HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rainbow-bridge-client.