No funded issue found.
Check out the Issue Explorer
Be the OSS Funding you wish to see in the world.
Looking to fund some work? You can submit a new Funded Issue here .
Time left
Opened
Issue Type
Workers Auto Approve
Project Type
Time Commitment
Experience Level
Permissions
Accepted
Reserved For
[feature] Resend txn & Handle dropped txns
digixglobal
Ruby, Shell, HTML
# Feature
## *What* is the feature?
This feature is covered by two scenarios.
#### Scenario 1 (Handling Dropped Txns)
Whenever a signed transaction is sent to the Ethereum blockchain, it is stored in the "Mempool" before getting mined in a future block. There is a limit to the size of the Mempool. In instances where the blockchain is overloaded with a large number of transactions, the Mempool eventually becomes full. This causes some pending transactions to be dropped from the Mempool.
When a transaction is dropped from the Mempool, the user needs to resend the transaction (preferably with a higher gas price). We have faced these scenarios a few times in the last couple of months. Users who are under the assumption that their transaction will be mined after the network settles down, are later surprised to note that their transaction actually cannot be found in the pending transactions as well (because it got dropped out of the Mempool).
#### Scenario 2 (Re-sending txns with higher gas price)
The second scenario also occurs when the blockchain network is congested. In this scenario, a user who sent a transaction with a gas price of say, 5 gwei, would have to wait for long time before their transaction is mined (if the average gas price during that time is say, 20 gwei). In such cases, some users may prefer and afford re-sending the same transaction with a higher gas price of say, 30 gwei, to force their transaction through.
In order to resend a transaction with updated gas price, this new transaction must have the same nonce as the older one. By modifying just the `gas price` of the transaction object, the new transaction can be signed again and sent to the Ethereum node. Both those transactions would now have the same nonce, but the latest one with a higher gas price. Whenever one of them is mined, the other is automatically dropped.
## *How* can it be done?
#### Solution
The solution to both problems is to save the transaction so that it can be resent or reused later.
- When the user signs a transaction, the UI must send the signed and raw transaction to be monitored via `watchTransaction`
- When the user resends a transaction, the UI must send the transaction and send the signed and raw transaction again to update the previous transaction via `resendTransaction`
- Also the same nonce must be reused for resending the transaction
- The user is shown the same "Sign Txn" modal to update the gas price, and re-sign the txn before it can be sent again
- A 5 minute cron job will check all watched transaction. For each watched transaction, check the status of the transaction by querying the Ethereum Blockchain:
- If the transaction cannot be fetched, it is considered dropped
- If the transaction is mined in a past block, delete all transactions with the same `group_id` to unwatch them
- If all of the transactions of a group is dropped, resend only the latest raw signed transaction and delete the other transactions in the group.
#### Schema
In `dao-server`, create `watching_transactions` table consisting of the following:
* `id` - Primary key for recording transactions. Prefer UUID over auto-generated integer.
* `user_id`- Id of the user who signed the transaction
* `group_id` - Id of the original transaction to group resent transactions. If this is the original transaction, this is just `id`. If this refers to a resent transaction, this refers to that transaction's `id`.
* `transaction_object` - `JSON.stringify`-ied transaction object. This stores the transaction parameters to be reused when it needs to be resent with higher gas. Consult https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendtransaction
* `signed_transaction` - Signed transaction object in HEX format. https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendrawtransaction
* `created_at` and `updated_at` - Default timestamp
* `txhash` - Field to index or search a transaction
#### GraphQL
Types:
* `WatchedTransaction`
* `id` (ID) - UUID of the watched transaction
* `user`(User) - Signer of the transaction
* `transactionObject` (String) - The JSONified transaction data object
Mutations:
* `watchTransaction`
Given a transaction, save it to the database to be resent.
* Input
* `txhash` (String) - The hash of a transaction that is referred by the UI
* `transactionObject` (String) - The JSONified transaction data object Resend txn & Handle dropped txns bounty
#70 opened on Aug 1 by roynalnaruto
5
[feature] Email Notifications on Comments bounty
#69 opened on Jul 30 by roynalnaruto
6
ProTip! no:milestone will show everything without a milestone.
© 2019 GitHub, Inc.
Terms
Privacy
Security
Status
Help
Contact GitHub
Pricing
API
Training
Blog
About
* `signedTransaction` (String) - Signed transaction in HEX format
* Output
* `watchedTransaction` (WatchedTransaction) - Newly created transaction
* `resendTransaction`
Given an old transaction, resend it with new parameters or gas prices.
- The nonce must be the same as the previous
- The new transaction should have the same group id as the one being referred or resent.
* Input
* `id` (ID) - ID of the transaction to be resent
* `transactionObject` (String) - The JSONified transaction data object
* `signedTransaction` (String) - Signed transaction in HEX format
* Output
*`watchedTransaction` (WatchedTransaction) - Newly resent transaction
Query:
* `watchedTransaction`
Given a transaction txhash, find the last watched transaction in the group with that txhash .
* Input
* `txhash` (ID) - Txhash of the watched transaction
* Output
* `watchedTransaction` (WatchedTransaction) - Found transaction
## Other Comments
The scenario #2 has front-end integration as well. The github issue for that is [here](https://github.com/DigixGlobal/governance-ui-components/issues/366).
Setup your profile
Tell us a little about you:
Skills
No results found for [[search]] .
Type to search skills..
Bio Required
[[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Next
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Back
Next
Save
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email:
Email
Back
Save