This PR renames the default in-mempool max ancestors/descendants constants MAX_ANCESTORS/MAX_DESCENDANTS in the functional tests to match the ones in the codebase:
https://github.com/bitcoin/bitcoin/blob/c012875b9ded0a5183602f002738ca823d559518/src/policy/policy.h#L58-L59
https://github.com/bitcoin/bitcoin/blob/c012875b9ded0a5183602f002738ca823d559518/src/policy/policy.h#L62-L63
The custom limit constants MAX_ANCESTORS_CUSTOM/MAX_DESCENDANTS_CUSTOM are also renamed accordingly to better fit to this naming style. In the second commit, the default constants are deduplicated by moving them into the messages.py module. (Not sure if this module is really appropriate, as it doesn't have a connection to messages. If someone has a good suggestion, would be glad to hear it.)
scripted-diff: test: rename `MAX_{ANCESTORS,DESCENDANTS}` to `DEFAULT_{ANCESTOR,DESCENDANT}_LIMIT` #25810
pull theStack wants to merge 2 commits into bitcoin:master from theStack:202208-test-rename_default_ancestor_descendant_limits changing 3 files +35 −30-
theStack commented at 1:13 PM on August 9, 2022: contributor
-
0fda1c7df6
scripted-diff: test: rename `MAX_{ANCESTORS,DESCENDANTS}` to `DEFAULT_{ANCESTOR,DESCENDANT}_LIMIT`
-BEGIN VERIFY SCRIPT- ren() { sed -i "s:$1:$2:g" $(git grep -l "$1" ./test); } ren MAX_ANCESTORS_CUSTOM CUSTOM_ANCESTOR_LIMIT ren MAX_DESCENDANTS_CUSTOM CUSTOM_DESCENDANT_LIMIT ren MAX_ANCESTORS DEFAULT_ANCESTOR_LIMIT ren MAX_DESCENDANTS DEFAULT_DESCENDANT_LIMIT -END VERIFY SCRIPT- -
test: refactor: deduplicate `DEFAULT_{ANCESTOR,DESCENDANT}_LIMIT` constants b4a5ab96b4
- theStack force-pushed on Aug 9, 2022
- fanquake added the label Tests on Aug 9, 2022
- fanquake requested review from glozow on Aug 9, 2022
-
DrahtBot commented at 10:40 PM on August 9, 2022: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #25792 (test: add tests for
datacarrieranddatacarriersizeoptions by w0xlt)
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.
- #25792 (test: add tests for
- w0xlt approved
-
w0xlt commented at 1:07 AM on August 10, 2022: contributor
-
glozow commented at 11:47 AM on August 10, 2022: member
utACK b4a5ab96b42957a0e2110525b9e2e450deda09c1
-
glozow commented at 11:57 AM on August 10, 2022: member
In the second commit, the default constants are deduplicated by moving them into the messages.py module. (Not sure if this module is really appropriate, as it doesn't have a connection to messages. If someone has a good suggestion, would be glad to hear it.)
This seems fine given non-p2p-protocol constants like
MAX_BIP125_RBF_SEQUENCEandCOINare there. Pinging to see if @MarcoFalke has some vision for organizing this kind of stuff. - fanquake approved
-
fanquake commented at 3:53 PM on August 10, 2022: member
ACK b4a5ab96b42957a0e2110525b9e2e450deda09c1
- MarcoFalke merged this on Aug 10, 2022
- MarcoFalke closed this on Aug 10, 2022
- sidhujag referenced this in commit f8036f6e26 on Aug 11, 2022
- theStack deleted the branch on Aug 11, 2022
- bitcoin locked this on Aug 11, 2023