[net] Skip stale tip checks in regtest #12484

pull kallewoof wants to merge 1 commits into bitcoin:master from kallewoof:no-staletip-check-regtest changing 1 files +4 −0
  1. kallewoof commented at 1:10 AM on February 20, 2018: member

    Starting a regtest node and leaving it for a bit would start spamming

    2018-02-19 20:05:25 Potential stale tip detected, will try using extra outbound peer (last tip update: 32809 seconds ago)
    

    which seems unnecessary. I check if it's regtest by seeing if Consensus::Params.fPowNoRetargeting is true, which is perhaps not ideal, but works.

  2. [net] Skip stale tip checks in regtest 8439303930
  3. fanquake added the label P2P on Feb 20, 2018
  4. MarcoFalke commented at 1:51 AM on February 20, 2018: member

    Tend to NACK. That makes it impossible to test it on regtest, which is meant for testing

    On Feb 19, 2018 20:11, "kallewoof" notifications@github.com wrote:

    Starting a regtest node and leaving it for a bit would start spamming

    2018-02-19 20:05:25 Potential stale tip detected, will try using extra outbound peer (last tip update: 32809 seconds ago)

    which seems unnecessary. I check if it's regtest by seeing if Consensus::Params.fPowNoRetargeting is true, which is perhaps not ideal, but works.

    You can view, comment on, or merge this pull request online at:

    #12484 Commit Summary

    • [net] Skip stale tip checks in regtest

    File Changes

    Patch Links:

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/12484, or mute the thread https://github.com/notifications/unsubscribe-auth/AGGmvx79K6bsaI84rMZMy-jBq-dnDvAmks5tWhutgaJpZM4SLSre .

  5. kallewoof commented at 1:56 AM on February 20, 2018: member

    @MarcoFalke All tests pass, though..

    Edit: I see what you're saying. The spam is pretty obnoxious though.

    Edit 2: Is this even testable in regtest? It seems kind of tied to a chain with PoW.

  6. laanwj commented at 3:01 PM on February 22, 2018: member

    The stale tip check seems based on time, not PoW. So it could be potentially tested using mocktime on regtest.

    I don't think log spam while testing is a very urgent issue, but if so, my preferred solution would be to add some kind of congestion control to the message - e.g. have it logged at most once per block, or in a certain time window, instead of disabling the functionality on a per-chain basis.

  7. kallewoof commented at 4:07 AM on February 23, 2018: member

    @laanwj @MarcoFalke I'm tempted to add a flag for whether you should check for stale tips or not, and make it default true for all but regtest. Tests could then explicitly enable it when testing the feature -- which no tests have done so far, mind you.

    Downside is yet another flag to the startup options for the node / the .conf file.

  8. laanwj commented at 11:07 AM on February 23, 2018: member

    which no tests have done so far, mind you.

    Feel free to add one :) I'd much prefer that to any amount of hacking around this feature.

  9. kallewoof commented at 11:58 AM on February 23, 2018: member

    @laanwj That's the thing, though. Maybe I'm lacking in imagination but I can't think of a meaningful test for this. I'll give it some thought though.

  10. jnewbery commented at 9:40 PM on April 3, 2018: member

    Like @MarcoFalke , I'm NACKish on just disabling this on regtest, since we want regtest behaviour to be as close to mainnet behaviour as possible. Adding a flag seems reasonable enough, although I'd prefer the defaults to be the same for main/test/regtest.

  11. MarcoFalke commented at 9:42 PM on April 3, 2018: member

    Closing for now, until a better solution has been found.

  12. MarcoFalke closed this on Apr 3, 2018

  13. kallewoof deleted the branch on Oct 17, 2019
  14. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me