From 13477b5180263ca50f2cdfd096b91b24d743a944 Mon Sep 17 00:00:00 2001 From: gruve-p Date: Thu, 12 Oct 2023 09:32:52 +0200 Subject: [PATCH] Fixes after merging upstream --- ...{bitcoin-cli.bash => groestlcoin-cli.bash} | 0 .../bash/groestlcoin-cli.bash-completion | 141 ------------------ .../{bitcoin-tx.bash => groestlcoin-tx.bash} | 0 .../bash/groestlcoin-tx.bash-completion | 57 ------- .../bash/{bitcoind.bash => groestlcoind.bash} | 0 .../bash/groestlcoind.bash-completion | 56 ------- contrib/devtools/headerssync-params.py | 6 +- contrib/devtools/test_utxo_snapshots.sh | 22 +-- src/groestlcoin.h | 4 +- src/rpc/blockchain.cpp | 4 +- 10 files changed, 17 insertions(+), 273 deletions(-) rename contrib/completions/bash/{bitcoin-cli.bash => groestlcoin-cli.bash} (100%) delete mode 100644 contrib/completions/bash/groestlcoin-cli.bash-completion rename contrib/completions/bash/{bitcoin-tx.bash => groestlcoin-tx.bash} (100%) delete mode 100644 contrib/completions/bash/groestlcoin-tx.bash-completion rename contrib/completions/bash/{bitcoind.bash => groestlcoind.bash} (100%) delete mode 100644 contrib/completions/bash/groestlcoind.bash-completion diff --git a/contrib/completions/bash/bitcoin-cli.bash b/contrib/completions/bash/groestlcoin-cli.bash similarity index 100% rename from contrib/completions/bash/bitcoin-cli.bash rename to contrib/completions/bash/groestlcoin-cli.bash diff --git a/contrib/completions/bash/groestlcoin-cli.bash-completion b/contrib/completions/bash/groestlcoin-cli.bash-completion deleted file mode 100644 index 7db49f6c82292..0000000000000 --- a/contrib/completions/bash/groestlcoin-cli.bash-completion +++ /dev/null @@ -1,141 +0,0 @@ -# bash programmable completion for groestlcoin-cli(1) -# Copyright (c) 2012-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -# call $groestlcoin-cli for RPC -_groestlcoin_rpc() { - # determine already specified args necessary for RPC - local rpcargs=() - for i in ${COMP_LINE}; do - case "$i" in - -conf=*|-datadir=*|-regtest|-rpc*|-testnet) - rpcargs=( "${rpcargs[@]}" "$i" ) - ;; - esac - done - $groestlcoin_cli "${rpcargs[@]}" "$@" -} - -_groestlcoin_cli() { - local cur prev words=() cword - local groestlcoin_cli - - # save and use original argument to invoke groestlcoin-cli for -help, help and RPC - # as groestlcoin-cli might not be in $PATH - groestlcoin_cli="$1" - - COMPREPLY=() - _get_comp_words_by_ref -n = cur prev words cword - - if ((cword > 5)); then - case ${words[cword-5]} in - sendtoaddress) - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) - return 0 - ;; - esac - fi - - if ((cword > 4)); then - case ${words[cword-4]} in - importaddress|listtransactions|setban) - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) - return 0 - ;; - signrawtransactionwithkey|signrawtransactionwithwallet) - COMPREPLY=( $( compgen -W "ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- "$cur" ) ) - return 0 - ;; - esac - fi - - if ((cword > 3)); then - case ${words[cword-3]} in - addmultisigaddress) - return 0 - ;; - getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaddress|listsinceblock) - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) - return 0 - ;; - esac - fi - - if ((cword > 2)); then - case ${words[cword-2]} in - addnode) - COMPREPLY=( $( compgen -W "add remove onetry" -- "$cur" ) ) - return 0 - ;; - setban) - COMPREPLY=( $( compgen -W "add remove" -- "$cur" ) ) - return 0 - ;; - fundrawtransaction|getblock|getblockheader|getmempoolancestors|getmempooldescendants|getrawtransaction|gettransaction|listreceivedbyaddress|sendrawtransaction) - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) - return 0 - ;; - esac - fi - - case "$prev" in - backupwallet|dumpwallet|importwallet) - _filedir - return 0 - ;; - getaddednodeinfo|getrawmempool|lockunspent) - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) - return 0 - ;; - getbalance|getnewaddress|listtransactions|sendmany) - return 0 - ;; - esac - - case "$cur" in - -conf=*) - cur="${cur#*=}" - _filedir - return 0 - ;; - -datadir=*) - cur="${cur#*=}" - _filedir -d - return 0 - ;; - -*=*) # prevent nonsense completions - return 0 - ;; - *) - local helpopts commands - - # only parse -help if senseful - if [[ -z "$cur" || "$cur" =~ ^- ]]; then - helpopts=$($groestlcoin_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) - fi - - # only parse help if senseful - if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then - commands=$(_groestlcoin_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }') - fi - - COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) - - # Prevent space if an argument is desired - if [[ $COMPREPLY == *= ]]; then - compopt -o nospace - fi - return 0 - ;; - esac -} && -complete -F _groestlcoin_cli groestlcoin-cli - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/completions/bash/bitcoin-tx.bash b/contrib/completions/bash/groestlcoin-tx.bash similarity index 100% rename from contrib/completions/bash/bitcoin-tx.bash rename to contrib/completions/bash/groestlcoin-tx.bash diff --git a/contrib/completions/bash/groestlcoin-tx.bash-completion b/contrib/completions/bash/groestlcoin-tx.bash-completion deleted file mode 100644 index d6124bdfc1646..0000000000000 --- a/contrib/completions/bash/groestlcoin-tx.bash-completion +++ /dev/null @@ -1,57 +0,0 @@ -# bash programmable completion for groestlcoin-tx(1) -# Copyright (c) 2016-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -_groestlcoin_tx() { - local cur prev words=() cword - local groestlcoin_tx - - # save and use original argument to invoke groestlcoin-tx for -help - # it might not be in $PATH - groestlcoin_tx="$1" - - COMPREPLY=() - _get_comp_words_by_ref -n =: cur prev words cword - - case "$cur" in - load=*:*) - cur="${cur#load=*:}" - _filedir - return 0 - ;; - *=*) # prevent attempts to complete other arguments - return 0 - ;; - esac - - if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then - # only options (or an uncompletable hex-string) allowed - # parse groestlcoin-tx -help for options - local helpopts - helpopts=$($groestlcoin_tx -help | sed -e '/^ -/ p' -e d ) - COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) - else - # only commands are allowed - # parse -help for commands - local helpcmds - helpcmds=$($groestlcoin_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d ) - COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) ) - fi - - # Prevent space if an argument is desired - if [[ $COMPREPLY == *= ]]; then - compopt -o nospace - fi - - return 0 -} && -complete -F _groestlcoin_tx groestlcoin-tx - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/completions/bash/bitcoind.bash b/contrib/completions/bash/groestlcoind.bash similarity index 100% rename from contrib/completions/bash/bitcoind.bash rename to contrib/completions/bash/groestlcoind.bash diff --git a/contrib/completions/bash/groestlcoind.bash-completion b/contrib/completions/bash/groestlcoind.bash-completion deleted file mode 100644 index 1672d4c546147..0000000000000 --- a/contrib/completions/bash/groestlcoind.bash-completion +++ /dev/null @@ -1,56 +0,0 @@ -# bash programmable completion for groestlcoind(1) and groestlcoin-qt(1) -# Copyright (c) 2012-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -_groestlcoind() { - local cur prev words=() cword - local groestlcoind - - # save and use original argument to invoke groestlcoind for -help - # it might not be in $PATH - groestlcoind="$1" - - COMPREPLY=() - _get_comp_words_by_ref -n = cur prev words cword - - case "$cur" in - -conf=*|-pid=*|-loadblock=*|-rpccookiefile=*|-wallet=*) - cur="${cur#*=}" - _filedir - return 0 - ;; - -datadir=*) - cur="${cur#*=}" - _filedir -d - return 0 - ;; - -*=*) # prevent nonsense completions - return 0 - ;; - *) - - # only parse -help if sensible - if [[ -z "$cur" || "$cur" =~ ^- ]]; then - local helpopts - helpopts=$($groestlcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) - COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) - fi - - # Prevent space if an argument is desired - if [[ $COMPREPLY == *= ]]; then - compopt -o nospace - fi - return 0 - ;; - esac -} && -complete -F _groestlcoind groestlcoind groestlcoin-qt - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/devtools/headerssync-params.py b/contrib/devtools/headerssync-params.py index 0198f5db99f8b..33833afcafbd2 100644 --- a/contrib/devtools/headerssync-params.py +++ b/contrib/devtools/headerssync-params.py @@ -15,10 +15,10 @@ TIME = datetime(2026, 10, 5) # Expected block interval. [timedelta] -BLOCK_INTERVAL = timedelta(seconds=600) +BLOCK_INTERVAL = timedelta(seconds=60) # The number of headers corresponding to the minchainwork parameter. [headers] -MINCHAINWORK_HEADERS = 804000 +MINCHAINWORK_HEADERS = 4555555 # Combined processing bandwidth from all attackers to one victim. [bit/s] # 6 Gbit/s is approximately the speed at which a single thread of a Ryzen 5950X CPU thread can hash @@ -118,7 +118,7 @@ RANDOMIZE_OFFSET = True # Timestamp of the genesis block -GENESIS_TIME = datetime(2009, 1, 3) +GENESIS_TIME = datetime(2014, 3, 22) # Derived values: diff --git a/contrib/devtools/test_utxo_snapshots.sh b/contrib/devtools/test_utxo_snapshots.sh index d4c49bf098f28..1d3d6814e4a9c 100755 --- a/contrib/devtools/test_utxo_snapshots.sh +++ b/contrib/devtools/test_utxo_snapshots.sh @@ -23,7 +23,7 @@ SERVER_DATADIR="$(pwd)/utxodemo-data-server-$BASE_HEIGHT" CLIENT_DATADIR="$(pwd)/utxodemo-data-client-$BASE_HEIGHT" UTXO_DAT_FILE="$(pwd)/utxo.$BASE_HEIGHT.dat" -# Chosen to try to not interfere with any running bitcoind processes. +# Chosen to try to not interfere with any running groestlcoind processes. SERVER_PORT=8633 SERVER_RPC_PORT=8632 @@ -61,10 +61,10 @@ trap finish EXIT EARLY_IBD_FLAGS="-maxtipage=9223372036854775207 -minimumchainwork=0x00" server_rpc() { - ./src/bitcoin-cli -rpcport=$SERVER_RPC_PORT -datadir="$SERVER_DATADIR" "$@" + ./src/groestlcoin-cli -rpcport=$SERVER_RPC_PORT -datadir="$SERVER_DATADIR" "$@" } client_rpc() { - ./src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir="$CLIENT_DATADIR" "$@" + ./src/groestlcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir="$CLIENT_DATADIR" "$@" } server_sleep_til_boot() { while ! server_rpc ping >/dev/null 2>&1; do sleep 0.1; done @@ -104,13 +104,13 @@ read -p "Press [enter] to continue" _ echo echo "-- IBDing the blocks (height=$BASE_HEIGHT) required to the server node..." -./src/bitcoind -logthreadnames=1 $SERVER_PORTS \ +./src/groestlcoind -logthreadnames=1 $SERVER_PORTS \ -datadir="$SERVER_DATADIR" $EARLY_IBD_FLAGS -stopatheight="$BASE_HEIGHT" >/dev/null echo echo "-- Creating snapshot at ~ height $BASE_HEIGHT ($UTXO_DAT_FILE)..." sleep 2 -./src/bitcoind -logthreadnames=1 $SERVER_PORTS \ +./src/groestlcoind -logthreadnames=1 $SERVER_PORTS \ -datadir="$SERVER_DATADIR" $EARLY_IBD_FLAGS -connect=0 -listen=0 >/dev/null & SERVER_PID="$!" @@ -135,12 +135,12 @@ echo " {${RPC_BASE_HEIGHT}, AssumeutxoHash{uint256S(\"0x${RPC_AU}\")}, ${RPC_N echo echo echo "-- IBDing more blocks to the server node (height=$FINAL_HEIGHT) so there is a diff between snapshot and tip..." -./src/bitcoind $SERVER_PORTS -logthreadnames=1 -datadir="$SERVER_DATADIR" \ +./src/groestlcoind $SERVER_PORTS -logthreadnames=1 -datadir="$SERVER_DATADIR" \ $EARLY_IBD_FLAGS -stopatheight="$FINAL_HEIGHT" >/dev/null echo echo "-- Starting the server node to provide blocks to the client node..." -./src/bitcoind $SERVER_PORTS -logthreadnames=1 -debug=net -datadir="$SERVER_DATADIR" \ +./src/groestlcoind $SERVER_PORTS -logthreadnames=1 -debug=net -datadir="$SERVER_DATADIR" \ $EARLY_IBD_FLAGS -connect=0 -listen=1 >/dev/null & SERVER_PID="$!" server_sleep_til_boot @@ -163,7 +163,7 @@ read -p "When you're ready for all this, hit [enter]" _ echo echo "-- Starting the client node to get headers from the server, then load the snapshot..." -./src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" \ +./src/groestlcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" \ -connect=0 -addnode=127.0.0.1:$SERVER_PORT -debug=net $EARLY_IBD_FLAGS >/dev/null & CLIENT_PID="$!" client_sleep_til_boot @@ -176,7 +176,7 @@ echo echo "-- Loading UTXO snapshot into client..." client_rpc loadtxoutset "$UTXO_DAT_FILE" -watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" +watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./src/groestlcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" echo echo "-- Okay, now I'm going to restart the client to make sure that the snapshot chain reloads " @@ -189,12 +189,12 @@ read -p "Press [enter] to continue" while kill -0 "$CLIENT_PID"; do sleep 1 done -./src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" -connect=0 \ +./src/groestlcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" -connect=0 \ -addnode=127.0.0.1:$SERVER_PORT "$EARLY_IBD_FLAGS" >/dev/null & CLIENT_PID="$!" client_sleep_til_boot -watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" +watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./src/groestlcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" echo echo "-- Done!" diff --git a/src/groestlcoin.h b/src/groestlcoin.h index 13ae8bb11e185..66d54e43dd2f7 100755 --- a/src/groestlcoin.h +++ b/src/groestlcoin.h @@ -77,13 +77,11 @@ class CGroestlHashWriter private: GroestlHasher ctx; - const int nType; const int nVersion; public: - CGroestlHashWriter(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) {} + CGroestlHashWriter(int nVersionIn) : nVersion(nVersionIn) {} - int GetType() const { return nType; } int GetVersion() const { return nVersion; } void write(Span src) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index ede1af4d55238..238b9727112f4 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2711,13 +2711,13 @@ static RPCHelpMan loadtxoutset() "Meanwhile, the original chainstate will complete the initial block download process in " "the background, eventually validating up to the block that the snapshot is based upon.\n\n" - "The result is a usable bitcoind instance that is current with the network tip in a " + "The result is a usable groestlcoind instance that is current with the network tip in a " "matter of minutes rather than hours. UTXO snapshot are typically obtained from " "third-party sources (HTTP, torrent, etc.) which is reasonable since their " "contents are always checked by hash.\n\n" "You can find more information on this process in the `assumeutxo` design " - "document ().", + "document ().", { {"path", RPCArg::Type::STR,