-
Notifications
You must be signed in to change notification settings - Fork 7
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
get_list_of_payments() does not search through the right range of blocks #960
Comments
@PaweuB I know - just do it |
Based on #996 blueprint I think this needs to work differently for regular payments (batch transfers) and for settlement payments. When you are looking for regular payments you want:
For forced subtask payments you want start block to be the above minus some safety margin (let's say 10 blocks). Then you go through those extra 10 blocks and see if there are any extra forced subtask payments matching any of the subtask ID submitted by the provider. You take those but ignore all those with IDs that do not match (this is specified #1005 so you should really wait for that one before fixing this). The safety margin ensures that if the forced subtask payments happens to match a subtask with |
I have updated the description with stuff from my comment above. I've also added the information that this function does not really need to return forced subtask payments. Below the old description in case someone is confused by the comments here:
|
@cameel, how does this relate to current implementation of # Concent gets list of forced payments from payment API where T0 <= payment_ts + PAYMENT_DUE_TIME.
list_of_forced_payments = service.get_list_of_payments( # pylint: disable=no-value-for-parameter
requestor_eth_address=requestor_ethereum_address,
provider_eth_address=provider_ethereum_address,
payment_ts=oldest_payments_ts,
transaction_type=TransactionType.FORCE,
) ? In other words - we don't need it anymore? Or shall it be created differently? |
|
quite frankly, it should be:
EDIT:
then what? raise exception? |
No, it should be Block timestamp is not the time when block was published. It's usually close to the time of the publication of the previous block. But it can be inaccurate or even manipulated by the miner so we don't want to assume this. We really only care about I know the relations between all those timestamps are confusing and I spent a lot of effort first trying to understand it myself and then to explain it in blueprint #996. Please read the section titled "Blockchain and the timeline", and especially "Accuracy of block timestamps". There are even several examples after that which show timestamps on the blockchain in addition to timestamps in messages. I hope I explained it well but If anything is still unclear, please ask.
That's a good point. Then we probably need a new helper. I'm just telling you what the current spec requires. If it's not possible to implement then we may need to discuss ways to deal with it with Golem team.
No. the list is empty. No transactions qualify to be included in the results. Simply, if there are less than 6 blocks, then every block is considered unconfirmed and there are no transactions. This is just a very unlikely corner case. I specified it only because |
EDIT: Description rewritten by @cameel
Currently
get_list_of_payments()
does not use the correct range of block when searching for payments.The range of blocks should be as follows:
payment_ts
. Then filter out payments for whichclosure_time
<payment_ts
.SCIImplementation.REQUIRED_CONFS
SCIImplementation.REQUIRED_CONFS
block overall, then no block qualifypayment_ts
. How much exactly is "a few" should be determined by a constant. 10 should be enough in nearly all situations.SCIImplementation.REQUIRED_CONFS
Actually, after recent talks with Łukasz on Rocket, turns out that 2. is not necessary at all. We'll never need to search for forced subtask payments or additional verification payments and we need to revert #982. The rules are given just in case it's needed after all but we should really just to remove support for searching for forced subtask payments.
The text was updated successfully, but these errors were encountered: