Skip to content

Commit

Permalink
Fixes after merging upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Oct 12, 2023
1 parent 16aa9e8 commit 13477b5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 273 deletions.
File renamed without changes.
141 changes: 0 additions & 141 deletions contrib/completions/bash/groestlcoin-cli.bash-completion

This file was deleted.

File renamed without changes.
57 changes: 0 additions & 57 deletions contrib/completions/bash/groestlcoin-tx.bash-completion

This file was deleted.

File renamed without changes.
56 changes: 0 additions & 56 deletions contrib/completions/bash/groestlcoind.bash-completion

This file was deleted.

6 changes: 3 additions & 3 deletions contrib/devtools/headerssync-params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down
22 changes: 11 additions & 11 deletions contrib/devtools/test_utxo_snapshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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="$!"

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 "
Expand All @@ -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!"
4 changes: 1 addition & 3 deletions src/groestlcoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<const std::byte> src)
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://github.com/bitcoin/bitcoin/blob/master/doc/design/assumeutxo.md>).",
"document (<https://github.com/groestlcoin/groestlcoin/blob/master/doc/design/assumeutxo.md>).",
{
{"path",
RPCArg::Type::STR,
Expand Down

0 comments on commit 13477b5

Please sign in to comment.