Commit Graph

245 Commits

Author SHA1 Message Date
Jude Nelson
c7c8183c9a remove now-unused files 2016-08-31 11:31:19 -04:00
Jude Nelson
e692706058 don't remove a peer if it's whitelisted or blacklisted 2016-08-30 20:37:06 -04:00
Jude Nelson
8e27fc5586 abort on fatal error 2016-08-30 20:23:52 -04:00
Jude Nelson
bc40d5a901 abort on fatal error; better atlas start/stop logic; report JSON
tracebacks as strings
2016-08-30 20:23:33 -04:00
Jude Nelson
069037077b bugfixes found in testing; better socket error logging 2016-08-30 20:23:20 -04:00
Jude Nelson
03da6c4a66 runtime sanity checks on lock state 2016-08-30 12:31:46 -04:00
Jude Nelson
da509dc2ba atlas_start() and atlas_stop() as explicit methods 2016-08-30 00:37:25 -04:00
Jude Nelson
7edcafa753 more bugfixes from mesh testing 2016-08-30 00:37:02 -04:00
Jude Nelson
940d29e14e remove unused code 2016-08-29 17:35:40 -04:00
Jude Nelson
4655830e53 set NUM_CONFIRMATIONS to 0 when testing, so we can get faster results 2016-08-29 17:35:28 -04:00
Jude Nelson
d4a7c5e772 set initial peer table 2016-08-29 17:35:17 -04:00
Jude Nelson
eb2015307b more code clean-up:
* autoincrement peer index
* enable test network methods only if we're a subordinate atlas peer,
and not the main test thread
* locking bugfixes
* remove redundant code
* more debug output
2016-08-29 17:34:36 -04:00
Jude Nelson
5fd23a8938 make blockstack-server amenable to running in the network simulator 2016-08-26 18:46:41 -04:00
Jude Nelson
b0876869b5 make blockstack server amenable to being run as an atlas peer in the
test framework.
2016-08-26 18:46:15 -04:00
Jude Nelson
28f01ac54d more bugfixes found during testing; remove dead code; fix deadlocks 2016-08-26 18:45:52 -04:00
Jude Nelson
d999f1beb7 typo (bug) 2016-08-24 17:42:56 -04:00
Jude Nelson
3a625263e9 add atlas config options 2016-08-24 17:42:38 -04:00
Jude Nelson
d23bdf3c16 bugfixes found in testing; add top-level startup/shutdown logic; add db
sync logic
2016-08-24 17:41:53 -04:00
Jude Nelson
848cfff660 fix a few bugs in MHRWDA, found during testing 2016-08-23 23:13:05 -04:00
Jude Nelson
8039310238 Implement Metropolis-Hastings Random Walk with Delayed Acceptance,
instead of Metropolis-Hastings Random Walk with Backtracking.  This is
in light of reading the SIGCOMM 2012 paper by Lee, Xu, and Eun.  Also,
update documentation to briefly explain the peer selection and
exploration rationale.
2016-08-23 18:01:50 -04:00
Jude Nelson
89c0fc2572 support atlas = [True|False] under [blockstack] 2016-08-23 11:39:56 -04:00
Jude Nelson
1298b543a3 conditionally enable atlas support based on config file 2016-08-23 11:39:41 -04:00
Jude Nelson
fe8741da4b all rpc_ methods receive **con_info to contain client information 2016-08-22 18:00:05 -04:00
Jude Nelson
f67c2258b1 rework peer discovery and peer retention logic:
* use metropolis-hastings random walk with random backtracking (variant of MRWB)
to sample the peer graph in as unbiased a way as we can.  The only major
difference between this and MRWB is that we don't maintain a peer stack;
we just select a random peer instead of backtracking.
* keep the peer table and the peer database in sync--the table is the
cache-coherent copy.
* keep only 65536 peers.  Hash the peer address and a nonce to select a
slot, and ping an old peer before evicting it on collision (and keep the
old peer on collision if it responds)
* a peer can ask for all other peers.
* remove up to 10 peers that are unhealthy per walk; add up to 10 new
peers that we discover on remote peer queries.
* use socket-determined peer address, not RPC-given peer address
* various code cleanups.
2016-08-22 17:55:58 -04:00
Jude Nelson
566b6f5735 numerous bugfixes found in testing 2016-08-18 18:33:54 -04:00
Jude Nelson
5e6344dc37 atlas inventory requests are in terms of byte offset and length 2016-08-18 18:33:25 -04:00
Jude Nelson
4ac8651741 use correct zonefile cache path; disable update tx check when testing 2016-08-18 18:33:08 -04:00
Jude Nelson
f71b91983a plumb through atlas support to peer and zonefile queries 2016-08-17 00:36:54 -04:00
Jude Nelson
5fc3851aed more work on atlas support:
* push zonefiles if we receive them, and know of another peer that needs
them (i.e. should happen frequently near the chain tip)
* when getting the peer list, queue the requester for pinging
* move unit tests to integration test framework
2016-08-17 00:35:59 -04:00
Jude Nelson
d01edf1f10 WIP: Atlas peer code and (rough) unit tests.
* Atlas nodes are a lot like BitTorrent nodes, where the blockchain
gets used to encode the sequence of zonefiles (chunks) a peer goes and
fetches.
* Atlas nodes discover each other from a set of seed nodes, and try
to construct a K-regular network graph using a random walk through
the peers neighbor relations.
* Atlas nodes propagate peer information to each other in a "K-rarest
known peers that are alive" fashion, to encourage even peer mixing.
* Atlas nodes maintain a bitwise big-endian "zonefile inventory vector"
where bit i is set if the ith NAME_UPDATE's associated zonefile has
been obtained.
* Atlas nodes exchange zonefile inventory vectors amongst their
neighbors in an effort to find missing zonefiles.  They obtain zonefiles
in a rarest-first fashion--i.e. the first missing zonefile to fetch
should be the one known by the least amount of neighbors.
* Atlas nodes occasionally refresh inventory vectors with neighbors to
ensure that knowledge of a zonefile propagates through the network.

This is mostly untested code, save for what the unit tests at the end of
the file cover.  TODO: integrate with CircleCI
2016-08-15 18:20:43 -04:00
Jude Nelson
9de8cb6fdb update symbols 2016-08-15 18:20:35 -04:00
Jude Nelson
7b69b499cc tweak comments; add get_zonefile_hashes_at() for Atlas node support 2016-08-15 18:20:18 -04:00
Jude Nelson
7cd61e362f remove dead imports; if unit-testing, then set a version directly (won't
be used unless the right envars are set)
2016-08-15 18:19:41 -04:00
Jude Nelson
3d96a7ad55 WIP: add Atlas RPC methods 2016-08-15 18:19:26 -04:00
Jude Nelson
5e570de5bf remove dead code 2016-08-15 18:19:12 -04:00
Jude Nelson
21285a9d7e remove dead code 2016-08-15 18:19:00 -04:00
Jude Nelson
6263fb41a2 add tx_filter to select only 'id' op_returns 2016-08-10 19:49:18 -04:00
Jude Nelson
59930bfcbf use blockstack_client's semvar; add expected_snapshots argument (pulled
from sqlite3 branch)
2016-08-10 19:30:58 -04:00
Jude Nelson
c8f857a241 version 0.14.0 2016-08-10 16:07:49 -04:00
Jude Nelson
4b5b72fa77 enforce op_fee formatting quirk; check for absurdly high-value transactions
while testing
2016-08-10 16:07:21 -04:00
Jude Nelson
7a7692ba8e if there's no analytics key, then log it 2016-08-10 16:07:03 -04:00
Jude Nelson
ccc6f91e5e some things don't have to be considered p2pkh scripts any longer :D 2016-08-06 00:15:45 -04:00
Jude Nelson
4656fe951a CONSENSUS-BREAKING CHANGE: if we can't find the pubkey hex in the script
sig, then set it to "", not None.  This hadn't been a problem before,
because all keys were p2pkh and always had public keys.  With multisig
support, this will no longer be the case.
2016-08-06 00:14:42 -04:00
Jude Nelson
070e9b86de period 2016-08-06 00:14:32 -04:00
Jude Nelson
0006c7b48d remove now-unneeded code 2016-08-06 00:14:07 -04:00
Jude Nelson
162c9174e9 use virtualchain's key logic 2016-08-04 15:43:06 -04:00
Jude Nelson
d86cbee2de use virtualchain's key logic 2016-08-04 15:42:51 -04:00
Jude Nelson
f0e1ad44e9 use virtualchain's key logic (to automatically use testnet); convert
import addresses to testnet addresses if we're in testnet mode.
2016-08-04 15:42:20 -04:00
Jude Nelson
4f27523f9b convert burn address hash to proper address format 2016-08-04 13:50:38 -04:00
Jude Nelson
2f4c0019e8 disable mock_bitcoind support 2016-08-04 13:50:16 -04:00