Commit Graph

2126 Commits

Author SHA1 Message Date
Gary Yu 928279a676 schnorr signature batch verification (#2961)
* schnorr signature batch verification

* Split the fee and lock_height verification out from the batch signature verification

* Remove the new added fee_height_verify to comply with #2859

* fix: the last n could not be leaf?
2019-09-03 15:44:10 +01:00
jackiszhp 2cebdc5868 it was miscounted (#3013) 2019-09-02 10:13:46 +01:00
jaspervdm 30156cdcf9 Kernel lookup api method (#3000)
* Kernel lookup api

* Min and max height parameters, scan backwards

* Return null instead of 404 if kernel not found

* Return TxKernel instead of TxKernelPrintable

* Update description of KernelHandler
2019-08-30 10:03:12 +01:00
Gary Yu d36a0b29ef store both mmr index and block height into database for output (#2903)
* store both mmr index and block height into database for output

* rustfmt

* fix: mmr position is 1-based instead of 0-based

* (Hash, u64, u64) deserves a type
2019-08-29 17:14:39 +01:00
Antioch Peverell 97f961fc67 verify the ignored fee is still 0 (#3007)
* verify the ignored bytes are indeed 0

* check for !=0 (rather than >0)
2019-08-29 12:56:21 +01:00
Antioch Peverell 357bc11746 Fix invalid root (#3005)
* use the correct (header) head for the header extension

* add test coverage for header first fork scenario
2019-08-29 10:15:41 +01:00
Antioch Peverell dcd405e263 cleanup deprecation warnings about missing dyn with trait objects (#2997) 2019-08-26 21:17:47 +01:00
Antioch Peverell d06b56cf6d simplify broadcast - send to all connected peers (#2996) 2019-08-22 16:35:31 +01:00
Antioch Peverell 5bf813ee93 improve checking for p2p connection limits (revised) (#2993)
* Add check for p2p connection limits

* Simplify undesirable connection shutdown

* Make inbound and outbound connections more explicit

* Cleanup inbound and outbound connections

* Cleanup an outbound peers check

* Rename healthy_peers_mix to enough_outbound_peers

* be a lot less restrictive when picking some candidate peers to connect to
keep the peer address queue drained but actually attempt a healthy number of connections
as most of these attempts are going to fail due to majority of nodes not being publicly accessible
2019-08-21 19:58:43 +01:00
antiochp 17dddeeb0d Revert "Improve checking for p2p connection limits (#2985)"
This reverts commit 24f0a52437.
2019-08-21 15:02:10 +01:00
j01tz 24f0a52437 Improve checking for p2p connection limits (#2985)
* Add check for p2p connection limits

* Simplify undesirable connection shutdown

* Make inbound and outbound connections more explicit

* Cleanup inbound and outbound connections

* Cleanup an outbound peers check

* Rename healthy_peers_mix to enough_outbound_peers
2019-08-21 12:43:09 +01:00
Mattia Rossi ea023387bf Fix doc grin <subcommand> help syntax. (#2991) 2019-08-20 18:05:26 +01:00
Antioch Peverell 6036b671e8 fee and lock_height maintained in kernel features variants (#2859)
* fee and lock_height now maintained in kernel features enum variants

* sum fees via explicit enum variants

* cleanup semantics around with_fee and with_lock_height for tx builders

* document the kernel feature variants

* serialize kernel features correctly for api json

* cleanup

* commit

* bump to unstick azure
2019-08-19 14:28:02 +01:00
j01tz d220410571 Improve error handling when computing PMMR roots (#2988)
* Improve error handling for invalid PMMR roots

* Update tests that rely on pmmr root

* Fix pmmr store tests
2019-08-09 15:10:54 +01:00
j01tz ea1d14ddb0 Improve validation when processing orphan blocks (#2981) 2019-08-03 09:07:01 +01:00
Yeastplume 705fcbb1a6 Updates to support XORed wallet keys/Tokens (#2982)
* updates to support xored tokens in wallet

* rustfmt
2019-08-02 11:30:26 +01:00
Quentin Le Sceller f79d05ba53 TxHashSet Download Improvement (#2984)
* Ban on cannot get block header in txhashset_write

* Rusfmt

* Fix typo

* Missing error handling

* Rustfmt

* Only accept txhashset from corresponding peer

* Switch to AtomicBool instead of RwLock<bool>

* Rustfmt
2019-08-01 17:46:06 +01:00
Antioch Peverell 4bd3aa109d cleanup and simplify how we generate the genesis block in user_testing (and automated_testing) modes (#2986) 2019-08-01 17:22:12 +01:00
Antioch Peverell aa5c428eb1 Prune list robustness (#2976)
* make prune list deserialization more robust (1-index vs 0 values)

* cleanup
2019-07-29 12:42:12 +01:00
eupn d918c5fe84 extkey_bip32.rs: fix misleading comment on HMAC (#2979) 2019-07-27 17:44:44 +01:00
NaN-git 0d4d98db0d fix wording in comment (#2913) 2019-07-26 08:43:18 +01:00
Antioch Peverell 515fa54614 Rewind head and header_head consistently. (#2918)
* maintain header_head as distinctly separate from head

* cleanup corrupted storage log msg

* simplify process_header and check_header_known

* remember to commit the batch when successfully processing a header...

* rework sync_block_headers for consistency with process_block_header

* cleanup unrelated code

* fix pool tests

* cleanup chain tests

* cleanup chain tests (reuse helpers more)

* cleanup - head not header on an extension
shortcircuit "rewind and apply fork" for headers if next header
2019-07-26 08:36:24 +01:00
pharazen 45cf1d96df Adds command to remove chain_data (#2954) 2019-07-25 10:13:56 +01:00
Joseph Goulden 2ae76d39bb fix: move checks for automated test mode into global.rs (#2956)
* fix: move checks for test/production mode into one place - global.rs

* chore: rustfmt
2019-07-25 10:08:24 +01:00
Joseph Goulden ecd16d114f fix: move sync state check from server into test_miner (#2958)
* fix: move sync state check from server into test_miner

* fix: compile error from SyncState moving to grin_chain
2019-07-25 10:07:56 +01:00
antiochp 441e846af6 Merge remote-tracking branch 'upstream/milestone/2.x.x' 2019-07-24 16:18:49 +01:00
antiochp 16af57706a Merge branch master into milestone/2.x.x 2019-07-24 15:33:26 +01:00
antiochp c6cea4744c Merge branch 'master' into milestone/2.x.x 2019-07-24 15:10:26 +01:00
Chengcheng Zhang 9040b5b774 Update intro_ZH-CN.md (#2965) 2019-07-24 13:18:10 +02:00
Ramin Soltanzadeh eff24723d0 Update Swedish intro.md (#2968)
* Update Swedish intro.md

Significant improvements, including a less excessive translation of the English terminology.
2019-07-24 12:02:10 +01:00
Quentin Le Sceller 38ddc32cf3 Move SyncStatus and SyncState to chain crate (#2964)
* Moved SyncState and SyncStatus to chain

* Rustfmt

* Fix typo in SyncError
2019-07-23 16:47:59 +02:00
Quentin Le Sceller 298e3caae2 [2.x.x] CI Improvements (#2963) 2019-07-23 16:25:25 +02:00
Antioch Peverell fb33d3af1f make sure user_testing uses a sensible txhashset interval (#2962) 2019-07-23 13:25:34 +01:00
Quentin Le Sceller 4966dc04f7 [2.x.x] Generate txhashset archives on 720 block intervals. (#2951)
Generate txhashset archives on 720 block intervals.
2019-07-23 10:46:29 +02:00
Quentin Le Sceller 121e6c8c46 [DOC] Translate documents & fix some typo (#2952)
*  add files for translation

*  WIP translation

* finish to translate coinbase_maturity.md && fix some typo to understand easily

*  add doc link in coinbase_maturity.md

*  remove wrong file

* Fix typo and unecessary word
2019-07-18 11:42:34 +02:00
Mike Dallas a1c7f304bd fix on_header_received hook (#2953) 2019-07-16 21:17:40 +02:00
Joseph Goulden b8c508d255 test: Re-enabled too large block test. Block tests now use ChainTypes:AutomatedTesting (#2950) 2019-07-16 13:02:21 +02:00
hashmap d3dbafa80b [2.x.x] Use blocking IO in P2P to reduce CPU load (#2855)
* Use blocking IO in P2P to reduce CPU load
2019-07-12 23:17:38 +02:00
Antioch Peverell 1395074a25 [2.x.x] simplify txhashset zip creation and extraction (#2908)
* simplify how we extract files from the txhashset zip archive

* bump version of zip-rs
cleanup create_zip (was compress)
use explicit list of files when creating zip archive

* rework zip tests for our simplified impl

* periodic debug during txhashset download

* rework list_files to return something usable
2019-07-12 10:50:27 +01:00
Joseph Goulden 3a4752635a fix: One less DB call when verifying block sums (#2945) 2019-07-12 10:47:04 +01:00
Antioch Peverell 2348214719 fix our check_known check for blocks/headers (#2943) 2019-07-11 17:08:36 +01:00
lehnberg 7434eca5d0 update Dandelion documentation (2.x.x) (#2942)
* update dandelion documentation as per PR#2723
* remove dandelion simulation docs as per PR#2723
2019-07-08 15:18:21 +01:00
Antioch Peverell d284d8f6de [2.x.x] Writeable protocol version aware (#2856)
* introduce protocol version to deserialize and read

* thread protocol version through our reader

* cleanup

* cleanup

* streaming_reader cleanup

* Pass protocol version into BinWriter to allow for version specific serialization rules.

* rustfmt

* read and write now protocol version specific
2019-07-06 15:51:03 +01:00
j01tz 09cf6de1d1 Add 4th contact to SECURITY.md (#2939) 2019-07-04 19:46:29 +02:00
Antioch Peverell b6daf1edfd check for known robustly when processing header (#2834) 2019-07-04 12:30:22 +01:00
Antioch Peverell f4eb3e3d4b Always stem local txs if configured that way (unless explicitly fluffed) (#2876)
* always stem local txs if configured that way (unless explicitly fluff from wallet)
this overrides current epoch behavior for txs coming in via "push-api"
rename "local" to "our" txs

* TxSource is now an enum for type safety.
2019-07-04 11:56:42 +01:00
Yeastplume b377d4cb4e Derive --version output dynamically from cargo package version (#2937) 2019-07-02 16:02:57 +01:00
Yeastplume e6bdc5987c update version number for next potential beta release 2019-07-01 11:00:02 +01:00
Yeastplume 8f3be49dfa change version to 2.0.0 for release 2019-07-01 09:24:33 +01:00
hashmap dbd2535f42 Increase peer's send buffer (#2931) (#2934)
When we send a txhashet archive a peer's thread is busy with sending it
and can't send other messages, eg pings. If the network connection is
slow buffer capacity 10 may be not enough,  hence the peer's drop.

Safer attempt to address #2929 in 2.0.0
2019-06-30 22:26:17 +02:00