decred / dcrdex

The Decred Decentralized Exchange (DEX), powered by atomic-swaps.
Other
187 stars 100 forks source link

test/dcr: Add `--rejectnonstd` flag to dcrd simnet harness. #1122

Open JoeGruffins opened 3 years ago

JoeGruffins commented 3 years ago

Good stuff, but oh boy did this give the user a hell of a foot-gun, especially with Decred where a non-final txn like the refund can enter mempool before locktime to wait for mining

Ah, I forgot that this is because only on Decred's mainnet are non-standard transactions blocked from entering mempool or being relayed! Only on testnet and simnet should this be a problem. And it should help use test out the edge cases.

https://github.com/decred/dcrd/blob/2e8efe15a335f654ccacbef23ae8616181ae20a3/internal/mempool/mempool.go#L1307-L1312

We might consider running our dcrd harness with --rejectnonstd to match mainnet. Needs some thought.

https://github.com/decred/dcrd/blob/2e8efe15a335f654ccacbef23ae8616181ae20a3/internal/mempool/policy.go#L315-L319

Originally posted by @chappjc in https://github.com/decred/dcrdex/pull/1110#issuecomment-875102779

chappjc commented 3 years ago

On a related note, I suspect had we used --rejectnonstd with all networks, we would have been forced to reckon with the locktime expiry issue you fixed so efficiently in https://github.com/decred/dcrdex/pull/1099 and https://github.com/decred/dcrdex/pull/1058 much earlier.