Commit Graph

261 Commits

Author SHA1 Message Date
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
Jude Nelson
8e7c78f3d3 remove dead code 2016-09-09 16:55:30 -04:00
Jude Nelson
84266a9f2e if re-revealing an expired namespace of the same name, reconstruct the
appropriate history snapshot first (i.e. the previous revealed state)
2016-09-09 16:55:01 -04:00
Jude Nelson
8f7e37a414 add include_expired to get_namespace_op_state; fix get_namespace_at to
work at all block heights
2016-09-09 16:54:36 -04:00
Jude Nelson
d33aa69228 check namespace fields before updating it; when selecting a namespace at
a block height, optionally ignore the reveal block
2016-09-09 16:53:45 -04:00
Jude Nelson
f60a9b73d4 report correct expire block 2016-09-09 16:53:27 -04:00
Jude Nelson
dfb4cbea2d use new epoch system to determine correct price multipliers 2016-09-09 11:20:26 -04:00
Jude Nelson
c6c8c9a4f9 API sync 2016-09-09 11:20:16 -04:00
Jude Nelson
f094d3cb1d WIP: make expired namespace_reveals restorable 2016-09-09 11:19:56 -04:00
Jude Nelson
0143b7cb85 new price_name() API sync 2016-09-09 11:19:38 -04:00
Jude Nelson
60e82529fe better history index notation in debug output 2016-09-09 11:19:23 -04:00
Jude Nelson
feed3422ee get_namespace_op_state() for getting historic namespace states; on
committing a state transition, include expired namespace op sequences
(this is because the block we're processing is one block later than the
block we used to query properties about the namespace--we need to ensure
that if we have a state-transition on a namespace that occurred on the
last possible block, we still accept it)
2016-09-09 11:17:53 -04:00
Jude Nelson
4802c6638b WIP: use the new epoch system; working on restoring expired
namespace_reveals
2016-09-09 11:16:55 -04:00
Jude Nelson
eb430d4258 WIP: add a notion of a "settings epoch" to the server, where some
settings are only valid for certain block ranges
2016-09-09 11:16:18 -04:00
Jude Nelson
70b7957141 add get_namespace_cost(); pass working db path to verifydb 2016-09-09 11:15:51 -04:00
Jude Nelson
9cd931dcfa print CHECK statements for the time being 2016-09-07 11:10:26 -04:00