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

backport: Merge #23517,23546,23703 (scripted diff) #5685

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

vijaydasmp
Copy link

@vijaydasmp vijaydasmp commented Nov 8, 2023

-BEGIN VERIFY SCRIPT-
git grep -l GetArg | xargs sed -i 's/GetArg(([^)]*( [0-9]+|-1|port|BaseParams().RPCPort()|Params().GetDefaultPort()|_TIMEOUT|Height|_WORKQUEUE|_THREADS|_CONNECTIONS|LIMIT|SigOp|Bytes|_VERSION|_AGE|_CHECKS|Checks() ? 1 :
0|_BANTIME|Cache|BLOCKS|LEVEL|Weight|Version|BUFFER|TARGET|WEIGHT|TXN|TRANSACTIONS|ADJUSTMENT|i64|Size|nDefault|_EXPIRY|HEIGHT|SIZE|SNDHWM|_TIME_MS)))/GetIntArg(\1)/g'
-END VERIFY SCRIPT-

Copy link

This pull request has conflicts, please rebase.

@knst
Copy link
Collaborator

knst commented Nov 24, 2023

I feel like it is not good idea for rushing with backports such as "merge bitcoin#22976: Rename overloaded int GetArg to GetIntArg"

By rough estimation, there are more than 500 older backports waiting their turn to be done and any backport from that queue that uses an old version of GetArg will create an extra conflict that requires manual resolving.

Of course, each particular fix in each particular case is trivial, the compiler even will show it as a compilation error, so, it won't cause any real issue.

But disadvantage of doing bitcoin#22976 at this moment is an overall slowdown of backporting process. Current backport status of full coverage (98-99%) at this point in v21:

Q_Staged (merged to knstqq local repo) ae32e5c Merge bitcoin#18669: log: Use Join() helper when listing log categories FALSE 8/21/2023 3 3 FALSE

If get list all of commit between them 22976 and 18669:

 git rev-list --ancestry-path ae32e5ce3d..825f4a64e612dab62cd0a73b2afe32dac5e0c69f

and grep 'GetArg' after that:

git rev-list --ancestry-path ae32e5ce3d..825f4a64e612dab62cd0a73b2afe32dac5e0c69f^ | xargs git show  | grep "\<GetArg\>"  | grep '^[+-]' -c
477

There's 477 particular usage of GetArg and even assuming that 50% of this changes are already backported, it is still huge amount.

It means that all trivial changes such as this https://github.com/bitcoin/bitcoin/pull/21056/files

+    const int timeout = gArgs.GetArg("-rpcwaittimeout", DEFAULT_WAIT_CLIENT_TIMEOUT);
+    const int64_t deadline = GetTime<std::chrono::seconds>().count() + timeout;

will require one extra manual conflict resolving/compilation fix.

@vijaydasmp may I ask you to don't backports any big refactorings such as this one (especially scripted-diffs that affect hundreds of lines) from v22 or newer bitcoin version while the gap is that big yet?

@vijaydasmp
Copy link
Author

I feel like it is not good idea for rushing with backports such as "merge bitcoin#22976: Rename overloaded int GetArg to GetIntArg"

By rough estimation, there are more than 500 older backports waiting their turn to be done and any backport from that queue that uses an old version of GetArg will create an extra conflict that requires manual resolving.

Of course, each particular fix in each particular case is trivial, the compiler even will show it as a compilation error, so, it won't cause any real issue.

But disadvantage of doing bitcoin#22976 at this moment is an overall slowdown of backporting process. Current backport status of full coverage (98-99%) at this point in v21:

Q_Staged (merged to knstqq local repo) ae32e5c Merge bitcoin#18669: log: Use Join() helper when listing log categories FALSE 8/21/2023 3 3 FALSE

If get list all of commit between them 22976 and 18669:

 git rev-list --ancestry-path ae32e5ce3d..825f4a64e612dab62cd0a73b2afe32dac5e0c69f

and grep 'GetArg' after that:

git rev-list --ancestry-path ae32e5ce3d..825f4a64e612dab62cd0a73b2afe32dac5e0c69f^ | xargs git show  | grep "\<GetArg\>"  | grep '^[+-]' -c
477

There's 477 particular usage of GetArg and even assuming that 50% of this changes are already backported, it is still huge amount.

It means that all trivial changes such as this https://github.com/bitcoin/bitcoin/pull/21056/files

+    const int timeout = gArgs.GetArg("-rpcwaittimeout", DEFAULT_WAIT_CLIENT_TIMEOUT);
+    const int64_t deadline = GetTime<std::chrono::seconds>().count() + timeout;

will require one extra manual conflict resolving/compilation fix.

@vijaydasmp may I ask you to don't backports any big refactorings such as this one (especially scripted-diffs that affect hundreds of lines) from v22 or newer bitcoin version while the gap is that big yet?

Thanks I will drop this commit for now, will make use of above command to efficiently backport

-BEGIN VERIFY SCRIPT-
 # Move module
 git mv src/miner.cpp src/node/
 git mv src/miner.h   src/node/
 # Replacements
 sed -i 's:miner\.h:node/miner.h:g'     $(git grep -l miner)
 sed -i 's:miner\.cpp:node/miner.cpp:g' $(git grep -l miner)
 sed -i 's:MINER_H:NODE_MINER_H:g'      $(git grep -l MINER_H)
-END VERIFY SCRIPT-
…d arguments (tests only)

-BEGIN VERIFY SCRIPT-
 perl -0777 -pi -e 's:((\(|\{|,)(\n| )*)\/\* ?([^=* ]+) ?\*\/
?:\1/*\4=*/:g' $( git ls-files ./src/test ./src/wallet/test )
-END VERIFY SCRIPT-
-BEGIN VERIFY SCRIPT-
 sed -i -e 's|, /\* optional \*/ true,|, /*optional=*/true,|g' $( git
grep -l ', /\* optional \*/ true,' )
-END VERIFY SCRIPT-
…ntion of boost

-BEGIN VERIFY SCRIPT-
FILES=$(git ls-files src/qt)
sed -i 's/boostPathToQString/PathToQString/g' -- $FILES
sed -i 's/qstringToBoostPath/QStringToPath/g' -- $FILES
-END VERIFY SCRIPT-
@vijaydasmp vijaydasmp changed the title backport: Merge #22976 backport: Merge #23456 Nov 25, 2023
@vijaydasmp vijaydasmp changed the title backport: Merge #23456 backport: Merge #23517,23546,23703 Nov 25, 2023
@vijaydasmp
Copy link
Author

vijaydasmp commented Nov 25, 2023

will be keeping this scripted diff in drafts only and will open it for review once its appropriate for it to merge

@vijaydasmp vijaydasmp changed the title backport: Merge #23517,23546,23703 backport: Merge #23517,23546,23703 (scripted diff) Nov 25, 2023
Copy link

github-actions bot commented Dec 1, 2023

This pull request has conflicts, please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants