Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Qt: Network Watch tool #9849

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants
Member

luke-jr commented Feb 24, 2017

Simple realtime log of p2p network activity (blocks and transactions only)

  • Doesn't begin logging until opened; limited to 0x400 entries (outputs)
  • Automatically scrolls if left at the bottom of the log; maintains position if left elsewhere
  • Memory-efficient circular buffer; CTransaction references become weak after they're 0x200 entries back in the log
  • Search function that selects all matching log entries, including ongoing

@fanquake fanquake added the GUI label Feb 24, 2017

src/qt/netwatch.cpp
+ }
+ ++rows_used;
+ if (rows_used > max_nonweak_txouts) {
+ LogEntry& le = getLogEntryRow(rows_used - max_nonweak_txouts - 1);
@paveljanik

paveljanik Feb 24, 2017

Contributor

le is the same name as the first argument here, it will bring shadow warning.

Contributor

paveljanik commented Feb 24, 2017

This is how it looks like here on testnet:

screen shot 2017-02-24 at 08 22 39

Member

jonasschnelli commented Feb 24, 2017

Thanks. Will review.
I just played a bit with it and had massive locking issues on mainnet during catch-up of 2-3 weeks.

Member

jonasschnelli commented Mar 17, 2017

Running this PR (built over gitian: https://bitcoin.jonasschnelli.ch/build/54) makes Bitcoin-Qt and also the rest of my apps almost unusable. Had to force kill the process.

+void NetWatchLogModel::LogBlock(const CBlockIndex* pblockindex)
+{
+ CBlock block;
+ if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus())) {
@jonasschnelli

jonasschnelli Mar 17, 2017

Member

IMO reading each block will cause a massive slow down during IBD / catchup.

@luke-jr

luke-jr Mar 17, 2017

Member

The OS should have the data cached already?

+ // Indicate error somehow?
+ return;
+ }
+ assert(block.vtx.size());
@jonasschnelli

jonasschnelli Mar 17, 2017

Member

What we probably should do is adding each blocks size and vtx.size() to CBlockIndex* (would require to alter the block index, migration, etc. yes).

@luke-jr

luke-jr Mar 17, 2017

Member

That wouldn't change anything here...?

luke-jr added some commits Feb 24, 2017

Qt: Network Watch tool
Simple realtime log of p2p network activity (blocks and transactions only)

- Doesn't begin logging until opened; limited to 0x400 entries (outputs)
- Automatically scrolls if left at the bottom of the log; maintains position if left elsewhere
- Memory-efficient circular buffer; CTransaction references become weak after they're 0x200 entries back in the log
- Search function that selects all matching log entries, including ongoing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment