[CHIA-2224] Add some extra safety into create_message_spend
#19153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to an issue #19152 where recovery information was accidentally cleared during a routine message spend. There's no reliable reproduction for this issue so it's tough to say if this will fix it, but my best guess is that the
self.did_info
was not fully in sync before the user was allowed to submit a transaction that uses that information. This is a big architectural problem with the DID wallet but without a complete overhaul, I'm not sure how we can fix it. This PR is a small step that should add some extra safety by ensuring that the inner puzzle we think we have does actually match what is in the coin and then using the information directly from that inner puzzle to create the new one. It should be impossible with these changes to do a message spend where any recovery or otherwise metadata can change during the creation of the spend.