Commit Graph

83 Commits

Author SHA1 Message Date
Jude Nelson
b8db5fdfa4 implement get_state_paths 2016-11-07 11:49:30 -05:00
Jude Nelson
ac74c68889 if we're testing, we're always running 2016-10-28 13:54:18 -04:00
Jude Nelson
dc58363948 also gc before/after atlasdb sync 2016-10-27 16:24:33 -04:00
Jude Nelson
01d6d83b7a don't forget gc 2016-10-27 16:24:25 -04:00
Jude Nelson
c43858ccef strategic garbage collect 2016-10-27 16:10:27 -04:00
Jude Nelson
a82cd3cb1e strategic garbage collection 2016-10-27 15:47:49 -04:00
Jude Nelson
6abc1f0644 remove dead code 2016-10-27 15:47:20 -04:00
Larry Salibra
83c5351282 undo whitespace changes 2016-10-28 00:57:56 +08:00
Larry Salibra
460e982929 fix variable name typo 2016-10-28 00:48:59 +08:00
Jude Nelson
08fac559d6 synchronize atlasdb state on each block, and check for shutdown requests
using the new db_continue() interface
2016-10-27 00:03:52 -04:00
Jude Nelson
71b082832a remove commented-out code 2016-10-24 22:43:49 -04:00
Jude Nelson
ec02bc89a6 comment on what offset/count mean when selecting modifier operations
from a block.
2016-10-24 22:43:25 -04:00
Jude Nelson
6b6c1f3aad queries for the number of names, number of names by namespace, and block
heights with name operations
2016-10-24 17:10:27 -04:00
Jude Nelson
a18028589e get number of names and number of names in a namespace; fix bugs found
in testing
2016-10-24 17:08:45 -04:00
Jude Nelson
7929d100d9 calculate the SNV block operations hash at each block 2016-10-24 03:21:26 -04:00
Jude Nelson
9c61836944 update the calls that query historic name operations to allow the caller
to page through the history.  Also, pre-calculate the SNV block
operation hash, since it never changes and it's expensive to calculate
on-the-fly.
2016-10-24 03:20:36 -04:00
Jude Nelson
432d70d57b Refactor the db to make expensive queries pageable, so we don't
overwhelm the node with one bad RPC.  In particular, make
it so the caller can page through the list of operations that occurred
at a particular block (so the caller can fetch them in small batches),
and make it possible to query the history table directly.
2016-10-24 03:18:47 -04:00
Jude Nelson
d70f003ec2 remove unused code 2016-10-13 20:47:32 -04:00
Jude Nelson
e62739c1e4 take out gratuitous timestamps 2016-10-13 20:47:11 -04:00
Jude Nelson
42a9d9feb2 when looking for points in the blockchain where a name was updated, do
not forget to select on the name itself (lest we read the whole database
into RAM)
2016-10-13 20:20:31 -04:00
Jude Nelson
d4a9b365e9 expand role of method to fetch zonefile information from the name
database
2016-10-11 08:15:08 -04:00
Jude Nelson
333fee0fe7 use a huge timeout for db connections 2016-10-10 12:51:18 -04:00
Jude Nelson
4a8de8c118 add namedb_get_last_nameops() and namedb_get_blocks_with_ops() 2016-10-10 12:02:57 -04:00
Jude Nelson
c5f1029a96 use namedb_get_blocks_with_ops() as a more efficient version of
namedb_get_history_range(), and add get_last_nameops()
2016-10-10 12:02:33 -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
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
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
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
e9af1f6406 be pedantic: close the DB handle when we're done with it 2016-09-14 18:17:02 -04:00
Jude Nelson
61ba8eb3a2 inform virtualchain of our read-only intent 2016-09-14 16:12:43 -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
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
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
9cd931dcfa print CHECK statements for the time being 2016-09-07 11:10:26 -04:00
Jude Nelson
a3cce7c843 when producing the op sequence on state transition, include expired
names.  This is because the acceptance criteria are predicated on the
current block, whereas the op sequence calculation is predicated on the
next block.
2016-09-07 11:09:25 -04:00
Jude Nelson
234903c057 get_name_last_creation_opcode(); better abort debug output 2016-09-05 20:45:27 -04:00
Jude Nelson
f0443a0202 don't need history 2016-09-05 20:45:13 -04:00
Jude Nelson
d42a7614d5 whitespace 2016-09-02 00:21:37 -04:00
Jude Nelson
45194de4bf Merge sqlite3's database to develop. Use a sqlite3 database instead of
a flat file.  Preserve the BlockstackDB API, but be a lot more rigorous
about checking invariants that must hold across state-preordering,
state-creating, and state-transitioning.
2016-09-02 00:19:06 -04:00
Jude Nelson
c93390ef0e sqlite3 merger: add much more rigorous operation-checking:
* identify and preserve invariant properties that must hold across name
state-transitions (like no-collisions, or limiting fields that can
change).
* add history validation
* identify consensus-bearing fields, and how each state-creation or
state-transition may affect them (and add runtime checks to see that
they only affect the fields we say they will)
* add decorators that we can apply to name operations to enforce the
above.
2016-09-02 00:16:36 -04:00
Jude Nelson
8e27fc5586 abort on fatal error 2016-08-30 20:23:52 -04:00
Jude Nelson
d999f1beb7 typo (bug) 2016-08-24 17:42:56 -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
4b5b72fa77 enforce op_fee formatting quirk; check for absurdly high-value transactions
while testing
2016-08-10 16:07:21 -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
d86cbee2de use virtualchain's key logic 2016-08-04 15:42:51 -04:00