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

Completed too large transaction not being rejected but re-tried all the time #6108

Closed
hansieodendaal opened this issue Jan 30, 2024 · 1 comment
Assignees

Comments

@hansieodendaal
Copy link
Contributor

hansieodendaal commented Jan 30, 2024

  • Wallets should not be able to negotiate and finalize transactions that will be rejected when broadcast due to size
  • In the event that the above happens, those transactions should be rejected with reason, feedback to the user
┌Transaction Details────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│TxID:                   415804858639007959                                                                                         │
│Source Address:         🍞🍎🎂🌹🐺🎬🌻📈🎼🍰🚁🏆🐽🐭🐉👖💕🌠🐮🐴🌷💦🎹🏠🎣🐷🍪💺📣🎣🍗🐊🐑                                         │
│Destination address:    🍁👕🛁💄🚨🌴🎪🍀🏦😹🏦🌍💭🐜🎭🚧🎲🐴🔬🎸🚽🐚📈🍬🐉🐷🐭🔦👟💌👗🌽🎺                                         │
│Direction:              Outbound                                                                                                   │
│Amount:                 10.000000 T                                                                                                │
│Fee:                    65932 µT (weight: 65932g, #inputs: 8226, #outputs: 2)                                                      │
│Status:                 Completed                                                                                                  │
│Message:                                                                                                                           │
│Mined At (Local):                                                                                                                  │
│Imported At (Local):    2024-01-30 07:27:01                                                                                        │
│Excess:                 c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800                                           │
│Confirmations:          N/A                                                                                                        │
│Mined Height:           N/A                                                                                                        │
│Maturity:               N/A                                                                                                        │

Broadcast protocol - submit

2024-01-30 07:27:03.094744900 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:27:03.197487500 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:30:03.755733300 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:33:04.339905700 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:36:04.890536900 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:39:05.443215000 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:42:06.006999000 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:45:06.574369900 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:48:07.187957400 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:51:07.739875200 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:54:08.317652000 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node
2024-01-30 07:57:08.928839000 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submitting Transaction (TxId: 415804858639007959) with signature 'c55924af988864e6e961f6e4c3324b2a359260c1b6a919dc76d753aad565c800' to Base Node

Broadcast protocol - request failed

2024-01-30 07:27:03.268101100 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:30:03.816433100 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:33:04.401773200 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:36:04.945696100 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:39:05.506331000 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:42:06.066411400 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:45:06.630080900 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:48:07.250018700 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:51:07.798234100 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:54:08.383611900 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:57:09.002633500 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 08:00:09.620892600 [wallet::transaction_service::protocols::broadcast_protocol] INFO  Submit Transaction RPC Call to Base Node failed: Request failed: General: Request body was too large. Expected <= 3145728 but got 4732053

Comms

2024-01-30 07:27:03.257033100 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:30:03.806074400 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:33:04.390569400 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:36:04.933833600 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:39:05.496289000 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:42:06.054128900 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:45:06.619621800 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:48:07.239250000 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:51:07.786760800 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:54:08.372530700 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 07:57:08.985709600 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 08:00:09.608816300 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
2024-01-30 08:03:10.214940700 [comms::rpc::status] ERROR Internal error: Request body was too large. Expected <= 3145728 but got 4732053
@hansieodendaal hansieodendaal changed the title Wallets can negotiate large transaction but rejected by comms Completed large transaction rejected by comms without feedback to the wallet Jan 30, 2024
@hansieodendaal hansieodendaal changed the title Completed large transaction rejected by comms without feedback to the wallet Completed too large transaction not being rejected but re-tried all the time Jan 30, 2024
@hansieodendaal
Copy link
Contributor Author

See #6154

SWvheerden pushed a commit that referenced this issue Mar 1, 2024
Description
---
Added checks to ensure that transactions negotiated between parties,
transactions to self and imported transactions do not exceed the RPC
frame size limit when the transaction is broadcast to the base node.
This can easily happen when lots of dust inputs are collected to be
spent. If a too-large transaction is detected in any of the transaction
service protocols it will be cancelled so that the user can try to
create a new transaction with different parameters, for example, to
reduce the recipient amount.

**Edit:**
- Added a wallet sqlite memory type connection to speed up tests with
large amounts of db activity
- Used fake outputs without valid bulletproof range proofs in the
`spend_dust` tests to speed it up even more as suggested by @SWvheerden

Motivation and Context
---
See #6108

How Has This Been Tested?
---
Added unit tests:
- `test_spend_dust_to_self_in_oversized_transaction`
- `test_spend_dust_to_other_in_oversized_transaction`
- `test_spend_dust_happy_path`

What process can a PR reviewer use to test or verify this change?
---
Code walk-through
Review unit tests

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
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

No branches or pull requests

2 participants