8000 simnet: Add per-match address tests and README. by JoeGruffins · Pull Request #3562 · decred/dcrdex · GitHub
[go: up one dir, main page]

Skip to content

simnet: Add per-match address tests and README.#3562

Open
JoeGruffins wants to merge 2 commits intodecred:masterfrom
JoeGruffins:udatesimnetharnesstests
Open

simnet: Add per-match address tests and README.#3562
JoeGruffins wants to merge 2 commits intodecred:masterfrom
JoeGruffins:udatesimnetharnesstests

Conversation

@JoeGruffins
Copy link
Member

Add four new simnet trade tests exercising the per-match swap address protocol:

  • notakeraddr: taker omits address, server faults taker
  • nomakeraddr: maker omits address, server faults maker
  • notakerredeem: taker fails to redeem after maker, taker penalized
  • missedcpaddr: taker disconnects before counterparty_address notification, reconnects, address re-delivered, trade completes

Enhance monitorOrderMatchingAndTradeNeg to verify every match receives a unique per-match SwapAddr, and monitorTrackedTrade to verify CounterPartyAddr is populated for matches that reach MakerSwapCast.

Add sendFilter to tConn for intercepting outgoing Send calls, and withRequestFilter/withSendFilter helpers for cleaner filter lifecycle management.

Document the per-match address design rationale in server/swap/swap.go and client/core/trade.go: unique addresses protect against a counterparty reusing one contract across matches, but the server does not enforce uniqueness since reusing your own address only weakens your own protection.

Add README for simnet-trade-tests with prerequisites, build instructions, all asset pairs, test descriptions, and troubleshooting.

@JoeGruffins JoeGruffins force-pushed the udatesimnetharnesstests branch from dfd5462 to 7de728c Compare March 11, 2026 11:16
Add four new simnet trade tests exercising per-match swap address
protocol: notakeraddr, nomakeraddr, notakerredeem, and missedcpaddr.
Enhance trade monitoring to verify per-match SwapAddr uniqueness and
CounterPartyAddr population. Add sendFilter to tConn and
withRequestFilter/withSendFilter helpers for cleaner filter lifecycle.

Fix polygon simnet FinalizeConfs (was 64, now 2 on simnet) so polygon
redeems confirm within the test timeout. Fix orderstatus test Badger
DB lock by disabling wallets after disconnect to prevent background
bond maintenance from reconnecting old wallets. Skip EVM balance
assertions in missedcpaddr test (same rationale as simpleTradeTest).

Clamp test order rates to the market minimum rate so markets like
zec_btc with high minimum rates don't reject orders. Bump ZEC simnet
maxFeeRate from 200 to 10000 to match the wallet's ZIP-317 fee rate.

Add new markets (LTC/DASH, DOGE/POLYGON, BCH/ETH, FIRO/BTC) to
enable running more test pairs in parallel without wallet conflicts.

Switch EVM harness connections from IPC to websocket endpoints in both
simnet trade tests and loadbot. Add build commit/dirty logging to the
run script. Add README for simnet-trade-tests.

Document per-match address design rationale in server/swap/swap.go
and client/core/trade.go.
The refund was passing the per-action fee rate (5000 zats) as the
absolute fee, but a refund tx has 2 logical actions under ZIP-317,
requiring 10,000 zats. Calculate the proper fee using TxFeesZIP317
based on actual input/output sizes.
@JoeGruffins JoeGruffins force-pushed the udatesimnetharnesstests branch from 7de728c to da5a22b Compare March 12, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0