Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Oct 20, 2024
2 parents e11fb47 + e8f72ae commit f0ae324
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 32 deletions.
8 changes: 4 additions & 4 deletions contrib/tracing/connectblock_benchmark.bt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ usdt:./build/src/groestlcoind:validation:block_connected /arg1 >= $1 && (arg1 <=
@inputs = @inputs + $inputs;
@sigops = @sigops + $sigops;

@durations = hist($duration / 1000);
@durations = hist($duration / 1e6);

if ($height == $1 && $height != 0) {
@start = nsecs;
Expand All @@ -92,7 +92,7 @@ usdt:./build/src/groestlcoind:validation:block_connected /arg1 >= $1 && (arg1 <=
if ($2 > 0 && $height >= $2) {
@end = nsecs;
$duration = @end - @start;
printf("\nTook %d ms to connect the blocks between height %d and %d.\n", $duration / 1000000, $1, $2);
printf("\nTook %d ms to connect the blocks between height %d and %d.\n", $duration / 1e9, $1, $2);
exit();
}
}
Expand All @@ -102,7 +102,7 @@ usdt:./build/src/groestlcoind:validation:block_connected /arg1 >= $1 && (arg1 <=
blocks where the time it took to connect the block is above the
<logging threshold in ms>.
*/
usdt:./build/src/groestlcoind:validation:block_connected / (uint64) arg5 / 1000> $3 /
usdt:./build/src/groestlcoind:validation:block_connected / (uint64) arg5 / 1e6 > $3 /
{
$hash = arg0;
$height = (int32) arg1;
Expand All @@ -120,7 +120,7 @@ usdt:./build/src/groestlcoind:validation:block_connected / (uint64) arg5 / 1000>
printf("%02x", $b);
$p -= 1;
}
printf(") %4d tx %5d ins %5d sigops took %4d ms\n", $transactions, $inputs, $sigops, (uint64) $duration / 1000);
printf(") %4d tx %5d ins %5d sigops took %4d ms\n", $transactions, $inputs, $sigops, (uint64) $duration / 1e6);
}


Expand Down
2 changes: 1 addition & 1 deletion depends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-ex

#### For Win64 cross compilation

- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux)
apt install g++-mingw-w64-x86-64-posix

#### For linux (including i386, ARM) cross compilation

Expand Down
24 changes: 3 additions & 21 deletions doc/build-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,18 @@ The steps below can be performed on Ubuntu or WSL. The depends system
will also work on other Linux distributions, however the commands for
installing the toolchain will be different.

First, install the general dependencies:

sudo apt update
sudo apt upgrade
sudo apt install cmake curl g++ git make pkg-config

A host toolchain (`g++`) is necessary because some dependency
packages need to build host utilities that are used in the build process.

See [dependencies.md](dependencies.md) for a complete overview.
See [README.md](../depends/README.md) in the depends directory for which
dependencies to install and [dependencies.md](dependencies.md) for a complete overview.

If you want to build the Windows installer using the `deploy` build target, you will need [NSIS](https://nsis.sourceforge.io/Main_Page):

sudo apt install nsis
apt install nsis

Acquire the source in the usual way:

git clone https://github.com/groestlcoin/groestlcoin.git
cd groestlcoin

## Building for 64-bit Windows

The first step is to install the mingw-w64 cross-compilation toolchain:

```sh
sudo apt install g++-mingw-w64-x86-64-posix
```

Once the toolchain is installed the build steps are common:

Note that for WSL the Groestlcoin Core source path MUST be somewhere in the default mount file system, for
example /usr/src/groestlcoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
This means you cannot use a directory that located directly on the host Windows file system to perform the build.
Expand Down
2 changes: 1 addition & 1 deletion doc/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Arguments passed:
3. Transactions in the Block as `uint64`
4. Inputs spend in the Block as `int32`
5. SigOps in the Block (excluding coinbase SigOps) `uint64`
6. Time it took to connect the Block in microseconds (µs) as `uint64`
6. Time it took to connect the Block in nanoseconds (ns) as `uint64`

### Context `utxocache`

Expand Down
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
block.vtx.size(),
nInputs,
nSigOpsCost,
time_5 - time_start // in microseconds (µs)
Ticks<std::chrono::nanoseconds>(time_5 - time_start)
);

return true;
Expand Down
15 changes: 11 additions & 4 deletions test/functional/interface_usdt_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import ctypes
import time

# Test will be skipped if we don't have bcc installed
try:
Expand Down Expand Up @@ -105,10 +106,12 @@ def handle_blockconnected(_, data, __):
handle_blockconnected)

self.log.info(f"mine {BLOCKS_EXPECTED} blocks")
block_hashes = self.generatetoaddress(
self.nodes[0], BLOCKS_EXPECTED, ADDRESS_BCRT1_UNSPENDABLE)
for block_hash in block_hashes:
expected_blocks[block_hash] = self.nodes[0].getblock(block_hash, 2)
generatetoaddress_duration = dict()
for _ in range(BLOCKS_EXPECTED):
start = time.time()
hash = self.generatetoaddress(self.nodes[0], 1, ADDRESS_BCRT1_UNSPENDABLE)[0]
generatetoaddress_duration[hash] = (time.time() - start) * 1e9 # in nanoseconds
expected_blocks[hash] = self.nodes[0].getblock(hash, 2)

bpf.perf_buffer_poll(timeout=200)

Expand All @@ -123,6 +126,10 @@ def handle_blockconnected(_, data, __):
assert_equal(0, event.sigops) # no sigops in coinbase tx
# only plausibility checks
assert event.duration > 0
# generatetoaddress (mining and connecting) takes longer than
# connecting the block. In case the duration unit is off, we'll
# detect it with this assert.
assert event.duration < generatetoaddress_duration[block_hash]
del expected_blocks[block_hash]
assert_equal(BLOCKS_EXPECTED, len(events))
assert_equal(0, len(expected_blocks))
Expand Down

0 comments on commit f0ae324

Please sign in to comment.