Fix AuxInvoiceManager prop tests #1672
                
     Merged
            
            
          
  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.
  
    
  
    
Description
On the top level, this PR fixes the flake reported in #1670.
The actual moment in our development history where this flake could have been discovered was here #1478
By merging the above PR, we added an extra check to the HTLC validation by the aux invoice manager. That check compared the assets of the HTLC against the assets of the channel. We would draw the channel ID from
rapid.Uint64, but due to the nature of rapid draws this would cause conflicts in the channel ID. That lead to failures when checking the HTLC against the channel.Why this is a flake
The current design of the aux invoice manager prop test allows rapid to draw many values randomly. Many of these values are flags that indicate whether a certain type of error should be caused. Due to the large number of draws related to "things that can go wrong" we would rarely run into the case where "nothing is going wrong, except for a chan ID collision".
With the assumption that we don't really want to account for non-sane cases where we have colliding channel IDs, we change the draw to be done from
rand.Uint64instead. This way intentional collisions, which are not relevant, are avoided.Closes #1670