Commit Graph

496 Commits

Author SHA1 Message Date
Jude Nelson
a1fff2793a correct zonefile request interval (groups of 100); do not attempt to
parse zonefiles we receive from atlas peers (since we don't care)
2016-10-03 01:26:50 -04:00
Jude Nelson
8312db7f41 check the validity of cached zonefile data only after we load it. also,
debug cache hits/misses for now
2016-10-03 01:15:27 -04:00
Jude Nelson
2c7a00f003 fetch zonefiles in batches of 100 or less 2016-10-03 01:15:13 -04:00
Jude Nelson
e7b7ad8fa0 justify why we check lastblock when we open the db 2016-10-03 00:47:35 -04:00
Jude Nelson
24bbe6ccc8 find all instances where we log the zonefile inventory vector, and make
sure we don't accidentally print out a huge amount of text
2016-10-03 00:47:11 -04:00
Jude Nelson
3f0d668032 close the db when we're done with it, but not before 2016-10-03 00:46:55 -04:00
Jude Nelson
2a78fb1ad4 add a way to remove invalid cached zonefiles, and check that the
zonefile *data* is cached (not that the zonefile cached is a standard
zonefile).
2016-10-03 00:20:55 -04:00
Jude Nelson
110bc01024 serve back *arbitrary* zonefiles, not just ones that are standard.
TODO: don't serve them back if they're too big, but find a way to cap
this at the driver level.
2016-10-03 00:18:56 -04:00
Jude Nelson
a1a15460b4 when storing zonefiles, log the remote peer that served them. Also,
don't print the entire inventory (since it can get long), and add an
assertion that the thread that unlocks the peer table is the same one
that locked it.
2016-10-03 00:18:15 -04:00
Jude Nelson
1795f0ebf8 clear indexing state before loading the db 2016-09-29 14:36:19 -04:00
Jude Nelson
c81231b55c use right variable name 2016-09-29 14:16:53 -04:00
Jude Nelson
527f7d3e16 require a name for getting the txid 2016-09-28 20:28:57 -04:00
Jude Nelson
0851ffc901 take namespace parameter when getting namespace price 2016-09-28 20:27:48 -04:00
Jude Nelson
46abc13e9a improve error-path log messages a bit 2016-09-28 20:26:18 -04:00
Jude Nelson
4233614110 take an optional lastblock when determining whether or not a preorder is
"new"
2016-09-28 20:26:01 -04:00
Jude Nelson
438647fea2 update preorder schema to include the txid as well as preorder hash, so
we don't violate the uniqueness constraint if someone reuses the same
key
2016-09-28 19:54:00 -04:00
Jude Nelson
8b5c554a93 accept a dict of expected consensus hashes while verifying the database,
and check each block along the way (instead of just the last one)
2016-09-28 19:53:15 -04:00
Jude Nelson
78f773db00 rework epoch logic to consider per-epoch rules on a per-namespace basis. 2016-09-28 19:52:50 -04:00
Jude Nelson
7fa57c2468 accept raw base64-encoded zonefiles via put_zonefile (API break in 0.14);
do not attempt to parse zonefiles, but instead just store them directly.
2016-09-28 19:52:18 -04:00
Jude Nelson
22bdb8045c whitespace 2016-09-25 23:47:38 -04:00
Jude Nelson
002875f125 fix deadlock conditions in atlas refactoring 2016-09-25 16:12:30 -04:00
Jude Nelson
2dcc7ff522 pass db to zonefile verification 2016-09-25 16:12:15 -04:00
Jude Nelson
def3b3d632 remove needless import 2016-09-22 20:30:33 -04:00
Jude Nelson
7b5fe6deff Merge branch 'develop' into release-candidate 2016-09-21 14:11:10 -04:00
Jude Nelson
6ed3457ea2 remove unused code; pass through db from RPC endpoint 2016-09-21 14:04:28 -04:00
Jude Nelson
65d8a827af pass db handle through to look up txid. don't get_db_state() 2016-09-21 14:04:12 -04:00
Jude Nelson
f266966072 revert back to checking storage every 12 hours 2016-09-20 17:12:47 -04:00
Jude Nelson
bf79be3fb5 retry storage every 2 hours, not 12 2016-09-20 16:35:34 -04:00
Jude Nelson
c38c0d4c19 use separate variables for epoch constants 2016-09-20 16:35:16 -04:00
Jude Nelson
c57bfab3bd pass -1 for offset/length if not known or we don't care (don't use None) 2016-09-16 17:46:14 -04:00
Jude Nelson
6df34adb46 when looking up the txid that funded a zonefile update, go and look up
the name if we aren't given one
2016-09-16 17:45:47 -04:00
Jude Nelson
b7f0b5ae9e when getting all names or names in a namespace, just get the names
themselves.
2016-09-16 17:45:24 -04:00
Jude Nelson
cf71d6b84e bugfix: get_all_names 2016-09-16 17:45:13 -04:00
Jude Nelson
afca0ad5b3 re-crawl storage for missing zonefiles every so often (12 hours by
default).  also, when storing a zonefile we crawled, we don't
necessarily need the txid (i.e. the zonefile can be non-current)
2016-09-16 17:44:40 -04:00
Jude Nelson
c732990977 reset the tried_storage flag on boot-up if we don't have the zonefile 2016-09-16 11:05:43 -04:00
Jude Nelson
993f880eb0 while testing keep the price of a 1-char namespace low so we don't run
out of regtest bitcoin
2016-09-15 17:00:30 -04:00
Jude Nelson
95651ab1ff after loading a zonefile from storage drivers, invoke the garbage
collector.  Otherwise we run out of RAM (due to a weird Python-ism, I
guess--another solution is to avoid looping over all zonefiles trying to
load them one-by-one from storage)
2016-09-15 15:46:56 -04:00
Jude Nelson
d8f9367e16 remove dead code 2016-09-15 15:46:42 -04:00
Jude Nelson
b4bc4997aa some refactoring of the zonefile crawler; only open the atlas db when
needed while crawling zonefiles (since we can crawl a lot of them at
once)
2016-09-15 12:37:06 -04:00
Jude Nelson
b7c35a5b96 a zonefile inventory is "fresh" if we've asked recently, but
the peer is dead and hasn't given us anything
2016-09-15 12:02:12 -04:00
Jude Nelson
5a096ae317 update zonefile inventory refresh time even if we failed to get a
zonefile inventory (stops us from hammering the same dead peer over and
over)
2016-09-15 11:42:20 -04:00
Jude Nelson
e9af1f6406 be pedantic: close the DB handle when we're done with it 2016-09-14 18:17:02 -04:00
Jude Nelson
075cdaa306 less verbose debugging (only log missing zonefiles once) 2016-09-14 17:57:46 -04:00
Jude Nelson
2a8352a17d separate zonefile parsing from storage processing 2016-09-14 17:38:54 -04:00
Jude Nelson
90bd4fa2aa sync symbols 2016-09-14 17:38:45 -04:00
Jude Nelson
ebedd4183a make atlas slightly stupider--don't parse zonefiles; only deal with
data.  Also, use sensible timeouts (instead of constantly pinging
everyone to death)
2016-09-14 17:38:06 -04:00
Jude Nelson
49f4e3e624 zonefile cache directories are broken down by byte 2016-09-14 16:19:26 -04:00
Jude Nelson
ed67947572 pass zonefile=True hint when loading zonefiles 2016-09-14 16:12:57 -04:00
Jude Nelson
61ba8eb3a2 inform virtualchain of our read-only intent 2016-09-14 16:12:43 -04:00
Jude Nelson
a256e77bc5 clarify that atlas only takes well-formed zonefiles 2016-09-14 16:12:29 -04:00