Commit graph

440 commits

Author SHA1 Message Date
Antioch Peverell
72a6eb81e8
bump to 5.1.0 to prep for release (#3639) 2021-05-06 13:02:01 +01:00
Antioch Peverell
87729a2227
bump crate version to 5.1.0-beta.2 to prep for release (#3636) 2021-04-29 13:05:28 +01:00
Quentin Le Sceller
0259ed23ea
Update copyright year to 2021 (#3592)
* Update copyright year to 2021
2021-03-10 10:14:48 -05:00
Quentin Le Sceller
725622da7a
Remove imports and cleanups (#3590)
* Remove unused import and if else chain
2021-03-08 11:09:41 -05:00
Antioch Peverell
4284458e17
more consistent handling of peers_preferred during startup (#3578) 2021-03-02 20:34:55 +00:00
Antioch Peverell
08523b2b39
add BLOCK_HIST capabilities on startup if config archive_mode=true (#3563) 2021-02-23 11:40:48 +00:00
Antioch Peverell
a3c9b478e2
[5.0.x] inefficient locking on recv of peers lists can result in failure to get peers lock (#3566) (#3570)
* fix for: inefficient locking of peers lists can result in failure to get peers lock

* dont hold the peers Vec lock while writing to the peers lmdb

Co-authored-by: Blade Doyle <bladedoyle@gmail.com>
2021-02-22 15:18:09 +00:00
Antioch Peverell
5b9664bccf
inc quietly on small batches of headers (#3564) 2021-02-16 14:36:28 +00:00
Antioch Peverell
524dbd0170
pibd capabilities test was only relevant temporarily (#3565)
while we did not enable it by default
2021-02-16 11:28:01 +00:00
Antioch Peverell
4ab72902e0
add rate limiting to outbound p2p msg sending (#3560)
treat peers as abusive based on incoming msgs, not outgoing msg rates
2021-02-15 13:49:31 +00:00
jaspervdm
35ebdea967
Bump master version to 5.1.0-alpha.1 (#3510) 2021-01-04 15:29:50 +00:00
Antioch Peverell
1baa59c44d
prefer outbound peers when syncing (consistently) (#3521)
but use inbound peer for header and body sync if necessary
sync state from inbound peer if no outbound peers to sync from
2020-12-15 19:11:51 +00:00
Antioch Peverell
f48a23655d
bump 5.0.0-beta.2 after fixing windows release script (#3508) 2020-11-26 21:35:10 +00:00
jaspervdm
64c8e0cf0a
Bump version to 5.0.0-beta.1 (#3505) 2020-11-26 18:48:16 +01:00
John Tromp
48efb693e2
Fixfees (#3481)
* add FeeFields type

* use FeeFields with ::zero and try_into().unwrap()

* fixed tests

* avoid 0 accept_base_fee

* add aggregate_fee_fields method for transaction

* implement std::fmt::Display trait for FeeFields

* make base_fee argument non-optional in libtx::mod::tx_fee

* add global and thread local accept_fee_base; use to simplify tests

* set unusually high fee base for a change

* revert to optional base fee argument; default coming from either grin-{server,wallet}.toml

* remove optional base fee argument; can be set with global::set_local_accept_fee_base instead

* define constant global::DEFAULT_ACCEPT_FEE_BASE and set global value

* add Transaction::accept_fee() method and use

* Manual (de)ser impl on FeeFields

* fix comment bug

* Serialize FeeFields as int in tx

* allow feefields: u32:into() for tests

* try adding height args everywhere

* make FeeFields shift/fee methods height dependent

* prior to hf4 feefield testing

* rename selected fee_fields back to fee for serialization compatibility

* fix test_fee_fields test, merge conflict, and doctest use of obsolete fee_fields

* make accept_fee height dependent

* Accept any u64 in FeeFields deser

Co-authored-by: Jasper van der Maarel <j@sper.dev>
2020-11-26 18:03:06 +01:00
Antioch Peverell
14f4683ca1
enable PIBD_HIST capability by default (#3500) 2020-11-26 09:53:00 +00:00
jaspervdm
96afc766a1
PIBD segment p2p messages (#3496)
* Define PIBD segment p2p messages

* Respond to segment requests

* Use specialized (de)ser for output bitmap segments

* Allowed segment height ranges in const
2020-11-25 21:52:09 +01:00
John Tromp
f86102b2a6
fixDAA; implement wtema (#3477)
* implement wtema

* reduce FTL from 12 to 5 mins; fix inaccuracies in cuckoo doc

* rename difficulty window for DampedMovingAverage DAA

* fix FTL error msg

* secondary_scale becomes extended nonce past HF4

* secondary_scale change actually belongs in hardfork4 PR

* make future time limit configurable

* define constant global::DEFAULT_FUTURE_TIME_LIMIT and refactor a bit

* fix typos

* as_ref() feels safer than as_mut() :-)

* remove obsolete mut

* make future_time_limit non-mandatory in grin-server.toml
2020-11-25 10:58:39 +00:00
Antioch Peverell
b5c6d24b40
default capabilities cleanup (#3484)
* default capabilities cleanup

* fix tests for unused pibd capabilities
2020-11-21 21:49:19 +00:00
Antioch Peverell
25fcefada2
Flexible peer filtering (#3458)
* first pass at peers iter cleanup

* more flexible peer with diff lookups

* PeersIter with impl Iterator

* sync against outbound peers
reorder peers filters so expensive filters come later

* filter peers by capabilities during sync

* prefer outbound peers with high total difficulty

* with_difficulty now takes a fn to allow more flexible comparisons based on difficulty

* rename peers_iter() -> iter()
2020-10-27 12:36:00 +00:00
Quentin Le Sceller
cf2a65242d
Rename Floonet to Testnet (#3431)
* Rename Floonet to Testnet

* Fix test

* Rename test and docker
2020-10-07 09:36:02 -04:00
Antioch Peverell
e7bbda81a0
migrate blocks in batches (rework db iterator impl) (#3450)
* rework db iterator
more robust block migration based on low level iterator

* cleanup

* cleanup

* fixup
2020-10-07 11:47:25 +01:00
Antioch Peverell
f25b7ae032
use choose_multiple to clean get_peers() up (#3457) 2020-10-01 14:42:57 -04:00
jaspervdm
defc714f6e
Refactor p2p reader (#3433)
* Refactor p2p reader

* Rename Output enum

* Consume enum takes owned values instead of references

* Deserialization in codec, remove Consume enum

* Calculate block header size

* Read headers in batches

* Remove headers type from deserializer
2020-09-28 14:43:37 +01:00
Antioch Peverell
a22d98e9d5
bump working version on master to 4.2.0-alpha.1 (#3443)
we now have a current/4.1.x branch for 4.1.0 release
2020-09-15 17:26:44 +01:00
Antioch Peverell
655e080963
maintain preferred peer connections (#3435) 2020-09-08 08:22:19 +01:00
Antioch Peverell
7dc94576bd
Introduce CommitOnly variant of Inputs (#3419)
* Introduce CommitOnly variant of Inputs.
Introduce CommitWrapper so we can sort commit only inputs correctly.

* rememebr to resort if converting

* write inputs based on variant and protocol version

* read and write protocol version specific inputs

* store full blocks in local db in v3
convert to v2 when relaying to v2 peers

* add debug version_str for inputs

* no assumptions about spent index sort order

* add additional version debug logs

* fix ser/deser tests for proto v3

* cleanup coinbase maturity

* rework pool to better handle v2 conversion robustly

* cleanup txpool add_to_pool

* fix nrd kernel test

* move init conversion earlier

* cleanup

* cleanup based on PR feedback
2020-09-07 16:58:41 +01:00
Nym Seddon
d78980c4c4
P2P replace DNS panic with map_err (#3383)
Replace panic on DNS resolution error with map_err to bubble
up error to the caller

Co-authored-by: Nym Seddon <unseddd@shh.xyz>
2020-07-17 13:44:43 +01:00
Antioch Peverell
824c51a346
bump version to 4.1.0 on master (4.0.1 on 4.0.x branch) (#3390) 2020-07-13 12:16:43 +01:00
Antioch Peverell
30db9c410e
bump master to 4.0.1-alpha.1 to differentiate from 4.0.0 official tagged build (#3374) 2020-07-02 15:51:11 +01:00
Yeastplume
7abe9fcb39
Versioning for 4.0.0 release (#3373) 2020-07-02 10:29:10 +01:00
Yeastplume
098d25e569
Version bump for 4.0.0-rc.1 (#3366) 2020-06-26 13:10:42 +01:00
Antioch Peverell
55a929e214
cleanup old unused code (#3355) 2020-06-15 15:05:47 +01:00
Antioch Peverell
dd88d28a7a
bump version to 4.0.0-beta.2 (#3351) 2020-06-12 14:08:12 +01:00
Antioch Peverell
6757a3040d
this test was jamming up in azure CI (#3349)
* this test was jamming up in azure CI

* peer handshake test requires global chain type
2020-06-10 21:56:28 +01:00
Quentin Le Sceller
093c500fed
Cargo Update (#3338) 2020-06-08 17:15:32 -04:00
Yeastplume
c7c9a32b9b
4.0.0-beta.1 Version Bump (#3339) 2020-06-04 14:52:26 +01:00
Antioch Peverell
6faa0e8d75
thread local chain type vs global chain type (#3327)
* Introduce GLOBAL_CHAIN_TYPE and make CHAIN_TYPE thread_local.
This makes testing more explicit and significantly more robust.

* set_local_chain_type() in tests

* cleanup - weird

* get pool tests working with explicit local chain_type config

* core tests working with explicit local chain_type

* p2p tests working with explicit local chain_type

* store tests working

* cleanup, feedback
2020-05-22 12:51:58 +01:00
hashmap
8a22fb516a
Reduce number of allocations in to_key calls (#3311)
We have to make an extra allocation per db get request because key generation function to_key takes Vec. Taking byte slice (AsRef<[u8]> to be precise) also simplifes the code a bit.
2020-04-30 17:47:44 +02:00
hashmap
a82041d0ed
Refactor Readable trait (#3309)
Currently Writable accepts trait Write as a type parameter but Readable
takes Read as a trait object, which is not symmetrical and also less performant. This PR changes Readable trait and all places where it's used
2020-04-30 17:42:19 +02:00
Quentin Le Sceller
be4779c923
Less cloning and pattern simplifications (#3305)
* Cleanup 
* Pattern simplification
2020-04-24 11:19:34 +02:00
hashmap
e64e90623b
Reduce number of allocations in Headers message read (#3301)
We allocate 17 vectors (in the heap) per 512 headers, this PR reduces the number to 1 by resuing the buffer for headers and eliminating the need in the vector of indices
2020-04-18 14:07:26 +01:00
jaspervdm
6bdf31f23d
Remove unused code in message handling (#3269) 2020-03-13 12:50:35 +01:00
Yeastplume
b73fc0bb9b
Version bump for next development release 2020-03-02 12:27:16 +00:00
Yeastplume
533da2d192
version bump for 3.1.0 release (#3258) 2020-03-02 10:38:56 +00:00
Antioch Peverell
ef755a5c49
bump to 3.1.0-beta.3 (#3252) 2020-02-28 12:42:08 +00:00
Antioch Peverell
5071084445
bump version to 3.1.0-beta.2 (#3244) 2020-02-27 09:35:44 +00:00
Antioch Peverell
f2380585a7
explicit read_timeout and write_timeout during hand/shake (#3249)
* explicit read_timeout and write_timeout during hand/shake

* longer timeout for reading Hand and Shake messages to give peer time to send it over
2020-02-27 07:49:38 +00:00
Antioch Peverell
8a15007c8a
ignore error from set_read_timeout (#3243) 2020-02-25 20:23:32 +00:00
Antioch Peverell
6855241a56
handle mpsc channel disconnect from peer_write thread (#3241)
* handle mpsc channel disconnect from peer_write thread
also actually shutdown the writer when we say we are going to

* fix - we need to break here
2020-02-25 19:15:27 +00:00