althea-net / rita

Rita is a routing and billing protocol that allows devices to buy and sell bandwidth
https://docs.althea.net/
Apache License 2.0
91 stars 24 forks source link

Althea billing should make use of block based payment timeouts #856

Closed jkilpatr closed 6 months ago

jkilpatr commented 7 months ago

Base EVM (Ethereum) transactions that we use for payments on Gnosis chain are valid from the moment they are signed until a validator chooses to include them in the chain.

This could be hours, days, or even years after the transaction was first created and broadcast.

For this is a problem for Althea since we need to make many frequent payments between routers.

When a payment is made by rita it is passed off to the payment validator module which then verifies that the payment was sent or after a period of time (10 minutes currently) sends it back to the debt keeper process to be potentially retried.

With EVM chains we just have to accept some failures here and that it's possible a payment that has 'timed out' will be included in the future. On Althea L1 we don't have to accept this possibility.

The message args of any CosmosSDK transaction allow us to specify a block timeout for transactions. After this block has passed it becomes impossible for the transaction to enter the chain.

Right now the payment validator code for Althea L1 is a logical copy of the code for Gnosis chain / EVM platforms and doesn't take advantage of this capability.

jkilpatr commented 6 months ago

Resolved this in #865