Auto Restore Plugin
Last updated
Last updated
The Auto Restore plugin can be used to automatically perform a restore transaction whenever a soroban transaction simulation identifies archived states that would interfere with the transaction execution.
For further details on this scenario, refer to Soroban's official documentation on State Archival.
Pipeline Type: Simulate Transaction
Supported Pipelines:
Soroban Transaction - Targets its inner pipeline.
Classic Transaction- Targets its inner pipeline.
Constructor arguments:
restoreTxInvocation: An object of a Transaction Invocation to parametrize the restore transaction. If a Fee Bump header is present, the transaction will use the Fee Bump plugin to wrap the transaction with this header.
networkConfig: A network configuration. Refer to Network
customRpcHandler: An optional custom RPC handler to be used for this transaction.
During the postProcess
of the Simulate Transaction pipeline, the Auto Restore plugin will verify if the response of the simulation indicates a restore is required. In case yes, it will perform the following steps:
Extract the restorePreamble from the simulation
Build a restore transaction with its parameters and the restorePreamble
Execute the transaction
Verify if the original transaction's source was the same as the restore transaction and bumps its sequence number if necessary.
Afterward, the Simulation Pipeline will proceed with the postProcess
step before exiting.