A credit module that stores a balance for each address (default 0) that can be negative. This is quite similar to the default bank module but with the possibility to go bellow 0 and have negative credits.
Process address payment
The process now has a new attribute paymentAddress that delegates the payment of executions of this process to a specific address. The default is the owner of the process. The process doesn't have any balance anymore and each executions transfer from the paymentAddress of the process and not the process itself. We can still have the a process that has credits and use the address of the process as paymentAddress.
Execution price
The execution price is not set by the user based on a minExecPrice anymore but calculated based on 3 variables defined by service's tasks:
perCall: The cost in credit of an invocation
perSec: The cost in credit of a second of invocation (rounded to the higher second, 1.2 sec will cost 2sec)
perKB: The cost in credit of the sum of the inputs and outputs of the execution (rounded to the highest kB, 0.4 kB will cost the price of 1 kB)
The current calculation is
perCall + duration x perSec + size(input) x perKB + size(input) x perKB
All these payment are done with the credit modules and not the native token anymore. This allows to have negative credits for executions that can be paid later.
New credit module
A credit module that stores a balance for each address (default 0) that can be negative. This is quite similar to the default bank module but with the possibility to go bellow 0 and have negative credits.
Process address payment
The process now has a new attribute
paymentAddress
that delegates the payment of executions of this process to a specific address. The default is the owner of the process. The process doesn't have any balance anymore and each executions transfer from thepaymentAddress
of the process and not the process itself. We can still have the a process that has credits and use the address of the process aspaymentAddress
.Execution price
The execution price is not set by the user based on a
minExecPrice
anymore but calculated based on 3 variables defined by service's tasks:perCall
: The cost in credit of an invocationperSec
: The cost in credit of a second of invocation (rounded to the higher second, 1.2 sec will cost 2sec)perKB
: The cost in credit of the sum of the inputs and outputs of the execution (rounded to the highest kB, 0.4 kB will cost the price of 1 kB) The current calculation isAll these payment are done with the credit modules and not the native token anymore. This allows to have negative credits for executions that can be paid later.
TODO in other PR / discuss: