⚠️ maflcko reopened an issue: "assumeutxo: nTx and nChainTx violations in CheckBlockIndex"
(https://github.com/bitcoin/bitcoin/issues/29261)
When disabling the "test-only" assumptions in CheckBlockIndex, the check fails. This is problematic, because test-only code should not affect the behavior of the program in production.
Current diff:
```diff
diff --git a/src/validation.cpp b/src/validation.cpp
index 8c583c586c..00d7ee3736 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -4866,9 +4866,9 @@ void ChainstateManager::CheckBlockIndex()
unsigned int prev_chain_tx = pindex->pprev ? pindex->pprev->nChainTx
...
(https://github.com/bitcoin/bitcoin/issues/29261)
When disabling the "test-only" assumptions in CheckBlockIndex, the check fails. This is problematic, because test-only code should not affect the behavior of the program in production.
Current diff:
```diff
diff --git a/src/validation.cpp b/src/validation.cpp
index 8c583c586c..00d7ee3736 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -4866,9 +4866,9 @@ void ChainstateManager::CheckBlockIndex()
unsigned int prev_chain_tx = pindex->pprev ? pindex->pprev->nChainTx
...
💬 maflcko commented on issue "assumeutxo: nTx and nChainTx violations in CheckBlockIndex":
(https://github.com/bitcoin/bitcoin/issues/29261#issuecomment-1918947945)
> test
Good idea.
On top of https://github.com/bitcoin/bitcoin/pull/29354 , the following diff should crash the node:
```diff
diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py
index 528680f2ca..e9d74ea132 100755
--- a/test/functional/feature_assumeutxo.py
+++ b/test/functional/feature_assumeutxo.py
@@ -165,6 +165,14 @@ class AssumeutxoTest(BitcoinTestFramework):
self.mini_wallet.send_self_transfer(from_node=n0)
...
(https://github.com/bitcoin/bitcoin/issues/29261#issuecomment-1918947945)
> test
Good idea.
On top of https://github.com/bitcoin/bitcoin/pull/29354 , the following diff should crash the node:
```diff
diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py
index 528680f2ca..e9d74ea132 100755
--- a/test/functional/feature_assumeutxo.py
+++ b/test/functional/feature_assumeutxo.py
@@ -165,6 +165,14 @@ class AssumeutxoTest(BitcoinTestFramework):
self.mini_wallet.send_self_transfer(from_node=n0)
...
🤔 theStack reviewed a pull request: "test: fix intermittent failure in p2p_v2_earlykeyresponse"
(https://github.com/bitcoin/bitcoin/pull/29352#pullrequestreview-1853577256)
Concept ACK
I think you need to also initialize the newly introduced variable in the `PeerEarlyKey` constructor, otherwise the following can happen in the `wait_until` loop:
```
AttributeError: 'PeerEarlyKey' object has no attribute 'connection_made2'
```
(https://github.com/bitcoin/bitcoin/pull/29352#pullrequestreview-1853577256)
Concept ACK
I think you need to also initialize the newly introduced variable in the `PeerEarlyKey` constructor, otherwise the following can happen in the `wait_until` loop:
```
AttributeError: 'PeerEarlyKey' object has no attribute 'connection_made2'
```
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472767521)
Added
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472767521)
Added
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472768478)
Yes, fixed here and other place I did the same.
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472768478)
Yes, fixed here and other place I did the same.
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472775391)
> Maybe add tests where you (successfully) configure the node's wallet using -maxfeerate?
I dont understand what you mean by successfully configure nodes wallet.
The test you are commenting on configure node[0] with the `-maxfeerate` option.
Could you clarify your comment, thanks.
---
> Similarly, it would be good to test that both maxfee and maxfeerate requirements must be met.
Their is a test for `maxtxfee` already, and I added one for `maxfeerate`.
https://github.com/bitcoin/b
...
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472775391)
> Maybe add tests where you (successfully) configure the node's wallet using -maxfeerate?
I dont understand what you mean by successfully configure nodes wallet.
The test you are commenting on configure node[0] with the `-maxfeerate` option.
Could you clarify your comment, thanks.
---
> Similarly, it would be good to test that both maxfee and maxfeerate requirements must be met.
Their is a test for `maxtxfee` already, and I added one for `maxfeerate`.
https://github.com/bitcoin/b
...
💬 josibake commented on pull request "Silent Payments: Implement BIP352":
(https://github.com/bitcoin/bitcoin/pull/28122#discussion_r1472778222)
Output calculation doesn't depend on the position, but using output position makes the implementation much simpler. I did try something similar to what you suggested but it ended up being really complicated to make sure I was matching up all the right amounts and was always _implicitly_ relying on output position. @achow101 pointed out it would be better and simpler to just use the output index explicitly.
This also doesn't create any dependence on output position. The user can still order th
...
(https://github.com/bitcoin/bitcoin/pull/28122#discussion_r1472778222)
Output calculation doesn't depend on the position, but using output position makes the implementation much simpler. I did try something similar to what you suggested but it ended up being really complicated to make sure I was matching up all the right amounts and was always _implicitly_ relying on output position. @achow101 pointed out it would be better and simpler to just use the output index explicitly.
This also doesn't create any dependence on output position. The user can still order th
...
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472785028)
`relayMinFee` is relative to the fee rate of the transaction. I believe I did the right thing by removing it and enforcing this check on `-maxfeerate` instead.
I don't think we should use the base fee value as a quantifier for the fee rate, as transaction sizes differ.
This is indicated in the issue description #29220.
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472785028)
`relayMinFee` is relative to the fee rate of the transaction. I believe I did the right thing by removing it and enforcing this check on `-maxfeerate` instead.
I don't think we should use the base fee value as a quantifier for the fee rate, as transaction sizes differ.
This is indicated in the issue description #29220.
💬 josibake commented on pull request "Silent Payments: Implement BIP352":
(https://github.com/bitcoin/bitcoin/pull/28122#issuecomment-1919057289)
> Started reviewing. Basic question first. Which RPCs are supposed to work at this stage? I was under impression, that none RPCs should understand SP addresses yet and the support come with send and receiving PRs.
Thanks for the review @S3RK ! The goal isn't that none of the RPCs should understand SP addresses, rather the goal is that _full_ RPC support is deferred to the send and receiving PRs.
> But since you've registered SP destination in `CTXDestination` variant, the SP addresses wou
...
(https://github.com/bitcoin/bitcoin/pull/28122#issuecomment-1919057289)
> Started reviewing. Basic question first. Which RPCs are supposed to work at this stage? I was under impression, that none RPCs should understand SP addresses yet and the support come with send and receiving PRs.
Thanks for the review @S3RK ! The goal isn't that none of the RPCs should understand SP addresses, rather the goal is that _full_ RPC support is deferred to the send and receiving PRs.
> But since you've registered SP destination in `CTXDestination` variant, the SP addresses wou
...
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472790897)
Thanks for highlighting this issue @josibake , I agree with your `BroadcastTransaction` should enforce check on both.
This will make `sendrawtransaction` returns a specific error message.
---
For this reason
`MAX_FEE_RATE_EXCEEDED` error string is now `Fee exceeds maximum configured by user.`
because if I add the option `maxtxfee` it will be misleading for in `sendrawtransaction` output
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472790897)
Thanks for highlighting this issue @josibake , I agree with your `BroadcastTransaction` should enforce check on both.
This will make `sendrawtransaction` returns a specific error message.
---
For this reason
`MAX_FEE_RATE_EXCEEDED` error string is now `Fee exceeds maximum configured by user.`
because if I add the option `maxtxfee` it will be misleading for in `sendrawtransaction` output
💬 josibake commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472810952)
I think the check needs to be enforced on both, since we are letting a user set one or the other (or both). Removing the check entirely for one of the options feels like a regression.
It's a good point that using the base fee value as a quantifier is not ideal, but previously this code was checking that the user did not set a `maxtxfee` that was so low that the minrelay fee could never be met. Now you've removed that check, which means I can set a very low `maxtxfee` and not get a warning.
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472810952)
I think the check needs to be enforced on both, since we are letting a user set one or the other (or both). Removing the check entirely for one of the options feels like a regression.
It's a good point that using the base fee value as a quantifier is not ideal, but previously this code was checking that the user did not set a `maxtxfee` that was so low that the minrelay fee could never be met. Now you've removed that check, which means I can set a very low `maxtxfee` and not get a warning.
💬 josibake commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472815229)
Better to keep the option name in the error message:
```suggestion
return Untranslated("Fee exceeds maximum configured by user (maxtxfee)");
```
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472815229)
Better to keep the option name in the error message:
```suggestion
return Untranslated("Fee exceeds maximum configured by user (maxtxfee)");
```
📝 maflcko opened a pull request: "doc: Assert that assumed-valid blocks are not fully valid in CheckBlockIndex()"
(https://github.com/bitcoin/bitcoin/pull/29355)
It does not make sense for a block to be fully-valid and assumed-valid at the same time.
Check it in `CheckBlockIndex()` and fix the tests that violate this assumption.
(https://github.com/bitcoin/bitcoin/pull/29355)
It does not make sense for a block to be fully-valid and assumed-valid at the same time.
Check it in `CheckBlockIndex()` and fix the tests that violate this assumption.
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472820140)
Yes but I think should come in a follow-up after cleaning up your suggestion here
https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472790897
I have a local branch that does this on top of this.
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472820140)
Yes but I think should come in a follow-up after cleaning up your suggestion here
https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472790897
I have a local branch that does this on top of this.
💬 sdaftuar commented on pull request "v3 transaction policy for anti-pinning":
(https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1472822671)
@glozow's analysis looks right to me. I don't think it matters too much way we go -- either we should update the code comments to explain that correctness relies on invoking ApplyV3Rules and PV3C on package transactions, or we can just leave the duplicate check in here so that PV3C stands on its own for package validation. I'd probably vote for just updating the comment but I don't feel strongly either way.
(https://github.com/bitcoin/bitcoin/pull/28948#discussion_r1472822671)
@glozow's analysis looks right to me. I don't think it matters too much way we go -- either we should update the code comments to explain that correctness relies on invoking ApplyV3Rules and PV3C on package transactions, or we can just leave the duplicate check in here so that PV3C stands on its own for package validation. I'd probably vote for just updating the comment but I don't feel strongly either way.
💬 sipa commented on pull request "wallet: Add CoinGrinder coin selection algorithm":
(https://github.com/bitcoin/bitcoin/pull/27877#discussion_r1472836168)
Sounds good.
(https://github.com/bitcoin/bitcoin/pull/27877#discussion_r1472836168)
Sounds good.
💬 ismaelsadeeq commented on pull request "Wallet: Add `maxfeerate` wallet startup option":
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472858661)
> Removing the check entirely for one of the options feels like a regression.
I don't think its a regression because this is the right behavior to check if the maximum fee rate we set is < minimum relay fee rate.
> but previously this code was checking that the user did not set a `maxtxfee` that was so low that the minrelay fee could never be met. Now you've removed that check, which means I can set a very low maxtxfee and not get a warning.
With the assumption of 1k vb size, transac
...
(https://github.com/bitcoin/bitcoin/pull/29278#discussion_r1472858661)
> Removing the check entirely for one of the options feels like a regression.
I don't think its a regression because this is the right behavior to check if the maximum fee rate we set is < minimum relay fee rate.
> but previously this code was checking that the user did not set a `maxtxfee` that was so low that the minrelay fee could never be met. Now you've removed that check, which means I can set a very low maxtxfee and not get a warning.
With the assumption of 1k vb size, transac
...
💬 epiccurious commented on pull request "test: Handle functional test disk-full error":
(https://github.com/bitcoin/bitcoin/pull/29335#issuecomment-1919164884)
utACK
(https://github.com/bitcoin/bitcoin/pull/29335#issuecomment-1919164884)
utACK
📝 hernanmarino converted_to_draft a pull request: "assumeutxo, rpc: Add 'start' parameter to loadtxoutset"
(https://github.com/bitcoin/bitcoin/pull/28659)
Might fix https://github.com/bitcoin/bitcoin/issues/28620
This PR only modifies the behavior of loadtxoutset to require a mandatory "start" string as a first parameter.
This change will allow to implement "status", "abort" or similar future parameters in follow-ups, without breaking the current RPC protocol with incompatible changes (if this were to be merged in the current release cycle)
Also, it is implemented in a minimalist way, to make it easy to review.
(https://github.com/bitcoin/bitcoin/pull/28659)
Might fix https://github.com/bitcoin/bitcoin/issues/28620
This PR only modifies the behavior of loadtxoutset to require a mandatory "start" string as a first parameter.
This change will allow to implement "status", "abort" or similar future parameters in follow-ups, without breaking the current RPC protocol with incompatible changes (if this were to be merged in the current release cycle)
Also, it is implemented in a minimalist way, to make it easy to review.
💬 theStack commented on pull request "test: p2p: adhere to typical VERSION message protocol flow":
(https://github.com/bitcoin/bitcoin/pull/29353#issuecomment-1919238556)
Squashed the last two commits, as the second to last commit failed without the last bugfix commit ("test: p2p: process post-v2-handshake data immediately"); this should hopefully make the "test each commit" CI target happy.
(https://github.com/bitcoin/bitcoin/pull/29353#issuecomment-1919238556)
Squashed the last two commits, as the second to last commit failed without the last bugfix commit ("test: p2p: process post-v2-handshake data immediately"); this should hopefully make the "test each commit" CI target happy.