DigixGlobal / dao-server

RoR server for managing user accounts and Dao Forum content
Other
4 stars 6 forks source link

[feature] Resend txn & Handle dropped txns #70

Open roynalnaruto opened 5 years ago

roynalnaruto commented 5 years ago

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.

Schema

In dao-server, create watching_transactions table consisting of the following:

GraphQL

Types:

Mutations:

Query:

Other Comments

The scenario #2 has front-end integration as well. The github issue for that is here.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 1.017 ETH (199.93 USD @ $196.59/ETH) attached to it.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 267 years, 2 months from now. Please review their action plans below:

1) bshevchenko has been approved to start work.

Will do in a most accurate way :)

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 5 years ago

@bshevchenko Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

bshevchenko commented 5 years ago

@gitcoinbot yeap

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 1.017 ETH (180.69 USD @ $177.67/ETH) has been submitted by:

  1. @bshevchenko

@tymat please take a look at the submitted work:


gitcoinbot commented 5 years ago

⚡️ A tip worth 1.01700 ETH (182.63 USD @ $179.58/ETH) has been granted to @bshevchenko for this issue from @tymat. ⚡️

Nice work @bshevchenko! To redeem your tip, login to Gitcoin at https://gitcoin.co/explorer and select 'Claim Tip' from dropdown menu in the top right, or check your email for a link to the tip redemption page.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 1.017 ETH (183.94 USD @ $180.87/ETH) attached to this issue has been approved & issued to @bshevchenko.

Additional Tips for this Bounty: