Commit Graph

1523 Commits

Author SHA1 Message Date
Mike Dallas dd8b4fa264 Turn a Vec of bytes into a BIP39 mnemonic (#2005)
* add from_entropy() function to turn bytes into a mnemonic

* add tests

* rustfmt
2018-11-21 15:37:00 +00:00
Antioch Peverell 66f2545186 Block accepted reorg aware (#2003)
* block_accepted via adapter is now reorg aware
we skip reconciling the txpool is block is not most work
we skip reconciling the reorg_cache is not a reorg

* rustfmt

* logging tweaks

* rework block_accepted interface

* rustfmt

* rework reorg determination

* introduce BlockStatus to represent next vs reorg vs fork

* rustfmt

* cleanup logging

* log from adapter, even during sync
2018-11-21 14:35:38 +00:00
Antioch Peverell 61f1f6103b Reorg cache time based (cache 30mins of txs) (#2002)
* cache 30 mins of txs for reorg handling
hard limit set the same as the txpool size limit

* rustfmt
2018-11-20 21:47:59 +00:00
Antioch Peverell e86eb641f1 move txpool reconcile_block to after block propagation in adapter (#2000) 2018-11-20 14:55:05 +00:00
Yeastplume 0eec80789a start libtx docs (#1998) 2018-11-20 13:02:51 +00:00
Antioch Peverell 458a980470 [WIP] minimum_confirmations = 10 (#1996)
* default to minimum_confirmation = 10
pass in minimum_confirmations to grin wallet info

* rustfmt

* rebase against master

* fixup wallet tests

* fixup server tests
2018-11-20 11:17:03 +00:00
Yeastplume 5ba163fa66 Provide wallet 'plugin' architecture (#1983)
* remove receive_coinbase fn from wallet to wallet client

* start moving clients into separate mod

* rustfmt

* move wallet client + start listener into wallet 'clients'

* rustfmt

* refactor API to make it more modular and completely decouple sending

* rustfmt

* further decouple API from sending methods

* rustfmt

* remove wallet to wallet client trait

* rustfmt

* rename / refactor client + adapters

* rustfmt

* add adapter concept

* add midding node_clients dir

* add file and null adapters

* rustfmt

* remove receive from owner api

* factor out receiving slates into trait

* rustfmt

* adding listen trait

* rustfmt

* change listener to use trait

* rustfmt

* add test for file-based exchange

* replace http api send command

* rustfmt

* move controller out of libwallet and into top-level wallet dir

* rustfmt

* add moved controller
2018-11-19 19:47:40 +00:00
Ignotus Peverell 66acee8f71 Cuckaroo validation implementation (#1911)
* First pass at iterative siphash
* Generalizing our siphash24 implementation slightly to make it friendlier to repeated hashing
* Block siphash algorithm, Cuckaroo placeholder
* Cuckaroo validator, still needs to be tested with vectors from the @tromp implementation
* Working cuckaroo validation with test vectors for cuckaroo19, will add cuckaroo29 vectors when a lean or mean implementation can find some solutions
2018-11-19 11:03:58 -08:00
pj 77e6e4b41f doc: fix typo (#1995) 2018-11-18 09:10:09 -08:00
hashmap bc36de8187 Remove unsafe code from base58 impl (#1992) 2018-11-17 09:23:54 -08:00
Ryan Zimmerman f8787514f9 Fix build docs (#1994)
* Update rust version requirement in doc/build.md

* Apply previous updates to doc/build_ES.md

English version was updated and ES version wasn't kept in sync
2018-11-17 00:38:26 +01:00
Ignotus Peverell 5f67af52d6 P2p read write (#1993)
Refactor some p2p to use Read/Write over TcpStream
2018-11-16 09:57:16 -08:00
antiochp f7608f5b9c rustfmt 2018-11-16 14:34:05 +00:00
antiochp 4b48eebdfe refactor some p2p to use Read/Write over TcpStream 2018-11-16 14:33:35 +00:00
Antioch Peverell f0fa410273 Streaming headers (#1989)
* headers msg is now "streamed" off the tcp stream

* rustfmt

* cleanup

* move StreamingReader into ser.rs
extract read_exact out into util crate

* rustfmt
2018-11-16 11:00:39 +00:00
hashmap a011450825 Remove unsafe from chain (#1990)
Now roaring bitmap implements Sync and Send, we don't need to implement
it manually for Chain
2018-11-15 23:27:42 +01:00
Ignotus Peverell e4be820671 Configurable max block weight for mining (aka soft limit) (#1976) 2018-11-14 10:22:08 -08:00
Antioch Peverell 2e421191e2 implement read_multi with an internal iterating reader (#1981)
* rework read_multi to use an "iterating reader" internally
we are going to use this for reading headers in batches

* rustfmt
2018-11-14 14:52:43 +00:00
Jacob Gadikian fb3f967a86 Update build.md (#1975)
added LLVM to the dependency one-liner and dependency list for 

https://github.com/saulius/croaring-rs
2018-11-14 10:17:41 +01:00
Antioch Peverell cb652e7ef1 do not treat txhashset.zip download as abusive behavior (#1973)
* do not treat txhashset.zip download as abusive behavior

* count times, not bytes so we exclude quiet increments

* use inc_quiet when tracking sent bytes via an attachment

* add comment

* fixup "quiet" counter entries

* rustfmt
2018-11-13 21:34:45 +00:00
Ignotus Peverell 137c70f6b9 Add cancel_tx and retrieve by tx_slate_id in owner_api (#1963)
* Add retrieve by tx_id in owner_api
* Add cancel tx by tx_slate_id
* Add doc
2018-11-13 09:34:33 -08:00
Ignotus Peverell 5fb8b4764f Replace ftruncate/ftruncate64 with a simple set_len() call (#1961) 2018-11-13 09:31:43 -08:00
Antioch Peverell 01900f2e4d Enable TX_KERNEL_HASH capability by default (#1971) 2018-11-13 09:28:36 -08:00
Yeastplume 5a06f5dac7 Split wallet client trait (#1970)
* complete trait split

* rustfmt
2018-11-13 13:18:33 +01:00
Antioch Peverell 236fe56f60 ask for peers with PEER_LIST capability when asking for more peers (#1969)
do not simply look for peers with the same capabilities we have
2018-11-13 10:59:33 +00:00
Quentin Le Sceller e923b90ad2 Fix tests 2018-11-13 11:57:43 +01:00
Quentin Le Sceller 2ab31d18a3 Add doc 2018-11-13 11:56:48 +01:00
Quentin Le Sceller 59b0f1b1d7 Add cancel tx by tx_slate_id 2018-11-13 11:53:23 +01:00
Antioch Peverell c631b45ab6 cleanup how we deal with flexible rproof size in ser/deser (#1965) 2018-11-13 09:30:40 +00:00
Antioch Peverell a3c1c6d603 Do not use mem::size_of() when calculating serialized size of data (#1967)
* use FixedLength to define serialized size in bytes of various structs
replace usages of mem::size_of() with ::LEN so we correctly calculate serialized sizes in bytes

* rustfmt
2018-11-13 09:30:02 +00:00
Yeastplume 4e6d7e374b wallet seed trim on read (#1964) 2018-11-12 20:09:33 +00:00
Quentin Le Sceller 1b264595e3 Add retrieve by tx_id in owner_api 2018-11-12 19:18:54 +01:00
antiochp f820b3675d cleanup 2018-11-12 13:59:22 +00:00
antiochp 0010a9227e replace ftruncate/ftruncate64 with a simple set_len() call 2018-11-12 13:54:38 +00:00
Mike Dallas 1b65738504 BIP39 Support (#1502)
* add BIP39 word list

* implement BIP39

* add unit tests

* add from_mnemonic() constructor to ExtendedPrivKey

* fix formatting

* update hasher name

* replace rust-crypto supercrate with individual crates

* rustfmt
2018-11-12 10:06:04 +00:00
Antioch Peverell 207621b545 Tx kernel entry (#1957)
* Wrap tx kernels in tx kernel entries when storing them in the MMR.
Decouples the storage impl of kernels.

* rustfmt
2018-11-11 16:03:03 +01:00
Antioch Peverell d0d8d14ac2 cleanup unused compact_transaction code (#1958)
we use a simplified "kernel first" impl
2018-11-11 15:59:05 +01:00
hashmap f5b71b4190 Instantiate wallet once in wallet cli (#1927)
Also remove extra Box to simplify type
2018-11-11 12:56:42 +01:00
Gary Yu 7ff1ee5fde Peer send receive bytes statistics missed response messages and attachment (#1953)
* fix: peer send receive bytes statistics missed response message and attachment

* rustfmt
2018-11-11 07:30:57 +08:00
Gary Yu 2352275dff Suppress some peers logs by trace level instead of debug (#1952)
* suppress some peers boring logs by trace instead of debug

* rustfmt
2018-11-11 07:30:14 +08:00
Antioch Peverell 183d9c9f3e Refactor kernel sig msg creation (#1954)
* refactor kernel msg creation

* rustfmt

* Error not secp::Error

* fix tests for refactored errors
2018-11-10 16:24:11 +01:00
Antioch Peverell 29b2c3384c refactor secp errors in transaction (#1955)
* cleanup secp errors in transaction

* rustfmt
2018-11-10 15:48:45 +01:00
Gary Yu 9af9ca9518 refactor the state_sync to handle the long fork (#1902)
* split horizon into two explicit values for cut through and txhashset request

* let node which has 2-7 days of history be able to handle forks larger than 2 days

* add test simulate_long_fork

* add pause/resume feature on p2p for tests

* refactor the state_sync

* ignore the test case simulate_long_fork for normal Travis-CI

* refactor function check_txhashset_needed to be shared with body_sync

* fix: state TxHashsetDone should allow header sync
2018-11-10 11:27:52 +08:00
Antioch Peverell 408fcc386e show header and chain tip hashes on status page in tui (#1951) 2018-11-09 15:14:25 +00:00
Antioch Peverell 39ebb33ba1 bump 0.4.0 -> 0.4.1 (tx kernel broadcast support) (#1950) 2018-11-09 14:57:25 +00:00
Antioch Peverell 10c6f8d1ad add "User Agent" column to peers in tui (#1949) 2018-11-09 14:47:28 +00:00
Ignotus Peverell ee5fd489bb Moving distro-related files to etc subdir 2018-11-08 22:29:30 +00:00
Dawid Ciężarkiewicz a98f2afa29 Add nix-shell to help test/build on NixOS (#1819) 2018-11-08 14:26:25 -08:00
Yeastplume ee19cfcf86 Wallet self-send (#1939)
* add self send function to wallet

* rustfmt

* add destination to self send method

* update usage doc

* doc clarification

* remove localhost send restriction
2018-11-08 09:46:09 +00:00
Ignotus Peverell e9c50ccb56 Time comparisons are difficult. Or not. 2018-11-08 00:40:28 +00:00