Commit graph

1691 commits

Author SHA1 Message Date
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
Ignotus Peverell
f7d0fe1840
Bug fix, tuning of peer message rate counting 2018-11-07 22:15:12 +00:00
Antioch Peverell
ab30f714fc
Capabilities now deserialize safely (#1946)
* deserialize capabilities dropping unknown flag bits

* add tests for capabilities deserialization

* rustfmt

* FULL_NODE needs to be handled safely for legacy nodes
2018-11-07 11:15:37 +00:00
Antioch Peverell
e25a3b9d72
Fix capabilities (#1944)
* we cannot safely update nodes to use capabilities bits = 15 ...

* rustfmt
2018-11-07 10:00:42 +00:00
Antioch Peverell
949f75c77c
fix the lock on the new mutex (#1942) 2018-11-07 09:40:39 +00:00
Antioch Peverell
d97a6c2189
[DNM] broadcast tx kernel hash (if supported by peer) (#1929)
broadcast tx kernel hash (if supported by peer)
2018-11-07 09:28:17 +00:00
Ignotus Peverell
8b546632fe
Peer rate limiting (#1933)
* Rate counter in peer conn to monitor traffic 
* Ban peers that trigger is_abusive
2018-11-06 17:51:22 -08:00
hashmap
d2088ff48c Fix recently introduced peer deadlock (#1941) 2018-11-06 16:42:36 -08:00
hashmap
8742c334dd Remove unsafe sync/send impl for Peers (#1938)
This is really unsafe. Fixes #1937

* Switch to better mutex
2018-11-06 08:59:46 -08:00
hashmap
0af1f13bf9 Fix IPV6 address deserialization (#1932)
Fuzz test found that we don't read IPV6 addr (as part of p2p message)
properly. The code is supposed to read 8 dwords, but [0..8] is not a
slice of 8 ints, but a slice of one Range, so we always read just one
dword
2018-11-05 20:38:41 -08:00
hashmap
109a426990
Add fuzz tests for p2p crate (#1931)
Add fuzz tests for p2p crate
2018-11-05 21:50:16 +01:00
Antioch Peverell
26d449a08b
only rewind and reapply on header extension if necessary (#1930)
* only rewind and reapply on header extension if necessary

* use head of full block chain
2018-11-05 19:59:39 +00:00
Gary Yu
1b264d3554
protection of parallel requests of TxHashSetRequest (#1923)
* protection of parallel requests of TxHashSetRequest

* fix: adapt the test of test_unexpected_zip
2018-11-05 22:56:45 +08:00
Quentin Le Sceller
24ed4b787a
Add a maximum size to stempool (#1895)
* Add a maximum size to stempool

* Simplify logic
2018-11-05 13:51:52 +01:00
Antioch Peverell
d3a8613e43
use hash_file abstraction for pmmr backend (#1925)
* use HashFile (wraps an AppendOnlyFile) in the PMMR backend

* rustfmt

* cleanup

* rustfmt
2018-11-05 12:01:24 +00:00
j0hnta
92e41fa571 doc: Add Japanese translation of intro.md (#1917)
* doc: Add Japanese translation of intro.md

* doc: fixes

* doc: add link to japanese translation

* doc: fix typo
2018-11-05 09:58:44 +01:00
Gary Yu
d56ef364c4
fix: init_test_logger update for log4rs (#1921) 2018-11-05 11:57:59 +08:00
Ignotus Peverell
f276de1719
Revert #1643, fixes #1654, header head not updating on low diff 2018-11-05 01:50:33 +00:00
hashmap
04438347ad Fix wallet output for old config (#1919)
Wallet output operations expect now color scheme be defined in the
configuration file. This fix makes it works for old configuration files.
2018-11-05 07:58:10 +08:00
hashmap
53bce41981
Don't use process::exit in wallet cmd (#1913)
Unlike panic it doesn't call destructors (Drop) so all open transactions
are not closed. It's fine when LMDB file is open by the current process
only, but if another process keeps the same file open such transactions
will be considered alive until the second process exits. We usually have
one or more long-lived process (like `wallet listen`) which opens the
same wallet db as short-lived wallet commands. When a command fails it
calls process::exit and as result leaks a transaction.
This pr replaces such calls with an exit code return, which allows to call
all destructors before calling process::exit.
Fixes #1822
2018-11-04 21:26:46 +01:00
Gary Yu
f645937a2b replace cyan and yellow which not easy to read on white background (#1903)
* replace cyan and yellow which not easy to read on white background

* wallet output color scheme configuration for terminal dark/white background

* use true for dark_background_color_scheme to make the default behavior same as before
2018-11-03 09:42:41 +01:00
Jeff Barg
cc63fe4d32 refactor: refactored the API into related handler files (#1914) 2018-11-03 07:46:12 +01:00
eupn
40d727a01c fix: more readable timestamp format for logging (#1912)
* Use more readable timestamp format for logging

* Add logging level highlighting

* Change date and time format to YYYYMMDD from MM-DD
2018-11-02 15:13:12 +00:00
Antioch Peverell
d23dec73d0
PMMRable cleanup (#1910)
* cleanup pmmrable and len()
introduce FixedLength trait with a const LEN
make Hash impl FixedLength for consistency

* rustfmt

* store tests cleanup

* rustfmt

* whats going on with those comments and rustfmt?
2018-11-01 20:14:46 +00:00
hashmap
9cebbf24b8 Update TLS wallet doc (#1908)
Cover Stratum server changes
2018-11-01 10:37:48 -07:00
hashmap
b087325761 Don't die on malformed HTTPS request (#1907)
Fixes #1906
2018-11-01 23:03:32 +08:00
Yeastplume
9d0641c2b8
Wallet restore fix (#1904)
* wallet restore txlog + status fixes

* rustfmt
2018-11-01 11:36:29 +00:00
hashmap
368e1a461e
Tiny store crate cleanup (#1899) 2018-11-01 12:34:47 +01:00
Antioch Peverell
12be191ecd
validate root of header MMR when processing headers (during sync and full blocks) (#1836)
validate root of header MMR when processing headers (during sync and full blocks) (#1836)
2018-11-01 09:51:32 +00:00
Gary Yu
e8f4c47178 Avoid unnecessary panic of some wallet commands (#1893)
Replace wallet command panic with map_err or unwrap_or_else
2018-10-31 13:26:17 -07:00
Antioch Peverell
d51522a9cd Genesis is height 0 (not height 1) (#1896) 2018-10-31 13:24:21 -07:00
hashmap
b01fcd2f56 Remove unused unsafe declarations (#1901) 2018-10-31 13:19:28 -07:00
Ignotus Peverell
385b385456
Minor block.rs cleanup (#1889) 2018-10-31 13:18:59 -07:00