Giter VIP home page Giter VIP logo

Comments (4)

mfornet avatar mfornet commented on August 16, 2024 1

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.

sept-en avatar sept-en commented on August 16, 2024 1

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.

paouvrard avatar paouvrard commented on August 16, 2024

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:

block.transactions.map(async (t) => await provider.getTransactionReceipt(t.hash))

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.

paouvrard avatar paouvrard commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.