Repository: farcaster-project/farcaster-node
Pull request #704 (2022-08-30 11:09:11)

Restore swap refactor
Instead of keeping track of the available checkpoints in the farcaster runtime, we use the cli to drive execution by first retrieving the checkpoint information for a certain swap id and then triggering the restore workflow.
    
Because the checkpoint list does not need to be persisted in farcasterd anymore, the ckecpoint list is no longer routed through farcasterd.

Based on #693 


Patch:
diff --git a/diagrams/staterecovery_sequencediagram.svg b/diagrams/staterecovery_sequencediagram.svg
index 29565448..5a1f595a 100644
--- a/diagrams/staterecovery_sequencediagram.svg
+++ b/diagrams/staterecovery_sequencediagram.svg
@@ -1,1 +1,1 @@
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="657" height="525"><desc>title%20State%20Recovery%20Procedure%0A%0A%2F%2F%20TODO%3A%20remove%20walletd%20once%20it's%20stateless%0Aparticipant%20swapd%0Aparticipant%20walletd%0Aparticipant%20databased%0Aparticipant%20farcasterd%0Aparticipant%20cli%0A%0A%3D%3D%20State%20Recovery%20Procedure%0Aentryspacing%200.8%0Afarcasterd%20-%3E%20walletd%20%3A%20launch%0Afarcasterd%20-%3E%20databased%20%3A%20launch%0Acli%20-%3E%20databased%20%3A%20RetrieveAllCheckpointInfo%0Adatabased%20-%3E%20farcasterd%20%3A%20CheckpointList%0Afarcasterd%20-%3E%20cli%20%3A%20CheckpointList%0Acli%20-%3E%20farcasterd%20%3A%20RestoreCheckpoint%0Afarcasterd%20-%3E%20swapd%20%3A%20launch%0Afarcasterd%20-%3E%20databased%20%3A%20RestoreCheckpoint%0Adatabased%20-%3E%20walletd%20%3A%20Checkpoint%0Adatabased%20-%3E%20swapd%3A%20Checkpoint%0A%0A</desc><defs/><g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g><rect fill="white" stroke="none" x="0" y="0" width="657" height="525"/></g><g><text fill="black" stroke="none" font-family="sans-serif" font-size="16.5pt" font-style="normal" font-weight="normal" text-decoration="normal" x="186.27641800649263" y="22.6179738" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">State Recovery Procedure</text></g><g/><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 47.532992188176756 88.511670804 L 47.532992188176756 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 145.5906433583535 88.511670804 L 145.5906433583535 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 88.511670804 L 268.38371043481834 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 88.511670804 L 446.87678208891987 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 625.3698537430214 88.511670804 L 625.3698537430214 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/></g><g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 7.5393246000000005 47.799317964000004 L 87.52665977635351 47.799317964000004 L 87.52665977635351 88.511670804 L 7.5393246000000005 88.511670804 L 7.5393246000000005 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="23.899658982" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">swapd</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 102.60530897635351 47.799317964000004 L 188.5759777403535 47.799317964000004 L 188.5759777403535 88.511670804 L 102.60530897635351 88.511670804 L 102.60530897635351 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="118.9656433583535" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">walletd</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 213.35670811458593 47.799317964000004 L 323.4107127550508 47.799317964000004 L 323.4107127550508 88.511670804 L 213.35670811458593 88.511670804 L 213.35670811458593 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="229.71704249658592" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">databased</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 393.2997805316269 47.799317964000004 L 500.4537836462128 47.799317964000004 L 500.4537836462128 88.511670804 L 393.2997805316269 88.511670804 L 393.2997805316269 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="409.6601149136269" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">farcasterd</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 600.8928525671981 47.799317964000004 L 649.8468549188447 47.799317964000004 L 649.8468549188447 88.511670804 L 600.8928525671981 88.511670804 L 600.8928525671981 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="617.2531869491982" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">cli</text></g></g><g><g><g><rect fill="white" stroke="none" x="269.45524893128317" y="114.145374444" width="53.55692758470703" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="271.7170463112832" y="127.716158724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">launch</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 133.747618404 L 158.00539786635352 133.747618404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(145.5906433583535,133.747618404) translate(-145.5906433583535,-133.747618404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 158.1561843583535 127.46484790400001 L 145.5906433583535 133.747618404 L 158.1561843583535 140.030388904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="330.85178246951557" y="151.84199744400001" width="53.55692758470703" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="333.1135798495156" y="165.412781724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">launch</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 171.44424140400002 L 280.7984649428183 171.44424140400002" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(268.38371043481834,171.44424140400002) translate(-268.38371043481834,-171.44424140400002)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 280.94925143481834 165.16147090400003 L 268.38371043481834 171.44424140400002 L 280.94925143481834 177.72701190400002 Z"/></g></g><g><g><rect fill="white" stroke="none" x="349.73998470891985" y="189.538620444" width="194.27359476" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="352.00178208891987" y="203.109404724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">RetrieveAllCheckpointInfo</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 625.3698537430214 209.140864404 L 280.7984649428183 209.140864404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(268.38371043481834,209.140864404) translate(-268.38371043481834,-209.140864404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 280.94925143481834 202.85809390400001 L 268.38371043481834 209.140864404 L 280.94925143481834 215.423634904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="301.2517839953945" y="227.235243444" width="112.75692453294921" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="303.5135813753945" y="240.806027724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">CheckpointList</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 246.837487404 L 434.4620275809199 246.837487404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(446.87678208891987,246.837487404) translate(-446.87678208891987,-246.837487404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 434.31124108891987 240.554716904 L 446.87678208891987 246.837487404 L 434.31124108891987 253.120257904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="479.74485564949595" y="264.931866444" width="112.75692453294921" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="482.00665302949596" y="278.502650724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">CheckpointList</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 284.534110404 L 612.9550992350214 284.534110404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(625.3698537430214,284.534110404) translate(-625.3698537430214,-284.534110404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 612.8043127430213 278.25133990399996 L 625.3698537430214 284.534110404 L 612.8043127430213 290.816880904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="464.7198503089198" y="302.62848944399997" width="142.80693521410157" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="466.9816476889198" y="316.199273724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">RestoreCheckpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 625.3698537430214 322.230733404 L 459.29153659691985 322.230733404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(446.87678208891987,322.230733404) translate(-446.87678208891987,-322.230733404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 459.44232308891986 315.94796290399995 L 446.87678208891987 322.230733404 L 459.44232308891986 328.513503904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="220.4264233461948" y="340.32511244399996" width="53.55692758470703" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="222.6882207261948" y="353.89589672399995" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">launch</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 359.92735640399997 L 59.94774669617676 359.92735640399997" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(47.532992188176756,359.92735640399997) translate(-47.532992188176756,-359.92735640399997)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 60.09853318817676 353.64458590399994 L 47.532992188176756 359.92735640399997 L 60.09853318817676 366.210126904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="286.2267786548183" y="378.02173544399994" width="142.80693521410157" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="288.4885760348183" y="391.592519724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">RestoreCheckpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 397.62397940399995 L 280.7984649428183 397.62397940399995" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(268.38371043481834,397.62397940399995) translate(-268.38371043481834,-397.62397940399995)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 280.94925143481834 391.3412089039999 L 268.38371043481834 397.62397940399995 L 280.94925143481834 403.906749904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="163.43371157835352" y="415.71835844399993" width="87.10693063646484" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="165.6955089583535" y="429.28914272399993" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">Checkpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 435.32060240399994 L 158.00539786635352 435.32060240399994" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(145.5906433583535,435.32060240399994) translate(-145.5906433583535,-435.32060240399994)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 158.1561843583535 429.0378319039999 L 145.5906433583535 435.32060240399994 L 158.1561843583535 441.60337290399997 Z"/></g></g><g><g><rect fill="white" stroke="none" x="114.40488599326513" y="453.4149814439999" width="87.10693063646484" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="116.66668337326513" y="466.985765724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">Checkpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 473.01722540399993 L 59.94774669617676 473.01722540399993" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(47.532992188176756,473.01722540399993) translate(-47.532992188176756,-473.01722540399993)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 60.09853318817676 466.7344549039999 L 47.532992188176756 473.01722540399993 L 60.09853318817676 479.29999590399996 Z"/></g></g></g><g/><g/><g/><g/><g/></g></svg>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="657" height="525"><desc>title%20State%20Recovery%20Procedure%0A%0A%2F%2F%20TODO%3A%20remove%20walletd%20once%20it's%20stateless%0Aparticipant%20swapd%0Aparticipant%20walletd%0Aparticipant%20databased%0Aparticipant%20farcasterd%0Aparticipant%20cli%0A%0A%3D%3D%20State%20Recovery%20Procedure%0Aentryspacing%200.8%0Afarcasterd%20-%3E%20walletd%20%3A%20launch%0Afarcasterd%20-%3E%20databased%20%3A%20launch%0Acli%20-%3E%20databased%3A%20GetCheckpointEntry%0Adatabased%20-%3E%20cli%3A%20ChechkpointEntry%0Acli%20-%3E%20farcasterd%3A%20RestoreCheckpoint%0Afarcasterd%20-%3E%20swapd%20%3A%20launch%0Aswapd%20-%3E%20farcasterd%3A%20Hello%0Afarcasterd%20-%3E%20databased%20%3A%20RestoreCheckpoint%0Adatabased%20-%3E%20walletd%20%3A%20Checkpoint%0Adatabased%20-%3E%20swapd%3A%20Checkpoint%0A</desc><defs/><g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g><rect fill="white" stroke="none" x="0" y="0" width="657" height="525"/></g><g><text fill="black" stroke="none" font-family="sans-serif" font-size="16.5pt" font-style="normal" font-weight="normal" text-decoration="normal" x="186.27641800649263" y="22.6179738" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">State Recovery Procedure</text></g><g/><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 47.532992188176756 88.511670804 L 47.532992188176756 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 145.5906433583535 88.511670804 L 145.5906433583535 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 88.511670804 L 268.38371043481834 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 88.511670804 L 446.87678208891987 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 625.3698537430214 88.511670804 L 625.3698537430214 525.7924976039999" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray="11.598960923076923,5.0262164"/></g><g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 7.5393246000000005 47.799317964000004 L 87.52665977635351 47.799317964000004 L 87.52665977635351 88.511670804 L 7.5393246000000005 88.511670804 L 7.5393246000000005 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="23.899658982" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">swapd</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 102.60530897635351 47.799317964000004 L 188.5759777403535 47.799317964000004 L 188.5759777403535 88.511670804 L 102.60530897635351 88.511670804 L 102.60530897635351 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="118.9656433583535" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">walletd</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 213.35670811458593 47.799317964000004 L 323.4107127550508 47.799317964000004 L 323.4107127550508 88.511670804 L 213.35670811458593 88.511670804 L 213.35670811458593 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="229.71704249658592" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">databased</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 393.2997805316269 47.799317964000004 L 500.4537836462128 47.799317964000004 L 500.4537836462128 88.511670804 L 393.2997805316269 88.511670804 L 393.2997805316269 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="409.6601149136269" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">farcasterd</text></g><path fill="none" stroke="none"/><g><path fill="white" stroke="black" paint-order="fill stroke markers" d=" M 600.8928525671981 47.799317964000004 L 649.8468549188447 47.799317964000004 L 649.8468549188447 88.511670804 L 600.8928525671981 88.511670804 L 600.8928525671981 47.799317964000004 Z" stroke-miterlimit="10" stroke-width="2.4125838720000004" stroke-dasharray=""/></g><g><g/><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="617.2531869491982" y="73.43302160400002" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">cli</text></g></g><g><g><g><rect fill="white" stroke="none" x="269.45524893128317" y="114.145374444" width="53.55692758470703" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="271.7170463112832" y="127.716158724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">launch</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 133.747618404 L 158.00539786635352 133.747618404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(145.5906433583535,133.747618404) translate(-145.5906433583535,-133.747618404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 158.1561843583535 127.46484790400001 L 145.5906433583535 133.747618404 L 158.1561843583535 140.030388904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="330.85178246951557" y="151.84199744400001" width="53.55692758470703" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="333.1135798495156" y="165.412781724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">launch</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 171.44424140400002 L 280.7984649428183 171.44424140400002" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(268.38371043481834,171.44424140400002) translate(-268.38371043481834,-171.44424140400002)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 280.94925143481834 165.16147090400003 L 268.38371043481834 171.44424140400002 L 280.94925143481834 177.72701190400002 Z"/></g></g><g><g><rect fill="white" stroke="none" x="370.7316534100917" y="189.538620444" width="152.29025735765626" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="372.99345079009174" y="203.109404724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">GetCheckpointEntry</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 625.3698537430214 209.140864404 L 280.7984649428183 209.140864404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(268.38371043481834,209.140864404) translate(-268.38371043481834,-209.140864404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 280.94925143481834 202.85809390400001 L 268.38371043481834 209.140864404 L 280.94925143481834 215.423634904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="379.156648832455" y="227.235243444" width="135.4402665129297" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="381.418446212455" y="240.806027724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">ChechkpointEntry</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 246.837487404 L 612.9550992350214 246.837487404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(625.3698537430214,246.837487404) translate(-625.3698537430214,-246.837487404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 612.8043127430213 240.554716904 L 625.3698537430214 246.837487404 L 612.8043127430213 253.120257904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="464.7198503089198" y="264.931866444" width="142.80693521410157" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="466.9816476889198" y="278.502650724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">RestoreCheckpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 625.3698537430214 284.534110404 L 459.29153659691985 284.534110404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(446.87678208891987,284.534110404) translate(-446.87678208891987,-284.534110404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 459.44232308891986 278.25133990399996 L 446.87678208891987 284.534110404 L 459.44232308891986 290.816880904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="220.4264233461948" y="302.62848944399997" width="53.55692758470703" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="222.6882207261948" y="316.199273724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">launch</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 322.230733404 L 59.94774669617676 322.230733404" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(47.532992188176756,322.230733404) translate(-47.532992188176756,-322.230733404)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 60.09853318817676 315.94796290399995 L 47.532992188176756 322.230733404 L 60.09853318817676 328.513503904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="226.33475617090184" y="340.32511244399996" width="41.74026193529297" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="228.59655355090183" y="353.89589672399995" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">Hello</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 47.532992188176756 359.92735640399997 L 434.4620275809199 359.92735640399997" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(446.87678208891987,359.92735640399997) translate(-446.87678208891987,-359.92735640399997)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 434.31124108891987 353.64458590399994 L 446.87678208891987 359.92735640399997 L 434.31124108891987 366.210126904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="286.2267786548183" y="378.02173544399994" width="142.80693521410157" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="288.4885760348183" y="391.592519724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">RestoreCheckpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 446.87678208891987 397.62397940399995 L 280.7984649428183 397.62397940399995" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(268.38371043481834,397.62397940399995) translate(-268.38371043481834,-397.62397940399995)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 280.94925143481834 391.3412089039999 L 268.38371043481834 397.62397940399995 L 280.94925143481834 403.906749904 Z"/></g></g><g><g><rect fill="white" stroke="none" x="163.43371157835352" y="415.71835844399993" width="87.10693063646484" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="165.6955089583535" y="429.28914272399993" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">Checkpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 435.32060240399994 L 158.00539786635352 435.32060240399994" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(145.5906433583535,435.32060240399994) translate(-145.5906433583535,-435.32060240399994)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 158.1561843583535 429.0378319039999 L 145.5906433583535 435.32060240399994 L 158.1561843583535 441.60337290399997 Z"/></g></g><g><g><rect fill="white" stroke="none" x="114.40488599326513" y="453.4149814439999" width="87.10693063646484" height="19.602243960000003"/></g><text fill="black" stroke="none" font-family="sans-serif" font-size="11pt" font-style="normal" font-weight="normal" text-decoration="normal" x="116.66668337326513" y="466.985765724" text-anchor="start" dominant-baseline="alphabetic" xml:space="preserve">Checkpoint</text></g><g><path fill="none" stroke="black" paint-order="fill stroke markers" d=" M 268.38371043481834 473.01722540399993 L 59.94774669617676 473.01722540399993" stroke-miterlimit="10" stroke-width="1.2565541" stroke-dasharray=""/><g transform="translate(47.532992188176756,473.01722540399993) translate(-47.532992188176756,-473.01722540399993)"><path fill="black" stroke="none" paint-order="stroke fill markers" d=" M 60.09853318817676 466.7344549039999 L 47.532992188176756 473.01722540399993 L 60.09853318817676 479.29999590399996 Z"/></g></g></g><g/><g/><g/><g/><g/></g></svg>
\ No newline at end of file
diff --git a/diagrams/staterecovery_sequencediagram.txt b/diagrams/staterecovery_sequencediagram.txt
index 360f8944..0122b3fd 100644
--- a/diagrams/staterecovery_sequencediagram.txt
+++ b/diagrams/staterecovery_sequencediagram.txt
@@ -11,11 +11,11 @@ participant cli
 entryspacing 0.8
 farcasterd -> walletd : launch
 farcasterd -> databased : launch
-cli -> databased : RetrieveAllCheckpointInfo
-databased -> farcasterd : CheckpointList
-farcasterd -> cli : CheckpointList
-cli -> farcasterd : RestoreCheckpoint
+cli -> databased: GetCheckpointEntry
+databased -> cli: ChechkpointEntry
+cli -> farcasterd: RestoreCheckpoint
 farcasterd -> swapd : launch
+swapd -> farcasterd: Hello
 farcasterd -> databased : RestoreCheckpoint
 databased -> walletd : Checkpoint
 databased -> swapd: Checkpoint
diff --git a/src/bus/ctl.rs b/src/bus/ctl.rs
index c8963a50..2a7fba0c 100644
--- a/src/bus/ctl.rs
+++ b/src/bus/ctl.rs
@@ -14,7 +14,9 @@ use internet2::addr::{InetSocketAddr, NodeAddr};
 use strict_encoding::{NetworkDecode, NetworkEncode};
 
 use crate::bus::msg::Commit;
-use crate::bus::{AddressSecretKey, Failure, OfferStatusPair, OptionDetails, Outcome, Progress};
+use crate::bus::{
+    AddressSecretKey, CheckpointEntry, Failure, OfferStatusPair, OptionDetails, Outcome, Progress,
+};
 use crate::swapd::CheckpointSwapd;
 use crate::syncerd::SweepAddressAddendum;
 use crate::walletd::runtime::CheckpointWallet;
@@ -61,7 +63,7 @@ pub enum Ctl {
     PeerdTerminated,
 
     #[display("restore_checkpoint({0})", alt = "{0:#}")]
-    RestoreCheckpoint(SwapId),
+    RestoreCheckpoint(CheckpointEntry),
 
     #[display("make_offer({0})")]
     MakeOffer(ProtoPublicOffer),
diff --git a/src/bus/rpc.rs b/src/bus/rpc.rs
index d16c31b1..7c725d49 100644
--- a/src/bus/rpc.rs
+++ b/src/bus/rpc.rs
@@ -2,16 +2,16 @@ use std::str::FromStr;
 use std::time::Duration;
 
 use amplify::ToYamlString;
-use farcaster_core::{
-    blockchain::Blockchain, role::TradeRole, swap::btcxmr::PublicOffer, swap::SwapId,
-};
+use farcaster_core::{blockchain::Blockchain, swap::btcxmr::PublicOffer, swap::SwapId};
 use internet2::addr::{InetSocketAddr, NodeAddr};
 #[cfg(feature = "serde")]
 use serde_with::{DisplayFromStr, DurationSeconds};
 use strict_encoding::{NetworkDecode, NetworkEncode, StrictDecode, StrictEncode};
 use uuid::Uuid;
 
-use crate::bus::{AddressSecretKey, Failure, List, OfferStatusPair, OptionDetails, Progress};
+use crate::bus::{
+    AddressSecretKey, CheckpointEntry, Failure, List, OfferStatusPair, OptionDetails, Progress,
+};
 use crate::cli::OfferSelector;
 
 #[derive(Clone, Debug, Display, From, NetworkEncode, NetworkDecode)]
@@ -50,6 +50,9 @@ pub enum Rpc {
     #[display("needs_funding({0})")]
     NeedsFunding(Blockchain),
 
+    #[display("get_checkpoint_entry({0})")]
+    GetCheckpointEntry(SwapId),
+
     // Progress functionalities
     // ----------------
     // Returns a SwapProgress message
@@ -152,6 +155,11 @@ pub enum Rpc {
     #[display("monero_address_list({0})")]
     MoneroAddressList(List<String>),
     // - End GetAddresses section
+
+    // - GetCheckpointEntry section
+    #[display("checkpoint_entry({0})")]
+    CheckpointEntry(CheckpointEntry),
+    // - End GetCheckpointEntry section
 }
 
 #[cfg_attr(feature = "serde", serde_as)]
@@ -275,20 +283,6 @@ pub struct SwapInfo {
     pub public_offer: PublicOffer,
 }
 
-#[derive(Clone, PartialEq, Eq, Debug, Display, NetworkEncode, NetworkDecode)]
-#[display("{swap_id}, {public_offer}")]
-#[cfg_attr(
-    feature = "serde",
-    derive(Serialize, Deserialize),
-    serde(crate = "serde_crate")
-)]
-#[display(CheckpointEntry::to_yaml_string)]
-pub struct CheckpointEntry {
-    pub swap_id: SwapId,
-    pub public_offer: PublicOffer,
-    pub trade_role: TradeRole,
-}
-
 #[cfg_attr(feature = "serde", serde_as)]
 #[derive(Clone, PartialEq, Eq, Debug, Display, Default, NetworkEncode, NetworkDecode)]
 #[cfg_attr(
diff --git a/src/bus/types.rs b/src/bus/types.rs
index d066acdd..22bd24ab 100644
--- a/src/bus/types.rs
+++ b/src/bus/types.rs
@@ -1,11 +1,28 @@
 use std::fmt::{self, Debug, Display, Formatter};
 
-use farcaster_core::swap::btcxmr::PublicOffer;
+use farcaster_core::{
+    role::TradeRole,
+    swap::{btcxmr::PublicOffer, SwapId},
+};
 
 use amplify::{ToYamlString, Wrapper};
 use microservices::rpc;
 use strict_encoding::{NetworkDecode, NetworkEncode};
 
+#[derive(Clone, PartialEq, Eq, Debug, Display, NetworkEncode, NetworkDecode)]
+#[display("{swap_id}, {public_offer}")]
+#[cfg_attr(
+    feature = "serde",
+    derive(Serialize, Deserialize),
+    serde(crate = "serde_crate")
+)]
+#[display(CheckpointEntry::to_yaml_string)]
+pub struct CheckpointEntry {
+    pub swap_id: SwapId,
+    pub public_offer: PublicOffer,
+    pub trade_role: TradeRole,
+}
+
 #[derive(Clone, Debug, Display, NetworkDecode, NetworkEncode)]
 pub enum AddressSecretKey {
     #[display("addr_key({address}, ..)")]
diff --git a/src/cli/command.rs b/src/cli/command.rs
index a72820bc..0f87754c 100644
--- a/src/cli/command.rs
+++ b/src/cli/command.rs
@@ -102,8 +102,13 @@ impl Exec for Command {
             }
 
             Command::RestoreCheckpoint { swap_id } => {
-                runtime.request_ctl(ServiceId::Farcasterd, Ctl::RestoreCheckpoint(swap_id))?;
-                runtime.report_response_or_fail()?;
+                runtime.request_rpc(ServiceId::Database, Rpc::GetCheckpointEntry(swap_id))?;
+                if let BusMsg::Rpc(Rpc::CheckpointEntry(entry)) = runtime.report_failure()? {
+                    runtime.request_ctl(ServiceId::Farcasterd, Ctl::RestoreCheckpoint(entry))?;
+                    runtime.report_response_or_fail()?;
+                } else {
+                    return Err(Error::Farcaster("Received unexpected response".to_string()));
+                }
             }
 
             Command::Make {
diff --git a/src/databased/runtime.rs b/src/databased/runtime.rs
index a568ca6c..e8bf2bc2 100644
--- a/src/databased/runtime.rs
+++ b/src/databased/runtime.rs
@@ -12,11 +12,12 @@ use bitcoin::secp256k1::SecretKey;
 
 use crate::bus::{
     ctl::{Checkpoint, CheckpointState, Ctl},
-    rpc::{Address, CheckpointEntry, OfferStatusSelector, Rpc},
-    AddressSecretKey, BusMsg, Failure, FailureCode, List, OfferStatus, OfferStatusPair, ServiceBus,
+    rpc::{Address, OfferStatusSelector, Rpc},
+    AddressSecretKey, BusMsg, CheckpointEntry, Failure, FailureCode, List, OfferStatus,
+    OfferStatusPair, ServiceBus,
 };
 use crate::{CtlServer, Error, LogStyle, Service, ServiceConfig, ServiceId};
-use microservices::esb;
+use microservices::esb::{self, Handler};
 
 pub fn run(config: ServiceConfig, data_dir: PathBuf) -> Result<(), Error> {
     let runtime = Runtime {
@@ -121,7 +122,7 @@ impl Runtime {
                 debug!("checkpoint set");
             }
 
-            BusMsg::Ctl(Ctl::RestoreCheckpoint(swap_id)) => {
+            BusMsg::Ctl(Ctl::RestoreCheckpoint(CheckpointEntry { swap_id, .. })) => {
                 match self.database.get_checkpoint_state(&CheckpointKey {
                     swap_id,
                     service_id: ServiceId::Wallet,
@@ -286,12 +287,59 @@ impl Runtime {
                     .collect();
                 endpoints.send_to(
                     ServiceBus::Rpc,
+                    self.identity(),
                     source,
-                    ServiceId::Farcasterd,
                     BusMsg::Rpc(Rpc::CheckpointList(checkpointed_pub_offers)),
                 )?;
             }
 
+            Rpc::GetCheckpointEntry(swap_id) => {
+                let entry = match self.database.get_checkpoint_state(&CheckpointKey {
+                    swap_id,
+                    service_id: ServiceId::Wallet,
+                }) {
+                    Ok(raw_state) => {
+                        match CheckpointState::strict_decode(std::io::Cursor::new(raw_state)) {
+                            Ok(CheckpointState::CheckpointWallet(CheckpointWallet {
+                                wallet,
+                                ..
+                            })) => match wallet {
+                                Wallet::Bob(wallet) => Some(CheckpointEntry {
+                                    swap_id,
+                                    public_offer: wallet.pub_offer,
+                                    trade_role: wallet.local_trade_role,
+                                }),
+                                Wallet::Alice(wallet) => Some(CheckpointEntry {
+                                    swap_id,
+                                    public_offer: wallet.pub_offer,
+                                    trade_role: wallet.local_trade_role,
+                                }),
+                            },
+                            _ => None,
+                        }
+                    }
+                    _ => None,
+                };
+                if let Some(entry) = entry {
+                    endpoints.send_to(
+                        ServiceBus::Rpc,
+                        self.identity(),
+                        source,
+                        BusMsg::Rpc(Rpc::CheckpointEntry(entry)),
+                    )?;
+                } else {
+                    endpoints.send_to(
+                        ServiceBus::Ctl,
+                        self.identity(),
+                        source,
+                        BusMsg::Ctl(Ctl::Failure(Failure {
+                            code: FailureCode::Unknown,
+                            info: format!("Could not retrieve checkpoint entry for {}", swap_id),
+                        })),
+                    )?;
+                }
+            }
+
             Rpc::GetAddressSecretKey(Address::Monero(address)) => {
                 match self.database.get_monero_address_secret_key(&address) {
                     Err(_) => endpoints.send_to(
diff --git a/src/farcasterd/runtime.rs b/src/farcasterd/runtime.rs
index fe8728c3..18377ae2 100644
--- a/src/farcasterd/runtime.rs
+++ b/src/farcasterd/runtime.rs
@@ -23,7 +23,7 @@ use crate::farcasterd::Opts;
 use crate::syncerd::{Event as SyncerEvent, SweepSuccess, TaskId};
 use crate::{
     bus::ctl::{Keys, LaunchSwap, ProgressStack, Token},
-    bus::rpc::{CheckpointEntry, OfferInfo, OfferStatusSelector, ProgressEvent, Rpc, SwapProgress},
+    bus::rpc::{OfferInfo, OfferStatusSelector, ProgressEvent, Rpc, SwapProgress},
     bus::{Failure, FailureCode, Outcome, Progress},
     clap::Parser,
     error::SyncerError,
@@ -94,7 +94,6 @@ pub fn run(
         progress: none!(),
         progress_subscriptions: none!(),
         stats: none!(),
-        checkpointed_pub_offers: vec![].into(),
         config,
         syncer_task_counter: 0,
         trade_state_machines: vec![],
@@ -117,9 +116,8 @@ pub struct Runtime {
     pub public_offers: HashSet<PublicOffer>, // The set of all known public offers. Includes open, consumed and ended offers includes open, consumed and ended offers
     progress: HashMap<ServiceId, VecDeque<ProgressStack>>, // A mapping from Swap ServiceId to its sent and received progress messages (Progress, Success, Failure)
     progress_subscriptions: HashMap<ServiceId, HashSet<ServiceId>>, // A mapping from a Client ServiceId to its subsribed swap progresses
-    pub checkpointed_pub_offers: List<CheckpointEntry>, // A list of existing swap checkpoint entries that may be restored again
-    pub stats: Stats,                                   // Some stats about offers and swaps
-    pub config: Config, // Configuration for syncers, auto-funding, and grpc
+    pub stats: Stats,             // Some stats about offers and swaps
+    pub config: Config,           // Configuration for syncers, auto-funding, and grpc
     pub syncer_task_counter: u32, // A strictly incrementing counter of issued syncer tasks
     pub trade_state_machines: Vec<TradeStateMachine>, // New trade state machines are inserted on creation and destroyed upon state machine end transitions
     syncer_state_machines: HashMap<TaskId, SyncerStateMachine>, // New syncer state machines are inserted by their syncer task id when sending a syncer request and destroyed upon matching syncer request receival
@@ -568,16 +566,6 @@ impl Runtime {
                 self.send_client_rpc(endpoints, source, Rpc::ListenList(listen_url))?;
             }
 
-            Rpc::CheckpointList(checkpointed_pub_offers) => {
-                self.checkpointed_pub_offers = checkpointed_pub_offers.clone();
-                endpoints.send_to(
-                    ServiceBus::Rpc,
-                    ServiceId::Farcasterd,
-                    source,
-                    BusMsg::Rpc(Rpc::CheckpointList(checkpointed_pub_offers)),
-                )?;
-            }
-
             // Returns a unique response that contains the complete progress queue
             Rpc::ReadProgress(swap_id) => {
                 if let Some(queue) = self.progress.get_mut(&ServiceId::Swap(swap_id)) {
diff --git a/src/farcasterd/trade_state_machine.rs b/src/farcasterd/trade_state_machine.rs
index 7317b1ae..a800acaf 100644
--- a/src/farcasterd/trade_state_machine.rs
+++ b/src/farcasterd/trade_state_machine.rs
@@ -3,8 +3,8 @@ use crate::bus::ctl::{
     MoneroFundingInfo, ProtoPublicOffer, PubOffer,
 };
 use crate::bus::msg::{Msg, TakeCommit};
-use crate::bus::rpc::{CheckpointEntry, MadeOffer, OfferInfo, Rpc, TookOffer};
-use crate::bus::{Failure, FailureCode, OfferStatus, OfferStatusPair};
+use crate::bus::rpc::{MadeOffer, OfferInfo, Rpc, TookOffer};
+use crate::bus::{CheckpointEntry, Failure, FailureCode, OfferStatus, OfferStatusPair};
 use crate::farcasterd::runtime::{launch, launch_swapd, syncer_up, Runtime};
 use crate::LogStyle;
 use crate::{
@@ -138,6 +138,7 @@ pub struct RestoringSwapd {
     arbitrating_syncer_up: Option<ServiceId>,
     accordant_syncer_up: Option<ServiceId>,
     swapd_up: bool,
+    trade_role: TradeRole,
 }
 
 pub struct SwapdRunning {
@@ -520,7 +521,11 @@ fn attempt_transition_to_restoring_swapd(
 ) -> Result<Option<TradeStateMachine>, Error> {
     // check if databased and walletd are running
     match event.request.clone() {
-        BusMsg::Ctl(Ctl::RestoreCheckpoint(swap_id)) => {
+        BusMsg::Ctl(Ctl::RestoreCheckpoint(CheckpointEntry {
+            swap_id,
+            public_offer,
+            trade_role,
+        })) => {
             if let Err(err) = runtime.services_ready() {
                 event.send_ctl_service(
                     event.source.clone(),
@@ -544,25 +549,6 @@ fn attempt_transition_to_restoring_swapd(
                 return Ok(None);
             }
 
-            let CheckpointEntry {
-                public_offer,
-                trade_role,
-                ..
-            } = match runtime
-                .checkpointed_pub_offers
-                .iter()
-                .find(|entry| entry.swap_id == swap_id)
-            {
-                Some(ce) => ce,
-                None => {
-                    event.complete_ctl(BusMsg::Ctl(Ctl::Failure(Failure {
-                        code: FailureCode::Unknown,
-                        info: "No checkpoint found with given swap id, aborting restore."
-                            .to_string(),
-                    })))?;
-                    return Ok(None);
-                }
-            };
             let arbitrating_syncer_up = syncer_up(
                 &mut runtime.spawning_services,
                 &mut runtime.registered_services,
@@ -597,6 +583,7 @@ fn attempt_transition_to_restoring_swapd(
                 arbitrating_syncer_up,
                 accordant_syncer_up,
                 swapd_up: false,
+                trade_role,
             })))
         }
         req => {
@@ -919,6 +906,7 @@ fn attempt_transition_from_restoring_swapd_to_swapd_running(
         mut arbitrating_syncer_up,
         mut accordant_syncer_up,
         mut swapd_up,
+        trade_role,
     } = restoring_swapd;
     match (event.request.clone(), event.source.clone()) {
         (BusMsg::Ctl(Ctl::Hello), source)
@@ -945,7 +933,11 @@ fn attempt_transition_from_restoring_swapd_to_swapd_running(
         runtime.stats.incr_initiated();
         event.complete_ctl_service(
             ServiceId::Database,
-            BusMsg::Ctl(Ctl::RestoreCheckpoint(swap_id)),
+            BusMsg::Ctl(Ctl::RestoreCheckpoint(CheckpointEntry {
+                swap_id,
+                public_offer: public_offer.clone(),
+                trade_role,
+            })),
         )?;
 
         Ok(Some(TradeStateMachine::SwapdRunning(SwapdRunning {
@@ -965,6 +957,7 @@ fn attempt_transition_from_restoring_swapd_to_swapd_running(
             arbitrating_syncer_up,
             accordant_syncer_up,
             swapd_up,
+            trade_role,
         })))
     }
 }


Test patch:
diff --git a/tests/swap.rs b/tests/swap.rs
index a1f27e5d..5fb22221 100644
--- a/tests/swap.rs
+++ b/tests/swap.rs
@@ -4,7 +4,8 @@ extern crate log;
 use bitcoincore_rpc::RpcApi;
 use farcaster_core::swap::SwapId;
 use farcaster_node::bus::ctl::{BitcoinFundingInfo, MoneroFundingInfo};
-use farcaster_node::bus::rpc::{CheckpointEntry, NodeInfo};
+use farcaster_node::bus::rpc::NodeInfo;
+use farcaster_node::bus::CheckpointEntry;
 use futures::future::join_all;
 use std::collections::HashSet;
 use std::sync::Arc;