View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012280 | Taler | exchange | public | 2026-11-21 10:28 | 2026-11-21 22:44 |
| Reporter | bot-oec [agent] | ||||
| Implementer | oec | ||||
| Priority | low | Severity | major | ||
| Status | implementing | ||||
| Target Version | 1.10 | ||||
| Summary | 0012280: Pending close requests do not count towards the target account's `CLOSE` limit | ||||
| Description | A close request to an account other than the origin is a `CLOSE` operation on the target account, and the limit check sums the operations in the rule's timeframe. The close handler (`taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c`) sums the request's balance and the target's executed closings (`iterate_reserve_close_info.c`, table `reserves_close`). Close requests that the closer has not executed yet (`close_requests`, not done) are not counted, so several requests to one account, made before the closer runs, each pass the limit alone, and several reserves are closed to one account beyond the limit together. **Steps to reproduce:** with a rule `CLOSE`, threshold EUR:5, timeframe 1d, measure `verboten`: 1. A single close request for EUR:6.01 to another account: 451 (control). 2. Two reserves of EUR:4.01 each ask to be closed to the same account: the second request gets 200 instead of 451. The test `src/testing/test_exchange_api_close_kyc.c` does this; it fails on master at step 2 (expects 451, gets 200). The test will be on branch `dev/oec/formalization-findings` on git.taler.net; a note here will name the commit. **Proposed fix:** count the pending close requests to the account as well. `close_requests` stores the target only as a payto URI; it needs the normalized payto hash to be matched with the account: a migration adds `h_normalized_payto` (through the `exchange_tables` alter mechanism), `insert_close_request.c` fills it, and `iterate_reserve_close_info.c` adds the requests not yet done. With it the test passes, and the other close tests still pass. **Found by:** the formalization of the Taler protocols; the rule violated is (K2) in `spec/kyc.md`: a close request to another account than the origin is a `CLOSE` operation on the target account, the check sums the operations in the timeframe, and splitting over several operations does not avoid a limit. | ||||
| Tags | No tags attached. | ||||
| Test: branch `dev/oec/formalization-findings` of exchange.git (git.taler.net), commit 1ce504e63786 "testing: pending close requests and the CLOSE limit (0012280)", on master 7b658d8da. test_exchange_api_close_kyc_{cs,rsa}, with a CLOSE rule: two close requests to one account, each within the limit, together above it, the first not yet executed; expected 451 for the second, gets 200. Fails on master at close-request-2. | |
| Proposed fix on branch dev/oec/fix-12280 (exchange, on master ba48fdeac): - f1bd53d68 testing: pending close requests and the CLOSE limit - 94d9ac635 exchange: count pending close requests towards the CLOSE limit Migration exchange-0021 adds close_requests.h_normalized_payto (through the exchange_tables alter mechanism, with an index on the requests not done); insert_close_request fills it, and iterate_reserve_close_info adds the requests to the account that the closer has not executed yet, with the balance at the request. On dev/oec/v47-prep, exchange-0021 is taken; it gets the next number when master is merged in. test_exchange_api_close_kyc_{rsa,cs}, test_kyc_api, test_exchange_api_rsa and the exchangedb suite pass (fresh database). | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-21 10:28 | bot-oec | New Issue | |
| 2026-11-21 10:28 | bot-oec | Implementer | => oec |
| 2026-11-21 10:28 | bot-oec | Reviewer | => Christian Grothoff |
| 2026-11-21 10:28 | bot-oec | Release signed by | => Christian Grothoff |
| 2026-11-21 10:28 | bot-oec | Deployed by | => Florian Dold |
| 2026-11-21 10:28 | bot-oec | Verifier | => oec |
| 2026-11-21 10:28 | bot-oec | Communicator | => CM_7 |
| 2026-11-21 10:47 | bot-oec | Note Added: 0030680 | |
| 2026-11-21 16:16 | oec | Implementer | oec => |
| 2026-11-21 22:20 | Christian Grothoff | Implementer | => oec |
| 2026-11-21 22:20 | Christian Grothoff | Priority | normal => low |
| 2026-11-21 22:20 | Christian Grothoff | Status | new => planning |
| 2026-11-21 22:20 | Christian Grothoff | Target Version | => 1.10 |
| 2026-11-21 22:21 | Christian Grothoff | Status | planning => implementing |
| 2026-11-21 22:42 | Christian Grothoff | View Status | private => public |
| 2026-11-21 22:44 | bot-oec | Note Added: 0030711 |