Commit graph

2152 commits

Author SHA1 Message Date
eupn
56b62a319b Fill BlindingFactor with zeros on Drop (#2847)
* Implement simple zeroing of BlindingFactor in Drop

* rustfmt

* Make Debug implementation for BlindingFactor empty

* Implement BlindingFactor zeroing unit test

* mnemonic.rs: fix deprecated warning in test_bip39_random test

* Use zeroize crate to clear BlindingFactor

* Fix comment and implement dummy Debug trait for BlindingFactor

* Fix formatter
2019-05-30 23:16:53 +02:00
hashmap
25a2ee1233 Fix unused doc warning in Rust 1.35 (#2863)
This version brings a new warning to inform that rustdoc doesn't add docs for macro
expansions
2019-05-30 08:04:17 +08:00
hashmap
2863ed67fd Speedup shutdown (#2862)
I made an suboptimal (aka stupid) decision to stop and wait for peers
one by one which makes shutdown very slow - O(n). This PR decouples sending
stop signal from waiting a thread to exit. On top of it in Peers we
first send stop signal to all peers and only after that start waiting
for them to exit. It gives us a constant time of shutdown in most of the
cases.
2019-05-30 08:03:12 +08:00
Quentin Le Sceller
a1f71deba0
Remove Travis and Gitlab CI (#2861) 2019-05-29 15:35:24 -04:00
Yeastplume
bb793defa7
De/Serialize signatures (for slate consumption) to compressed format rather than raw (#2852)
* Serialize signatures in custom secp serializer as compact format instead of raw

* rustfmt
2019-05-28 16:48:24 +01:00
Quentin Le Sceller
ee9b9fe763
Update minimum required rust version and dockerfile (#2858) 2019-05-28 11:02:10 -04:00
Michalis Kargakis
a745df3e40 Add commented webhook config (#2849)
* Add commented webhook config

* Remove redundant config
2019-05-28 06:47:10 +02:00
eupn
7e57c10ec7 Remove TODO (#2854) 2019-05-27 13:15:47 -04:00
Mike Dallas
4b88a9b5bd impl Readable/Writable for PublicKey (#2841)
* impl Readable/Writable for PublicKey

* rustfmt
2019-05-27 10:19:24 +01:00
eupn
249fe03d5c Remove needless lifetimes (#2845)
* Remove lifetimes that could be elided

* rustfmt
2019-05-25 17:13:36 +01:00
eupn
f17dd5fa44 Fix warnings in tests (#2846) 2019-05-25 17:13:09 +01:00
eupn
a2a350dac7 txhashset: remove unnecessary mutability from self references in getters (#2844)
* txhashset.rs: make self references immutable in getters

* rustfmt
2019-05-25 17:12:32 +01:00
eupn
9f28e6aaa3 Replace S and R with corresponding ASCII arrows in bandwidth column (#2836) 2019-05-24 23:41:51 +02:00
eupn
f9c5505e9f Report reorg depth in block status (#2839)
* Calculate reorg depth in BlockStatus::Reorg enum member

* rustfmt

* Fix reorg height calculation and implement reorg test

* rustfmt

* Report reorg depth in webhook payload

* Add optional depth field to the block webhook JSON reply
2019-05-24 21:44:28 +02:00
Quentin Le Sceller
572be5d264 Update Cursive to 0.12 (#2831)
* Update Cursive to 0.12

* Update windows CI patch
2019-05-20 14:25:12 -07:00
hashmap
9c32321c57
Fix the curve name in one section of intro (#2823) 2019-05-17 22:03:17 +02:00
hashmap
9ab23f6eef Implement graceful shutdown (#2812)
* Remove stop status mutex
* remove some deadlocks
* Rewrite stop channel handling
* fix deadlock in peers object
* add missing test fixes
2019-05-15 08:51:35 -07:00
jaspervdm
884851cdeb Modifiy visibility for request functions (#2826) 2019-05-15 14:23:16 +01:00
Max Levy
136a4ba207 a tiny clarification about the point H (#2774)
IMHO, introducing the point _H_ explicitly makes the explanation arguably a bit more clear
2019-05-14 14:05:54 -07:00
Antioch Peverell
e56cd55980
initial support for kernel data download (#2765)
* initial support for kernel data download

* fix vec backend for tests

* cleanup after rebase
2019-05-14 17:17:38 +01:00
Antioch Peverell
ff1c55193f Wrap MsgHeader in MsgHeaderWrapper for Known/Unknown msg type support (#2791)
* wrap MsgHeader in MsgHeaderWrapper for Known/Unknown msg type support.
* cleanup based on feedback
2019-05-14 09:07:51 -07:00
Antioch Peverell
4ba7b0a46a make sure we use BigEndian when reading numbers via StreamingReader (#2821) 2019-05-13 15:04:14 -07:00
Quentin Le Sceller
59db5e3bd1 Evict transaction from transaction pool (#2797)
* Evict transaction from transaction pool

* Remove Result from evict function
2019-05-13 15:03:47 -07:00
Daogang Tang
15b56a97f5 docs: fix typo. (#2816)
Signed-off-by: Mike Tang <daogangtang@gmail.com>
2019-05-13 14:47:09 -07:00
Daogang Tang
9ac4143bc9 fix: try to fix issue #2585 by adding block cleanup from db directly. (#2815)
* fix: try to fix issue #2585 by adding block cleanup from db directly.

Signed-off-by: Mike Tang <daogangtang@gmail.com>

* use another effective algorithm to do old block and short-lived block cleaup.

Signed-off-by: Mike Tang <daogangtang@gmail.com>

* 1. rename iter_lived_blocks to blocks_iter;
2. comments and iterator calling optimiztions.

Signed-off-by: Mike Tang <daogangtang@gmail.com>

* Fix locking bug when calling is_on_current_chain() in batch.blocks_iter just by removing it.
Because "we want to delete block older (i.e. lower height) than tail.height".

Signed-off-by: Mike Tang <daogangtang@gmail.com>
2019-05-13 16:10:31 +01:00
Quentin Le Sceller
998824ecf3 Add Azure-pipeline badge (#2818)
* Add Azure-pipeline badge

* Fix formatting
2019-05-09 10:54:24 -07:00
Quentin Le Sceller
567ed95fc2
Set up CI with Azure Pipelines (#2744)
Set up CI with Azure Pipelines
2019-05-09 13:15:10 -04:00
Antioch Peverell
fabff51dd3
Header version cleanup (#2809)
* introduce HeaderVersion (was u16) for type safety
cleanup pow ser/deser (version unused)

* fixup tests for HeaderVersion

* validate header version during header deserialization
2019-05-08 21:10:42 +01:00
Antioch Peverell
8d5f73e8f1
Protocol version type safety (#2811)
* add type safety for protocol_version

* cleanup tui for protocol version

* cleanup
2019-05-08 20:51:07 +01:00
John Tromp
4ad2ed48a3 add proofsize check in pow verify (#2805) 2019-05-05 11:51:46 +02:00
Antioch Peverell
4ef4212f1f
Simplify peer connection handling (#2801)
* connection no longer wrapped in an Option in peer

* introduce peer.send()

* remove some Arc indirection

* self.send() cleanup

* extract Peer:new() from connect and accept

* fixup

* cleanup
2019-05-03 15:56:25 +01:00
Antioch Peverell
6c54c90101
remove the error_channel and simplify how we close peer connections (#2796) 2019-05-03 15:35:43 +01:00
Antioch Peverell
d3b4526e03
mimblewinble -> mimblewimble (#2803) 2019-05-03 13:48:25 +01:00
hashmap
55cbdf58fe
Gracefully shutdown if SIGINT was sent in TUI mode (#2784)
Fixes #2799

Also 2 Arc's were replaced by one server's instance.
It is needed for p2p thread management in #2778, currently there is no point where we could store thread handles and join them because thread::join
consume the caller, which is impossible in case of Arc.
2019-05-03 14:20:36 +02:00
Antioch Peverell
85d06fe416
fix typo (#2802)
single char typo - merging
2019-05-03 12:07:39 +01:00
fresheneesz
7f12b45a34 Updating the (dead) link to the transaction UML (#2798) 2019-05-02 15:16:04 -04:00
Antioch Peverell
b9db129b33 Add debug logging on startup to provide size of our leaf_set (aka UTXO set) (#2788) 2019-04-30 12:27:37 -07:00
Antioch Peverell
6352780d6a Bump rand crate to 0.6 (was 0.5) (#2790)
shuffle was deprecated, fix this up
2019-04-30 12:25:19 -07:00
Antioch Peverell
b2b96f3f81
bucket_transactions is now fee_to_weight aware (#2758)
* bucket_transactions is now fee_to_weight aware
bucket_transactions now returns the underlying txs

* cleanup

* simplify pool bucket sorting, no need for depth sort key
2019-04-30 12:14:02 +01:00
hashmap
3d0f9bd0d3 Set TUI FPS (#2783)
New version of Cursive allows to set fps, the existing  set_autorefresh sets 30 fps. This change decreases CPU usage from 50-65% to 15-25% on my machine.
2019-04-30 08:04:36 +08:00
hashmap
304ae444ab
Fix peer dropping (#2780)
It turns out that we drop connection if we fail to process a message
because of chain/store/internal error, eg we have a header already, so
we refuse it and drop the peer.
This pr doesn't forward this error to the peer error channel so the
connection will not be dropped.
2019-04-26 20:22:07 +02:00
Ignotus Peverell
81a6af9624
Increase peer max count significantly (#2754)
* Increase peer max count significantly

* Reduce limit to 125, like bitcoin
2019-04-24 15:04:59 -07:00
Antioch Peverell
de21f0d62d Cleanup how we deal with fixed size vs variable size data files (#2757)
introduce a SizeInfo enum (to replace two options)
2019-04-24 13:43:06 -07:00
Antioch Peverell
e72409d804 Bump the version of croaring to 0.3.9 (#2763) 2019-04-24 11:17:20 -07:00
Antioch Peverell
19106b3643 Relax our p2p rules around matching protocol versions (#2764) 2019-04-24 11:15:08 -07:00
hashmap
3c400f7e2a Fix unused import warnings (#2775) 2019-04-23 18:16:03 +08:00
David Burkett
0e6a249126 Increasing thread sleeps for socket listener thread and per-connection threads. (#2773) 2019-04-23 08:29:24 +02:00
Gary Yu
97e96e4fcf use a grin specific tmp dir instead of a system tmp dir (#2753) (#2772)
* use a grin specific tmp dir instead of a system tmp dir

* rustfmt

* using create_new instead of create

* switch the txhashset sandbox from system tmp dir to grin specific tmp dir

* rustfmt

* adapter get_tmp_dir delegate to chain implementation

* simply the logic of protolc for get_tmpfile_pathname

* rustfmt

* fix the merge mistake
2019-04-22 16:54:36 -07:00
Antioch Peverell
d7f940e160 cleanup unused data_file_path (#2766) 2019-04-22 16:53:53 -07:00
Gary Yu
b61b773cee Get back the lost code of #2575 (#2771) 2019-04-22 16:53:24 -07:00