-
Notifications
You must be signed in to change notification settings - Fork 87
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
Eliminate online gas estimation from send and invite flows #117
Conversation
…r/hackathon/offline-transactions
…celo-monorepo into hackathon/offline-transactions
…celo-monorepo into hackathon/offline-transactions
…thon/offline-transactions
…r/hackathon_wrapup
…r/hackathon_wrapup
…r/eliminate-double-estimation
…r/eliminate-double-estimation
…r/eliminate-double-estimation
…tion' into victor/eliminate-double-estimation
…te-double-estimation
Just noticed in the logs the following message.
I have a feeling it's related to this line below, but I'm not exactly sure what to do differently. Maybe a helpful reviewer could suggest a fix! |
Sounds like this: https://reactjs.org/blog/2020/02/26/react-v16.13.0.html#warnings-for-some-updates-during-render Maybe we can fix these in a different PR though unless it's easy to make the change. It's not a huge problem for now, but we should fix these warnings at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked over the changes but for me at this point this is mostly a learning exercise. Would be good to get Jean's eyes over this as well for sure.
Hi @nategraf I have verified this issue using Android Internal Build V1.12.0(1004294340) & observed following:
Let me know if anything else need to test. |
Description
As described in celo-org/celo-monorepo#5432, gas estimation is a costly
operation for the mobile client. The most promising short-term solution is to simply hard-code the
gas value to be used in for simple transactions along common code paths. The most common transaction
sent by a typical user is to send cUSD, either by a direct transfer or an invite.
This PR adds the required plumbing to use a single gas value, price and currency throughout the send
and invite flows. As a result, a single constant gas value can be used from start to finish. The
major result of this is that instead of estimating gas online twice, as the app currently does, the
static value is used and online gas estimation is never used.
This represents a large improvement to the experienced transaction speed, especially in less than
ideal network conditions. Additional effects of this are that errors caused by gas estimation should
be reduced, it's possible to give a fee estimate while offline, and the fee estimate shown the user
will be respected as a maximum fee value.
Other changes
EstimateFee.tsx
sendTransaction
sendTransaction
networkConnectedSelector
to access the network connectivity state reported by the device.Tested
Related issues
Backwards compatibility
No backwards compatibility concerns.