Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Apr 22, 2021

By implementing segwit, it is already clear that all feerates in Bitcoin Core are denoted in (amount/virtual size). Though, there is inconsistency, as some places use kvB, some use kB. Thus, replace all with "kvB".

See also commit 6da3afb, which did the replacement for wallet RPCs.

@maflcko maflcko added the Docs label Apr 22, 2021
@maflcko maflcko changed the title scripted-diff: Clarify that feerates are per virtual size [doc] scripted-diff: Clarify that feerates are per virtual size Apr 22, 2021
Copy link
Contributor

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

What about:

Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</string>

--- a/src/qt/forms/sendcoinsdialog.ui
+++ b/src/qt/forms/sendcoinsdialog.ui
@@ -850,7 +850,7 @@
                    <property name="toolTip">
                     <string>Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size.
 
-Note:  Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</string>
+Note:  Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kvB" for a transaction size of 500 virtual bytes (half of 1 kvB) would ultimately yield a fee of only 50 satoshis.</string>
                    </property>
                    <property name="text">
                     <string>per kilobyte</string>

@jonatack
Copy link
Member

jonatack commented Apr 30, 2021

Concept ACK. I was hesitant to propose this across the codebase, as some reviewers prefered kB to kvB when I was working on the initial sat/vB fee_rate changes. A further possibility would be to replace "fee" with "fee rate" where the meaning is a fee rate and not a fee (credit to @xekyo for tuning my antennae to this).

@jonatack
Copy link
Member

jonatack commented Apr 30, 2021

There might be some remaining user-facing ones, grepping for "per kB".

src/init.cpp:541:    argsman.AddArg("-printpriority", strprintf("Log transaction fee per kB when mining blocks (default: %u)", DEFAULT_PRINTPRIORITY), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
src/wallet/rpcwallet.cpp:2295:                "\nSet the transaction fee per kB for this wallet. Overrides the global -paytxfee command line parameter.\n"
src/qt/forms/sendcoinsdialog.ui:851:                    <string>Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size.
src/qt/forms/sendcoinsdialog.ui:853:Note:  Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</string>

#20391 fixes the one in src/wallet/rpcwallet.cpp but we may as well do it here.

@jarolrod
Copy link
Contributor

@jonatack

src/qt/forms/sendcoinsdialog.ui:851: Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size.

That states "of the transaction's virtual size"

src/qt/forms/sendcoinsdialog.ui:853:Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.

Brought this one up here: #21752 (review)

@ghost
Copy link

ghost commented Apr 30, 2021

@jonatack

I was hesitant to propose this across the codebase, as some reviewers prefered vB to kvB when I was working on the initial sat/vB fee_rate changes.

vB will be better IMO

A further possibility would be to replace "fee" with "fee rate" where the meaning is a fee rate and not a fee

Agree

@maflcko maflcko changed the title [doc] scripted-diff: Clarify that feerates are per virtual size [doc] Clarify that feerates are per virtual size May 1, 2021
@maflcko maflcko changed the title [doc] Clarify that feerates are per virtual size doc: Clarify that feerates are per virtual size May 1, 2021
-BEGIN VERIFY SCRIPT-
sed -i 's|/kB|/kvB|g' $( git grep -l '/kB' ./src )
-END VERIFY SCRIPT-
@maflcko
Copy link
Member Author

maflcko commented May 1, 2021

Thanks, done

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK fae1961. Checked instances where units were being added in the second commit and they all looked right.

@maflcko maflcko merged commit 94f8353 into bitcoin:master May 11, 2021
@maflcko maflcko deleted the 2104-docFee branch May 11, 2021 09:59
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 11, 2021
<string>Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size.

Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</string>
Note: Since the fee is calculated on a per-byte basis, a fee rate of "100 satoshis per kvB" for a transaction size of 500 virtual bytes (half of 1 kvB) would ultimately yield a fee of only 50 satoshis.</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the addition of the word "rate"? I thought the word "rate" usually meant over time, like a frequency. Not sure why we need the word here, given that a fee is a one to one relationship to a TX.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're everywhere referring to fee/(v)byte as feerate.

gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants