ProgramCrafter / ecvrf-coordinator-contract

Coordinator contract (randomness bridge) for TON ECVRF
6 stars 1 forks source link

Bag with counting pending requests #2

Open LuriDDD opened 2 months ago

LuriDDD commented 2 months ago

When a user who is already subscribed sends additional requests for messages, the current logic results in duplicated counts in the overall message counter (unfulfilled_requests).

Steps to Reproduce:

  1. A user subscribes for the first time and their messages are correctly added to unfulfilled_requests.
  2. The same user sends another request for additional messages.
  3. The logic incorrectly adds the already counted messages to unfulfilled_requests again, causing duplication.

Current Behavior:

You can verify this by calling the get methods (get_unfulfilled return 3 while get_subscribers - 0) on your contract https://tonviewer.com/EQCwaEBhdPAl8Lj5ctJjB_6dZv2qOoeuIrjVPgDFvVTvDRL-

Cosmodude commented 2 months ago

How did it happen that get_unfulfilled= 3 and get_subscribers = 0?

Was it sth like 3 initial requests and 3 duplicate requests were added? So only the initial ones were fulfilled?

LuriDDD commented 2 months ago

First I sent a transaction for 4 requests, then another one for 1 request, but by this time the oracle had completed 1 request, so only 3 were duplicated