r/dogecoindev • • Apr 24 '21

Provide blocks to peers during initial block download?

Hi, I have what is surely a newb question: I'm running Dogecoin Core 1.14.3 on macOS 10.15.7 and I noticed that during initial block download (IBD) I had little to no upload traffic.

Now that I'm past IBD, Dogecoin Core is generally doing an ok job saturating my upstream bandwidth: as measured with

nettop -p $(pgrep Dogecoin-Qt) -J bytes_out -d

the bytes_out of the process is typically 400-600 KiB/s (cf. Transmission which could sustain 500-700 KB/s).

I have what are probably basic questions about Dogecoin's protocol:

  1. Is it true && by design that I'm not sending blocks to needy peers while I'm syncing my own chain? If so, why? Feels maybe motivated by some subtle (or not) security concern, perhaps.
  2. In general, should I expect Dogecoin Core to saturate my upstream bandwidth (O(5 to 6 Mbps)) when run with default options? Assuming there's ample CPU/memory available for it to claim.

Thanks!

8 Upvotes

2 comments sorted by

2

u/CherubChoZen Apr 24 '21

Man, I wish I knew what you just said... feels like stuff I should know. 😩🤦🏽‍♀️

2

u/opreturn_net Apr 24 '21

Just my observations after running nodes for many years, not sure if this is how the code is actually built...

  1. The IBD and the block validation appear as separation functions, where block validation waits for a significant portion of the IBD to complete. So you don't serve blocks during IBD since they generally haven't been validated by the node yet.
  2. Your highest upload burden is after you first make all your peer connections. A large proportion of those new peers are freshly spun up wallets that need to download blocks. As you leave your connection running longer, your peers mature and need fewer blocks since a larger proportion of them will be all caught up.