Commit Graph

2410 Commits

Author SHA1 Message Date
deevope fd5dfaaec4 reorg cache fix (#3495)
* reorg cache period configurable

* fix comment

* u32 type

Co-authored-by: deevope <you@example.com>
2020-11-25 17:59:37 +00:00
Antioch Peverell 3efe382e9c add peer capabilities to tui peers screen (#3490) 2020-11-25 16:29:33 +00:00
John Tromp 97425af637 make min_wtema difficulty chain type dependent (#3502)
* make min_wtema difficulty chain type dependent

* fix bad graph weights for automated and user testing

* only mainnet can get wtema difficulty unstuck at 59s blocks
2020-11-25 15:13:43 +00:00
Antioch Peverell 6e73e00d6b fix calls to next_diff() in tests to use next height correctly (#3501) 2020-11-25 12:47:30 +00: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
John Tromp a5b8968826 HardFork4 (#3478)
* HardFork4 initial commit

* HF4 obsoletes secondary_scale, which becomes an nonce extension 8->12 bytes

* fix TESTNET_FOURTH_HARD_FORK height

* improve predicted height for testnet fork on dec 8

* move local variable as suggested by antiochp
2020-11-24 16:13:28 +00:00
Antioch Peverell 2125c05020 use extend_from_slice when appending multiple hashes to hash file (#3497)
* use extend_from_slice when appending multiple hashes to hash file

* bump
2020-11-24 14:24:19 +00:00
jaspervdm 055b684416 More efficient serialization for bitmap segments (#3492)
* More efficient serialization for bitmap segments

* Rename a const

* Correctly count number of chunks in a segment

* Enum for BitmapBlock (de)ser mode

* Add more segments in test

* Fix duplicate function
2020-11-24 15:19:07 +01:00
Antioch Peverell b3938de8b3 we have no patch file and nothing to patch (#3499) 2020-11-23 15:02:02 -05:00
Antioch Peverell cba3137338 add segmenter for generating segments from txhashset with consistent rewind (#3482)
* add segmenter for generating segments from txhashset with consistent rewind

* rework segmenter to take a txhashset wrapped in rwlock
rework our rewindable pmmr so we can convert to readonly easily

* placeholder code for rewinding readonly txhashset extension to build a rangeproof segment

* segment creation for outputs/rangeproofs/kernels/bitmaps

* placeholder segment impl

* commit

* rework segmenter to use a cached bitmap (rewind is expensive)

* cache segmenter instance based on current archive header

* integrate the real segment and segment identifier with our segmenter

* exercise the segmenter code on chain init

* wrap accumulator in an arc, no need to clone each time
2020-11-23 19:07:07 +00:00
Antioch Peverell 5282ecb12f try and call refreshenv before running tests on windows (#3498)
* try and call refreshenv before running tests on windows

* try again
2020-11-23 16:58:59 +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
jaspervdm 8faba4ef83 PMMR segment creation and validation (#3453)
* Chunk generation and validation

* Rename chunk -> segment

* Missed a few

* Generate and validate merkle proof

* Fix bugs in generation and validation

* Add test for unprunable MMR of various sizes

* Add missing docs

* Remove unused functions

* Remove segment error variant on chain error type

* Simplify calculation by using a Vec instead of HashMap

* Use vectors in segment definition

* Compare subtree root during tests

* Add test of segments for a prunable mmr

* Remove assertion

* Only send intermediary hashes for prunable MMRs

* Get hash from file directly

* Require both leaves if one of them is not pruned

* More pruning tests

* Add segment (de)serialization

* Require sorted vectors in segment deser

* Store pos and data separately in segment

* Rename log_size -> height

* Fix bitmap index in root calculation

* Add validation function for output (bitmap) MMRs

* Remove left over debug statements

* Fix test

* Edge case: final segment with uneven number of leaves

* Use last_pos instead of segment_last_pos

* Simplify pruning in test

* Add leaf and hash iterators

* Support fully pruned segments

* Drop backend before deleting dir in pruned_segment test

* Simplify output of first_unpruned_parent
2020-11-17 19:38:44 +01:00
Antioch Peverell e6145db743 Disable merkle proofs for v2 get_block (#3487)
* api v2 get_blocks should not include Merkle proofs

* default to not including merkle proofs in v2 get_blocks api
2020-11-09 14:56:01 -05:00
Antioch Peverell 49cccea035 on_block_accepted logging and webhooks all the time (#3486) 2020-11-09 12:11:27 -05: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
Daniel Lehnberg cea546ceb8 fix: correct typo in SECURITY.md (#3462) 2020-10-08 09:46:48 -04:00
Antioch Peverell 145c2874f5 fix v2 conversion to ensure we provide blocks in correct format (#3465) 2020-10-08 09:27:00 +01: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
jaspervdm 4c6d1dd4bd Define get_data_from_file function on ReadablePMMR trait (#3464) 2020-10-07 14:09:27 +02: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
Quentin Le Sceller eab26b3ae4 CI: no directories in checksum file (#3460) 2020-10-02 13:14:02 -04:00
Antioch Peverell c3b1ccff3c Cleanup usage of legacy bitmaps. (#3455)
The legacy bitmaps are no longer required and
have not been in use for a while.
2020-10-02 09:40:04 -04:00
Antioch Peverell f25b7ae032 use choose_multiple to clean get_peers() up (#3457) 2020-10-01 14:42:57 -04:00
Antioch Peverell cc4e608d1b cleanup validate() no need to return kernel sums (#3456) 2020-10-01 14:56:37 +01:00
jaspervdm 0aec8b533b Refactor PMMR read methods into trait (#3454) 2020-09-29 15:57:33 +02: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 4944679fb2 add test coverage around existing behavior for exists() and iter() (#3452) 2020-09-25 13:49:48 +01:00
Antioch Peverell 62783997df refactor get_ser to use get_with internally (#3451)
less code duplication and a cleaner code path
batch.exists() now aware of current write tx
2020-09-25 12:47:04 +01:00
Daniel Lehnberg f40564ef34 Update Code of Conduct (#3447)
Replace old CoC with a link to the website with the updated code of conduct.

Related:
https://github.com/mimblewimble/site/pull/222
https://github.com/mimblewimble/grin-pm/issues/309
2020-09-22 17:15:37 +01:00
Blade Doyle dc47beda78 cleanup mining stats (#3439)
* cleanup mining stats; make edge_bits dynamic (last size submitted), dont show bogus stats when no miners are connected

Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>
2020-09-16 13:03:42 -04: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 06a09f25c4 bump protocol version to 1000 to facilitate deprecation of earlier versions (#3434) 2020-09-11 11:07:57 +01:00
Paouky dfd0a649c7 Organize doc files (#3436)
* create and occupy translations dir

* update translation links

* add mimblewimble whitepaper

* add p2p_protocol from docs

* add validation_logic from docs

Co-authored-by: Paouky <Paouky@users.noreply.github.com>
2020-09-10 09:45:14 -04:00
j01tz 3d07adb621 Remove hashmap as disclosure contact (#3438) 2020-09-09 10:09:24 +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
Antioch Peverell 133089e985 Refactor Output Identifiers (#3371)
* refactor output to have internal output identifier

refactor to use AsRef for output identifier

make the output MMR explicit in terms of output identifiers

* put the serde deser back for rangeproof

* add json test for transactions
2020-09-03 10:59:54 +01:00
Antioch Peverell caa6b8c747 further tweaks to block_accepted logs for clarity (#3379)
* further tweaks to block_accepted logs for clarity

* fix tests

* depth based off prev_head
2020-08-20 17:28:35 +01:00
Antioch Peverell 1cff387f61 Use mmr sizes in header to validate header weight (#3395)
* use mmr sizes in header to validate block weight given header only

* add global weight validaton to headers when reading them untrusted off the network

* fixup tests, one pending test

* add test for deserializing untrusted block header exceeeding weight limits

* validate header mmr sizes, must grow for each block

* remove redundant height check

* fix tests after rebase
block specific TooHeavy error
2020-08-19 09:40:56 +01:00
Antioch Peverell 78e3ec3df0 sync_all() on leaf_set and prune_list when using temp file (#3354) 2020-08-19 09:37:22 +01:00
Antioch Peverell 29cffe9b3c verify_cut_through and test coverage (#3424)
* fix inconsistent verify_cut_through() logic

* add test coverage for chain::process_block() and cut_through logic

* fix comment
2020-08-18 20:09:54 +01:00
Nym Seddon 6a012d7e5b Add TransactionPool fuzz driver (#3396)
Add fuzz driver for fuzzing adding transactions to the main and stem
TransactionPool

Co-authored-by: Nym Seddon <unseddd@shh.xyz>
2020-08-17 14:05:25 -04:00
Quentin Le Sceller a038687d20 Fix #3380 Broken API Links (#3381) 2020-08-17 13:28:38 -04:00
Antioch Peverell efece9e0c7 use sync pmmr for building locator (#3397) 2020-08-17 13:21:54 -04:00
Antioch Peverell 599bf22cfc Simplify api commits (#3423)
* simplify api with unspent by commitment

* fix chain tests
2020-08-17 13:19:29 -04:00
Quentin Le Sceller d1b90f89a0 Update dockerfile with rust 1.45 and Debian Buster (#3426) 2020-08-17 12:11:27 -04:00
draz3nv 110deff702 [Docs] Revision to intro page (#3281)
* Update intro.md

Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>
2020-08-11 17:43:06 -04:00
John Tromp 9c517db3c3 add test cases for C32 and C33 solutions (#3422) 2020-08-10 11:05:13 -04:00
Antioch Peverell 34adaf797e orphan check needs to handle fast sync "edge case" (#3418) 2020-08-08 11:21:38 +01:00