Skip to content

Conversation

@Crypt-iQ
Copy link
Contributor

In the current mempool benchmarks, the coins were not being deleted from available_coins since Available rather than Available& was used. Also the lack of the reference meant that coin.vin_left++ only incremented the copy's variable rather than the one in the vector. The removal condition previously compared the coin's vin.size() to vin_left, when it should have been using vout.size(). I changed the MempoolCheck bench to instead use min_ancestors of 1 rather than 5 as otherwise an underflow could occur when calling coin.ref->vout.size() - coin.vin_left. This previously did not occur since vin_left was always 0 since a copy of the coin was used. Using 1 vs 5 shouldn't give too much of a difference since the test can still generate more than 1 (or 5) ancestors.

@maflcko
Copy link
Member

maflcko commented Apr 25, 2022

See also #23693

@DrahtBot DrahtBot added the Tests label Apr 25, 2022
@Crypt-iQ
Copy link
Contributor Author

With this change but without the min_ancestors = 1 change, the underflow would make my computer swap heavily and run out of disk space since n_to_take would be ~max unsigned long

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 25, 2022

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

Conflicts

No conflicts as of last run.

@Crypt-iQ
Copy link
Contributor Author

Crypt-iQ commented Apr 26, 2022

It seems like #24927 changes the mempoolcheck benchmark by using a PopulateMempool func, so this PR could actually just be a revert #23693 unless changing the ComplexMempool bench should instead be using something like PopulateMempool with "real" coins?

@Crypt-iQ
Copy link
Contributor Author

Rebased since MempoolCheck no longer relies on the coin creation

@achow101
Copy link
Member

cc @glozow

@Crypt-iQ
Copy link
Contributor Author

unfortunately don't have time to work on this, lmk if i should close it

Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

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

Agree these are correct bug fixes. It's unclear to me why #22856, but not this, has the underflow problem?

unless changing the ComplexMempool bench should instead be using something like PopulateMempool with "real" coins?

This function and PopulateMempool are quite similar. If PopulateMempool creates equally complex graphs of transactions, yeah, it probably makes sense to switch it over.

@achow101
Copy link
Member

unfortunately don't have time to work on this, lmk if i should close it

Closing as Up For Grabs.

@achow101 achow101 closed this Oct 28, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants