-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Protocol 23 introduced autorestore, which, for most cases, makes explicit restore operations (and the restore preamble returned by simulateTransaction) redundant.
#463 enabled autorestore for simulateTransaction for protocol > 22 but disabled restore preambles.
However, there are corner cases (when network limits are surpassed) for which autorestore isn't enough. In those cases we need to split restoring into autorestore+restore preamble.
To implement this we should include this changes in the libpreflight Rust library:
- run simulation using regular (non-auto-restore) snapshot source. the result will contain auto-restored entries (if any) in
SorobanTransactionData. The result will also have proper fees and limits for autorestoration. - verify the output
SorobanTransactionDataagainst the network limits.
a. if it is below limits, return the result from step 1
b. if it is above limits, re-run simulation usingAutoRestoringSnapshotSourceand populate the restore preamble. now you'll have an invoke transaction without any auto-restored entries, and a restore transaction.
note, that step 2b doesn't guarantee that the original transaction without autorestore, or the restore transaction don't exceed the network limits. which is why I suggest to postpone that until after we have a more coherent design for handling the network limits in simulation. thus the algorithm can be shortcut to just step 1.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status