Commit Graph

358 Commits

Author SHA1 Message Date
Ignotus Peverell efe414bf07 No send back for blocks and transactions (#212)
* Do not send txs and blocks to senders. Keeps a ring buffer of transaction and blocks hashes that a peer has received. Do not send what we've already received.
* Test fix and fmt
2017-10-26 17:48:51 +00:00
AntiochP 68bcd79da5 height 0 means we have 0 confirmations (cut-through output?) (#211) 2017-10-26 17:41:08 +00:00
AntiochP d7b94a12f5 only hold wallet write lock for write operations on the wallet (#210)
* mount v2 router for flexibility, wallet checker now refreshes multiple outputs via single api call
* add read_wallet so we can read without acquiring the lock
* fix the api router
* read wallet without acquiring or holding lock, only acquire the write lock for wallet when updating or adding outputs
2017-10-25 21:09:34 +00:00
Ignotus Peverell e2e24bc38e Transaction broadcast (#209)
* Add transaction broadcast to all known peers once they have been
accepted by our own transaction pool.
* Some debug log

Fixes #200
2017-10-25 21:06:24 +00:00
AntiochP 7178b400b8 refresh multiple wallet outputs in single api call (#205)
* mount v2 router for flexibility - wallet checker now refreshes multiple outputs via single api call
* fix the api router
2017-10-25 17:57:48 +00:00
Ignotus Peverell 17837b9199 Get the sumtree roots outside of an extension 2017-10-24 18:12:32 +00:00
AntiochP 68cfbbecad "grin wallet init" to create the initial wallet.seed file (#198)
* "wallet init" to create the initial wallet.seed file
* cleanup and better error msgs
* add some basic wallet docs
* cleanup and make passphrase optional
2017-10-24 17:34:34 +00:00
Ignotus Peverell 1582ec4e73 Fixing repository links after move 2017-10-23 17:20:32 +00:00
Yeastplume 9c0411ac5e Bind to services to all interfaces rather than loopback (#197)
* changing default ip
2017-10-23 16:34:43 +00:00
bgmrk 7f0d638107 Contract Ideas (#194)
* Contract Ideas - Began to catalogue mentions of different contract ideas from the email list.
* Add files via upload
2017-10-23 16:32:15 +00:00
Ignotus Peverell f679a9e458 Consensus change: set reward and base grin unit 2017-10-22 10:56:55 +00:00
Ignotus Peverell 2d105deea7 rustfmt 2017-10-22 10:40:24 +00:00
Ignotus Peverell fd08c34474 Missing mut for test config 2017-10-22 09:44:27 +00:00
Ignotus Peverell 3237df70f6 Spurious mut, different lint level on CI 2017-10-22 09:14:18 +00:00
Ignotus Peverell fc6349f26c Ditto 2017-10-22 08:44:30 +00:00
Ignotus Peverell 556dd012af Last min changes always warrant a recompile... 2017-10-22 08:09:02 +00:00
Ignotus Peverell f1488f9529 Lots of chain sync and block validation fixes
* Fix for the chain pipeline partly relying on an outdated head,
leading to not properly recognizing a fork and inconsistent sum
tree state.
* Do not drop block requests during sync that don't get satisfied,
retry enough time to get them and avoid stall.
* Always validate header, even in sync where we may have validated
it already. We don't want a block coming from a peer that could
squeeze through with an invalid header.
* When syncing, do not mark blocks that were errored by the chain
as received (typical case: orphan). Keep retrying.
* Improved chain state dump for debugging.
* Do not add to orphans blocks too far in the future.
* Better error reporting on db errors.
* Related sync test fixes.

TODO figure out why syncing peers timeout so often, very useful
to test but not that great for a fast sync experience.
2017-10-22 07:11:45 +00:00
Ignotus Peverell f12559f53b Logger init for tests 2017-10-22 07:09:40 +00:00
Ignotus Peverell 6c18451a2b Fix typo (yes I use vi) 2017-10-18 10:26:37 +00:00
AntiochP fa1f2f695b we now mine both txs so update test to reflect this (#189) 2017-10-18 23:23:37 +00:00
AntiochP 4d7b46b0b9 wallet can now optionally spend zero-confirmation txs (#188)
* wallet can now optionally spend zero-confirmation txs
* add rule to get_mineable_transactions based on total pool size
2017-10-18 20:47:37 +00:00
AntiochP bab7bd7060 update_roots on pool to keep it consistent after reconciliation (#182)
* failing test case that exercises
prepare_mineable_transactions and reconcile_block
and highlights what appears to be unexpected behavior
* adjust the failing test - the failure state is where we have
a tx in the pool *but* it is not in the list of roots in the pool
* zero confirmation txs are now working
introduce update_roots to graph to ensure pool is consistent
after calling remove_pool_transaction
* move update_roots to sweep_transactions so we only call it once
rework update_roots to be more efficient
* use HashSet in reconcile_block to avoid marking txs multiple times
* use HashSet and not HashMap
return from mark_transaction early if already seen tx
2017-10-18 20:42:51 +00:00
Ignotus Peverell 6fc48dbae2 More small fixes and improvements to sync 2017-10-18 07:19:44 +00:00
Ignotus Peverell 406642a1f0 Fix for missing header head during sync
Addresses a corner case of sync. If we're still in sync mode but
just caught up to the head, a block could be added through normal
gossip. So we can't short-circuit some of the header handling
even though during sync the header should have already been
validated and saved, because we can still get a block from gossip.
2017-10-18 04:48:21 +00:00
Ignotus Peverell 42ff6c2f6b Clean up last 2 refs to syncing from adapter 2017-10-17 14:06:18 +00:00
Ignotus Peverell affec50588 Warn when no seed configured 2017-10-17 14:00:54 +00:00
Ignotus Peverell 37cc919f6e Doc for new OneTime.is_initialized 2017-10-17 13:56:47 +00:00
Ignotus Peverell 4fa7f34b7e Use local ref to syncing 2017-10-17 13:55:12 +00:00
Ignotus Peverell 28ac46c563 Do not sync when configured with no seeding 2017-10-17 13:51:02 +00:00
Ignotus Peverell 7dbd1ef962 Did not mean to commit that at all 2017-10-17 12:41:57 +00:00
Ignotus Peverell efdbcd600a Miner process wait until sync. Fix #185 2017-10-17 12:18:21 +00:00
Ignotus Peverell 60efa62896 Dead downloads need to be retried, not discarded 2017-10-17 09:38:55 +00:00
Ignotus Peverell ef08140ad7 Merge branch 'master' of github.com:ignopeverell/grin 2017-10-17 08:47:48 +00:00
Yeastplume 2bc7624ca8 Update cuckoo miner tag (#183)
Fixes #143 and mimblewimble/cuckoo-miner#12
2017-10-17 16:53:39 +00:00
Ignotus Peverell 837ef0fd03 Added detail about kernel sticking around 2017-10-17 03:20:31 +00:00
Yeastplume 8f76746e84 Switch commitments (#179)
* Adding switch commit to grin outputs
* logging output fix
* adding switch commitment hash to sum tree node
* added hash_with to Hashed trait, to allow for hashing to include another writeable element
* adding hash_with as method in hashed trait
2017-10-16 21:23:10 +00:00
AntiochP c84a136e48 refactor burn key into key_overrides on keychain (#178)
* refactor burn key into key_overrides on keychain
* introduce UnconfirmedChange output status, we can potentially spend these with zero confirmations
* pass in burn_key_id for the burn enabled keychain, spend *all* coins when spending from a wallet, spend UnconfirmedChange coins also
* add comment about simplifying wallet_data.select logic
* replace UnconfirmedChange output status with a more flexible zero_ok, flag on the output data
2017-10-16 17:11:01 +00:00
Ignotus Peverell 472912c68c Added clarification about block struct 2017-10-15 20:44:34 +00:00
Ignotus Peverell aa520d34d5 Move new block notif out of sumtree lock. Fix #180 2017-10-15 20:44:34 +00:00
Ignotus Peverell dd90031902 Doc tweaks after feedback 2017-10-15 20:44:34 +00:00
AntiochP 9a230ca7f6 fail deserialization if inputs or outputs are not sorted for txs (#173)
* fail deserialization if input or outputs are not sorted for txs, fail deserialization if inputs or outputs or kernels are not sorted for blocks, make sure we sort them before serialization
* extract consensus rule into verify_sort_order on VerifySortOrder trait
* rework the sort and write into WriteableSorted trait
* fix wallet sending bug (fees related) so we can test
* refactored read_and_verify_ordered out into ser, used in transaction and block
2017-10-13 17:23:18 +00:00
Yeastplume 49797853d9 tweaks to logging configuration (#176)
* tweaks to logging configuration
* doc port update
2017-10-13 16:42:04 +00:00
Ignotus Peverell dda10a6dee Wrong extensions 2017-10-13 05:12:39 +00:00
Ignotus Peverell 77ce116eda Small guide and FAQ for people coming from a bitcoin background 2017-10-13 05:11:42 +00:00
AntiochP 86420d4bca Shorter identifiers and call them key_id (not pubkey) (#175)
* rename pubkey -> key_id, these are key identifiers, not public keys
* reduce identifier seize to 10 bytes, get rid of fingerprints (identifiers are now small enough to use as-is)
* IDENTIFIER_SIZE const
* add FeeDispute error for when sender and recipient disagre on fee calculation (should never happen)
* does not need to be mut
* cleaned up some warnings
2017-10-13 04:45:07 +00:00
Ignotus Peverell 957e402eae Always clean up block download list, report error 2017-10-12 19:36:57 +00:00
Ignotus Peverell 361e39c87c Log connection errors 2017-10-12 19:26:10 +00:00
Ignotus Peverell 2222b28981 Dump sumtrees state on error 2017-10-12 19:23:58 +00:00
Yeastplume 8e382a7593 slog-rs logging (#171)
* added global slog instance, changed all logging macro formats to include logger instance
* adding configuration to logging, allowing for multiple log outputs
* updates to test, changes to build docs
* rustfmt
* moving logging functions into util crate
2017-10-12 16:56:44 +00:00
Ignotus Peverell b85006ebe5 Wallet operation to burn some coins (#172)
* Burn transaction for testing
* Burn bug fixes, embed burn key in keychain
* Better error logging in API, wallet fee calc fix
2017-10-12 03:35:40 +00:00