Thanks for the comments Pieter!
We can make descriptions for the intended node behaviors more clear in the BIP.
Regarding interaction with BIPs 37 and 133, we have found that if Dandelion routing decisions are based on self-reported features, malicious nodes can often exploit that to launch serious deanonymization attacks. As a result, we recommend not allowing fee filters from peers to influence the choice of route. Your suggestion of automatically fluffing is a good solution. Another (similar) option would be to apply fee filters in the stempool. This would prevent the tx from propagating in stem phase, so eventually an embargo timer on the stem will expire and the transaction will fluff. This is slower than auto-fluffing, but requires (slightly) less code.
Regarding mempool-dependent transactions, the reference implementation adds any mempool transactions to the stempool but not vice-versa so that the stempool becomes a superset of the mempool. In other words, information is free to flow from the mempool to the stempool. Information does not flow from the stempool to the mempool except when a transaction fluffs. As a result, a node's stempool should accept and propagate Dandelion transactions that depend on other unconfirmed normal mempool transactions. The behavior you described is not intended; if you have any tests demonstrating this behavior, would you mind sharing them?
Orphans: stem orphans can occur when a node on the stem shuffles its route between sending dependent transactions. One way to deal with this issue would be to re-broadcast all previous Dandelion transactions that have not been fluffed after Dandelion route shuffling. This could add a fair amount of data and logic. This re-broadcast method also telegraphs the fact that a Dandelion shuffle has taken place and can result in bursts of transactions depending on traffic patterns. A second option (which we used in the reference implementation) is to wait for the fluff phase to begin, at which point the orphans will be resolved. This should happen within 15 seconds for most transactions. Do you have any thoughts on which option would be more palatable? Or if there are other options we have missed?
Regarding preferred connections, we have found that making Dandelion routing decisions based on claims made by peer nodes can cause problems and therefore would recommend against biasing the peer selection code.
On the implementation side:
* We apply the same logic to the stempool as the mempool in the reference implementation. The stempool should remain a superset of the mempool to allow for proper handling of mempool-dependent transactions.
* We'll take a look at setDandelionInventoryKnown.
* We will look into using scheduler jobs instead of a separate thread--could you point us towards somewhere else in the code that uses a scheduler job?
Based on the feedback we have received so far, we are planning to prioritize writing up a clearer spec for node behavior in the BIP. Does that seem reasonable, or are there other issues that are more pressing at this point?
Cheers