For now, RemoteTransactionProver connects on object creation, which implies a connection to the Prover RPC endpoint.
It would be nice to initialize the connection lazily, once the connection is attempted to be used, since otherwise this would imply unnecessary connections (for instance, creating a Client for doing something else rather than remotely proving a transaction).
An alternative is to just connect to the RPC server and drop the connection once the proven transaction arrives.
How should it be done?
Initialize a connection only on RemoteTransactionProver::prove(). This can be long-lived (stored as part of the struct), or dropped after having proven the transation.
When is this task done?
When a connection is not initialized on RemoteTransactionProver::new().
What should be done?
For now,
RemoteTransactionProver
connects on object creation, which implies a connection to the Prover RPC endpoint.It would be nice to initialize the connection lazily, once the connection is attempted to be used, since otherwise this would imply unnecessary connections (for instance, creating a
Client
for doing something else rather than remotely proving a transaction).An alternative is to just connect to the RPC server and drop the connection once the proven transaction arrives.
How should it be done?
Initialize a connection only on
RemoteTransactionProver::prove()
. This can be long-lived (stored as part of the struct), or dropped after having proven the transation.When is this task done?
When a connection is not initialized on
RemoteTransactionProver::new()
.Additional context
No response