Skip to content
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

feat: track send errors #227

Merged
merged 4 commits into from
Aug 15, 2023
Merged

feat: track send errors #227

merged 4 commits into from
Aug 15, 2023

Conversation

HashEngineering
Copy link
Collaborator

Issue being fixed or feature implemented

With Core 19, BIP61 was removed. This feature would send messages back to DashJ telling it why a transaction was rejected, for instance. This PR will simulate a BIP61 reject message internally so that DashJ clients can report some of these transaction errors to the users.

A workaround for Dash Core 0.14 was removed that would help us with sending transactions. There was a problem with 0.14 where a DashJ client was being disconnected as soon as it connected. This is a problem for DashJ clients, which may not be connected to the Dash Network at the time of sending a transaction. In such a case, DashJ first makes connections and then would immediately send the TX. However, the Dash Core 0.14 bug would kick DashJ clients off before sending could take place. Our temp fix was to keep sending the TX until there were no disconnect errors (or until 9 attempts to send were made).

This 9 retry is a problem if DashJ is sending an invalid transaction (double spend) because it will keep trying 9 times and then be banned by 9 * 3 or more nodes which can result in sync issues. With the removal of BIP61, we don't know why were are disconnected when sending. Therefore it was decided to remove this 9 retry code.

Lastly, the resend if only sent to one node was removed. Sending twice to the same node is not useful. By default on mainnet and testnet. If Only one node is connected, then DashJ will send the TX and then disconnect from that node and attempt reconnect to determine if the TX was received.

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@HashEngineering HashEngineering self-assigned this Aug 11, 2023
@HashEngineering HashEngineering marked this pull request as ready for review August 15, 2023 12:59
@HashEngineering HashEngineering merged commit e2b483b into master Aug 15, 2023
4 of 7 checks passed
@HashEngineering HashEngineering deleted the feature-track-send-errors branch September 26, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant