-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: validate coordinator proposed bitcoin fees #1431
base: main
Are you sure you want to change the base?
feat: validate coordinator proposed bitcoin fees #1431
Conversation
Existing comments on this code can be found in the original PR of which this is half: |
/// transactions which are spending the signer's UTXO, then this function | ||
/// will return [`None`]. | ||
/// | ||
/// TODO: This method currently blindly assumes that the mempool transactions |
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.
Could you create an issue and add it to the TODO? I think it sounds reasonable to have a sanity check..
/// The maximum acceptable multiplier fee difference between the signer and | ||
/// coordinator estimates when the coordinator's estimate is greater than | ||
/// the signer's. | ||
const SIGNER_MAX_BITCOIN_FEE_MULTIPLIER: f64 = 5.0; |
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.
So I remember there being a discussion about config vs. not and landing in that these shouldn't be exposed as config. What's the thinking around having config for Stacks max transaction fee but not these parameters?
@@ -286,6 +316,7 @@ impl BitcoinPreSignRequest { | |||
btc_ctx: &BitcoinTxContext, | |||
requests: &'a TxRequestIds, | |||
signer_state: SignerBtcState, | |||
signers_view_of_last_fees: &mut Option<Fees>, |
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.
Hm, I'm not really following why this is &mut
and then you're clearing it at the end? Is it that you only want this to be provided for the first transaction in the event of chained utxo's in mempool? If so then I would probably change the for
loop above to use .enumerate()
and only provide this on the first iteration instead of doing this dance.
Description
Closes the Bitcoin half of: #1192
This PR is from another PR (#1392) that got split up to separate Bitcoin and Stacks behavior.
This part was separated from the Stacks half because there's an issue with the way the transaction will be represented in the Signer database when a transaction is marked as invalid based on the coordinator's proposed fee:
Changes
Testing Information
unit and integration tests
Checklist: