Some hints can take a long time to process. This PR introduces a polling mechanism to Cairo-Hints, allowing it to handle long-running hint operations. The implementation enables Cairo programs to initiate hint requests and periodically check for results.
Key Changes
Modified execute_cheatcode function in rpc_hint_processor.rs:
Implemented a polling loop with configurable parameters (max attempts, polling interval, timeout).
Added initial request to start the job and retrieve a job_id.
Introduced periodic status checks using the job_id.
The polling configuration can be writing in servers.json as follow:
Overview
Some hints can take a long time to process. This PR introduces a polling mechanism to Cairo-Hints, allowing it to handle long-running hint operations. The implementation enables Cairo programs to initiate hint requests and periodically check for results.
Key Changes
Modified
execute_cheatcode
function inrpc_hint_processor.rs
:job_id
.job_id
.The polling configuration can be writing in
servers.json
as follow:Polling parameters are set by default as follow:
Server side example
In server side, you can implement the server as follow: