simnet: Add per-match address tests and README.#3562
Open
JoeGruffins wants to merge 2 commits intodecred:masterfrom
Open
simnet: Add per-match address tests and README.#3562JoeGruffins wants to merge 2 commits intodecred:masterfrom
JoeGruffins wants to merge 2 commits intodecred:masterfrom
Conversation
dfd5462 to
7de728c
Compare
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.
7de728c to
da5a22b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add four new simnet trade tests exercising the per-match swap address protocol:
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.