-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: Fee estimation functional test cleanups #23075
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
c31068e
to
35bc69b
Compare
Rebased and addressed @theStack 's feedback from both here and #22539. But i forgot #22539 (comment), will address but i think it can start to be reviewed in the meantime. |
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.
Concept ACK
35bc69b
to
4eb027e
Compare
Rebased. Gave a look to replacing the use of the P2SH anyonecanspend by Miniwallet and it's actually a pretty invasive refactoring of the test. |
Concept ACK. In a future PR, I think the |
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
4eb027e
to
0db0907
Compare
Rebased. |
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.
overall looks good, nice cleanup. I think there's a commit diff reorg needed - feature_fee_estimation.py doesn't pass in 9d6a88e because it doesn't fully remove instances of SCRIPT_SIG
The issue is that |
Using 2 different scripts is unnecessary complication Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This simplifies the code, and slightly speeds up the test. Running `./test/functional/test_runner.py -j15 $(printf 'feature_fee_estimation %.0s' {1..15})` on master 3 times gives: - Before: ALL | ✓ Passed | 788 s (accumulated) ALL | ✓ Passed | 818 s (accumulated) ALL | ✓ Passed | 873 s (accumulated) - After: ALL | ✓ Passed | 763 s (accumulated) ALL | ✓ Passed | 798 s (accumulated) ALL | ✓ Passed | 731 s (accumulated) Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
We don't need dust outputs anymore. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
Followups to bitcoin#22539 Co-Authored-By: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
0db0907
to
60ae116
Compare
Thanks you both! Done. |
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.
Thank you for the pr. As a newcomer, I find it very educational to review.
I ACK all commits up to 60ae116 (except 1fc0315, where I have a question more for my own learning than actually questioning the PR). I built and ran the test successfully. I agree after the changes, the behavior is kept the same and the code is shorter and easier to reason.
self.confutxo = [ | ||
{"txid": txid, "vout": i, "amount": splitted_amount} | ||
for i in range(utxo_count) | ||
] | ||
while len(node.getrawmempool()) > 0: | ||
self.generate(node, 1, sync_fun=self.no_op) |
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.
Is the node "state" here expected to exactly the same before and after changes in 1fc0315? If so, how to test?
E.g. this is what I tried to compare:
- before
node.getbalance()
returns Decimal('1200.00000000')
len(node.listunspent())
returns 24
- after
node.getbalance()
returns Decimal('1150.00000000')
len(node.listunspent())
returns 23
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.
Is the node "state" here expected to exactly the same before and after changes in 1fc0315?
It's not. At least, it was not my intention.
|
||
# vbytes == bytes as we are using legacy transactions | ||
fee = tx.get_vsize() * feerate | ||
tx.vout[0].nValue -= fee | ||
|
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.
@darosior said "since we use legacy txs in this test it's indeed much cleaner" in #22539 (comment). Does this mean for non-legacy txs, we can no longer use the same logic fee = tx.get_vsize() * feerate
to calculate fee?
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.
#22539 (comment) was refering to using the length of the serialized transaction. This works only for legacy transactions as there is no witness data discount (hence 1 byte == 1 vbyte).
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.
utACK 60ae116
Light code re-review, commits all pass now. Thanks for addressing comments, sorry for the delay!
# Force fSendTrickle to true (via whitelist.noban) | ||
self.extra_args = [ | ||
["-acceptnonstdtxn", "-whitelist=noban@127.0.0.1"], | ||
["-acceptnonstdtxn", "-whitelist=noban@127.0.0.1", "-blockmaxweight=68000"], | ||
["-acceptnonstdtxn", "-whitelist=noban@127.0.0.1", "-blockmaxweight=32000"], |
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.
yus 🚀 big fan of removing -acceptnonstdtxn
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.
LGTM
P2SH_2 = script_to_p2sh_script(REDEEM_SCRIPT_2) | ||
SCRIPT = CScript([OP_1, OP_DROP]) | ||
P2SH = script_to_p2sh_script(SCRIPT) | ||
REDEEM_SCRIPT = CScript([OP_TRUE, SCRIPT]) |
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 the previous wording was correct. Redeem script refers to the thing that is hashed (serialized), see also BIP 16:
serialized script - also referred to as the redeemScript
Some cleanups that i noticed would be desirable while working on #23074 and #22539, which are intentionally not based on it. Mainly simplifications and a slight speedup.
2**9
coins instead of creating2**8
2-outputs transactions