-
Notifications
You must be signed in to change notification settings - Fork 102
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
server/{db,swap},client/core: no maker redemption ack, no redeem confs #706
Conversation
bRedeemTime INT8, -- server time stamp | ||
aSigAckOfBRedeem BYTEA -- counterparty's (initiator) sig with ack of participant REDEEM data | ||
bRedeemTime INT8 -- server time stamp | ||
)` | ||
|
||
RetrieveSwapData = `SELECT status, sigMatchAckMaker, sigMatchAckTaker, | ||
aContractCoinID, aContract, aContractTime, bSigAckOfAContract, | ||
bContractCoinID, bContract, bContractTime, aSigAckOfBContract, | ||
aRedeemCoinID, aRedeemSecret, aRedeemTime, bSigAckOfARedeem, | ||
bRedeemCoinID, bRedeemTime, aSigAckOfBRedeem |
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.
Fortunately an explicit upgrade is not required since there are no select *
queries where the number of columns is implicit.
RedeemAAckTime int64 // time that B's signature of redeem A data was received | ||
RedeemBCoinID []byte | ||
RedeemBTime int64 | ||
RedeemBAckSig []byte // A's signature of redeem B data | ||
RedeemBAckTime int64 // time that A's signature of redeem B data was received |
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.
The AckTimes were never stored.
3d666a5
to
d7f8e2d
Compare
I have no further changes in mind for this PR. It has the potential to break stuff since it redefines match "completion" on both client and server, but it also fixes issues noted in #692 |
480a90a
to
51c7927
Compare
51c7927
to
0bf6beb
Compare
0bf6beb
to
4abca25
Compare
if dbMatch.Side == order.Taker { | ||
err = t.processMakersRedemption(match, redemption.CoinID, redemption.Secret) | ||
if err != nil { | ||
errs.addErr(err) | ||
} | ||
} | ||
// The server does not send a redemption request to the maker for the | ||
// taker's redeem since match negotiation is complete server-side when the | ||
// taker redeems, and it is complete client-side when we redeem. If we are | ||
// both sides, there is another trackedTrade and matchTracker for that side. |
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.
Now client will not even respond if it gets a redemption request as maker. We'll have to updated server pronto when this is merged.
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.
Correction, it still responds (t.dc.ack
above), it just doesn't record the TakerRedeem coin anymore. No server update urgency.
NOTE: This PR is now targeting on the
status-integ
.server/db
aSigAckOfBRedeem
column from matches table.active = FALSE
. Previously this was set when both redemption acks were received.Now any match in the table with status
MatchComplete
will also be inactive. Previously matches could be (and often were)MatchComplete
but also active. This was not great.server/swap
processBlock
no longer checks the redeem txns for their confirmations. We were checking against swapConf, but confirmations on the redeem txns never were important, only that both parties could author and bcast their redeem txns (the secret was shared and both parties used it to spend the respective contract outputs).processBlock
just checks swap txns against swapConf, and it now unlocks the order funding coins for the order when the swap txn that spent them reaches swapConf (previously it waited to do this when the entire match was completed). This reflects the "event-based" and "block-based" inaction check distinction.processRedeem
is now the spot where a match is deleted, when the taker's redeem is validated (whenMatchComplete
andactive=FALSE
are set). Note that this means there will no longer be matches inSwapper
memory withMatchComplete
status.processRedeem
now does the cancellation rate accounting that was previously done inprocessAck
since it is the'redeem'
validation that marks the end of the match for the user, not the redemption ack.processRedeem
no longer sends a'redemption'
request to the maker.processAck
no longer processes'redemption'
acks from the maker.UPDATE for
status-integ
rebase:client/core
'redemption'
request following taker's redeem to move toMatchComplete
.MakerRedeemed
if their'redeem'
request following the actual broadcast fails, otherwise they jump straight toMatchComplete
. This is switched byauth.RedeemSig
.MatchProof.IsRevoked
in logging statements not being called as a function.