Commit Graph

1234 Commits

Author SHA1 Message Date
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
Antioch Peverell f042f67fcd Reintroduce block sums, verify full kernel sums per block (#1559)
* block_sums and full kernel sum verification

* rustfmt

* add docs/comments

* docs

* rustfmt

* comment on fact total_kernel_sum is redundant now

* make sure we setup block_sums correctly on a fork

* rustfmt

* replace those asserts with errors

* rustfmt
2018-09-20 09:19:32 +01:00
Gary Yu e1c8dc5a3a fix: reset sync_head to header_head on initial transition to HeaderSync (#1531)
* fix for bug #1524, reset sync_head to header_head on initial transition to HeaderSync.
* using @antiochp fix solution in #1539
2018-09-20 07:29:24 +08:00
Gary Yu 56ffbee7e9 fix: all fast sync nodes report to peers as full nodes (#1547)
* fix: all fast sync nodes report to peers as full nodes
2018-09-20 07:09:39 +08:00
Gary Yu 2ca6ecc163 fix: early detection of peer connection lost when downloading txhashset (#1546) 2018-09-20 07:08:02 +08:00
Antioch Peverell 80bb1cb262 Cleanup new output commits (#1556)
No need for new_output_commits (batch handles this now)
2018-09-19 11:59:17 -07:00
Ignotus Peverell 7b6e219b5b Minor: move raw_difficulty to Proof 2018-09-19 18:31:03 +00:00
hashmap 53250ec51e Bump reqwest version to remove hyper 0.11
Follow up of #1371
2018-09-19 19:43:56 +02:00
hashmap 521ce901e4 Merge pull request #1557 from yourowncrypto/api-refactor
Refactor hyper router
2018-09-19 19:33:48 +02:00
Ignotus Peverell 9a15859b81 Scaling multiplier fix and slightly clearer structure 2018-09-19 16:25:44 +00:00
Roy Blankman febe9076f0 fixes #1507 - proper tx confirmation calculation (#1552)
when self.height == current_height, # of confirmations should be 1 not 0
2018-09-19 16:55:03 +01:00
hashmap d5ef3d9d12 Refactor hyper router
* Make it simpler to implement middleware
* Switch from the current thread runtime to the default one. It enables us to inject TLS support later one and potentially more scalable, unfortunately it involves some additonal cloning of the router, because we can't rely on thread local vars anymore
* Introduce `call` entrypoint for Handler, so it's possible to handle any HTTP method in one place, handy for middleware
* Implement example of middleware
2018-09-19 17:10:52 +02:00
Ignotus Peverell ba72e6e29e Last fixes that should have been part of #1534 2018-09-19 00:39:56 +00:00
Ignotus Peverell 9cc7aed713 Dual proof of work, first step (#1534)
* Move Proof and Difficulty types to pow module. Difficulty scaling calculation.
* Diffculty scaling and size shift for 2nd PoW
* Backport e7eb26ee
* Test compilation fixes
* Scaling only need to go one way, as @tromp pointed out
2018-09-18 15:12:57 -07:00
hashmap 7db8e5e2dd Improve API errors (#1543)
Address ##1525 in particular and improve error messages in general.
Instead of `Request Error: Error { inner:` a client would get:
`Generic error: Invalid request body: missing field `method` at line 1 column 162`
2018-09-18 15:11:58 -07:00
Roy Blankman db7b686073 Exit code 1 on wallet send fail (#1550)
Fixes #1504
2018-09-18 14:59:41 -07:00
Antioch Peverell c291c48436 Simplify block broadcast (#1549)
* removed random "block vs compact_block"
2018-09-18 10:51:37 -07:00
Antioch Peverell a4476443bb Compact transactions (initial prep work) (#1548)
* introduce CompactTransaction (unused currently)

* rustfmt

* fix comments
2018-09-18 15:25:26 +01:00
Quentin Le Sceller 345a6cb53e Update rand crate to 0.5 (#1542)
* Update rand crate to 0.5

* Rustfmt

* Misplaced import
2018-09-18 09:39:45 +01:00
hashmap b35950790b Use POST to compact and validate chain (#1541)
* More comments
* Move HeaderHandler code
2018-09-17 16:37:23 -07:00
Gary Yu a0deb18e77 Update version of some crates (#1536)
Update version of some crates
2018-09-17 10:47:48 +08:00
Gary Yu 8bef9bef02 Small cleanup of SIGINT and SIGTERM handler (#1535) 2018-09-17 07:02:23 +08:00
Ivy Evans 9aed3b9c7f Fix documented emission rate (#1537)
The emission rate was changed to 60 grin per minute (or approximately
1 grin/second) in #569.
2018-09-16 15:36:38 -07:00
Gary Yu 84ae8f1a78 memmap: use official crate, instead of the explicit git url (#1532) 2018-09-15 10:22:32 -07:00
Gary Yu 986b1f62d3 fix: deprecated warning for env::home_dir, after upgrading to rust 1.29.0 (#1533) 2018-09-15 09:56:09 -07:00
Gary Yu 2c712fefff Small cleanup and perf improvement for peak_sizes_height and peaks (#1526)
* Small cleanup and perf improvement for  and

* rustfmt

* define a const 'ALL_ONES' for u64::MAX
2018-09-15 08:28:41 +01:00
Gary Yu 26244ef9dd Optimizations for txhashset rewind (#1528) 2018-09-14 16:51:36 -07:00
Gary Yu d3a5ee130f Refactoring and cleanup on seed (#1513) 2018-09-14 16:09:25 -07:00
yeastplume e7eb26eed4 rustfmt 2018-09-14 15:25:07 +01:00
Gary Yu 3c1d8c3f8b Small cleanup and perf improvement for peak_map_height (#1521) 2018-09-13 09:59:49 -07:00
Gary Yu 4a5a91a9cf Fix: clean_peers is using connected_peers, which make it do nothing (#1505)
* a failed handshake for example don't deserve banning
* remove not used 'BadOthers' from ReasonForBan
2018-09-13 09:53:35 -07:00
Gary Yu 644c1367b8 fix: too many words in a 1st level title (#1520) 2018-09-13 09:46:57 -07:00
Gary Yu 5291a061f1 Update the chinese intro for recent changes in english intro (#1519) 2018-09-12 21:22:49 -07:00
Gary Yu 1db1a02934 fix the comments of test bitmap (#1516) 2018-09-12 16:16:13 +01:00
Antioch Peverell dca0d52dcd Cleanup transaction with offset (#1514)
* cleanup build::transaction_with_offset

* rustfmt
2018-09-12 12:17:36 +01:00
Antioch Peverell 07eefc4d6b cache get_shift() and get_leaf_shift() in prune_list (#1495)
* cache shift and leaf_shift values in prune_list for fast lookup later

* rustfmt

* fixup core tests
2018-09-12 08:19:05 +01:00
Parth Chopra 3eacc06a97 fixed list of requirements (pkg-config) (#1510)
pkg-config was incorrectly spelled pkc-config
2018-09-12 08:09:40 +01:00
Ignotus Peverell a83404b22e Simplify mining header serialization (#1509) 2018-09-11 20:31:05 -07:00