< cfields>
It still needs a few things. At minimum, it needs an interface class (similar to NetEventsInterface) to be useful for your tests. Then a few things to tidy up in CConnman, as it was just kinda shoved in there as-is.
< cfields>
I'll try to get it finished up tomorrow. But I think that gets you mostly what you were after.
< cfields>
oh, and loading the addrdb is very shoe-horned in there. Need to figure out where to stick that. IMO moving it into CAddrMan makes sense, as other implementations (tests) will likely be memory-backed anyway.
< ossifrage>
This may be me seeing things, of the 87 nodes connected, the ones with the longest ping times are all 0.15.0
< bitcoin-git>
bitcoin/master 258d33b Karl-Johan Alm: [mempool] Mark unaccepted txs present in mempool as 'already there'....
< bitcoin-git>
bitcoin/master 26fee4f Pieter Wuille: Merge #11062: [mempool] Mark mempool import fails that were found in mempool as 'already there'...
< sipa>
kallewoof: ^ i was confused to not see a 'already there' when starting up a master node, and then realized that wasn't merged yet
< bitcoin-git>
[bitcoin] sipa closed pull request #11062: [mempool] Mark mempool import fails that were found in mempool as 'already there' (master...mempool-alreadythere) https://github.com/bitcoin/bitcoin/pull/11062
< wumpus>
so std::vector::erase removes elements in a range, remove() returns the range vNodes.begin() to vNodes.end() minus pnode
< wumpus>
shouldn't this remove everything but pnode?
< wumpus>
std::remove "Transforms the range [first,last) into a range with all the elements that compare equal to val removed, and returns an iterator to the new end of that range."
< bitcoin-git>
bitcoin/master fa9de37 MarcoFalke: qa: Make tmpdir option an absolute path...
< bitcoin-git>
bitcoin/master fafa003 MarcoFalke: qa: Remove never used return value of sync_with_ping
< bitcoin-git>
bitcoin/master 6759a24 Wladimir J. van der Laan: Merge #11472: qa: Make tmpdir option an absolute path, misc cleanup...
< bitcoin-git>
[bitcoin] laanwj closed pull request #11472: qa: Make tmpdir option an absolute path, misc cleanup (master...Mf1710-qaMultiwalletRelDir) https://github.com/bitcoin/bitcoin/pull/11472
< wumpus>
thanks :)
< wumpus>
can we solve the basho riak download issue? I get an angry travis mail a few seconds after every merge now
< sipa>
?
< wumpus>
I have no idea why it's downloading that package in the first place, part of travis infrastructure I guess... hm in that case there's nothing we can do
< cfields>
ok. with an added interface class, is that what you were after?
< sdaftuar>
i think so, yeah (well i haven't looked at the addrman change yet, but if it's just like the banman change, then yes)
< sdaftuar>
i think the idea would be in regtest mode, to create a special mockedaddrman and sub it in. so just would want a (minimal) interface class to have to implement
< cfields>
sdaftuar: ok
< cfields>
though, my hope was that creating interfaces for these would allow us to do actual c++ unit tests, rather than having to launch an entire program instance for tests
< sdaftuar>
hm. that would be better!
< sdaftuar>
do you think we could really unit test interactions between net and net_processing though? that seems very hard.
< sdaftuar>
(then again, what i'm doing now is also very hard)
< cfields>
well we're getting close. the message processor is now an interface
< cfields>
so you can define your own PeerLogicValidation and ProcessMessages as necessary
< cfields>
i assume you need a good bit of stuff pulled out still, though?
< cfields>
you're trying to test the outgoing peer eviction here, right?
< sdaftuar>
yeah i want to test the logic i'm adding in #11490
< cfields>
ah thaks, i didn't realize you'd already PR'd it. Will review.
< sdaftuar>
i have one more commit that is possibly even harder to test than what i've pushed so far, actually. what is there now is mostly just behavior in net_processing which might be sort-of testable (i was able to rig a single peer in regtest mode that was correctly disconnected)
< sdaftuar>
but the next commit, where i have net_processing set an able_to_evict flag for net.cpp to choose to use, is trickier
< sdaftuar>
as i have no way to get multiple outbound connections in our regtest environment righ tnow
< sdaftuar>
that's partly due to addrman behavior (no more than one peer per ip) and net (don't connect out to a peer in the same network group as an existing peer)
< cfields>
sdaftuar: one thing i have in one of my libevent branches is an ip spoofer for CNode. The idea is to setup 2 CConnman, have 1 connect x times to the other, each with a specified (fake) IP. Then you can simulate the behavior of both sides of the conenection.
< sdaftuar>
so that aspect of it might be easier to do in a unit test than regtest
< cfields>
sounds like it would be, yes. Otherwise you have to shove in a bunch of test-specific behavior
< sdaftuar>
i don't think i'm very familiar right now with the existing unit tests that use connman, i should start there
< cfields>
heh, well there really aren't any. I'm desperately trying to get the interfaces stubbed out so that we can start writing them :)
< sdaftuar>
well i just noticed the existing DoS_tests file while reviewing your banman pr, that is already more than i thought we could do!
< sdaftuar>
so maybe it's not crazy to think i could write a unit test with just what we have now
< cfields>
yes, that one is a pretty good example of where I'd like to be heading. It allows for all local behavior without relying on a global instance
< cfields>
Something else I really needed when testing the libevent code was a way to flood a peer with garbage and see how it would react. Garbage from 1 peer, 100 peers, etc. I think that's the perfect use-case for this kind of testing, because it's easy to code up a quick stub of a message processor that just does ping/pong as quickly as possible.
< cfields>
I could try to code that up if it'd be helpful
< sdaftuar>
thanks, not sure yet what i need until i think about the unit testing framework a bit more! i'll dive into it and see what issues i run into
< bitcoin-git>
bitcoin/0.15 9e8aae3 Karl-Johan Alm: [wallet] Close DB on error....
< bitcoin-git>
bitcoin/0.15 50bd3f6 practicalswift: Avoid returning a BIP9Stats object with uninitialized values...
< bitcoin-git>
bitcoin/0.15 b278a43 Wladimir J. van der Laan: rpc: Write authcookie atomically...
< cfields>
wumpus: I forgot to mention in the PR, but I believe 11521 would've mitigated today's travis issue
< ossifrage>
This is very strange, the 'copy addess' (all copy to clipboard) functions just stop running on bitcoin-qt (0.15.0 linux), other programs talk to the cut buffer just fine, but not bitcoin-qt
< ossifrage>
Ah, there is console output: "Warn Dissector bug, protocol Bitcoin, in packet 3560375: proto.c:5519: failed assertion "idx >= 0 && idx < num_tree_types""
< ossifrage>
Never mind, that has nothing to do with this...
< ossifrage>
I can't even copy text from the transaction details dialog...
< DEV_>
we are working on a development project of the blockchain any donations will be welcome we will update you on the progress of the project as you go btc wallet : 1LJBnabTgobc6xpgH92eV7yha36KSMvtSP