Open rwrzesien opened 6 years ago
1) Step 2C
Any of the items from list of overdue acceptances matches condition current_time > payment_ts + -
PAYMENT_DUE_TIME
+PAYMENT_GRACE_PERIOD
.
It's supposed to be `payment_ts +` or `payment_ts -`?
BTW, you're missing the backticks on a lot of variable names and they kinda get lost among the text.
2) Step 2C
Any of the items from list of overdue acceptances matches condition current_time > payment_ts + -
PAYMENT_DUE_TIME
+PAYMENT_GRACE_PERIOD
.
Shouldn't it be the opposite? When this condition is satisfied, the payment **is** beyond payment time so it should not fall into this case according to the title.
3) Step 2C and step 2D seem the same to me. 2C says "not beyond payment time" which means the same thing as "not overdue" in 2D.
4) Step 2D
- V <= 0.
- All of the items from list of overdue acceptances matches condition current_time < payment_ts +
PAYMENT_DUE_TIME
+PAYMENT_GRACE_PERIOD
.
I think it should be either one or the other. The way you wrote it it looks like both need to be satisfied at the same time.
5) Step 2B. Same here. It should be one or the other.
6) Step 2E
All of the items from list of overdue acceptances matches condition current_time < payment_ts +
PAYMENT_DUE_TIME
+PAYMENT_GRACE_PERIOD
I think it should be the opposite. Your condition currently says that no payment is overdue.
7) Step 1
> - At least one obligation from requestor to provider defined in SubtaskResultAccepted is overdue.
> - Requestor committed a batch payment but the payment is incomplete thus provider has unsatisfied payment obligation.
`ForcePayment` message should be processed even if these conditions are not satisfied. The second step take care of it.
8) Step 2E
The message is returned in the HTTP response to the same request that has submitted ForcePayment.
There are two messages. Which one is returned in the HTTP response to the same request?
9) There is no case that says what happens if the requestor does not have enough deposit to pay for his computations. There's 2A but it only mentions communication fees. Communication fee is the small payment that the client must pay before Concent will even respond. It's not the same as payment for computation.
@cameel
Ad 1). Updated (but off course some backticks might be still missing, if I find any I will update).
Ad 2). Right, it should be opposite, I was probably thinking how to write a correct path, forgetting that I am describing negative scenario first.
Ad 3) I have updated 2D description.
Ad 4) I used to write one after another, which means that each next step has satisfied condition from previous one. This way somebody looking on step X doesn't need to check conditions from previous ones. But if my explanation is not convincing I will change, please let me know.
Ad 5) Same here.
Ad 6) Correct.
Ad 7) Right, I was trying to show it from client point of view, why he is starting communication, but it should no matter to Concent.
Ad 8) Updated.
Ad 9) There is If there is less then V on requestor's deposit, Concent transfers as much as possible.
Removed 2A and updated conditions.
Settings
New settings:
PAYMENT_DUE_TIME
PAYMENT_GRACE_PERIOD
For the purpose of the examples below let's assume the following setting values:
FORCE_ACCEPTANCE_TIME
= 4 hoursSUBTASK_VERIFICATION_TIME
= 4 hoursCONCENT_MESSAGING_TIME
= 1 hourPAYMENT_DUE_TIME
= 12 hoursPAYMENT_GRACE_PERIOD
= 0,5 hourStep 1: Provider forces getting payment via Concent.
Provider sends
ForcePayment
to Concent.Request example
Endpoint:
POST http://concent.golem.network/send/
Request headers:
Content-Type
application/octet-stream
Concent-Client-Public-Key
cHJvdmlkZXIgcHVibGljIGtleSAxMjM0NTY=
Request body:
ForcePayment
:Response example
See various cases in step 2.
Step 2A: Concent rejects provider's request immediately if all passed
SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are not signed by the same requestor or not related to the same Ethereum account.Provider receives
ServiceRefused
from Concent.Conditions:
SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are signed by the same requestor.SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are related to the same Ethereum account.The message is returned in the HTTP response to the same request that has submitted
ForcePayment
.Request example
See step 1.
Response example
Status code:
200 OK
Response headers:
Content-Type
application/octet-stream
Response body:
ServiceRefused
:Step 2B: Concent rejects provider's request immediately if any passed SubtaskResultAccepted messages from subtask_results_accepted_list are not beyond payment time.
Concent defines time
T0
equal to oldest payment_ts from passedSubtaskResultAccepted
messages fromsubtask_results_accepted_list
. Concent gets list of transactions from payment API wheretimestamp >= T0
. Concent defines timeT1
equal to youngest timestamp from list of transactions. Concent checks if all passedSubtaskResultAccepted
messages fromsubtask_results_accepted_list
havepayment_ts < T1
. Concent gets list of list of forced payments from payment API whereT0 <= payment_ts + PAYMENT_DUE_TIME + PAYMENT_GRACE_PERIOD
. Provider receivesForcePaymentRejected
from Concent.Conditions:
current_time < payment_ts + PAYMENT_DUE_TIME + PAYMENT_GRACE_PERIOD
.SubtaskResultAccepted
messages from `subtask_results_accepted_list are signed by the same reqestor.The message is returned in the HTTP response to the same request that has submitted
ForcePayment
.Request example
See step 1.
Response example
Status code:
200 OK
Response headers:
Content-Type
application/octet-stream
Response body:
ForcePaymentRejected
:Step 2C: Concent rejects provider's request immediately if there is no value to be paid.
Concent defines value V equal to sum of payment values from passed
SubtaskResultAccepted
messages fromsubtask_results_accepted_list
minus added sum of values from list of transactions and sum of values from list of forced payments. Provider receivesForcePaymentRejected
from Concent.Conditions:
V <= 0
.current_time < payment_ts + PAYMENT_DUE_TIME + PAYMENT_GRACE_PERIOD
.SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are signed by the same requestor.SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are related to the same Ethereum account.The message is returned in the HTTP response to the same request that has submitted
ForcePayment
.Request example
See step 1.
Response example
Status code:
200 OK
Response headers:
Content-Type
application/octet-stream
Response body:
ForcePaymentRejected
:Step 2D: Concent forces payment.
Concent defines time
T2
(end time) equal to youngestpayment_ts
from passedSubtaskResultAccepted
messages fromsubtask_results_accepted_list
. Concent makes transaction from requestor's deposit to provider's account on amountV
withpayment_ts
set toT2
. If there is less thenV
on requestor's deposit, Concent transfers as much as possible. Provider receivesForcePaymentCommitted
withpayment_ts
set toT2
from Concent. Requestor receivesForcePaymentCommitted
withpayment_ts
set toT2
from Concent out of band.Conditions:
V > 0
.current_time > payment_ts + PAYMENT_DUE_TIME + PAYMENT_GRACE_PERIOD
.SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are signed by the same requestor.SubtaskResultAccepted
messages fromsubtask_results_accepted_list
are related to the same Ethereum account.The message ForcePaymentCommitted
is returned in the HTTP response to the same request that has submitted
ForcePayment`.Request 1 example
See step 1.
Response 1 example
Status code:
200 OK
Response 1 headers:
Content-Type
application/octet-stream
Response 1 body:
ForcePaymentCommitted
:Request 2 example
POST http://concent.golem.network/receive-out-of-band/
Request 2 headers:
Content-Type
application/octet-stream
Concent-Client-Public-Key
cmVxdWVzdG9yIHB1YmxpYyBrZXkgMTIzNDU2=
Response 2 example
Status code:
200 OK
Response 2 headers:
Content-Type
application/octet-stream
Response 2 body:
ForcePaymentCommitted
: