linera-protocol icon indicating copy to clipboard operation
linera-protocol copied to clipboard

Limit oracle calls, and charge fees for them.

Open afck opened this issue 1 year ago • 2 comments

query_service calls the application's service code inside the validator workers. We need to make sure these calls time out if they take too long, and add a fee category for them.

Similarly http_post should limit the length of the response it accepts.

In general, all oracles must limit their cost, and cost fees.

afck avatar Jun 12 '24 14:06 afck

@afck Should we close this now or move to Testnet-2?

ma2bd avatar Aug 27 '24 04:08 ma2bd

I moved it to Testnet-2.

afck avatar Aug 27 '24 06:08 afck

I tried to implement a maximum execution time for services, but because the runtime runs in a synchronous thread, we can't cancel that thread. Attempting to cancel that thread with pthread_cancel led to process crashes because pthread expects an exception to be thrown through the call stack, and apparently that is caught somewhere in the code (maybe by Wasmer).

Since this is blocking the new testnet release, we discussed the problem and decided to perform the on-chain changes first, and later use Wasm metering to stop the service when it exceeds its execution time budget.

jvff avatar Mar 10 '25 14:03 jvff