Commit Graph

1271 Commits

Author SHA1 Message Date
Quentin Le Sceller bcaecdeba7 API Documentation: Node API (#1655)
* Structure of the api doc

* Initial Node API Doc
2018-10-04 09:35:39 -04:00
Gary Yu 6e1031fea0 test: double the speed of Travis-CI test (#1647)
* test: optimization for travis-ci tests

* refactor: split script into 2 lines for visibility on Travis-CI

* improve: add cargo clean for binary release build
2018-10-04 07:31:04 +08:00
Quentin Le Sceller 1e93b7fe65 Fix documentation (#1652)
* Markdown formating
2018-10-03 16:31:28 -04:00
Ignotus Peverell f2b4c6dc07 Resurrect a random peer on every monitor (#1646)
Picks a random defunct peer and marks it healthy again anytime
we're querying peers to find more. Over enough time, any peer will
see another as defunct, leading to peer list atrophy. This
allows us random retries.

In addition, we need to cleanup peers after a while, we quickly
accumulate hundreds of dead peers over time. This should be
tracked by a different issue however.

Related: #1632
2018-10-03 09:16:32 -07:00
Ignotus Peverell 8e66aae592 Don't push mined blocks to the chain during sync (#1643)
Related to #1632
2018-10-03 09:08:25 -07:00
Ignotus Peverell 2919a78b0f Don't stall sync when header chain regresses (#1644)
This should normally never happen but this is meant to catch unforeseen edge cases or block acceptance bugs.
2018-10-03 09:07:57 -07:00
Yeastplume 497d66e482 Pow test fix (#1651)
* fix pow testing

* rustfmt
2018-10-03 12:18:23 +01:00
Ignotus Peverell 2259c18dd6 Demo lean miner, minor PoW improvements (#1630) 2018-10-03 11:39:16 +01:00
Antioch Peverell 4d70968e70 More robust block pruning (#1637)
* more robust block deletion

* rustfmt
2018-10-02 16:17:15 +01:00
Antioch Peverell 0635945740 cleanup verifier_cache (add it to block ctx) (#1638)
rename process_block_no_orphans -> process_block_single
2018-10-02 16:13:02 +01:00
Ignotus Peverell 85d5feafa3 Fix concurrency issue around peer add and start. Fixes #1585 (#1633)
* Fix concurrency issue around peer add and start. Fixes #1585
2018-10-02 10:17:29 -04:00
Gary Yu 0cb228d4e9 test: switch off the mac Travis-CI test temporarily (#1636) 2018-10-02 21:50:05 +08:00
Gary Yu 147159b0bd test: avoid infinite waiting on basic_stratum_server test (#1634)
* test: avoid infinite waiting on basic_stratum_server test

* rustfmt
2018-10-02 19:23:51 +08:00
hashmap 4a6cae0fe6 Allow TLS for Wallet APIs (#1626)
* Allow TLS for Wallet APIs

This PR adds an optional support of TLS for wallet APIs. Only PKCS12 format is supported, will address .pem support in next PR and provide some documentation.
Address #1425
2018-10-02 09:49:36 +02:00
Gary Yu d7fbeb2c62 fix: no need switching to HeaderSync in FastSync states (#1622)
* fix: no need switching to HeaderSync in FastSync states
2018-10-02 12:09:49 +08:00
Antioch Peverell 6d67cbdecb perf: update sync_head once per batch of headers (#1629)
perf: update sync_head once per batch of headers
2018-10-02 11:13:26 +08:00
Antioch Peverell f15bfbd35b lock chain.head() for less time (scope it in a block) (#1625)
* lock the chain.head for less tieme (scope it in a block)

* actually scope it to that block...
2018-10-01 22:12:56 +01:00
Antioch Peverell c9c829514b Trace get block (#1628)
* trace on GetBlock msg

* rustfmt
2018-10-01 22:12:39 +01:00
Antioch Peverell 4d2cbe6596 fix: init_sync_head was not behaving as expected (#1624)
Fix #1612
2018-10-01 23:03:06 +08:00
Gary Yu d8ca684260 fix: in case of all known, update header_head and sync_head (#1619)
* fix: in case of all known for Headers received, update sync_head to the last header

* refactor: push this logic down into pipe
2018-10-01 21:58:50 +08:00
Gary Yu 6ad54b9840 fix: mutex dead lock between difficulty_iter and txhashset_write (#1617)
fix #1611
2018-10-01 11:51:15 +08:00
Antioch Peverell 73ddd1d01d no need to pass sync_head around in ctx (#1608) 2018-09-29 16:19:19 +01:00
Antioch Peverell 985bced99d remove duplicate dir creation code (#1603) 2018-09-29 09:50:32 +01:00
Antioch Peverell fd8c03679a use sync_head consistently in sync_block_headers (#1604)
* use sync_head consistently in sync_block_headers

* rustfmt
2018-09-29 08:47:50 +01:00
Michalis Kargakis 9e6ef6f237 Conform auth check to rfc2616 (#1607)
According to rfc2616[1], the response from a server to a request with
bad credentials should be a 401 instead of a 403. Grin does not have
the concept of identities so it does not actually recognize a user
request with bad credentials.

[1] https://tools.ietf.org/html/rfc2616#section-10.4.2
2018-09-29 09:28:25 +02:00
Antioch Peverell 2cad812b29 use an lru_cache for the block_hashes_cache (#1602) 2018-09-28 17:27:31 +01:00
Yeastplume e64f4fbcd1 Rust Cuckatoo for verifier and test-miner (#1558)
* cuck placeholder

* rustfmt

* cuckatoo, early days

* rustfmt

* data structures are in place, siphash key creation is consistent with @tromp

* solver in place, (not yet working)

* cuckatoo test solver working with test nonce

* rustfmt

* update solver to remove adjacency list removals

* verifier functioning

* rustfmt

* Proper error handing in Cuckatoo module, couple of tests

* modify cuckoo/cuckatoo solvers and verifiers to function identically, in advance of trait refactoring

* rustfmt

* refactor PoW context into trait, default to using cuckoo context

* rustfmt

* create macros for integer casting/unwraps

* don't instantiate structs when just verifying, add test validation vector for cuckatoo 29

* rustfmt

* don't init cuckoo structs if just validating

* test fix

* ensure BH hashing for POW is only done within miner/validators
2018-09-28 11:53:14 +01:00
Quentin Le Sceller a13c20ceb2 Fix API wallets calls (#1597)
* Add API Secret in wallet calls

* File node api secret default to same api secret and directly in http parameter
2018-09-27 21:45:48 +02:00
Antioch Peverell 5a83989cf6 explicitly handle the header when processing blocks (#1600) 2018-09-27 15:12:08 +01:00
Antioch Peverell 4b0fdc2499 rework to only pass a single block_context to pipeline (#1599) 2018-09-27 11:44:50 +01:00
Antioch Peverell 56f84cc2f4 pass batch to process_block and process_block_header (#1594)
* use a batch consistently when processing blocks and headers

* rustfmt
2018-09-27 09:35:25 +01:00
Quentin Le Sceller 62fd8f2124 Implement Basic Auth for API and Owner API (#1566)
* Add api_secret

* Add to base64 method

* Add basic auth in API

* Add Basic Auth to owner API

* Add flag to enable disable basic auth

* Add .api_secret file
2018-09-26 22:38:44 +02:00
Antioch Peverell acec59e249 introduce rewindable_kernel_view (readonly but rewindable kernel MMR view) (#1587)
* introduce rewindable_kernel_view
cleanup header in extension

* cleanup and docs/comments

* txhashset does not need to be mutable here

* pull validate_kernel_history out into fn
2018-09-26 09:59:00 +01:00
Quentin Le Sceller e55c3d2ec9 Replace rust-crypto with RustCrypto (#1573)
* Replace rust-crypto with RustCrypto
2018-09-25 16:24:05 -04:00
Michalis Kargakis 8c3f6eb8f7 Dockerfile updates (#1580)
* pregenerate config and disable tui
* install openssl now that native-tls is pulled in
* EXPOSE directive cleanup
* Update build instructions
2018-09-25 13:18:17 -07:00
Gary Yu bbe0b0384b docs: add release instruction (#1571) 2018-09-25 13:14:10 -07:00
Antioch Peverell 11f2d7b6d4 UTXOView (readonly, minimal, output only txhashset extension) (#1584)
* make the utxo view explicit

* introduce utxo_view (readonly, minimal txhashset extension)

* rustfmt

* cleanup

* cleanup

* rustfmt

* cleanup build warnings, comments etc.

* rustfmt

* utxo_view even more readonly now

* cleanup

* refactor pmmr, split out readonly_pmmr and backend

* rustfmt
2018-09-25 11:01:19 +01:00
Gary Yu 830f4d6b7c chore: automatic binaries release (#1540)
* automatic binaries release from Travis-CI server
* build both osx and linux binary
* add before_deploy for making tarball and show size
* set file_glob for wildcards
* automatic changelog generator
* remove the --depth flag entirely, travis-ci default depth 50 cause change log auto-generation fail
* note: 
  - '#' in file name will be converted as '.', replace '#' with '-'
  - file_glob wildcards don't support multiple lines of 'file'
2018-09-25 08:37:24 +08:00
Gary Yu 7a187d5c98 docs: update for obsoleted usage of 'rustfmt', update 'Find us' (#1570) 2018-09-25 06:50:43 +08:00
Gary Yu 8d62247c99 Small cleanup of rand usage (#1576)
Clean 3 build warning of deprecated item 'rand::Rand::rand'
2018-09-24 15:15:55 -07:00
Gary Yu 32486e2f63 Always enable header sync on initial state transition from NoSync / Initial (#1582) 2018-09-24 15:09:57 -07:00
Antioch Peverell e72d8b58e4 [WIP] txpool (tx validation) using block sums for full validation (#1567)
tx validation (txpool) rework/simplify
2018-09-24 09:24:10 +01:00
hashmap 82b785282c Remove println (#1575) 2018-09-22 21:22:02 +02:00
hashmap 274df3b8bb Fix wallet APIs launch command (#1574)
We used to launch a thread for API server inside the wallet crate, now we do it inside api crate, so the cmd tool launches API and exit. This fix makes sure that command will wait for API thread.
2018-09-22 09:34:28 +02:00
hashmap 3a3ba4d636 Improve middleware support in web layer (#1572)
* Middleware and handler (mw implements the same trait) could be attached to multiple nodes inside the router
* Middleware could be attached to the router (syntactic sugar, it is attached to the root node) as well as to any node
* Handler's call method receives an iterator of handlers and responsible for calling the next handler if needed
2018-09-21 19:57:59 +02:00
hashmap 972c2e5aa9 Support TLS in ApiServer (#1565)
* Support TLS in ApiServer

This is ground work to support TLS in Grin APIs (like wallet ot node). Particular API implemention needs to decide if TLS is used or not and pass certificate data etc.

* P12 format support
* New method to start TLS server
* Transparent TLS support in API client (depends on URL scheme http/https)
* Refactoring
* Initial support for graceful shutdown (commentred out int this PR, unstable for now)
* API server tests (TLS server test is disabled by default, hyper client rejects self-signed certificates, so extra step is needed to install local CA (I used mkcert)
* Add a cert file to make test complile
2018-09-21 13:33:23 +02:00
hashmap 56234d1023 Merge pull request #1560 from yourowncrypto/bump-reqwest
Bump reqwest version to remove hyper 0.11
2018-09-21 09:53:10 +02:00
Ivy Evans ac7d575d65 Bump Docker builder image to rust:1.29.0 (#1569) 2018-09-20 14:58:23 -04:00
Gary Yu 3adddfba76 Refactor: run_sync() ballooning, extract 3 utility functions (#1562) 2018-09-20 10:00:09 -07:00
Mike Dallas 0d7fa06fe0 Remove a dead link from docs (#1563)
* Update intro.zh-cn.md

remove link

* Update intro.md

remove link

* Undo

* Change link to point to original paper
2018-09-20 17:46:52 +01:00