Commit Graph

279 Commits

Author SHA1 Message Date
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
Jude Nelson
31144dd34f no need for get_db_state or bloom filters 2016-09-14 16:12:20 -04:00
Jude Nelson
67ce3c557b use 2-char zonefile directory names 2016-09-14 14:52:26 -04:00
Jude Nelson
c19cda29eb don't log unparsable zonefiles 2016-09-13 22:26:16 -04:00
Jude Nelson
63fb35a8d8 use atlasdb_open to set the proper row factory 2016-09-13 22:20:40 -04:00
Jude Nelson
ae45aa947b use iterative construction of zonefile inventory instead of list
comprehension
2016-09-13 22:13:42 -04:00
Jude Nelson
2d1a4a9e84 put the PID file *before* bootstrapping atlas 2016-09-13 22:07:23 -04:00
Jude Nelson
245d939ec8 use right comparison in server version 2016-09-13 22:07:10 -04:00
Jude Nelson
5d39ee7fc9 pass along name to zonefile storage driver whenever possible 2016-09-13 16:31:40 -04:00
Jude Nelson
3ca538136f pass along name to zonefile storage driver whenever possible 2016-09-13 16:31:23 -04:00
Jude Nelson
eb179d23d5 update zonefile acquisition logic: try storage drivers first, and then
try atlas peers.  Only try storage drivers once per zonefile hash either
way (add a 'tried_storage' column to the atlas db to track this)
2016-09-13 16:30:41 -04:00
Jude Nelson
fc62c5892f fix epoch look up and abort on failure 2016-09-12 18:00:44 -04:00
Jude Nelson
c4cf324e1b register/renew can mutate op_fee, since the epoch can change between
preorder/register or register/renew.  Also, when considering name
prices, use the preorder's block number (i.e. the epoch the preorder
occurred in determines the price to pay, not the register).  For
renewals, however, use the current block height to determine the fee.
2016-09-12 17:59:35 -04:00
Jude Nelson
41c22f172a remove dead code 2016-09-12 17:59:29 -04:00
Jude Nelson
f6d81c332d back up op_fee, since it can change due to an epoch change 2016-09-12 17:59:14 -04:00
Jude Nelson
7792395b69 optionally get a preorder for a name that already exists (i.e. a failed
preorder)
2016-09-12 17:58:58 -04:00
Jude Nelson
06bc0bb15c find the current epoch's namespace lifetime multiplier and use it to
calculate the expire block for a name
2016-09-12 17:58:38 -04:00
Jude Nelson
5f11ba1658 set default port 2016-09-09 17:11:24 -04:00