Skip to content
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

test: add missing comparison of node1's mempool in MempoolPackagesTest #29948

Merged
merged 1 commit into from May 10, 2024

Conversation

Umiiii
Copy link
Contributor

@Umiiii Umiiii commented Apr 24, 2024

#29941 Recreated a pull request because there was a conflict. Trying to resolve the conflict but the old one automatically closed.

Add missing comparison for TODO comments in mempool_packages.py

Also, notice that the ancestor size limits and descendant size limits actually implemented in #21800 , so I removed the todo for those two size limits.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 24, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK alfonsoromanz, kevkevinpal, rkrux, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28676 ([WIP] Cluster mempool implementation by sdaftuar)

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.

@DrahtBot DrahtBot added the Tests label Apr 24, 2024
Copy link
Contributor

@alfonsoromanz alfonsoromanz left a comment

Choose a reason for hiding this comment

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

Tested ACK e912717. The code looks good to me and the test execution is successful.

@kevkevinpal
Copy link
Contributor

ACK e912717

looks good to me

@Umiiii
Copy link
Contributor Author

Umiiii commented Apr 27, 2024

Hello everyone,
Could you please confirm if it is ready for merging, or does it require further reviews?

@fjahr
Copy link
Contributor

fjahr commented Apr 27, 2024

@Umiiii I am not sure why you are asking me because I am not familiar with this change yet. I'm sure a maintainer will take a look at this change soon. You need to have a bit of patience though, there are a lot of open PRs and Issues and this being open for 3 days is not a very long time. And in general, more review is always better, 3 ACKs is the rule of thumb for simple but non-trivial changes.

And please remove the @ mentions in your commit message. The commit message is merged with the change and that leads to a lot of unnecessary notifications for those that are tagged.

Copy link

@rkrux rkrux left a comment

Choose a reason for hiding this comment

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

tACK e912717

Make successful, all functional tests pass. Left couple suggestions.
Also for some reason checking out this PR using this method doesn't work, I had to checkout this particular commit instead. Is it because the forked repo's branch is also called master?
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


# TODO: test ancestor size limits
entry0 = self.nodes[0].getmempoolentry(tx)
entry1 = self.nodes[1].getmempoolentry(tx)
Copy link

Choose a reason for hiding this comment

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

With this, isn't the check on line 201 redundant now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mempool1 only stores string(txid), while getmempoolentry contains more information that we need to check, so no, it is not redundant. Also see: https://developer.bitcoin.org/reference/rpc/getmempoolentry.html

Copy link

Choose a reason for hiding this comment

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

Hmm so not redundant keeping in mind that testing getrawmempool is also needed, got it.

@@ -251,10 +251,14 @@ def run_test(self):
assert tx in mempool1
for tx in chain[CUSTOM_DESCENDANT_LIMIT:]:
assert tx not in mempool1
# TODO: more detailed check of node1's mempool (fees etc.)

# TODO: test descendant size limits
Copy link

Choose a reason for hiding this comment

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

Where is this done? Can you share link?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

You mean in mempool_package_limits?

Comment on lines +255 to +261
entry0 = self.nodes[0].getmempoolentry(tx)
entry1 = self.nodes[1].getmempoolentry(tx)
assert not entry0['unbroadcast']
assert not entry1['unbroadcast']
assert_equal(entry1['fees']['base'], entry0['fees']['base'])
assert_equal(entry1['vsize'], entry0['vsize'])
assert_equal(entry1['depends'], entry0['depends'])
Copy link

Choose a reason for hiding this comment

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

Nit: This portion is copy-paste of the above block, can be extracted in a function compareMempoolsEntry(entry0, entry1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's on purpose, just to align with the existing coding style within this file (and other testing code). Those unit tests don't actually introduce new functions while comparing two entries (and the entries' variables).

Copy link

@rkrux rkrux left a comment

Choose a reason for hiding this comment

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

Thanks for quick responses.

@achow101
Copy link
Member

ACK e912717

@achow101 achow101 merged commit 7066980 into bitcoin:master May 10, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants