-
Notifications
You must be signed in to change notification settings - Fork 210
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
add user determined fees to peg-outs #276
Conversation
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.
nice, I think the fetch_peg_out_fees
naming is a bit confusing tough
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.
Great PR! Just a few questions :)
2501d55
to
f54c256
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.
Only reviewed the diff since my last review, only two nits, otherwise LGTM. Waiting for @justinmoon to take a look.
client/client-lib/src/mint/mod.rs
Outdated
); | ||
let txid = final_tx.tx_hash(); | ||
let mint_tx_id = self.context.api.submit_transaction(final_tx).await?; | ||
// TODO: make check part of submit_transaction |
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 think we can remove that TODO now 😄
|
||
tx.build(self.context.secp, &mut rng) | ||
self.context.db.apply_batch(batch).expect("DB 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.
From a crash-safety pov we should first save and then submit imo. But that's a bigger issue (#35) and could be a separate PR, just something we need to keep in mind.
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.
Isn't it the other way around? If the tx fails we shouldn't change anything in the DB?
I thought this PR was fixing #35
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 think what we want is:
- "Stage" tx in DB (this PR introduces this intermediate state)
- Submit tx
- If an error occurs either on submit or the tx isn't confirmed for some reason we can later rollback the staged tx in the client DB. If the tx succeeds we finalize the staged tx in the client DB.
I assumed this apply_batch
invocation was for step 1, but maybe I'm mistaken?
f54c256
to
eb9d05d
Compare
LGTM. I sent kitman a couple messages on discord. In general it would be nicer to have smaller commits (I make huge commits too, working on it!). But looks like a great improvement. |
98e732d
to
a1142e4
Compare
a1142e4
to
138851e
Compare
Stops the fed from crashing due to peg-outs (fixes step 1 in #233)
FeeConsensus
(target confirmation time = 10 blocks) and the calculated transaction weight (no more profits/losses).TransactionStatus::Rejected
, allowing clients react to tx errors.reissue_pending_coins
if a tx is rejected (fixes Make client architecture crash-safe #35)