-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: Babysit refund transactions. #3082
base: master
Are you sure you want to change the base?
Conversation
bee4875
to
9491c14
Compare
31a4c6b
to
c6f14c0
Compare
a50edc8
to
5a4b56a
Compare
Looks good! |
client/db/bolt/upgrades.go
Outdated
amb := []byte("matches") // archived matches | ||
|
||
var nRefunded int | ||
|
||
defer func() { | ||
upgradeLog.Infof("%d inactive refunded matches set to confirmed status", nRefunded) | ||
}() | ||
|
||
archivedMatchesBkt := dbtx.Bucket(amb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amb := []byte("matches") // archived matches | |
var nRefunded int | |
defer func() { | |
upgradeLog.Infof("%d inactive refunded matches set to confirmed status", nRefunded) | |
}() | |
archivedMatchesBkt := dbtx.Bucket(amb) | |
var nRefunded int | |
defer func() { | |
upgradeLog.Infof("%d inactive refunded matches set to confirmed status", nRefunded) | |
}() | |
archivedMatchesBkt := dbtx.Bucket(activeMatchesBucket) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to avoid using any outside variables in the upgrade, that way changes to surrounding code will not affect it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I should also apply this to matchKey and proofKey...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or did you mean to change to activeMatchesBucket
? I don't think those can be revoked yet?
client/core/trade.go
Outdated
if _, is := t.accountRefunder(); is { | ||
feeSuggestion = t.metaData.MaxFeeRate | ||
} else { | ||
feeSuggestion = t.redeemFeeSuggestion.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case would be incorrect, since it's using the fee suggestion for the redeem asset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah... I think I meant to come back to this. I guess doing the same as for redeems.
9dbd211
to
358a1bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been testing and I see a few issues:
- When I do ETH/BTC swap, the side that is redeeming BTC cannot confirm the redemption:
- When force a refund for eth, and then replace the transaction with another one with the same nonce, the popup for resubmitting the refund does not show up. If I restart
bisonw
, it shows up though. I tested this by using the test which I updated here: 0fe42e5 . You can update the seed and the nonce of the transaction that you want to have replaced, then run the test while waiting for the refund. Then you press enter right as the refund is submitted, and it will send a transaction with the same nonce, but a higher fee.
358a1bb
to
39ee55b
Compare
@martonp Sorry I didnt rebase before pushing changes. The first point is probably fixed by the change in trade.go here https://github.com/decred/dcrdex/compare/358a1bb86d500748e189738b2808244a3618e1e6..39ee55b05b201f3c2d85c9558ed8624c1bd56e6c I tried testing the replace transactions but I'm not sure if I'm blocking something bisonw needs for popups... I'll try some more. |
39ee55b
to
2eedfb3
Compare
Oh yeah, I'm only seeing the popup after restarting. hmmm... |
@martonp it is based on this timeout for a running instance dcrdex/client/asset/eth/eth.go Lines 108 to 110 in 0030e49
The tx should become stale and you will see the popup after that interval. You can reduce it ofc to check. |
ActionIDRedeemRejected = "redeemRejected" | ||
TopicRedeemRejected = "RedeemRejected" | ||
ActionIDRefundRejected = "refundRejected" | ||
TopicRefundRejected = "RefundRejected" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the UI the action was updated to txRejected
, so when these actions are sent, there is a UI error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, thanks. I guess keeping two here as handleCoreAction
needs them to be different. Reverting the js change and adding refundRejected
2eedfb3
to
aef1889
Compare
Adding refundRejected to js switch https://github.com/decred/dcrdex/compare/2eedfb3da5ea45204465d030c8fa63274c536489..aef18891dd3d51ffc43a56a16479c674bc0d8275 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is broken with both redemption and refund resubmission on ETH, even after I fix the bugs in the comments. Either the wrong nonce is used, or the transactions fail (status of transaction in receipt is 1).
const div = this.page.rejectedRedemptionTmpl.cloneNode(true) as PageElement | ||
txRejectedAction (req: ActionRequiredNote) { | ||
const { orderID, coinID, coinFmt, assetID, txType } = req.payload as RejectedTxData | ||
const div = this.page.rejectedTxTmpl.cloneNode(true) as PageElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is updated to rejectedTxTmpl
, but the html is not updated. Also the tx type label below needs to be added to the html.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure I updated this but it looks like I didn't commit changes.
client/core/core.go
Outdated
@@ -10712,23 +10712,31 @@ func (c *Core) handleRetryRedemptionAction(actionB []byte) error { | |||
coinID = match.MetaData.Proof.MakerRedeem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coinID needs to be the refund coin if this is retrying a refund.
aef1889
to
15ae009
Compare
It's asking me twice now to replace. Something is off. |
Failure is 0x00 status I think? |
This should fix the issue: 8d03288 |
Trying with the new harness changes and the thing mines a block if there is any transaction without telling it to. So, unable to get the replacement transaction in now. |
15ae009
to
9c5d74b
Compare
Fixing nonce error, but hard to test for me now https://github.com/decred/dcrdex/compare/15ae0091376ae4ea1d539f735778ea09fad51159..9c5d74bab7ceb582f6f12772a83458241c9d2204 |
closes #3063