Compare commits

...

2002 Commits

Author SHA1 Message Date
Denis S. Soldatov aka General-Beck
948a5387b3 downgrade rust (windows build) 2017-02-08 20:30:22 +01:00
Denis S. Soldatov aka General-Beck
8a050e4464 disable armv6 2017-02-08 23:21:17 +04:00
GitLab Build Bot
af998d8c40 js-precompiled 20170208-135150 2017-02-08 17:48:23 +01:00
Tomasz Drwięga
591673821c Work with string numbers in contract (Fixes #4472) (#4478) (#4480) 2017-02-08 14:45:06 +01:00
Tomasz Drwięga
ce5dfd8e34 Removing duplicate sign 2017-02-08 14:38:11 +01:00
Tomasz Drwięga
8c049e5d05 eth_sign improvements backport (#4473)
* Fix postsign (#4347)

* Fix whitespace.

* Fix post sign.

* Fix message.

* Fix tests.

* Rest of the problems.

* All hail the linter and its omniscience.

* ...and its divine omniscience.

* Grumbles and wording.

* Make signing compatible with geth. (#4468)
2017-02-08 10:40:42 +01:00
keorn
2bfcfd3813 sort corpus when hitting genesis (#4471) 2017-02-08 08:56:02 +01:00
GitLab Build Bot
4f869a9ba5 [ci skip] js-precompiled 20170207-191112 2017-02-07 19:16:45 +00:00
Jaco Greeff
dd0b2c2327 Handle registry not found errors (Fixes #4463) (#4465) (#4466) 2017-02-07 19:52:06 +01:00
GitLab Build Bot
889f85ea0d [ci skip] js-precompiled 20170207-184700 2017-02-07 18:50:56 +00:00
Tomasz Drwięga
42eec0f6bd Fixing histogram again (#4464) 2017-02-07 19:39:04 +01:00
Tomasz Drwięga
449e85743d Beta backports (#4462)
* Support HTML5-routed dapps (#4173)

* Fix compilation on latest nightly

* Updating precompiled
2017-02-07 19:10:24 +01:00
GitLab Build Bot
8764563222 [ci skip] js-precompiled 20170207-122754 2017-02-07 12:31:23 +00:00
Jaco Greeff
5b31af4e09 Fix Portal scrolling getting stuck (#4455) (#4456)
* Fix Portal scrolling getting stuck

* DappCard container flex

* Container height to 100%
2017-02-07 13:22:09 +01:00
GitLab Build Bot
b648bd403a [ci skip] js-precompiled 20170207-080055 2017-02-07 08:04:20 +00:00
Jaco Greeff
0994b91af5 Fix AccountCard stretch to 100% (#4450) (#4451) 2017-02-07 08:54:10 +01:00
GitLab Build Bot
2e595d60f0 [ci skip] js-precompiled 20170206-085912 2017-02-06 09:03:07 +00:00
Jaco Greeff
c2ceefbc22 Fix wrong output format of peers (#4270) (#4442)
* Fix wrong output format of peers

* Add outPeer tests
2017-02-06 09:53:22 +01:00
Tomasz Drwięga
ab2d02bbb6 Open popup without attempting inline (#4440) (#4441)
* Open popup without attempting inline

* Cater for all .web3.site addresses
2017-02-06 09:53:11 +01:00
Jaco Greeff
43bb862adb webpack config for inline icon svg (#4437) 2017-02-05 10:30:22 +01:00
Denis S. Soldatov aka General-Beck
172b40ae30 Create Docker file in beta
add for tags on hub docker
2017-02-05 03:36:48 +04:00
Denis S. Soldatov aka General-Beck
74e859a9d4 update gitlab-ci
add hub docker
[ci skip]
2017-02-05 03:33:16 +04:00
GitLab Build Bot
1fdbc07cb4 [ci skip] js-precompiled 20170204-162639 2017-02-04 16:30:03 +00:00
Arkadiy Paronyan
9912a3158c Backporting to beta (#4434)
* v1.5.2

* Fix eth_sign/parity_postSign (#4432)

* Fix dispatch for signing.

* Remove console log

* Fix signing & tests.
2017-02-04 17:06:40 +01:00
arkpar
fa6aceca42 mac build fix 2017-02-04 14:59:39 +01:00
GitLab Build Bot
503137a968 js-precompiled 20170204-084850 2017-02-04 12:57:40 +01:00
Tomasz Drwięga
184648a734 Returning default account as coinbase + allow altering sender in signer (#4323) (#4431)
* Returning first address as coinbase

* Allowing sender alteration in signer

* Adding default account RPC
2017-02-04 09:42:50 +01:00
Jaco Greeff
fb817fcdca [beta] UI updates for 1.5.1 (#4429)
* s/Delete Contract/Forget Contract/ (#4237)

* Adjust the location of the signer snippet (#4155)

* Additional building-block UI components (#4239)

* Currency WIP

* Expand tests

* Pass className

* Add QrCode

* Export new components in ~/ui

* s/this.props.netSymbol/netSymbol/

* Fix import case

* ui/SectionList component (#4292)

* array chunking utility

* add SectionList component

* Add TODOs to indicate possible future work

* Add missing overlay style (as used in dapps at present)

* Add a Playground for the UI Components (#4301)

* Playground // WIP

* Linting

* Add Examples with code

* CSS Linting

* Linting

* Add Connected Currency Symbol

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* Added `renderSymbol` tests

* PR grumbles

* Add Eth and Btc QRCode examples

* 2015-2017

* Add tests for playground

* Fixing tests

* Split Dapp icon into ui/DappIcon (#4308)

* Add QrCode & Copy to ShapeShift (#4322)

* Extract CopyIcon to ~/ui/Icons

* Add copy & QrCode address

* Default size 4

* Add bitcoin: link

* use protocol links applicable to coin exchanged

* Remove .only

* Display QrCode for accounts, addresses & contracts (#4329)

* Allow Portal to be used as top-level modal (#4338)

* Portal

* Allow Portal to be used in as both top-level and popover

* modal/popover variable naming

* export Portal in ~/ui

* Properly handle optional onKeyDown

* Add simple Playground Example

* Add proper event listener to Portal (#4359)

* Display AccountCard name via IdentityName (#4235)

* Fix signing (#4363)

* Dapp Account Selection & Defaults (#4355)

* Add parity_defaultAccount RPC (with subscription) (#4383)

* Default Account selector in Signer overlay (#4375)

* Typo, fixes #4271 (#4391)

* Fix ParityBar account selection overflows (#4405)

* Available Dapp selection alignment with Permissions (Portal) (#4374)

* registry dapp: make lookup use lower case (#4409)

* Dapps use defaultAccount instead of own selectors (#4386)

* Poll for defaultAccount to update dapp & overlay subscriptions (#4417)

* Poll for defaultAccount (Fixes #4413)

* Fix nextTimeout on catch

* Store timers

* Re-enable default updates on change detection

* Add block & timestamp conditions to Signer (#4411)

* Extension installation overlay (#4423)

* Extension installation overlay

* Pr gumbles

* Spelling

* Update Chrome URL

* Fix for non-included jsonrpc

* Extend Portal component (as per Modal) #4392
2017-02-04 09:42:36 +01:00
Denis S. Soldatov aka General-Beck
f76b94c2c5 update gitlab-ci
fix darwin build
2017-02-04 02:34:02 +04:00
Denis S. Soldatov aka General-Beck
78afa8ed54 update gitlab-ci
type fix
2017-02-04 01:03:27 +04:00
Denis S. Soldatov aka General-Beck
63bf2755ed fix darwin build
add `cargo build -j 8 --features final --release -p ethstore #$CARGOFLAGS`
2017-02-04 00:55:15 +04:00
Arkadiy Paronyan
f187b15a43 Transaction timestamp condtiion (#4427) 2017-02-03 19:34:26 +01:00
GitLab Build Bot
e9b1921950 [ci skip] js-precompiled 20170203-132415 2017-02-03 13:27:34 +00:00
Tomasz Drwięga
3106835ae3 Fixing embedded bar not closing in chrome extension (#4421) 2017-02-03 14:17:17 +01:00
Arkadiy Paronyan
c7dbd87f8e Backporting to beta (#4418)
* v1.5.1

* Disable notifications (#4243)

* Fix wrong token handling (#4254)

* Fixing wrong token displayed

* Linting

* Revert filtering out

* Revert the revert

* Don't panic on uknown git commit hash (#4231)

* Additional logs for own transactions (#4278)

* Integration with zgp whitelist contract (#4215)

* zgp-transactions checker

* polishing

* rename + refactor

* refuse-service-transactions cl option

* fixed tests compilation

* Renaming signAndSendTransaction to sendTransaction (#4351)

* Fixed deadlock in external_url (#4354)

* Fixing web3 in console (#4382)

* Fixing estimate gas in case histogram is not available (#4387)

* Restarting fetch client every now and then (#4399)
2017-02-03 13:57:04 +01:00
Denis S. Soldatov aka General-Beck
b09cfe1885 update depends
Depends: libssl1.0.0 (>=1.0.0)
[ci skip]
2017-02-03 14:49:12 +04:00
Denis S. Soldatov aka General-Beck
070c40c02f change depends
libssl (>=1.0.0)
[ci skip]
2017-02-03 13:16:23 +04:00
Denis S. Soldatov aka General-Beck
33ecf1313f Update gitlab-ci
[ci-skip] Remove `triggers` from stage `push-release`
2017-01-25 19:04:08 +04:00
GitLab Build Bot
971a481b0d [ci skip] js-precompiled 20170124-193815 2017-01-24 19:43:16 +00:00
Tomasz Drwięga
2b132c38d6 Embeddable ParityBar (#4222) (#4287)
* Embeddable ParityBar

* Replacing storage with store

* Fixing  references.

* Addressing style issues

* Supporting parity background

Conflicts:
	js/src/views/ParityBar/parityBar.js
2017-01-24 19:19:05 +00:00
Denis S. Soldatov aka General-Beck
dcd9119452 update gitlab-ci
revert 1337
2017-01-20 02:31:19 +04:00
Denis S. Soldatov aka General-Beck
f3f25ad50c update Dockerfile
add dependencies for Docker beta
[ci skip]
2017-01-20 01:44:22 +04:00
Denis S. Soldatov aka General-Beck
f3c4ea4fb9 update gitlab-ci
[ci skip]
small fix
2017-01-20 01:05:00 +04:00
Denis S. Soldatov aka General-Beck
1b79fc3e27 update gitlab-ci
comment curl 1337
[ci skip]
2017-01-20 00:51:01 +04:00
Denis S. Soldatov aka General-Beck
ce824089ac update gitlab-ci
add debian build with openssl 1.0.1
[ci skip]
2017-01-20 00:18:26 +04:00
Gav
d2e6fc0a65 Dont push-release for beta/stable changes 2017-01-19 14:27:31 +01:00
GitLab Build Bot
29d50f8f30 js-precompiled 20170119-105731 2017-01-19 12:13:13 +01:00
arkpar
536cf73db8 Merge branch 'backporting' into beta 2017-01-19 11:30:32 +01:00
Jaco Greeff
f15a3ca977 Non-secure for DappReg (#4216) 2017-01-19 11:11:19 +01:00
Gav Wood
096a44d9bf Console now has admin (#4220)
Fixes #4210
2017-01-19 10:50:24 +01:00
Jannis Redmann
ff3ae33d99 verification: add mainnet BadgeReg ids (#4190)
* verification: mainnet BadgeReg ids

* verification: fetch contracts by name

* verification: better wording

* typo

* reregistered badges
2017-01-19 10:50:13 +01:00
GitLab Build Bot
8e6d09e6ac [ci skip] js-precompiled 20170119-091230 2017-01-19 09:15:08 +00:00
Tomasz Drwięga
516e16a36b Fixing minimal transaction queue price (#4204)
* Fixing minimal transaction queue price

* Fixing tests
2017-01-18 19:54:40 +01:00
Arkadiy Paronyan
77b14b2736 Fixed --base-path on windows (#4193)
* Fixed --base-path on windows

* Add support for optional args with default text
2017-01-18 19:11:01 +01:00
Tomasz Drwięga
e01636fc34 Fixing etherscan price parsing (#4202)
* Fixing etherscan price parsing

* Handling all errors
2017-01-18 19:10:25 +01:00
arkpar
7b2cfd1cfb JsonRPC bump for IPC fix 2017-01-18 19:10:07 +01:00
Arkadiy Paronyan
cf6d870b09 Backporting to beta (#4203)
* Minor typo to ensure it updates only when synced. (#4188)

* Updater fixes (#4196)

* Minor typo to ensure it updates only when synced.

* Fix deadlock.

* Skip unneeded arg in making list.

* Allow auto-restart even when not running an update.

* Fix trace.

* Update update info on each loop.

* Fix build.

* Shutdown all sockets

* Remove superfluous use.

* Poll for upgrades as part of global status (long) (#4197)

* Poll for upgrades as part of global status (long)

* Fix path

* Prevent duplicate incoming connections (#4180)
2017-01-18 17:56:32 +01:00
Arkadiy Paronyan
f20db41169 gas_limit for blocks, mined by Parity will be divisible by 37 (#4154) (#4176)
* gas_limit for new blocks will divide evenly by 13

* increased PARITY_GAS_LIMIT_DETERMINANT to 37

* separate method for marking mined block

* debug_asserts(gas_limit within protocol range)

* round_block_gas_limit method is now static

* made round_block_gas_limit free-function

* multiplier renamed to multiple
2017-01-16 20:55:07 +01:00
GitLab Build Bot
6830273cb9 [ci skip] js-precompiled 20170116-132441 2017-01-16 13:28:28 +00:00
Arkadiy Paronyan
65594b8865 Backporting to beta (#4175)
* verification: check if server is running (#4140)

* verification: check if server is running

See also ethcore/email-verification#67c6466 and ethcore/sms-verification#a585e42.

* verification: show in the UI if server is running

* verification: code style , more i18n

* fix i18n key

* Optimized hash lookups (#4144)

* Optimize hash comparison

* Use libc

* Ropsten fork detection (#4163)

* Stop flickering + added loader in AddressSelector (#4149)

* Stop UI flickering + added loader to AddressSelector #4103

* PR Grumbles

* Add a password strength component (#4153)

* Added new PasswordStrength Component

* Added tests

* PR Grumbles

* icarus -> update, increase web timeout. (#4165)

* icarus -> update, increase web timeout.

* Fix estimate gas

* Fix token images // Error in Contract Queries (#4169)

* Fix dapps not loading (#4170)

* Add secure to dappsreg

* Remove trailing slash // fix dapps
2017-01-16 13:41:37 +01:00
Tomasz Drwięga
5b30a61158 [beta] Bumping hyper (#4168)
* Bumping hyper

* Bumping again
2017-01-16 10:47:58 +01:00
Denis S. Soldatov aka General-Beck
0bc2aeca8d remove icarus
[ci skip]
2017-01-13 16:28:24 +04:00
GitLab Build Bot
1478109c43 [ci skip] js-precompiled 20170113-100252 2017-01-13 10:05:21 +00:00
Arkadiy Paronyan
bbd2bd0e17 Backporting to beta (#4158)
* Remove onSubmit of current (no auto-change on password edit) (#4151)

* Remove onSubmit from current password

* Remove onSubmit from hint

* Pull in console dapp as builtin (#4145)

* Copy static dapps from static (no build)

* Console sources

* Add console to builtins

* Remove console assets

* Disable eslint on console.js

* Enable eslint after disable

* Webpack copy
2017-01-13 10:55:59 +01:00
Arkadiy Paronyan
1e212771b5 Backporting to beta (#4152)
* Fix broken transfer total balance (#4127)

* Add proper label to method decoding inputs (#4136)

* Another minor estimation fix (#4133)

* Return 0 instead of error with out of gas on estimate_gas

* Fix stuff up.

* Another estimate gas fix.

* Alter balance to maximum possible rather than GP=0.

* Only increase to amount strictly necessary.

* Get rid of unsafe code in ethkey, propagate incorrect Secret errors. (#4119)

* Implementing secret

* Fixing tests

* Refactor VoteCollector (#4101)

* dir

* simple validator list

* stub validator contract

* make the engine hold Weak<Client> instead of IoChannel

* validator set factory

* register weak client with ValidatorContract

* check chain security

* add address array to generator

* register provider contract

* update validator set on notify

* add validator contract spec

* simple list test

* split update and contract test

* contract change

* use client in tendermint

* fix deadlock

* step duration in params

* adapt tendermint tests

* add storage fields to test spec

* constructor spec

* execute under wrong address

* create under correct address

* revert

* validator contract constructor

* move genesis block lookup

* add removal ability to contract

* validator contract adding validators

* fix basic authority

* validator changing test

* more docs

* update sync tests

* remove env_logger

* another env_logger

* cameltoe

* hold EngineClient instead of Client

* return error on misbehaviour

* nicer return

* sprinkle docs

* Reenable mainnet update server. (#4137)

* basic tests for subscribeToEvents (#4115)

* subscribeToEvent fixtures 

* subscribeToEvent tests 

* temporarily skip failing test (#4138)

* Improvements and optimisations to estimate_gas (#4142)

* Return 0 instead of error with out of gas on estimate_gas

* Fix stuff up.

* Another estimate gas fix.

* Alter balance to maximum possible rather than GP=0.

* Only increase to amount strictly necessary.

* Improvements and optimisations to estimate_gas.

- Introduce proper error type
- Avoid building costly traces

* Fix tests.

* Actually fix testsActually fix tests

* Use estimateGas error (as per updated implementation) (#4131)

* Use estimateGas error (as per updated implementation)

* EXCEPTION_ERROR as per #4142

* Better error log reporting & handling (#4128)

* Don't pop-up notifications after network switch (#4076)

* Better notifications

* Don't pollute with notifs if switched networks

* Better connection close/open events / No more notifs on change network

* PR Grumbles

* Add close and open events to HTTP // Add tests

* Fix tests

* WIP Signer Fix

* Fix Signer // Better reconnection handling

* PR Grumbles

* PR Grumbles

* Fixes wrong fetching of balances + Notifications

* Secure API WIP

* Updated Secure API Connection + Status

* Linting

* Linting

* Updated Secure API Logic

* Proper handling of token updates // Fixing poping notifications

* PR Grumbles

* PR Grumbles

* Fixing tests

* Trim spaces from InputAddress (#4126)

* Trim spaces for addresses

* onSubmit has only value, not event

* onSubmit (again)

* Length check on trimmed value

* Remove bindActionCreators({}, dispatch) (empty) (#4135)
2017-01-12 17:06:15 +01:00
GitLab Build Bot
72bb687f5e [ci skip] js-precompiled 20170111-193033 2017-01-11 19:33:04 +00:00
Arkadiy Paronyan
5e70507c78 Backporting to beta (#4118)
* Ignore get_price_info test by default. (#4112)

* Auto-detect hex encoded bytes in sha3 (#4108)

* Auto-detect hex encoded bytes in sha3

* Using types/isHex

* Removing unused imports

* Use binary chop to estimate gas accurately (#4100)

* Initial sketch.

* Building.

* Fix a few things.

* Fix issue, add tracing.

* Address grumbles

* Raise upper limit if needed

* Fix test.

* Fixing decoding API with signatures in names (#4125)

* Fix call/estimate_gas (#4121)

* Return 0 instead of error with out of gas on estimate_gas

* Fix stuff up.
2017-01-11 20:03:08 +01:00
Denis S. Soldatov aka General-Beck
2b588d57f0 Update gitlab-ci.yml
comment curl in arm
remove armv6 build from beta
2017-01-10 19:43:13 +04:00
arkpar
e7fbf10819 Release track set to beta 2017-01-10 15:03:23 +01:00
GitLab Build Bot
6e43903ab7 [ci skip] js-precompiled 20170110-124838 2017-01-10 12:51:37 +00:00
Jaco Greeff
f0e017fe6c Wrong log output address (#4106) 2017-01-10 13:42:29 +01:00
Gav Wood
8117036e0f Avoid comms with not-yet-active release update server. (#4111) 2017-01-10 13:41:21 +01:00
GitLab Build Bot
16e22b7f87 [ci skip] js-precompiled 20170110-123414 2017-01-10 12:37:38 +00:00
Nicolas Gotchac
cee2ac43c0 Update Transfer logic + Better logging (#4098)
* Add logs and better Transfer Store logic

* Fix wallet transfer

* Fix wrong gas in Wallet

* Move log levels to Parity tab
2017-01-10 13:26:30 +01:00
Nicolas Gotchac
ae7619431b Fix Signer (#4104) 2017-01-10 13:19:18 +01:00
GitLab Build Bot
78566cf9bf [ci skip] js-precompiled 20170110-113807 2017-01-10 11:41:00 +00:00
Jannis Redmann
8958603f64 merge #4066 from jr-reverse-caching
cache registry reverses, completion in address selector
2017-01-10 12:30:57 +01:00
keorn
be30c44179 Validator/authority contract (#3937)
* dir

* simple validator list

* stub validator contract

* make the engine hold Weak<Client> instead of IoChannel

* validator set factory

* register weak client with ValidatorContract

* check chain security

* add address array to generator

* register provider contract

* update validator set on notify

* add validator contract spec

* simple list test

* split update and contract test

* contract change

* use client in tendermint

* fix deadlock

* step duration in params

* adapt tendermint tests

* add storage fields to test spec

* constructor spec

* execute under wrong address

* create under correct address

* revert

* validator contract constructor

* move genesis block lookup

* add removal ability to contract

* validator contract adding validators

* fix basic authority

* validator changing test

* more docs

* update sync tests

* remove env_logger

* another env_logger

* cameltoe

* hold EngineClient instead of Client

* add a comment about lock scope
2017-01-10 12:23:59 +01:00
Arkadiy Paronyan
5c5244911e No reorg limit for ancient blocks (#4099) 2017-01-10 12:22:28 +01:00
Arkadiy Paronyan
d67ceec50c Update registration after every write (#4102) 2017-01-10 12:11:32 +01:00
Jannis R
f12937a21e reverse caching: use subscribeToEvents 2017-01-09 19:09:22 +01:00
Jannis R
67c2981975 subscribeToEvent -> subscribeToEvents 2017-01-09 19:09:21 +01:00
Gav Wood
e86b955815 Default to no auto-update. (#4092)
* Default to no auto-update.

* Fix test.
2017-01-09 18:33:53 +01:00
Jannis R
cca7627fb8 reverse caching: PR grumbles 2017-01-09 17:49:06 +01:00
Tomasz Drwięga
a584c6396c Don't remove out of date local transactions (#4094) 2017-01-09 17:01:09 +01:00
Jannis R
61a42cc7e4 reverse caching: pass API into middleware 2017-01-09 16:59:33 +01:00
Jannis R
8c2aa4d87c address selector: unique registry results 2017-01-09 14:24:04 +01:00
Jannis R
f05ffd2e09 address selector: complete reverses by name as well 2017-01-09 14:13:11 +01:00
Jannis R
38734c92c2 address selector: lower case for reverse completion 2017-01-09 14:03:52 +01:00
Jannis R
92742e663a merge master into jr-reverse-caching 2017-01-09 12:50:26 +01:00
keorn
8d256b223d Fix rebroadcast panic (#4084)
* fix

* fix compile

* remove peers trace

* simplify

* Fixing 'simplify'
2017-01-09 12:41:19 +01:00
Jaco Greeff
378739fae1 Use shallow-only rendering in all tests (#4087)
* Container/Title with shallow

* IdentityName with shallow

* IdentityIcon with shallow

* TypedInput to shallow

* DetailsStep to shallow
2017-01-09 12:40:29 +01:00
Tomasz Drwięga
4c94878cf7 Sending transactions in chunks. (#4089) 2017-01-09 11:20:02 +01:00
Gav Wood
14e65e5c3c Move to new CI servers. (#4091) 2017-01-09 11:16:21 +01:00
Tomasz Drwięga
9fec422a1b Fixing compilation without dapps. (#4088) 2017-01-09 11:16:05 +01:00
Nicolas Gotchac
e1847442cc Fix balances update (#4077)
* Fix balances fetching

* Fix fetching balances while syncing
2017-01-09 11:15:00 +01:00
Nicolas Gotchac
40f0ee004f Key derivation in Worker (#4071)
* Add Signer Key Derivation in Service Worker

* Several fixes throughout the UI

* Hint for external account // working Worker

* Add Worker state change

* PR Grumbles
2017-01-09 11:14:36 +01:00
GitLab Build Bot
ec4b4cfbf2 [ci skip] js-precompiled 20170109-084458 2017-01-09 08:47:45 +00:00
Nicolas Gotchac
cf0a20f08b Display contract block creation (#4069)
* Add contract block creation to metadata

* Display mined block for contract on Contracts view

* Better use of Summary for Accounts

* Add sorted by mined block for contracts

* Proper Block Number sort // display in contract page

* PR Grumble

* Linting issues
2017-01-09 09:38:27 +01:00
Tomasz Drwięga
71e6e24a1f Improving logs for transactions sync and disable re-broadcasting while syncing (#4065)
* Improving logs for transaction propagation

* Propagate only on timer
2017-01-08 17:12:17 +01:00
GitLab Build Bot
33d3c1f999 [ci skip] js-precompiled 20170108-033146 2017-01-08 03:34:41 +00:00
GitLab Build Bot
920d2217c8 [ci skip] js-precompiled 20170107-041806 2017-01-07 04:21:07 +00:00
Jannis R
ba4263e33f fix tests 2017-01-06 18:55:18 +01:00
GitLab Build Bot
c73bb3eed7 [ci skip] js-precompiled 20170106-170326 2017-01-06 17:06:28 +00:00
Nicolas Gotchac
761ed913a8 Passwords are valid by default (#4075)
* Passwords are valid by default #4059

* Actually fixing the issue
2017-01-06 17:56:57 +01:00
GitLab Build Bot
a7f23cbaed [ci skip] js-precompiled 20170106-162807 2017-01-06 16:31:16 +00:00
Nicolas Gotchac
30394bdb1c Add Origin to events table (#4073) 2017-01-06 17:24:35 +01:00
Nicolas Gotchac
81641a5839 Fix tags after Account view (#4070) 2017-01-06 17:23:04 +01:00
Robert Habermeier
9c00eb4e8a Zero-alloc trie lookups (#3998)
* triedb cleanup

* factor out common portion of trie query

* allocate far fewer times in node decoding

* fix bench compilation

* introduce OwnedNode variant to make iter fast again

* generalize recorder trait to Query

* decode trie outputs cost-free in state

* test for passing closure as query
2017-01-06 16:18:45 +01:00
Tomasz Drwięga
e983339edd Opening local dapp (#4041)
* Opening local dapp

* Using Path/PathBuf instead of Strings

* Fixing typo and adding some docs to apps::fs functions
2017-01-06 16:05:58 +01:00
Jannis R
c4f7b8fb96 merge master into jr-reverse-caching 2017-01-06 16:03:05 +01:00
GitLab Build Bot
332a45846d [ci skip] js-precompiled 20170106-144307 2017-01-06 14:46:06 +00:00
Tomasz Drwięga
f6349187ef Bringing back js-sha3 to fix in-browser signing (#4063)
* Bring back Uint8Array sha3 support

* Added SHA3 test with HEX encoding

* Rename hex2Ascii => hexToAscii
Add tests or the api/util/format functions
Use js-sha3 for sha3 with hex encoding support

* Adding Uint8Array test

* Fixing Transaction import
2017-01-06 15:36:24 +01:00
Jannis R
ad3b89dc14 Merge master into jr-reverse-caching 2017-01-06 13:35:50 +01:00
GitLab Build Bot
52d3633473 [ci skip] js-precompiled 20170106-094801 2017-01-06 09:50:58 +00:00
Nicolas Gotchac
9ab9ff2381 Fix wrong transaction input for contract deployments (#4052)
* Fix mutable options in Contract API

* Add Swarm hash and meta data from Solidity

* Updates tests for contract deployment

* Add test for deploy without constructor Params
2017-01-06 10:39:18 +01:00
Tomasz Drwięga
1b93d79a90 Re-broadcast transactions to few random peers on each new block. (#4054)
* Introduce predictable randomness in tests

* Re-broadcasting to few peers
2017-01-06 10:38:49 +01:00
GitLab Build Bot
20aaf17389 [ci skip] js-precompiled 20170106-050640 2017-01-06 05:12:05 +00:00
GitLab Build Bot
c2d4ee7555 [ci skip] js-precompiled 20170105-202446 2017-01-05 20:28:26 +00:00
Tomasz Drwięga
eb0daea9b9 Removing old transactions from the queue (#4046)
* Removing old transactions from the queue

* Addressing grumbles
2017-01-05 21:16:52 +01:00
keorn
fbc9f0d7fb Add block rewards to more Engines (#4055)
* add block rewards

* imports
2017-01-05 21:16:13 +01:00
Robert Habermeier
b4e713efdc return old trie values on insert and remove (#4053)
* return old trie values on insert and remove

* fix json tests
2017-01-05 21:15:43 +01:00
Jannis Redmann
20c1d37b59 let users open urls from dapps view (#4042)
* browser: better url handling

* browser: pass url as param

* dapps: button to open browser

* dapps url button: remove url validation

* PR grumbles, better URL parsing

* code style 

* better URL parsing, react to changed URL fragment
2017-01-05 21:15:01 +01:00
Jannis R
2aa76e5acc address selector: simple completion for reversed addresses 2017-01-05 18:21:15 +01:00
Jannis R
71e80f10d8 reverse caching: optimize timing
Users quickly want all reverses registered in the path,
but don't care so much about live data.
2017-01-05 17:27:25 +01:00
Jannis R
6f492a4945 address selector: use cached reverses 2017-01-05 17:19:26 +01:00
GitLab Build Bot
7d807551e8 [ci skip] js-precompiled 20170105-155705 2017-01-05 15:59:53 +00:00
Jannis R
b38aa8d01f reverse caching: middleware 2017-01-05 16:56:40 +01:00
Jannis R
ac2c678e69 reverse caching: redux boilerplate 2017-01-05 16:56:11 +01:00
Jaco Greeff
20ad2e7d42 Util/validation update (#4051)
* Fix code validation for null inputs

* tests WIP

* tests WIP

* Update validation tests

* Adjust block names, slice (PR comments)
2017-01-05 16:51:27 +01:00
Jaco Greeff
9613145464 Convert ShapeShift modal to store (#4035)
* WIP

* WIP store

* Store in-place

* WIP tests

* Store completed

* Expand option tests for events

* Fix & test for errors found in manual testing

* Add missing @observer (rookie mistake)

* Fix intl formatting error (completed step)

* Pass store to ErrorStep, test all stages for components

* Add warning messages (e.g. no price found)

* Fix typo
2017-01-05 16:51:16 +01:00
Tomasz Drwięga
a076ffaf8c Using local path on Windows (#4017)
* Using non-roaming path on Windows

* Fixing test
2017-01-05 13:12:54 +00:00
Tomasz Drwięga
91f864b2b7 Fixing minGasLimit > ceil limit mining issue (#4018) 2017-01-05 12:59:16 +00:00
Robert Habermeier
f1dd96ca5d Merge pull request #3892 from ethcore/lightsync
Naive light client synchronization
2017-01-05 13:17:14 +01:00
GitLab Build Bot
e7e561024a [ci skip] js-precompiled 20170105-111302 2017-01-05 11:15:57 +00:00
Jaco Greeff
1ef67f68ed Starting on homestead shows reload snackbar (#4043)
* Fix issue where starting on homestead showed reload

* Align snackbar timing with errors (60s)
2017-01-05 12:07:10 +01:00
Nicolas Gotchac
d16ab5eac5 Show contract parameters in MethodDecoding (#4024)
* Add decoding of Inner Contract Deployment params #3715

* Fixed TypedInput when formatted value

* Fix TypedInput

* PR Grumble

* Add test to `Param.toParams`
2017-01-05 12:06:58 +01:00
Jaco Greeff
ddeb06d9cc UI component updates (#4010)
* Update blockStatus & test results

* IdentityIcon rendering tests for #3950

* Update IdentityName with external messages

* Expand to cover basic layout sections

* ConfirmDialog rendering tests

* TxHash expansion & tests

* Cleanup ui/*.spec.js PropType warnings

* Use react-intl plural for confirmation/confirmations (verified manually)
2017-01-05 12:06:46 +01:00
Jaco Greeff
602a4429cc Account view updates (#4008)
* Fix null account render issue, add tests

* Add tests for #3999 fix (merged in #4000)

* Only include sinon-as-promised globally for mocha

* Move transactions state into tested store

* Add esjify for mocha + ejs (cherry-picked)

* Extract store state into store, test it

* Use address (as per PR comments)

* Fix failing test after master merge
2017-01-05 12:06:35 +01:00
Maciej Hirsz
881066243b Merge pull request #4034 from maciejhirsz/mh-pwmsg
Better error messages for PoA chains, closes #4030
2017-01-05 11:13:45 +01:00
keorn
93237045b8 Merge pull request #4019 from ethcore/optional-spec
Make some spec fields optional
2017-01-04 19:25:42 +01:00
Robert Habermeier
99f091ecee Merge pull request #4021 from ethcore/basic-account
Basic account type
2017-01-04 19:00:21 +01:00
maciejhirsz
a4b4263580 Adaptive hints 2017-01-04 16:51:27 +01:00
GitLab Build Bot
7ebf8be12e [ci skip] js-precompiled 20170104-153136 2017-01-04 15:34:36 +00:00
Nicolas Gotchac
fbb52ac58b Fix wallet in main net (#4038) 2017-01-04 16:25:39 +01:00
Robert Habermeier
5a3aa98115 Merge pull request #4032 from ethcore/https-fetch
Removing orphaned Cargo.toml
2017-01-04 15:28:50 +01:00
GitLab Build Bot
6861230bee [ci skip] js-precompiled 20170104-142103 2017-01-04 14:24:09 +00:00
Jannis Redmann
839ee9afd7 address selector: support reverse lookup (#4033)
* address selector: simplify lookup

* address selector: support reverse lookup
2017-01-04 15:15:36 +01:00
Nicolas Gotchac
71e7a429d7 Only fetch App when necessary (#4023)
* Only fetch App when necessary. Show loadings + 404 #3914

* PR Grumble
2017-01-04 15:15:25 +01:00
Jaco Greeff
cc8e200ed5 Connection UI cleanups & tests for prior PR (#4020)
* Cleanups & tests for #3945

* Externalise icons as per PR comments
2017-01-04 15:15:11 +01:00
Jaco Greeff
7cdfaf1a43 Unsubscribe error on ShapeShift modal close (#4005)
* unsubscribe in onClose (state available)

* Revert "unsubscribe in onClose (state available)"

This reverts commit 1da0a7447563e3cb0d9149b0b9898ec93b483982.

* Fix shapeshift double unsubscribe

* Swap multiple list test addresses
2017-01-04 15:14:51 +01:00
Nicolas Gotchac
63017268ad Add ownership checks the Registry dApp (#4001)
* Fixes to the Registry dApp

* WIP Add Owner Lookup

* Proper sha3 implementation

* Add working owner lookup to reg dApp

* Add errors to Name Reg

* Add records error in Reg dApp

* Add errors for reverse in reg dApp

* PR Grumbles
2017-01-04 15:14:37 +01:00
Robert Habermeier
0b9a0b138b remove --light CLI 2017-01-04 15:07:49 +01:00
maciejhirsz
516c41c1ee Move hints to constants 2017-01-04 14:48:32 +01:00
maciejhirsz
4b1b67bfeb Analog error messages for unlocking accounts 2017-01-04 14:05:32 +01:00
maciejhirsz
8ca0e09ffc Better error messages for PoA chains 2017-01-04 12:50:50 +01:00
Tomasz Drwięga
8d1a91b3b8 Removing orphaned Cargo.toml 2017-01-04 12:36:37 +01:00
GitLab Build Bot
4c532f9e3d [ci skip] js-precompiled 20170104-033203 2017-01-04 03:34:53 +00:00
GitLab Build Bot
6c3b9327dd [ci skip] js-precompiled 20170103-164739 2017-01-03 16:50:54 +00:00
Jannis Redmann
565a1b510e refresh balances of contacts & contracts when syncing (#4022) 2017-01-03 17:42:05 +01:00
Jannis Redmann
9de8ba0cf5 show message on new chain (#4016)
* clear account infos on new chain

* new chain: show only snackbar

* fix new chain popup 🐛
2017-01-03 17:41:55 +01:00
Nicolas Gotchac
e8ef7b357d Use TypedInputs in Contracts view (#4015)
* Use TypedInput in Contracts

* Add right readOnly Bool TypedInput

* PR Grumbles
2017-01-03 17:41:46 +01:00
Nicolas Gotchac
0f41c5b847 Fix focus on Modal (#4014)
* Fix focus on Modal #3814

* PR Grumble
2017-01-03 17:41:31 +01:00
Jaco Greeff
04ed53e0f2 Fix newError noops when not bound to dispacher (#4013)
* AddContract properly binds newError

* EditMeta properly binds newError

* PasswordManager properly binds newError

* pass null instead of empty mapStateToProps

* Add openSnackbar test & binded prop
2017-01-03 17:41:21 +01:00
Robert Habermeier
5d2cf22ef4 use basic_account in snapshot 2017-01-03 17:05:27 +01:00
Robert Habermeier
eb2b1ad5da move basic_account to types module 2017-01-03 16:43:22 +01:00
Robert Habermeier
7c715aeec3 basic account type 2017-01-03 16:32:50 +01:00
keorn
e5b3c092c8 Merge branch 'master' into optional-spec 2017-01-03 15:42:56 +01:00
Robert Habermeier
9db3f383e3 Merge pull request #4004 from ethcore/testnet-flag-ropsten
parse testnet chain as ropsten
2017-01-03 12:29:10 +01:00
GitLab Build Bot
efa36545ce [ci skip] js-precompiled 20170103-033107 2017-01-03 03:33:55 +00:00
GitLab Build Bot
5210062a40 [ci skip] js-precompiled 20170102-033239 2017-01-02 03:35:30 +00:00
GitLab Build Bot
2fbb007911 [ci skip] js-precompiled 20170101-042119 2017-01-01 04:24:16 +00:00
GitLab Build Bot
6608027c02 [ci skip] js-precompiled 20161231-133348 2016-12-31 13:36:49 +00:00
Nicolas Gotchac
0c6a9ebbb9 Work on Portal Style (#4003)
* Reduce Portal size and close on click outside

* PR Grumbles
2016-12-31 13:28:16 +00:00
GitLab Build Bot
c93d3c1580 [ci skip] js-precompiled 20161231-033147 2016-12-31 03:34:58 +00:00
Robert Habermeier
29e8b2a3b8 parse testnet chain as ropsten 2016-12-30 15:52:49 +01:00
GitLab Build Bot
2365c714d4 [ci skip] js-precompiled 20161230-113233 2016-12-30 11:35:18 +00:00
Nicolas Gotchac
fd41a10319 Make Wallet first-class citizens (#3990)
* Fixed hint in Address Select + Wallet as first-class-citizen

* Separate Owned and not Owned Wallets

* Fix balance not updating

* Fix MethodDecoding for Contract Deployment

* Fix TypedInput params

* Fix Token Transfer for Wallet

* Small change to contracts

* Fix wallets shown twice

* Fix separation of accounts and wallets in Accounts

* Fix linting

* Execute contract methods from Wallet ✓

* Fixing linting

* Wallet as first-class citizen: Part 1 (Manual) #3784

* Lower level wallet transaction convertion

* Fix linting

* Proper autoFocus on right Signer input

* PR Grumble: don't show Wallets in dApps Permissions

* Add postTransaction and gasEstimate wrapper methods

* Extract Wallet postTx and gasEstimate to utils + PATCH api

* Remove invalid test

It's totally valid for input's length not to be a multiple of 32 bytes. EG. for Wallet Contracts

* Merge master

* Fix linting

* Fix merge issue

* Rename Portal

* Rename Protal => Portal (typo)
2016-12-30 11:28:12 +00:00
GitLab Build Bot
88c0329a31 [ci skip] js-precompiled 20161230-041039 2016-12-30 04:13:29 +00:00
GitLab Build Bot
02ea3ab0f8 [ci skip] js-precompiled 20161229-200742 2016-12-29 20:10:35 +00:00
Jaco Greeff
37c607d7b0 Don't slice non-existent tags (#4000) 2016-12-29 20:01:36 +00:00
GitLab Build Bot
b5f6162630 [ci skip] js-precompiled 20161229-185700 2016-12-29 18:59:55 +00:00
Nicolas Gotchac
75f2644e6a Update dev dependencies and make Webpack less verbose (#3997)
* Update dev dependencies // Less verbose Webpack

* Fix linting fro JSX
2016-12-29 18:48:39 +00:00
Tomasz Drwięga
b24fc97cb6 Correct log index in transaction receipt (#3995)
* Moving logs to separate, testable function

* Adding test

* Fixing log index

* Adding transaction log index

* Fixing rpc tests

* Making interface of  a bit cleaner.
2016-12-29 18:48:28 +00:00
Nicolas Gotchac
9814251a28 Add Email and Registry lookups to Address Selector (#3992)
* Move AccountSelect values to MobX store

* Mail registry + small fixes

* Add Registry to AddressSelect lookups + Nav fixes

* Fix linting

* PR Grumbles

* Fix tests and propTypes
2016-12-29 18:47:53 +00:00
Robert Habermeier
486f7ae684 Merge pull request #3994 from ethcore/remove-dead-journal
remove node journal: dead code
2016-12-29 13:58:41 +01:00
Robert Habermeier
4101396fc4 remove node journal: dead code 2016-12-29 11:06:00 +01:00
GitLab Build Bot
34aee26a2e [ci skip] js-precompiled 20161229-041755 2016-12-29 04:20:52 +00:00
GitLab Build Bot
a3fe74ac69 [ci skip] js-precompiled 20161228-175047 2016-12-28 17:53:25 +00:00
Jaco Greeff
8677c3b91f Cleanup AddContract with store (#3981)
* Splits (WIP)

* Expand getters & setters

* Initial abi type set

* Expand

* Don't rely on passed api

* Store tests in place

* Allow RadioButtons to accept MobX arrays

* Fixes for manual testing
2016-12-28 17:09:54 +00:00
Jaco Greeff
7e600b5a82 Store for EditPassword Modal (#3979)
* External store (WIP)

* address & meta

* Add editable (WIP)

* View converted (WIP)

* Single API stub creation

* Testing (WIP)

* Simplified meta assign

* Tests running

* Fix duplicate exports

* Fix tags not editable
2016-12-28 17:09:45 +00:00
Robert Habermeier
e6324a83f1 Merge branch 'master' into lightsync 2016-12-28 15:53:11 +01:00
Tomasz Drwięga
3067a8de3e Additional fetch tests (#3983)
* First bunch of tests

* Dapps zip tests
2016-12-28 12:45:25 +00:00
Robert Habermeier
fe1f542c4f Owning views of blockchain data (#3982)
* owning views of blockchain data

* port blockchain and client traits to owning views

* fix ethcore tests

* use strong headers and bodies in ethcore_light

* port ethsync to use owning views

* port rpc to owning views

* port parity informant and blockchain export
2016-12-28 12:44:51 +00:00
Robert Habermeier
592a3ac623 Merge pull request #3974 from ethcore/mock-net
make test network generic over peer type
2016-12-28 13:32:06 +01:00
Tomasz Drwięga
bc3dacc952 Fetch tests (first batch) (#3977)
* Customizable fetch

* Some basic Fetch tests
2016-12-27 15:38:55 +00:00
GitLab Build Bot
a95057abe1 [ci skip] js-precompiled 20161227-152844 2016-12-27 15:31:43 +00:00
Nicolas Gotchac
7581ac635f Fetch certifiers only when needed (#3978)
* Fetch certifiers once + on new Logs

* Linting

* BadgeReg First Query

* Rightly fetching badges on page change

* PR Grumbles

* Only fetch certifiers onces
2016-12-27 15:23:58 +00:00
Jaco Greeff
b27c809c64 Visible accounts for dapps (default whitelist) (#3898)
* Add APIs for Dapp management

* Move AddDapps modal

* Add DappsPermissions Modal (basics)

* Allow whitelist editing

* Add select/unselect tests

* Case

* Case

* Modal render/non-render tests

* UI made slightly prettier

* Adjust spacing

* Allow get/set of null for default whitelist (all)

* Allow null = all for selection

* Adjust selected background

* Address valid comment on formatters location
2016-12-27 15:23:41 +00:00
Robert Habermeier
80eae8cc49 remove some old (unused/duplicate) files (#3975) 2016-12-27 12:41:22 +00:00
Robert Habermeier
8125b5690c Port try macro to new ? operator. (#3962)
* initial untry sweep

* restore try in ipc codegen, fix inference

* change a few missed try instances
2016-12-27 12:53:56 +01:00
GitLab Build Bot
b1ef52a6d7 [ci skip] js-precompiled 20161227-114547 2016-12-27 11:48:47 +00:00
Jaco Greeff
19c8e55aa9 Small UI fixes (#3966)
* Load dapp visibility from localStorage

* Align MethodDecoding address svg properly

* Consolidate svg & img classes overrides

* improve isNullAddress check

* readOnly for null display

* disabled || readOnly
2016-12-27 12:40:33 +01:00
Nicolas Gotchac
ce8d9252e7 Fix wrong use of Icons (#3973) 2016-12-27 12:40:16 +01:00
Robert Habermeier
55dbfbf35b address grumbles 2016-12-27 12:24:18 +01:00
Robert Habermeier
84219a0094 make test network generic over peer type 2016-12-27 11:23:57 +01:00
Tomasz Drwięga
7454212b28 Updating dependencies (#3968) 2016-12-27 10:17:50 +00:00
Tomasz Drwięga
c7c309d152 Web Based Dapps (#3956)
* Dapps web

Conflicts:
	dapps/src/apps/fetcher.rs
	dapps/src/handlers/fetch.rs

* Rewriting fetch

* Parity-wide fetch service

* Obey the limits and support cancellation.

* Removing temporary files.

* Actually use Fetch for dapps

* Re-implementing file fetching to avoid temporary files.

* Serde to 0.8.19

* Fixing content & dapps fetch

* Serving web content and injecting scripts

* Don't wait for old content, start a new download

* Supporting timeouts and query

* Simple GUI for the browser

* Proxy tokens validation

* Recovering from invalid web-based requests

* Remember last visisted URL

* Removing unused variables

* Addressing review comments

* Setting default account in web3

* Adding WebBrowser dapp to the list

* Actually prune old entries when generating new token
2016-12-27 10:15:02 +00:00
Jannis Redmann
6842d43491 contract query: render false as false (#3971) 2016-12-27 10:04:14 +00:00
Jannis Redmann
5128438835 email verification: add Terms of Service (#3970) 2016-12-27 10:04:02 +00:00
Nicolas Gotchac
72c65d9c2f Fix method decoding (#3967)
* Fix method decoding

* Restore master version
2016-12-27 10:03:49 +00:00
Jaco Greeff
2bbefcd438 Store for EditMeta modal (#3959)
* Store basics

* Tested
2016-12-27 10:02:53 +00:00
Jannis Redmann
002e8b00d4 registry dapp: cleanup, support reverse entries (#3933)
* style fixes 

* registry dapp: show reverse events

* registry dapp: actions & reducers for isTestnet

* registry dapp: make Hash & Address components

* registry dapp: code style 

* registry dapp: bugfixes 🐛

* registry dapp: postTx helper

* registry dapp: refactor reducers

* registry dapp: use react-redux

* registry dapp: actions & reducers for reverse lookup

* registry dapp: reverse lookup component

* registry dapp: connect Address to redux

* registry dapp: de-DRY recordTypeSelect

In preparation for the next commit.

* registry dapp: support reverse lookup

* registry dapp: render reverse events

* registry dapp: show tx sender, add key prop

* registry dapp: link accounts to etherscan as well

* registry dapp: address style grumbles 💄

* registry dapp: address style grumbles 💄
2016-12-27 10:01:16 +00:00
Nicolas Gotchac
1ffc6ac58c New Address Selector Component (#3829)
* WIP new address selector

* WIP Working New Account Selector

* WIP Fully working Addres Selector (missing keyboards navigation)

* WIP Address Selector

* Fully functionnal new Address Selector!

* Implement disabled prop

* Don't auto-open on focus + Text Selection fix

* Add copy address capabilities

* Better Address Selector Focus

* Search from tags

* [Address Selector] Better Focus // Parity Background

* Linting

* [Adress Selector] Better focused input style

* Better focus support for inputs

* Fix style issue

* Add tags to accounts

* linting

* Add label to address selector

* Removed old address selector + improved styling

* Fixing address selection issues

* fix test

* Better logs...

* PR Grumbles Part 1

* PR Grumbles Part 2

* PR Grumbles Part 3.1

* PR Grumbles Part 3.2

* PR Grumbles Part 3.3

* New Portal Component

* Simpler Transition for Portal

* PR Grumbles Part 4

* Align font-family with rest of UI

* Fix null value input

* Fix Webpack build...
2016-12-27 09:59:37 +00:00
GitLab Build Bot
4e51f93176 [ci skip] js-precompiled 20161227-033404 2016-12-27 03:36:50 +00:00
GitLab Build Bot
7ace4b55c2 [ci skip] js-precompiled 20161226-033142 2016-12-26 03:34:29 +00:00
GitLab Build Bot
3ffc7890cb [ci skip] js-precompiled 20161225-045509 2016-12-25 04:57:52 +00:00
GitLab Build Bot
9cfc72ca43 [ci skip] js-precompiled 20161224-033250 2016-12-24 03:36:00 +00:00
GitLab Build Bot
c39e0aa3ef [ci skip] js-precompiled 20161223-204746 2016-12-23 20:50:31 +00:00
GitLab Build Bot
4893540103 [ci skip] js-precompiled 20161223-181511 2016-12-23 18:17:57 +00:00
Tomasz Drwięga
27ba0e6922 Limiting accounts returned by parity_accountInfo (#3931)
* Limiting accountNames returned by parity_accountNames

* Fixing middleware

* Change RPC interface

* Enhance tests for RPC layer

* UI uses parity_allAccountsInfo

* Update dapps to use parity_accountsInfo

* Don't filter by uuid (deprecated)

* Consistency in calls

* Fix js tests (missed stub call)
2016-12-23 18:52:02 +01:00
Robert Habermeier
546246c56b Unknown block error for RPC (#3965) 2016-12-23 18:46:17 +01:00
Robert Habermeier
612f14188f remove unused fields in informant (#3963) 2016-12-23 18:45:51 +01:00
keorn
afc4cd2785 Allow contract constructors in chain spec (#3932)
* constructor spec

* execute under wrong address

* create under correct address

* revert

* move genesis block lookup

* remove env_logger
2016-12-23 18:44:39 +01:00
Arkadiy Paronyan
5a3c3bcb45 Sync reorg up to history size (#3874)
* Allow sync reorg up to pruning history size

* Peer difficulty tracking

* Abort downloading block if received with NewBlock

* Set pruning history to 1200

* Renamed history size field
2016-12-23 18:43:40 +01:00
GitLab Build Bot
4516f893e5 [ci skip] js-precompiled 20161223-165758 2016-12-23 17:00:39 +00:00
Tomasz Drwięga
6251289b85 Rising the limit for fetch (#3964) 2016-12-23 17:23:31 +01:00
Nikolay Volf
e7ca4445e2 Bring integer arithmetic up to crates.io (#3943)
* split initial

* decouple crate

* fix tests compilation

* fix rlp tests
2016-12-23 16:53:06 +01:00
GitLab Build Bot
0ed45eaf15 [ci skip] js-precompiled 20161223-154928 2016-12-23 15:52:26 +00:00
Jaco Greeff
714298aa9a Eslint rule for block curlies (#3955)
* Add curly rule

* Fix pre-existing issues with new rule
2016-12-23 16:43:13 +01:00
Jaco Greeff
466f84f485 Gas exception warnings on deployment (#3938)
* add deployEstimateGas function

* Render gas warning with Warning component

* estimateGas, display warning on contract deploy

* Update messages

* Removed unused import

* Fix calculated gas usage

* Basic component smoktest

* Only display warning on edit steps
2016-12-23 16:42:48 +01:00
GitLab Build Bot
9529b6fa8c [ci skip] js-precompiled 20161223-144822 2016-12-23 14:52:31 +00:00
Jannis Redmann
db6964acc4 move verification store into modal (#3951)
* move verification store

* address style grumbles 
2016-12-23 15:40:04 +01:00
Jaco Greeff
fc620d0d3e Allow setting of minBlock on sending (#3921)
* minBlock value formatting

* Allow Contract execute to specify minBock

* Transfer allows minBlock

* Cleanups

* Check errors, verify via testing

* Display Submitted/Submission block in MethodDecoding
2016-12-23 15:31:19 +01:00
Jaco Greeff
74efb22230 Allow empty address (#3961) 2016-12-23 15:24:03 +01:00
Jaco Greeff
e006af1edd Fix default import (#3960) 2016-12-23 15:13:43 +01:00
Robert Habermeier
0688ccb003 chain_mem_used function on client 2016-12-23 14:54:31 +01:00
Robert Habermeier
bdf90df56f client report and heap size for header chain 2016-12-23 14:50:42 +01:00
Denis S. Soldatov aka General-Beck
63d68aaeef Update deb-build.sh
Add Depends: libssl
2016-12-23 16:47:50 +04:00
Robert Habermeier
d0194f3ad3 Merge branch 'master' into lightsync 2016-12-23 13:39:06 +01:00
Robert Habermeier
10c56acff6 revert tests submodule 2016-12-23 13:21:29 +01:00
GitLab Build Bot
4623f45686 [ci skip] js-precompiled 20161223-041415 2016-12-23 04:17:11 +00:00
GitLab Build Bot
9a013c4f47 [ci skip] js-precompiled 20161222-173736 2016-12-22 17:40:57 +00:00
Jaco Greeff
077069c452 Display 0x00..00 as null (#3950)
* Display 0x00..00 as null (custom black icon)

* rendering test for null
2016-12-22 18:30:59 +01:00
Tomasz Drwięga
f0387c33c6 Global Fetch Service (#3915)
* Dapps web

Conflicts:
	dapps/src/apps/fetcher.rs
	dapps/src/handlers/fetch.rs

* Rewriting fetch

* Parity-wide fetch service

* Obey the limits and support cancellation.

* Removing temporary files.

* Actually use Fetch for dapps

* Re-implementing file fetching to avoid temporary files.

* Serde to 0.8.19

* Fixing content & dapps fetch
2016-12-22 18:26:39 +01:00
GitLab Build Bot
1645419bc8 [ci skip] js-precompiled 20161222-164848 2016-12-22 16:51:32 +00:00
Jaco Greeff
c2e5b78c5b Update babel-loader for WebPack 2.2-rc (#3953)
* Update babel loader for WebPack 2.2

* Force build
2016-12-22 17:44:29 +01:00
GitLab Build Bot
7dd988860f [ci skip] js-precompiled 20161222-162822 2016-12-22 16:31:24 +00:00
Nicolas Gotchac
1140f9c9f8 Remove ui/views/modals bundles (#3946) 2016-12-22 17:21:59 +01:00
Jaco Greeff
203b419080 Fix manual input token (#3945)
* Fix manual input token (invalid regex)

* .trim() on token

* Add ^ & $ matching
2016-12-22 17:21:48 +01:00
Nicolas Gotchac
692ec97158 Update Webpack to 2.2 RC2 (#3952) 2016-12-22 17:07:18 +01:00
GitLab Build Bot
25f1c1dcc9 [ci skip] js-precompiled 20161222-153857 2016-12-22 15:42:00 +00:00
Jaco Greeff
00f4f128f2 Add missing Ethcore -> Parity headers (#3948) 2016-12-22 16:33:05 +01:00
Paul Peregud
b444d23b3a code example: do start before register_protocol (#3947) 2016-12-22 16:15:26 +01:00
Igor Artamonov
be75cbfaaa set CHAIN_ID for Classic (#3934)
* configurable CHAIN_ID

* set CHAIN_ID for Ethereum Classic
2016-12-22 13:10:58 +01:00
Robert Habermeier
b44cd7b1db Merge pull request #3940 from gguoss/auth-bft
Fixed compile error.
2016-12-22 12:54:14 +01:00
gavinGuo
70c9f7c80d Fixed compile error. 2016-12-22 14:51:25 +08:00
keorn
552a772cc1 make fields defaulting to 0 optional 2016-12-22 07:06:40 +01:00
GitLab Build Bot
a13135de30 [ci skip] js-precompiled 20161222-043246 2016-12-22 04:35:36 +00:00
GitLab Build Bot
8114d50b47 [ci skip] js-precompiled 20161221-183632 2016-12-21 18:39:21 +00:00
Nicolas Gotchac
bce69b2b09 Fix dApps not loading (#3935) 2016-12-21 19:30:49 +01:00
GitLab Build Bot
5ea70b1fd3 [ci skip] js-precompiled 20161221-141855 2016-12-21 14:22:59 +00:00
Nicolas Gotchac
aba38721b1 Fix Secure API hangs (#3927)
* Use proxy for WS in dev

* Update SecureAPI

* Update webpack config

* Fix dev contract

* Update webpack

* Linting fixes

* Refactor Secure API logic : Promise based, no wastes of req

* Fix tests

* Add try 'intitial' token
2016-12-21 15:12:40 +01:00
Robert Habermeier
a9f89b09e0 Merge pull request #3899 from ethcore/warp-sync-rpcs
parity_chainStatus RPC for block gap info
2016-12-21 15:09:45 +01:00
Nikolay Volf
af501e6467 Custom attribute for binary serialization (#3922)
* derive(Binary) -> binary

* ethcore types refact

* fixup ethcore

* make binary optional

* fix common types

* fix updater

* remove condition
2016-12-21 15:09:35 +01:00
Robert Habermeier
01b494ca2c Merge branch 'master' into lightsync 2016-12-21 13:42:07 +01:00
Gav Wood
b369939f20 Merge pull request #3926 from ethcore/split-ci-intermediate-stage
Split intermediate stage into two.
2016-12-20 18:42:11 +01:00
Gav Wood
af5c6af539 Split intermediate stage into two. 2016-12-20 17:54:09 +01:00
GitLab Build Bot
5bccd13111 [ci skip] js-precompiled 20161220-164120 2016-12-20 16:44:23 +00:00
Gav Wood
d486a983ac Merge pull request #3920 from ethcore/curl-rel-before-build
Move release-registering to intermediate stage.
2016-12-20 17:35:34 +01:00
Gav Wood
8f5804eab8 Merge pull request #3894 from ethcore/jg-fix-status-blocktime
Blocktime format rounding
2016-12-20 17:35:08 +01:00
Tomasz Drwięga
9a5bb9470b Ignore dapps_policy.json (#3919)
* Ignore dapps_policy.json

* Produce warning for non-ignored files
2016-12-20 16:34:53 +01:00
Gav Wood
f5a4581fa5 Move release-registering to intermediate stage. 2016-12-20 14:05:07 +01:00
GitLab Build Bot
269338d9bf [ci skip] js-precompiled 20161220-130157 2016-12-20 13:04:47 +00:00
GitLab Build Bot
ee050d4fd8 [ci skip] js-precompiled 20161220-111754 2016-12-20 11:20:41 +00:00
Jaco Greeff
d89ee5432e JS API interface for parity_chainStatus 2016-12-20 12:12:39 +01:00
Gav Wood
854cc604d9 Merge pull request #3912 from ethcore/ng-contract-dev
Fixing Contract Development
2016-12-20 12:12:06 +01:00
Nicolas Gotchac
7b3b82b750 Updating dependencies 2016-12-20 11:43:13 +01:00
Nicolas Gotchac
efb928b8f1 Removed Worker 2016-12-20 03:51:23 +01:00
Nicolas Gotchac
b4c73a52d1 Merge branch 'master' into ng-contract-dev 2016-12-20 02:39:10 +01:00
Nicolas Gotchac
244d1aefc6 linting 2016-12-20 02:38:40 +01:00
Nicolas Gotchac
1627c3fa71 Add import files in Contract Dev 2016-12-20 02:37:16 +01:00
Nicolas Gotchac
5886034265 Add optimize and autocompile toggles 2016-12-20 02:11:04 +01:00
Nicolas Gotchac
f70e808056 Fallback in Contract Dev if no worker 2016-12-20 01:55:57 +01:00
Gav Wood
8fc10c1911 Merge pull request #3911 from ethcore/use-rhash-for-non-native
Use rhash for non-native CI platforms and submit build.
2016-12-20 01:12:15 +01:00
Gav Wood
6659a4ec21 Use rhash for non-native CI platforms and submit build. 2016-12-20 00:21:19 +01:00
Gav Wood
61ade1e710 Merge pull request #3907 from ethcore/no-orbit-off
remove -Zorbit=off from rustflags on windows
2016-12-19 22:24:51 +01:00
Gav Wood
cd8af0a497 Merge pull request #3904 from ethcore/new-dirs
Fixed upgrading keys on the first run
2016-12-19 22:24:37 +01:00
Gav Wood
18965be047 Merge pull request #3903 from ethcore/test-mem-limit-deadlock
fix deadlock in queue drop
2016-12-19 22:23:56 +01:00
Gav Wood
5ba16e4867 Merge pull request #3897 from ethcore/single-provider-functions
require only simpler methods on Provider
2016-12-19 22:23:39 +01:00
Robert Habermeier
11f382ca1b remove -Zorbit=off from rustflags on windows 2016-12-19 19:15:18 +01:00
Robert Habermeier
70d53dcfd6 Merge branch 'master' into lightsync 2016-12-19 18:53:52 +01:00
Robert Habermeier
ae8f77bc7c fix deadlock in queue drop 2016-12-19 18:10:26 +01:00
arkpar
ddb242c969 Fixed upgrading keys on the first run 2016-12-19 17:41:55 +01:00
Robert Habermeier
e0f6f8f97e Merge pull request #3902 from ethcore/rpc-error-grammar
Fix grammar ("you try" -> "you tried" + article)
2016-12-19 16:49:39 +01:00
Robert Habermeier
5b6cd2183b Fix grammar ("you try" -> "you tried" + article) 2016-12-19 16:27:03 +01:00
Robert Habermeier
e1adc9606f parity_chainStatus RPC for block gap info 2016-12-19 15:27:17 +01:00
Gav Wood
002cec9e6f Merge pull request #3872 from ethcore/disable-light-server
remove light server capability temporarily
2016-12-19 15:22:44 +01:00
Gav Wood
1f8a1cac22 Merge pull request #3896 from ethcore/timestamp-ignore
Allow retry for future blocks
2016-12-19 15:21:05 +01:00
Gav Wood
9e3cadc6c3 Merge pull request #3895 from ethcore/rename-engines
Consistent engine and seal names
2016-12-19 15:19:57 +01:00
Robert Habermeier
4c7dc9f2d8 require only simpler methods on Provider 2016-12-19 14:54:10 +01:00
arkpar
d3486b45c5 Allow retry for future blocks 2016-12-19 14:47:48 +01:00
Nicolas Gotchac
e377ec3194 Working ServiceWorker 2016-12-19 14:39:10 +01:00
GitLab Build Bot
776a45af87 [ci skip] js-precompiled 20161219-132051 2016-12-19 13:25:03 +00:00
keorn
46662899da make spec naming consistent 2016-12-19 14:15:39 +01:00
Jannis Redmann
2862e8b92c update email certification ABI (#3893) 2016-12-19 14:14:54 +01:00
Jaco Greeff
6efaec8f8b Blocktime format rounding 2016-12-19 14:07:50 +01:00
Robert Habermeier
2b1f51694b fix cli test 2016-12-19 14:01:19 +01:00
GitLab Build Bot
65f2d2b050 [ci skip] js-precompiled 20161219-122700 2016-12-19 12:30:05 +00:00
Jaco Greeff
1b59ceb7c1 Remove existence & length checks on passwords & phrases (#3854)
* Allow input to receive FormattedMessage errors

* Only do existence checks on phrases & passwords

* Add missing import

* Remove existence checks, display security reminder
2016-12-19 13:17:28 +01:00
Jannis Redmann
7185fb0f37 refresh certifications automatically (#3878)
* certifications: eth.getLogs -> filters

* linting 👕, indentation

* certifications: fetch filter changes

* certifications: prevent overlapping

* certifications: watch blockNumber to refresh

* fix email certification contract

See ethcore/contracts@d86490e302

* update email certification contract
2016-12-19 13:17:15 +01:00
Nicolas Gotchac
670be41b62 Fix Wallet Settings Modal (#3856)
* Fixes wallet settings modal

* Fix linting
2016-12-19 13:16:59 +01:00
Robert Habermeier
a48435ca60 Merge branch 'master' into lightsync 2016-12-19 13:15:37 +01:00
Robert Habermeier
d765611050 allow queue to drain fully when idle 2016-12-19 12:41:00 +01:00
Robert Habermeier
ccdf5d5873 increase tick timer and limit peers to one req 2016-12-19 12:28:42 +01:00
Arkadiy Paronyan
14a9942d14 Update appveyor.yml 2016-12-18 01:11:48 +01:00
Arkadiy Paronyan
fc10d15b75 Update appveyor.yml 2016-12-18 01:11:29 +01:00
Gav Wood
e755c09446 Merge pull request #3884 from ethcore/fix-diff-adj
Fix difficulty adjustment.
2016-12-17 16:35:20 +01:00
Gav Wood
ec5b867a22 Merge pull request #3883 from ethcore/fix-win-ci
Final fixups for updater
2016-12-17 16:10:08 +01:00
Gav Wood
d98f0d8fb5 No need to test windows for every PR. 2016-12-17 16:00:33 +01:00
Gav Wood
023d413610 Fix difficulty adjustment.
Closes #3861
2016-12-17 15:53:06 +01:00
Gav Wood
efd4036a9a Fix build. 2016-12-17 15:40:55 +01:00
Gav Wood
6e12f4f719 Alter port for icarus. 2016-12-17 15:22:31 +01:00
Gav Wood
b418cb8da3 Merge remote-tracking branch 'origin/master' into fix-win-ci 2016-12-17 15:10:17 +01:00
Gav Wood
b2b3a0eb34 Final fixups for updater
- Wire up platforms to match those of CI.
- Introduce "final" feature to tag version with "nightly".
2016-12-17 14:36:30 +01:00
Gav Wood
6634b2e3da Merge pull request #3882 from ethcore/fix-win-ci
Attempt to fix windows CI.
2016-12-17 13:13:08 +01:00
Gav Wood
a81e833fcc Merge pull request #3881 from ethcore/tx-test-fix
Fixing racy test
2016-12-17 12:57:15 +01:00
arkpar
b34d3ee5a2 Fixin racy test 2016-12-17 12:28:31 +01:00
Gav Wood
adb0f6fb26 Merge pull request #3880 from ethcore/fix-updater-permissions
Fix updater permissions
2016-12-17 12:15:05 +01:00
Gav Wood
f00eb060c1 Attempt to fix windows CI. 2016-12-17 12:06:51 +01:00
Robert Habermeier
5b0531e964 fix compiler warnings 2016-12-17 00:44:18 +01:00
Robert Habermeier
bd59ef05ac prettier informant 2016-12-17 00:41:02 +01:00
Robert Habermeier
893892ca12 remove request limiting from sync service 2016-12-17 00:31:21 +01:00
Robert Habermeier
be914ddfc7 fix check for moving backwards 2016-12-16 23:53:36 +01:00
Robert Habermeier
2c0f456e4d guard import order 2016-12-16 23:53:20 +01:00
Robert Habermeier
e57ab96731 fix reverse start block check 2016-12-16 23:21:59 +01:00
Robert Habermeier
08587a1f56 fix subchain request ordering 2016-12-16 23:21:51 +01:00
Robert Habermeier
653363c572 limit to one pending request per peer 2016-12-16 23:21:17 +01:00
Arkadiy Paronyan
4c0741e568 Fixed windows stub signature 2016-12-16 22:26:12 +01:00
Robert Habermeier
a7505be627 fix deadlocks 2016-12-16 22:09:29 +01:00
Robert Habermeier
8970946b74 basic --light parameter 2016-12-16 21:45:51 +01:00
Gav Wood
75c92e9356 Add Parity.png 2016-12-16 20:34:08 +01:00
Gav Wood
83e6e03dd6 Merge pull request #3865 from ethcore/tx-block
Delayed transactions
2016-12-16 20:28:18 +01:00
Gav Wood
6f977f03ae Rename from troublesome filename 2016-12-16 20:26:49 +01:00
Gav Wood
c14d34e347 Merge pull request #3853 from ethcore/jg-token-log
Don't log auth token
2016-12-16 20:24:23 +01:00
Gav Wood
fa721f5cdf Merge pull request #3875 from ethcore/config-fix
Loading default config from default path
2016-12-16 20:24:12 +01:00
Gav Wood
c2448f6c2f Add mac icon. 2016-12-16 18:32:33 +01:00
Gav Wood
14e4fefbcf Fix updater permissions and refactor existing code. 2016-12-16 18:17:15 +01:00
Gav Wood
45f141b52f Merge pull request #3877 from ethcore/path-fix
New paths
2016-12-16 17:38:20 +01:00
Robert Habermeier
8b88ef1844 add light sync service to ethsync 2016-12-16 17:38:16 +01:00
Gav Wood
b9cd68e7e6 Minor paths change 2016-12-16 17:38:02 +01:00
Gav Wood
e8624fda88 Merge pull request #3876 from ethcore/fix-ci
Update tests, gitlabci
2016-12-16 16:56:46 +01:00
Robert Habermeier
f85313fbff Merge branch 'master' into lightsync 2016-12-16 15:29:11 +01:00
Robert Habermeier
ce84215d93 naive and bad request dispatcher 2016-12-16 15:26:39 +01:00
arkpar
6966fd6c63 New paths 2016-12-16 15:25:53 +01:00
Gav Wood
b89d10239b Update tests, gitlabci 2016-12-16 15:12:35 +01:00
Tomasz Drwięga
f345458b65 Loading config from default path 2016-12-16 15:03:31 +01:00
arkpar
65f07e5aa7 Renamed some functions 2016-12-16 14:54:26 +01:00
Robert Habermeier
0d7b638a2d ancestor search response handler 2016-12-16 14:53:36 +01:00
arkpar
6c9de9e6f8 Merge branch 'master' of github.com:ethcore/parity into tx-block 2016-12-16 13:36:07 +01:00
arkpar
f967713d08 Added a test 2016-12-16 13:27:14 +01:00
GitLab Build Bot
3450538208 [ci skip] js-precompiled 20161216-121923 2016-12-16 12:22:56 +00:00
Gav Wood
72f278efed Merge pull request #3868 from ethcore/new-dirs
Base directory option
2016-12-16 13:04:31 +01:00
Gav Wood
6e5a583cb4 Merge pull request #3505 from ethcore/check-updates
Auto-updating
2016-12-16 13:01:49 +01:00
Gav Wood
b437265082 Fix build. 2016-12-16 11:27:00 +01:00
Gav Wood
90d3d330f5 Use info! for blockchain status rather than stdout. 2016-12-16 11:00:17 +01:00
Gav Wood
396ab5b361 Refactor and make is_syncing. 2016-12-16 10:31:10 +01:00
Gav Wood
35b18485d4 Don't check for updates while syncing. 2016-12-16 10:14:44 +01:00
Gav Wood
ba60e046be Tone down logging. 2016-12-16 10:02:42 +01:00
Gav Wood
d9b9172089 Merge pull request #3873 from ethcore/fix-collision
Fix naming collision
2016-12-16 02:09:36 +01:00
keorn
d8470cc5ca revert slack 2016-12-16 00:07:07 +01:00
Robert Habermeier
a1f32de2d9 Merge branch 'master' into lightsync 2016-12-15 23:55:04 +01:00
Robert Habermeier
8f65a7bcc8 remove light server capability temporarily 2016-12-15 23:50:16 +01:00
keorn
447196398a fix start_step 2016-12-15 23:36:06 +01:00
Gav Wood
6ea5638240 Merge pull request #3858 from ethcore/fetcher-ref
Get rid of unecessary redirection while fetching content
2016-12-15 23:08:37 +01:00
Gav Wood
a6a8e431f5 Fix lint 2016-12-15 22:46:36 +01:00
Gav Wood
7cac50601f Add JS tests for parity_netPeers 2016-12-15 22:45:35 +01:00
Robert Habermeier
8622ab66dc skeleton for maintain_sync: all but dispatch 2016-12-15 22:42:24 +01:00
Gav Wood
869fbf5108 Fix linting. 2016-12-15 22:07:25 +01:00
Gav Wood
ca0d87da10 125 -> 69. 2016-12-15 22:05:54 +01:00
arkpar
e2371632c5 Base dir option 2016-12-15 21:56:45 +01:00
Robert Habermeier
9c7340307e handle events, minimal state machine 2016-12-15 21:51:08 +01:00
arkpar
060cc799a6 Minor tweaks 2016-12-15 21:44:31 +01:00
GitLab Build Bot
3e83aeeb17 [ci skip] js-precompiled 20161215-201838 2016-12-15 20:21:20 +00:00
arkpar
e1dd986c41 Hex-encoded block numbers 2016-12-15 21:16:32 +01:00
Gav Wood
5bab14e0c0 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-15 21:15:25 +01:00
Gav Wood
5fb34573c6 Merge pull request #3864 from ethcore/jr-fix-verification
fix verification stores
2016-12-15 21:13:05 +01:00
Gav Wood
1a790b784f Fix centos's reported build platform. 2016-12-15 20:49:09 +01:00
Jannis R
d2962fe47b store certifier index in constant 2016-12-15 20:47:41 +01:00
arkpar
27580586e0 Minor tweaks 2016-12-15 20:09:05 +01:00
keorn
b7b531ca75 more slack in test 2016-12-15 19:54:28 +01:00
Gav Wood
4410fb635a Respect system paths. 2016-12-15 19:53:13 +01:00
arkpar
450a9d2867 Merge branch 'master' of github.com:ethcore/parity into tx-block 2016-12-15 19:41:19 +01:00
Nicolas Gotchac
1d04f25a0a Add error toString 2016-12-15 19:35:16 +01:00
arkpar
3ac0794d28 Bump jsonrpc-core for rpc_cli 2016-12-15 19:31:26 +01:00
keorn
b88d50dc9b fix naming collision 2016-12-15 19:27:06 +01:00
Robert Habermeier
72f7391551 add BasicContext trait for handler ticking 2016-12-15 19:25:52 +01:00
Gav Wood
801596395e --release-track. 2016-12-15 19:23:25 +01:00
Gav Wood
995fafebee Fix last remaining test. 2016-12-15 19:19:50 +01:00
Gav Wood
d737de0fc0 Fix tests. 2016-12-15 19:17:44 +01:00
arkpar
f8961484c1 Merge branch 'master' of github.com:ethcore/parity into tx-block 2016-12-15 19:10:33 +01:00
Nicolas Gotchac
5983a0c1a5 Linting fixes 2016-12-15 19:07:13 +01:00
Nicolas Gotchac
365ab60fed Use ServiceWorker for Contract compilation 2016-12-15 19:06:05 +01:00
Gav Wood
4a2b418fc2 Configurable update tracks to help testing. 2016-12-15 18:51:59 +01:00
Robert Habermeier
5346539ef8 minimal header import and client service 2016-12-15 18:47:26 +01:00
Tomasz Drwięga
99e42db2f5 Merge branch 'master' into fetcher-ref 2016-12-15 18:33:58 +01:00
Gav Wood
fa319ff64c Remove duplicate line. 2016-12-15 18:24:18 +01:00
GitLab Build Bot
867fdb9eac [ci skip] js-precompiled 20161215-172100 2016-12-15 17:23:53 +00:00
Gav Wood
c12702fc51 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-15 18:23:02 +01:00
arkpar
2952ea1b85 Delayed transactions 2016-12-15 18:19:19 +01:00
Jannis Redmann
5939575c87 Merge #3863 from ethcore/jg-contract-subid
Store subscriptionId, align with main subscription model
2016-12-15 18:14:33 +01:00
Jannis R
7fdcc70825 Merge jg-contract-subid into jr-fix-verification 2016-12-15 18:12:45 +01:00
Jaco Greeff
1f1dc8b89d Store subscriptionId, use it to send changes 2016-12-15 18:09:59 +01:00
Jannis R
0e963da27b fix verification stores 🐛 2016-12-15 18:09:52 +01:00
Gav Wood
4d6b4d9d72 Merge pull request #3792 from ethcore/dapps-accounts-rpc
Additional RPCs for dapps accounts management
2016-12-15 18:09:40 +01:00
Jaco Greeff
2be5247567 Merge branch 'master' into jg-contract-subid 2016-12-15 18:06:45 +01:00
Gav Wood
eb90d70be1 Merge pull request #3830 from ethcore/cli-rpc
Add Ws Json rpc client and command line utils (take 2)
2016-12-15 18:04:35 +01:00
GitLab Build Bot
87f1486907 [ci skip] js-precompiled 20161215-170041 2016-12-15 17:03:27 +00:00
Jannis Redmann
29457c11ef Merge #3862 from ethcore/jg-fix-contracts-send
Fix typo in method call (broken contract interface)
2016-12-15 17:54:42 +01:00
Jaco Greeff
17781a5ac4 Fix typo in method call 2016-12-15 17:52:28 +01:00
Robert Habermeier
f776f48023 drain prepared headers from sync round 2016-12-15 17:33:25 +01:00
Gav Wood
943f58487c Merge remote-tracking branch 'origin/master' into cli-rpc 2016-12-15 17:13:51 +01:00
Gav Wood
d455ac4a40 Merge remote-tracking branch 'origin/master' into dapps-accounts-rpc 2016-12-15 17:12:18 +01:00
Gav Wood
db2e1dd01a Merge remote-tracking branch 'origin/master' into check-updates 2016-12-15 17:11:22 +01:00
Gav Wood
2e02db2d3e Merge pull request #3860 from ethcore/fix-channel
Fix flaky test
2016-12-15 17:10:41 +01:00
keorn
ee653bc262 unused import 2016-12-15 16:53:28 +01:00
keorn
9bfa69c6bd fix channel 2016-12-15 16:52:39 +01:00
Robert Habermeier
71e96aca10 handle abandoned requests 2016-12-15 16:19:28 +01:00
Tomasz Drwięga
2be6223eb3 Updating submodules to latest 2016-12-15 15:57:21 +01:00
Jaco Greeff
9dd1268b69 Add keys for steps (future-proof) 2016-12-15 15:56:58 +01:00
Robert Habermeier
ec88a992e3 provide response context to response handler 2016-12-15 15:50:36 +01:00
Tomasz Drwięga
b85f7b7433 Merge branch 'master' into fetcher-ref 2016-12-15 15:44:14 +01:00
Gav Wood
5e59e0b9d3 Fix build. 2016-12-15 15:35:46 +01:00
Tomasz Drwięga
dedf9d6dce Getting rid of redirection 2016-12-15 15:32:53 +01:00
Gav Wood
817a58cf64 Merge pull request #3844 from ethcore/trace-macros
Converting traces API to AutoArgs
2016-12-15 15:21:35 +01:00
Gav Wood
590428e7f2 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-15 15:12:09 +01:00
Gav Wood
d1040e4127 Whitespace 2016-12-15 15:03:34 +01:00
Gav Wood
8f5e0cf7d9 Fix build 2016-12-15 14:54:02 +01:00
GitLab Build Bot
7e76d6494c [ci skip] js-precompiled 20161215-134858 2016-12-15 13:52:59 +00:00
Gav Wood
ca63bc2f44 Update parking_lot dep 2016-12-15 14:46:31 +01:00
Gav Wood
0da564a4c2 Merge branch 'master' into cli-rpc 2016-12-15 14:45:15 +01:00
Gav Wood
d76239ed48 Merge pull request #3768 from ethcore/jr-use-badge-reg
get certifications from BadgeReg, show them in accounts overview
2016-12-15 14:43:05 +01:00
Gav Wood
20b2f84d48 Merge pull request #3828 from ethcore/new-dirs
New directory structure
2016-12-15 14:34:01 +01:00
GitLab Build Bot
6dfcbd4156 [ci skip] js-precompiled 20161215-130206 2016-12-15 13:06:03 +00:00
Jaco Greeff
054a6a9daf Merge branch 'master' into check-updates
# Conflicts:
#	.gitlab-ci.yml
#	js/webpack/dev.server.js
2016-12-15 13:52:28 +01:00
Gav Wood
be0d5ca516 Merge pull request #3827 from ethcore/jr-first-run
first run: skip account creation if they already have accounts
2016-12-15 13:52:01 +01:00
Jannis R
4c42dedcad sort props 💄 2016-12-15 13:51:44 +01:00
Gav Wood
1ea521ea7d Merge remote-tracking branch 'origin/master' into dapps-accounts-rpc 2016-12-15 13:51:22 +01:00
Gav Wood
9440c2600f Merge pull request #3857 from ethcore/tender-seal
Tendermint seal
2016-12-15 13:50:49 +01:00
Jannis R
f59f7c5773 address style grumbles 💄 2016-12-15 13:48:40 +01:00
keorn
0b9ab0797f fix build 2016-12-15 13:45:22 +01:00
keorn
943efc21bb add tendermint seal 2016-12-15 13:41:04 +01:00
Gav Wood
69eec105a7 Change default back to permissive for now. 2016-12-15 13:40:44 +01:00
Gav Wood
db73b0d66f Merge remote-tracking branch 'origin/master' into dapps-accounts-rpc 2016-12-15 13:28:37 +01:00
Jannis R
afba259506 merge master into jr-use-badge-reg 2016-12-15 13:25:35 +01:00
Gav Wood
a74bce2c06 Merge pull request #3759 from ethcore/auth-bft
Tendermint Engine
2016-12-15 13:18:15 +01:00
Gav Wood
1ebbb8ae3d Merge pull request #3852 from ethcore/js-css-lint
Expand lint to catch css issues
2016-12-15 13:09:51 +01:00
Gav Wood
8fa00a20e6 Merge pull request #3851 from ethcore/js-inject-all
inject exports both partiy & web3
2016-12-15 13:09:29 +01:00
Gav Wood
0562d85a0e Merge pull request #3848 from ethcore/ng-webpack-talkative
Let Webpack talk again
2016-12-15 13:09:06 +01:00
Gav Wood
a660024eac Merge pull request #3843 from ethcore/auth-round-seal
AuthorityRound seal and simplify Generic seal Spec
2016-12-15 13:08:50 +01:00
Gav Wood
c4406c9198 Merge pull request #3691 from ethcore/rotating-key
Signing transactions with rotating token
2016-12-15 13:08:19 +01:00
Robert Habermeier
5d8bfd8758 handle responses for round scaffold and frames 2016-12-15 13:05:38 +01:00
arkpar
6d41168bbe Change build order 2016-12-15 12:07:09 +01:00
Tomasz Drwięga
c6912c8e0a Removing on_done 2016-12-15 11:43:36 +01:00
Jaco Greeff
701399fc77 Don't log auth token 2016-12-15 10:23:01 +01:00
Jaco Greeff
88a26ec53f Support lint:cached 2016-12-15 10:08:57 +01:00
Jaco Greeff
9fc3c47bcb inject exports both partiy & web3 2016-12-15 10:05:52 +01:00
Denis S. Soldatov aka General-Beck
03db4d0373 Update gitlab-ci
add `cargo clean` in darwin build
2016-12-15 14:15:27 +07:00
Nicolas Gotchac
15050da1cd Let Webpack talk again 2016-12-15 00:07:49 +01:00
Robert Habermeier
0768a61944 light: add LightChainClient trait 2016-12-14 23:26:15 +01:00
Robert Habermeier
1bcfc9348d light: specialize Downloader to SyncRound 2016-12-14 23:25:51 +01:00
Robert Habermeier
91b8fa7039 light: downloader state machine stub 2016-12-14 22:57:30 +01:00
Gav Wood
bf7fb84937 Don't put sha3s. 2016-12-14 21:59:00 +01:00
Robert Habermeier
2966b88a7a Merge pull request #3835 from ethcore/bump-dev
Bump dev chain
2016-12-14 21:37:14 +01:00
Robert Habermeier
0d466fa8d0 light: tests for response module 2016-12-14 20:27:03 +01:00
Denis S. Soldatov aka General-Beck
245c8581bb Update .gitlab-ci.yml 2016-12-15 02:17:59 +07:00
Denis S. Soldatov aka General-Beck
244761782e Update gitlab-ci
Remove armv6 from `nightly`
remove `-j 8` key from windows builds
Remove `test-windows` from `nightly`
2016-12-15 02:14:15 +07:00
Tomasz Drwięga
d2b9bc5bd8 Traces to AutoArgs 2016-12-14 20:09:14 +01:00
Tomasz Drwięga
6e51b23e30 Adding traces tests 2016-12-14 20:07:33 +01:00
Robert Habermeier
887bcfb88a light: response decoding and verification module 2016-12-14 19:36:48 +01:00
Jaco Greeff
3df092f29d Add lint:css 2016-12-14 16:42:26 +01:00
Jaco Greeff
7330612bfb Toggle upgrade modal via upgrade link 2016-12-14 15:56:01 +01:00
Vincent Serpoul
339b889ac4 spelling (#3839) 2016-12-14 15:15:19 +01:00
Tomasz Drwięga
366f9a8cd7 Fixing tests 2016-12-14 14:44:09 +01:00
Jaco Greeff
2588aea6b2 Merge branch 'master' into check-updates 2016-12-14 14:37:38 +01:00
Jaco Greeff
a8f428ccca Display capability status on statusbar 2016-12-14 14:37:25 +01:00
Tomasz Drwięga
1d80725f66 Merge branch 'master' into cli-rpc 2016-12-14 14:12:27 +01:00
Tomasz Drwięga
7eb9112613 Merge branch 'master' into rotating-key
Conflicts:
	rpc/src/v1/traits/signer.rs
2016-12-14 14:10:44 +01:00
Jaco Greeff
d28ec2ff97 Make enode available on Status page 2016-12-14 13:41:29 +01:00
keorn
f686fa3d6f update specs and generic conversion 2016-12-14 12:50:32 +01:00
Jannis R
bbcae3d27b merge master into jr-first-run 2016-12-14 12:28:55 +01:00
Jannis R
240bab230c merge master into jr-use-badge-reg 2016-12-14 12:26:18 +01:00
keorn
8509a183ed deserialize new seal 2016-12-14 12:14:04 +01:00
keorn
ae98a56e8b revert submodule 2016-12-14 11:42:47 +01:00
keorn
e1d83d15b7 bump dev chain 2016-12-14 11:34:19 +01:00
arkpar
3280f071b1 Fixed moving dirs on windows 2016-12-14 01:33:57 +01:00
arkpar
be5fefe772 Merge branch 'master' of github.com:ethcore/parity into new-dirs 2016-12-14 00:04:11 +01:00
arkpar
6e3e1ea88b XDG paths 2016-12-13 23:38:29 +01:00
Gav Wood
d1653567d9 Add contract ABI auto-generatr.
o
2016-12-13 22:32:34 +01:00
Robert Habermeier
359d433292 light: pass incoming responses to peer state machine 2016-12-13 22:26:06 +01:00
Gav Wood
597c3a4770 Ensure chain state is at threshold security level before looking for updates. 2016-12-13 21:21:07 +01:00
Robert Habermeier
6fb71527e4 light: search for common ancestor with peers 2016-12-13 21:09:57 +01:00
Robert Habermeier
8c64400654 light: change sync module name 2016-12-13 21:09:43 +01:00
Gav Wood
805b8cab2c Add missing file. 2016-12-13 20:50:33 +01:00
Gav Wood
4424155d39 Similar checks on file changes to other tests. 2016-12-13 20:49:26 +01:00
Gav Wood
aaf6d59bda Disable windows tests until it works. 2016-12-13 20:22:04 +01:00
Gav Wood
6a48e9d9e5 Print output for commands, don't info! 2016-12-13 20:20:10 +01:00
Robert Habermeier
484023b171 light: max requests as 0 on unknown peer 2016-12-13 20:13:55 +01:00
Robert Habermeier
2a01b43bd1 light: block status and CHT module 2016-12-13 20:13:16 +01:00
keorn
c96826beaa expect instead of index 2016-12-13 18:22:56 +01:00
GitLab Build Bot
1a9a142a69 [ci skip] js-precompiled 20161213-171715 2016-12-13 17:19:48 +00:00
Gav Wood
72b8ee84c7 Merge pull request #3766 from ethcore/jr-email-verification
email verification
2016-12-13 18:09:41 +01:00
Gav Wood
80d6e49070 Merge pull request #3812 from ethereumproject/splix/classic-replay-protection
Network configuration for Ethereum Classic
2016-12-13 17:39:33 +01:00
Gav Wood
c6281fc1c7 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-13 17:26:09 +01:00
Gav Wood
575afd8bac Merge branch 'check-updates' of github.com:ethcore/parity into check-updates 2016-12-13 17:25:16 +01:00
Gav Wood
e099e0d93c Add auth code. 2016-12-13 17:23:48 +01:00
Robert Habermeier
0b69e41bd1 Merge pull request #3831 from ethcore/rpc-macros
Using jsonrpc-macros
2016-12-13 17:16:29 +01:00
Gav Wood
119f253be9 Fix windows test. 2016-12-13 17:14:18 +01:00
Gav Wood
362b201532 Don't run git unnecessarily. 2016-12-13 16:32:03 +01:00
Gav Wood
7e269fe3d3 GLitlab-CI script pushes build info. 2016-12-13 16:21:26 +01:00
Tomasz Drwięga
65d62ccf04 Altering the order [ci:skip] 2016-12-13 14:59:19 +01:00
Robert Habermeier
45ef986c04 light: finish basic header chain and add tests 2016-12-13 14:48:03 +01:00
Tomasz Drwięga
f47be50843 Using jsonrpc-macros 2016-12-13 14:40:35 +01:00
arkpar
49ae375605 Don't coneect peers on each sync 2016-12-13 13:23:10 +01:00
Tomasz Drwięga
5affefc763 Fixing CLI signer 2016-12-13 12:17:01 +01:00
GitLab Build Bot
1114ad3ca7 [ci skip] js-precompiled 20161213-051314 2016-12-13 05:15:44 +00:00
Robert Habermeier
c2264bed27 light: skeleton for sync service 2016-12-13 00:08:39 +01:00
Jaco Greeff
51b544c2db Simplify icon exports 2016-12-12 23:53:29 +01:00
arkpar
5fd2e15313 Style and docs 2016-12-12 23:21:44 +01:00
Jaco Greeff
dbc6b42267 Lint fixes 2016-12-12 23:14:44 +01:00
Jaco Greeff
9931d7657a Merge remote-tracking branch 'origin/check-updates' into check-updates 2016-12-12 23:07:41 +01:00
Robert Habermeier
4173ecf2a5 light: begin header chain 2016-12-12 22:59:05 +01:00
Jaco Greeff
e170134d97 Merge branch 'master' into check-updates 2016-12-12 22:45:12 +01:00
Jaco Greeff
f15671c74b UI interface completed, to be tested 2016-12-12 22:45:09 +01:00
keorn
fa504e510f Merge branch 'master' into auth-bft 2016-12-12 21:28:46 +01:00
Igor Artamonov
e61d14d7f7 reuse Morden for Classic Testnet 2016-12-12 19:50:32 +00:00
keorn
19adb84527 TestNet flushing and cleanup 2016-12-12 19:44:24 +01:00
Jaco Greeff
a8ae9b02f9 Typo 2016-12-12 18:58:31 +01:00
Jaco Greeff
a2a89f7e59 Basic UI structure in-place 2016-12-12 18:30:41 +01:00
Jaco Greeff
7a0fccf417 Add shared icons 2016-12-12 18:30:05 +01:00
Jaco Greeff
9a26caf548 Build settings 2016-12-12 18:29:45 +01:00
arkpar
85fd62917a Updated tests 2016-12-12 17:53:17 +01:00
keorn
722cd4d086 AuthorityRound fork test 2016-12-12 17:24:48 +01:00
keorn
f8ed5cf022 finalize unit tests 2016-12-12 17:20:20 +01:00
arkpar
edb853ca35 KillDB command 2016-12-12 17:19:41 +01:00
arkpar
6601fde328 New data paths with upgrade 2016-12-12 16:51:07 +01:00
Gav Wood
988ac8a22d Add forks supported. 2016-12-12 16:47:57 +01:00
Gav Wood
ab4d666681 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-12 16:35:11 +01:00
Jaco Greeff
1135674eaa WIP UI (dialog available) 2016-12-12 15:51:36 +01:00
Jaco Greeff
c784ab55d2 Extend jsapi interfaces with documentation 2016-12-12 15:43:59 +01:00
Jaco Greeff
a659adfd33 Only ignore parity.* files in root 2016-12-12 15:43:24 +01:00
GitLab Build Bot
d2a34acdfd [ci skip] js-precompiled 20161212-143454 2016-12-12 14:37:25 +00:00
Gav Wood
3a16247655 Merge pull request #3823 from ethcore/jg-typedinput-tests
Fixed bool dropdown in contract execution
2016-12-12 15:28:58 +01:00
Jannis R
b980e7a329 add skip button to first run modal 2016-12-12 14:32:55 +01:00
Jannis R
085adbaffd make showFirstRun in localStorage a bool 2016-12-12 14:15:26 +01:00
keorn
8ed89bb74f propagate proposal to all peers 2016-12-12 13:00:51 +01:00
Jaco Greeff
3a7e30ec5c Fix issue with bool type dropdown 2016-12-12 12:49:40 +01:00
Jaco Greeff
563c8c75f9 Tests for DetailsStep (only bool dropdown) 2016-12-12 12:49:04 +01:00
Jaco Greeff
c5c4e5e901 Updated 2016-12-12 12:48:43 +01:00
Jaco Greeff
29674a0e65 Small testability fixes 2016-12-12 12:48:32 +01:00
Jaco Greeff
23234fb1aa Allow operation in test mode 2016-12-12 12:48:16 +01:00
Jannis R
c43944584d fix import 2016-12-12 12:33:58 +01:00
Jannis R
723e9e55db merge master into jr-email-verification 2016-12-12 12:21:06 +01:00
Jannis R
d67a9388ff merge master into jr-use-badge-reg 2016-12-12 12:13:49 +01:00
Jaco Greeff
28be8d6f6c Test for bool TypedInput 2016-12-12 10:55:20 +01:00
Jaco Greeff
f9b5a056cf Merge branch 'master' into jg-typedinput-tests 2016-12-12 10:14:29 +01:00
Jaco Greeff
2c4c6ba4e4 Basic smoketest 2016-12-12 10:12:12 +01:00
GitLab Build Bot
1db4647327 [ci skip] js-precompiled 20161212-052342 2016-12-12 05:26:15 +00:00
GitLab Build Bot
f1096619a5 [ci skip] js-precompiled 20161212-034026 2016-12-12 03:43:28 +00:00
Gav Wood
7975d475e1 Flesh out RPC tests. 2016-12-12 04:29:55 +01:00
Gav Wood
c0a2d5c8f5 Merge pull request #3796 from ethcore/tx-broadcast
Avoid broadcasting transactions to peers that send them
2016-12-12 04:13:56 +01:00
Gav Wood
2844a4e85e Merge pull request #3800 from ethcore/eth-sign
eth_sign RPC now hashes given data instead of getting the hash
2016-12-12 04:12:27 +01:00
Gav Wood
4c9ea55e49 Add an Updater mockup and provide a test for it. 2016-12-12 03:49:50 +01:00
Gav Wood
77cb937065 Please info!s in updater target. 2016-12-12 03:02:27 +01:00
Gav Wood
382a0b2d8b Avoid warning. 2016-12-12 03:00:18 +01:00
Gav Wood
32746df706 Add missing ;s 2016-12-12 02:58:35 +01:00
Gav Wood
758744449f Expose all other RPCs. 2016-12-12 02:57:19 +01:00
GitLab Build Bot
29af24519d [ci skip] js-precompiled 20161211-234535 2016-12-11 23:48:03 +00:00
Nicolas Gotchac
0cb16ae589 Add store for MethodDecoding (#3821)
* Add Loader to Transactions

* Add Method Decoding Store (better fetching of methods)

* Load locally stored ABI in MethodDecodingStore

* Fixes UI glitches along the way

* Linting

* Add method decoding from User Contracts
2016-12-12 00:38:47 +01:00
Jaco Greeff
22ac80d98f Add store for AddAddress (#3819)
* WIP

* Updated tests

* Final round of fixes

* Header update
2016-12-12 00:38:38 +01:00
Gav Wood
2d0d4682ad Add first Updater RPC. 2016-12-11 23:36:38 +01:00
Gav Wood
d81d9d77b2 Wire-in Updater to parity RPC 2016-12-11 23:15:52 +01:00
keorn
3c5d5856d2 nicer tracing 2016-12-11 22:54:48 +01:00
Gav Wood
d8ad09b654 Make updater an IPC module. 2016-12-11 22:47:43 +01:00
GitLab Build Bot
2de64bb5e4 [ci skip] js-precompiled 20161211-202217 2016-12-11 20:24:36 +00:00
Tomasz Drwięga
83d9bc189b Fixing test 2016-12-11 21:08:15 +01:00
Nicolas Gotchac
4c3dea2a0b Fix React-Router in i18n locale change (#3815)
* Routes in routes config => no more react router error message

* Add LocalStorage for Locale Selection

* Ethcore to Parity LTD
2016-12-11 21:03:48 +01:00
Nicolas Gotchac
4dbfcf231d Cache fetched Dapps (#3804)
* Have a singleton DappsFetcher so we don't realod them at each page load

* Better dapps Fetcher : event based listener
  Update on meta change

* Remove dapps fetcher => all in singleton dapps store + utils

* Modify header to Parity
2016-12-11 21:03:40 +01:00
GitLab Build Bot
f4134cf634 [ci skip] js-precompiled 20161211-193650 2016-12-11 19:39:15 +00:00
Gav Wood
e528ac9217 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-11 20:20:09 +01:00
Gav Wood
972aa79f9f Merge pull request #3818 from ethcore/consistent-crate-info
authors & homepage => Parity
2016-12-11 20:17:40 +01:00
Gav Wood
3aab5dec9b Refactor into a service. 2016-12-11 20:14:18 +01:00
GitLab Build Bot
282178e1fa [ci skip] js-precompiled 20161211-190404 2016-12-11 19:06:28 +00:00
Gav Wood
94f5501c61 authors & homepage => Parity 2016-12-11 19:43:58 +01:00
Gav Wood
15bb3f9b0a Merge remote-tracking branch 'origin/master' into check-updates 2016-12-11 19:38:04 +01:00
Gav Wood
c33901bd9f Merge pull request #3817 from ethcore/rename-ethcore-parity
Rename Ethcore -> Parity Technologies
2016-12-11 19:36:21 +01:00
Gav Wood
58b72c521d Rename ethcore -> parity in licenses. 2016-12-11 19:31:31 +01:00
Gav Wood
17cc2be4b5 Rename ethcore -> parity in license. 2016-12-11 19:30:54 +01:00
Gav Wood
33f266fffe Merge remote-tracking branch 'origin/master' into check-updates 2016-12-11 19:26:24 +01:00
Gav Wood
35b037e055 Add renamed files. 2016-12-11 19:15:58 +01:00
Gav Wood
10b0898bdf Crate tidyups.
- Move Updater into its own crate.
- Change ethcore -> parity in authors, homepages and licenses.
2016-12-11 19:14:42 +01:00
keorn
a4bf914683 Merge branch 'auth-bft' of https://github.com/ethcore/parity into auth-bft 2016-12-11 18:23:54 +01:00
Tomasz Drwięga
627b8a8414 Changing default policy 2016-12-11 17:56:12 +01:00
GitLab Build Bot
797d787a7b [ci skip] js-precompiled 20161211-164839 2016-12-11 16:51:09 +00:00
keorn
d4c9493b00 verification cache retrieval 2016-12-11 17:50:12 +01:00
Jaco Greeff
929b6ee0f7 Allow editing of gasPrice & gas in Signer (#3777)
* Rework gas display (maintainable)

* Move GasPriceSelector to ui

* Allow opening of gas component (WIP)

* Merge

* Consistency

* Adjust for Signer display

* Set maximum height based on screen size

* Gas editor displays in-place

* Cleanups

* Merge

* Style fixes

* Fixup stash mishap (again)

* Add store test

* Allow edited values to refrect on the display

* Fix properties

* Adjust styling to show different rows

* git mv

* git mv

* Style fixes

* Style updates

* Pass gas & gasPrice with confirmation

* Fix build (case)

* Style fixes

* Basic GasPriceEditor smoketest

* manual move 1

* manual move 2

* manual move 1

* manual move 2

* NODE_ENV=test ace fix

* UI smoketests

* Style

* Format options via formatter

* Initial version

* Re-add even/odd class

* re-add gasLimit to embedded passing

* style

* Updated for passing gas & price to store

* Allow gas/price overrides when none available

* Fix slider value, pass as number
2016-12-11 17:43:51 +01:00
Jaco Greeff
885d6eaa4d i18n string dictionaries (#3532)
* TabBar & Settings -> Views i18n enabled

* Proxy i18n

* Settings i18n

* defaultLocale

* Introduce thin Translate wrapper

* PropTypes util caters for multiples

* Translate & LanguageSelector under ui

* Update location & proptypes

* Add UI Language selector

* German settings pages

* Add German language selection

* Corrected umlaut encoding

* Lint

* Re-apply pre-merge conflict changes

* better German i18n

* Language names in locale language

* i8n -> index

* Allow for development/production operation

* Use Yahoo react-intl (as opposed to react-i18nify)

* Use default messages wih expansions

* Remove non-reused variable definitions

* Use FormattedMessage directly, opens up WebPack & Babel opportunities

* Add flat to flatten

* Extract default messages via babel

* Webpack to aggegrate i18n defaultMessage

* Re-add react-intl after merge

* Update proptype references (merge)

* Strip down external dictionary

* i18n for dapps

* Restore tests submodule

* Allow language changes to reflect

* Style updates
2016-12-11 17:42:35 +01:00
Tomasz Drwięga
b56f12adc6 Merge branch 'master' into tx-broadcast
Conflicts:
	ethcore/light/src/net/context.rs
	ethcore/light/src/net/tests/mod.rs
2016-12-11 17:31:56 +01:00
Gav Wood
e09b1faf20 Fix semver version issues. 2016-12-11 17:13:26 +01:00
GitLab Build Bot
839e3385dd [ci skip] js-precompiled 20161211-155716 2016-12-11 16:00:49 +00:00
Gav Wood
22cb5753d0 Improve capability information and disable old clients. 2016-12-11 16:52:41 +01:00
Nicolas Gotchac
13509a9e83 Fix padding in App, again... (#3813) 2016-12-11 16:49:38 +01:00
Gav Wood
74a6203f72 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-11 15:43:28 +01:00
Gav Wood
0e17cf8d3a Fix tests. 2016-12-11 15:41:49 +01:00
Robert Habermeier
6724f574d6 Light server improvements and protocol adjustments (#3801)
* light: basic transaction pool

* light: network timeouts

* fix dead code warnings

* les: update to new message format

* fix indentation

* les: hash or number in headers req, not both
2016-12-11 15:40:31 +01:00
Igor Artamonov
6742b080f5 use decimals for block numbers in config 2016-12-11 20:38:37 +06:00
Igor Artamonov
4e3c49c809 revert ETC to correct Network ID 2016-12-11 20:34:46 +06:00
Gav Wood
e6444cd106 Merge pull request #3810 from ethcore/defaults-parse-fix
Tolerate errors in user_defaults
2016-12-11 15:15:43 +01:00
GitLab Build Bot
778f5bbfaf [ci skip] js-precompiled 20161211-141210 2016-12-11 14:14:41 +00:00
Gav Wood
b28537aa9a Merge pull request #3809 from ethcore/mining-min-gas-limit
block: enforce gas limit falls within engine bounds
2016-12-11 15:08:30 +01:00
Nicolas Gotchac
d3077c51fc Target Babel to latest Chrome Versions in dev (#3806)
* Use `babel-preset-env` to target Babel to latest Chrome Versions

* Opt-In mechanism for Babel Preset Env
2016-12-11 15:05:10 +01:00
arkpar
05dcf951d1 Merge w master 2016-12-11 14:59:57 +01:00
Igor Artamonov
aed633d7df Testnet for Ethereum Classic 2016-12-11 19:25:02 +06:00
Gav Wood
5bf9fa9168 Allow reuse of previous logger. 2016-12-11 13:35:00 +01:00
arkpar
a49ff3fb32 Merge branch 'master' of github.com:ethcore/parity into cli-rpc 2016-12-11 13:30:48 +01:00
Igor Artamonov
7b5bc115e9 EIP-160 configuration for Ethereum Classic 2016-12-11 18:29:40 +06:00
Igor Artamonov
592ff53bab EIP-155 configuration for Ethereum Classic 2016-12-11 18:28:37 +06:00
arkpar
2c653d2c2e Merge w master 2016-12-11 13:11:08 +01:00
Gav Wood
8d7a63bbea Join up the final dots. 2016-12-11 13:10:33 +01:00
arkpar
a56443aa6c Tolerate error is user_defaults 2016-12-11 13:00:49 +01:00
Robert Habermeier
9252ebf93d block: enforce gas limit falls within engine bounds 2016-12-11 12:50:48 +01:00
arkpar
c777362d02 Sync channel for consensus test 2016-12-11 12:32:01 +01:00
GitLab Build Bot
95af942fc9 [ci skip] js-precompiled 20161211-093638 2016-12-11 09:40:44 +00:00
Jaco Greeff
0a37288aa4 Lowercase npm packages (#3807) 2016-12-11 10:30:30 +01:00
GitLab Build Bot
17dee5f1a2 [ci skip] js-precompiled 20161211-091947 2016-12-11 09:22:07 +00:00
Jaco Greeff
36b8e4b6a8 Extended publishing of libraries to npm (#3786)
* Extended publishing of libraries to npm

* Update source links

* Add some tests before publishing NPM library

* Fix Shapeshift tests
2016-12-11 10:13:34 +01:00
Gav Wood
d9f6ea56ef Don't restart if we're not in the cradle. 2016-12-11 04:05:02 +01:00
Gav Wood
2865cbaf70 Use file contents instead of symlink. 2016-12-11 03:33:10 +01:00
Gav Wood
7a1539cfb5 Fix deadlock. 2016-12-11 02:39:56 +01:00
GitLab Build Bot
bfb684a641 [ci skip] js-precompiled 20161211-012647 2016-12-11 01:28:52 +00:00
Gav Wood
078feaadd5 Merge pull request #3799 from ethcore/ng-ui-fixes
Several Fixes to the UI
2016-12-11 02:16:21 +01:00
Gav Wood
0a494962e4 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-11 02:13:52 +01:00
Gav Wood
120564ff29 Avoid pulling in hash_fetch. 2016-12-11 02:12:52 +01:00
Gav Wood
0302d582d2 Fix build. 2016-12-11 02:02:40 +01:00
Nicolas Gotchac
ba3bfcc54d Merge branch 'master' into ng-ui-fixes 2016-12-11 01:26:55 +01:00
Gav Wood
068201a01b Merge pull request #3805 from ethcore/fix-ci
Remove "s
2016-12-11 00:30:28 +01:00
Gav Wood
7c2c9c89a4 Stricter search for rust changes. 2016-12-11 00:20:19 +01:00
Gav Wood
c14d8da350 Use real arithmetic operator rather than '=' 2016-12-11 00:09:04 +01:00
GitLab Build Bot
62492a915e [ci skip] js-precompiled 20161210-230517 2016-12-10 23:07:55 +00:00
Gav Wood
12df3adfeb Merge branch 'master' into fix-ci 2016-12-11 00:02:48 +01:00
Gav Wood
854eb1080c Remove "s 2016-12-10 23:59:50 +01:00
Gav Wood
fa30dfd4b9 Refactor into system service, add exe redirect. 2016-12-10 23:58:39 +01:00
Nicolas Gotchac
b44e7bb292 Extract CSS to file in production builds (#3783)
* Extract CSS to file if production build

* Use DAPPS_URL for testing purposes + better assets in Webpack

* Delete comments
2016-12-10 23:55:57 +01:00
Nicolas Gotchac
b0f1665f11 Notify user on transaction received (#3782)
* Notify user on new transaction #2556

* Add routing to account on notification click

* Timeout of notif set to 20s
2016-12-10 23:55:36 +01:00
Gav Wood
aa30619b6f Merge pull request #3772 from ethcore/txqueue-gc
Removing all old entries from transaction queue
2016-12-10 23:53:24 +01:00
Tomasz Drwięga
1e8638608c fixing tests 2016-12-10 22:59:35 +01:00
Nicolas Gotchac
e5c73b29d8 'contract/write' to 'contract/develop' 2016-12-10 22:42:49 +01:00
GitLab Build Bot
5ec1ff43ea [ci skip] js-precompiled 20161210-212741 2016-12-10 21:29:53 +00:00
Nicolas Gotchac
9dbccfda2f Fix padding bottom // Status bar fixed 2016-12-10 22:22:14 +01:00
Jaco Greeff
173a88804a Status page updates (#3774)
* Allow Page to create optional Actionbar

* Typo

* Display last block.timestamp

* Remove unnneeded console.log

* Re-do git mv

* git mv

* Force build changes

* Resolving case sensitivity issues

* Swapped to margin at bottom
2016-12-10 22:21:32 +01:00
Nicolas Gotchac
7401358543 PR grumbles 2016-12-10 22:15:56 +01:00
Tomasz Drwięga
b5020d3c8d Fixing Light context API 2016-12-10 21:25:28 +01:00
Tomasz Drwięga
19ca9ad460 Prevent broadcasting transactions to peer that send them. 2016-12-10 21:22:19 +01:00
Nicolas Gotchac
70eab0da03 PR grumbles 2016-12-10 20:29:22 +01:00
Nicolas Gotchac
89ed76497e Merge branch 'master' into ng-ui-fixes 2016-12-10 20:23:09 +01:00
Tomasz Drwięga
08a47ea2d4 Allow modifications of gas when confirming in signer (#3798) 2016-12-10 20:18:42 +01:00
Tomasz Drwięga
9b5fd93290 removing println [ci:skip] 2016-12-10 20:07:12 +01:00
Tomasz Drwięga
76a93d4eff eth_sign RPC now hashes given data 2016-12-10 20:01:04 +01:00
Nicolas Gotchac
0f6681d3e8 Linting issue 2016-12-10 19:15:45 +01:00
Nicolas Gotchac
69c0086ada Better Autocomplete Divider 2016-12-10 19:14:29 +01:00
Nicolas Gotchac
2346f29731 Add dividers to AutoComplete 2016-12-10 18:35:54 +01:00
keorn
b6c7ed24b7 Client trait reorg 2016-12-10 18:35:29 +01:00
keorn
f3af0f46be Merge branch 'master' into auth-bft 2016-12-10 18:14:35 +01:00
keorn
1611d190ba initial tendetmint consensus test 2016-12-10 17:40:53 +01:00
keorn
b9909da8b1 move Sealing methods to MiningBlockChainClient 2016-12-10 17:40:20 +01:00
Tomasz Drwięga
c408861c29 Updating submodules 2016-12-10 17:36:29 +01:00
Nicolas Gotchac
cd6ab07217 Use the new onClose autocomplete prop 2016-12-10 17:06:44 +01:00
Tomasz Drwięga
42c2d2291a Merge branch 'master' into rotating-key 2016-12-10 17:00:59 +01:00
Tomasz Drwięga
1f9adc8622 Merge branch 'master' into txqueue-gc
Conflicts:
	ethcore/src/miner/miner.rs
2016-12-10 17:00:29 +01:00
Nicolas Gotchac
84116130f6 Add sender balances to contract (exec/deploy) 2016-12-10 16:58:03 +01:00
Tomasz Drwięga
aaf6da4c00 Returning persistent node id 2016-12-10 16:55:29 +01:00
Robert Habermeier
a6fcd8a0d9 Merge pull request #3794 from ethcore/net-fix
Network connectivity fixes
2016-12-10 16:55:17 +01:00
keorn
239ba61a99 move transition message to to_step 2016-12-10 16:50:23 +01:00
Nicolas Gotchac
d9da8a48ff Add sender balance in transfer modal 2016-12-10 16:46:00 +01:00
Tomasz Drwięga
e66157f922 fixing test 2016-12-10 16:40:32 +01:00
Nicolas Gotchac
054b4810d5 Fix wallet data's prop types 2016-12-10 15:30:39 +01:00
Tomasz Drwięga
704054ef40 Merge branch 'master' into tx-broadcast
Conflicts:
	ethcore/src/client/traits.rs
2016-12-10 15:23:53 +01:00
Nicolas Gotchac
ef93262311 See addresses outside address book + Save them 2016-12-10 15:19:05 +01:00
Tomasz Drwięga
e1ade5b375 Maintaining a list of transactions propagated from other peers 2016-12-10 15:18:44 +01:00
Tomasz Drwięga
27503e8e8c Merge branch 'master' into rotating-key
Conflicts:
	ethstore/src/ethstore.rs
	ethstore/src/secret_store.rs
2016-12-10 15:13:58 +01:00
Nicolas Gotchac
65f586ed14 Fix tab bar active style 2016-12-10 14:32:54 +01:00
Nicolas Gotchac
81c5085b35 Don't create new Contracts instance if already exists 2016-12-10 14:31:20 +01:00
Nicolas Gotchac
13607d48be Better use of Tab Bar 2016-12-10 14:26:35 +01:00
arkpar
02c788a403 Network connectivity fixes 2016-12-10 14:20:34 +01:00
Nicolas Gotchac
591d086f42 Better use of React-Router (maintaining old routes) 2016-12-10 14:19:15 +01:00
Gav Wood
316c25d9f8 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-10 14:08:41 +01:00
Gav Wood
60ea787bd1 Merge pull request #3781 from ethcore/consistent-id
Make *ID names consistent with std Rust (Id)
2016-12-10 14:04:07 +01:00
Gav Wood
0977b82eeb More fixes. 2016-12-10 13:54:17 +01:00
Gav Wood
7eb30b1249 Fix build. 2016-12-10 13:52:43 +01:00
Gav Wood
82efa2675e Merge remote-tracking branch 'origin/master' into consistent-id 2016-12-10 13:36:30 +01:00
Nicolas Gotchac
51b9034a5e Don't show addresses while loading balances (fix flash of unsorted) 2016-12-10 12:44:48 +01:00
Tomasz Drwięga
4696d7f606 Additional RPCs for dapps accounts management 2016-12-10 12:36:04 +01:00
keorn
e5f8044cad Merge branch 'master' into auth-bft 2016-12-10 11:01:23 +01:00
Jaco Greeff
6eb63a7316 Update CI builds (#3780)
* Only run languages tests in appropriate areas

* Drop echo
2016-12-10 10:49:39 +01:00
keorn
5f09eb9d04 update tests to new spec (#3790) 2016-12-10 10:38:10 +01:00
Nicolas Gotchac
0d9b1882a3 Treat tabs as real link (enable Ctrl+Click for new Tab) 2016-12-10 01:56:38 +01:00
Nicolas Gotchac
f6564dcc2f Fix dapps separation 2016-12-10 01:32:39 +01:00
Nicolas Gotchac
b9c04fcd00 Fixes to the Wallet UI (#3787)
* Correct number of transactions for contracts

* Remove daily limit info if set to 0

* Hide tx count for contracts
2016-12-10 01:26:47 +01:00
Nicolas Gotchac
6655e7e3c0 Add support for wallets without getOwner() interface (#3779)
* Make Wallet Mist compatible #3282

* Owners icons on load

* Fix oversized logo on load

* Don't fetch registry twice (even when pending)

* Better logging...

* Better contract view : show if no events // show loading events

* Better decimal typed input

* PR grumble
2016-12-10 01:26:28 +01:00
Nicolas Gotchac
923f85d90d Update Material-UI (#3785)
* Update MUI => Fixes wrong error styled inputs

* Update postcss import
2016-12-10 01:26:03 +01:00
Nicolas Gotchac
5c555aa18f Fixes error in Transfer modal (mix between props and own property) (#3788) 2016-12-10 01:25:23 +01:00
Robert Habermeier
4d25445af5 Merge pull request #3755 from ethcore/lightserv
LES Part 3: Event handlers and handling responses
2016-12-10 00:40:46 +01:00
Gav Wood
341777dbb6 Merge pull request #3743 from ethcore/jg-test-ui
Basic UI rendering tests
2016-12-09 23:16:11 +01:00
Gav Wood
edd5e76050 Merge branch 'consistent-id' into check-updates 2016-12-09 23:12:36 +01:00
Gav Wood
5f1fcf95e0 Make *ID names consistent with std Rust (Id) 2016-12-09 23:01:43 +01:00
Robert Habermeier
d427d60156 Merge pull request #3776 from ethcore/p2p-event-ordering
network: process packets only after connection handler finishes
2016-12-09 23:00:59 +01:00
Kristoffer Ström
0e516162c3 Rebased on master 2016-12-09 22:27:32 +01:00
Kristoffer Ström
6552319074 Style rewrite 2016-12-09 22:26:08 +01:00
Kristoffer Ström
1d0ccb1c30 Move format_ether into transaction_request.rs 2016-12-09 22:26:08 +01:00
Kristoffer Ström
a7e10cebbd Remove forgotten test debug 2016-12-09 22:26:08 +01:00
Kristoffer Ström
e202b9c79a Fix Cargo.toml formating 2016-12-09 22:26:08 +01:00
Kristoffer Ström
68df68ca1d Use Signer mock from the signer crate 2016-12-09 22:26:08 +01:00
Kristoffer Ström
b2b00e9dbe Use Mutex from util 2016-12-09 22:26:08 +01:00
Kristoffer Ström
f700aa39fe Switch to jsonrpc request/response types 2016-12-09 22:26:07 +01:00
Kristoffer Ström
91b7780eb5 comment formating 2016-12-09 22:26:07 +01:00
Kristoffer Ström
7a176094d5 * Use try!/map_err instead of match
* Use jsonrpc_core for serializing/deserializing rpc messages
* Factor out unwraps
* Remove mem::replace
* Add nicer formating of ConfirmationRequests
2016-12-09 22:26:07 +01:00
Kristoffer Ström
273d7c00c3 Pass cli tests, remove compiler warnings 2016-12-09 22:26:07 +01:00
Kristoffer Ström
4e3f8bab10 Add Ws Json rpc client and command line utils 2016-12-09 22:26:05 +01:00
Robert Habermeier
503b126c93 Merge branch 'master' into lightserv 2016-12-09 21:37:55 +01:00
Robert Habermeier
b772901d77 network: process packets only after connection handler finishes 2016-12-09 21:17:05 +01:00
Gav Wood
2226324495 Merge pull request #3778 from ethcore/auth-round-test
AuthorityRound network simulation test
2016-12-09 20:58:05 +01:00
keorn
b15edd095e Merge branch 'auth-bft' of https://github.com/ethcore/parity into auth-bft 2016-12-09 20:51:42 +01:00
Gav Wood
c82754874c Fix typo. 2016-12-09 20:48:52 +01:00
keorn
08e7e79bfd more test 2016-12-09 20:48:05 +01:00
Gav Wood
46af3d18da Merge remote-tracking branch 'origin/master' into check-updates 2016-12-09 20:45:15 +01:00
Gav Wood
e5e6b77984 Cleanups and avoid redownloading. 2016-12-09 20:40:24 +01:00
arkpar
97f358ced9 AuthorityRound network simulation test 2016-12-09 20:38:06 +01:00
Gav Wood
fe27b0f313 Merge pull request #3775 from ethcore/auth-bft-test
AuthorityRound network simulation test
2016-12-09 20:25:51 +01:00
Tomasz Drwięga
c91a614c3d Fixing tests 2016-12-09 20:24:33 +01:00
Gav Wood
598fd42856 Merge pull request #3770 from ethcore/jg-execute-gas
GasPrice selection for contract execution
2016-12-09 20:24:10 +01:00
Gav Wood
0a4e63b462 Merge pull request #3762 from ethcore/tx-check
Reject existing transactions
2016-12-09 20:17:28 +01:00
Gav Wood
45ec84e627 Merge pull request #3752 from ethcore/jg-subscription-check
Allow autoRemove from api.subscribe based on callback return values
2016-12-09 20:16:34 +01:00
Gav Wood
2e1e167397 Merge pull request #3753 from ethcore/jg-fix-gitlab.yml
Replace misplaced & with && in gitlab-ci.yml
2016-12-09 20:16:10 +01:00
arkpar
ca7406773f AuthorityRound network simulation test 2016-12-09 19:27:16 +01:00
GitLab Build Bot
647b62b4a2 [ci skip] js-precompiled 20161209-182130 2016-12-09 18:23:46 +00:00
Gav Wood
cf0b1bb9b2 use path prefix 2016-12-09 19:21:39 +01:00
Gav Wood
b99403740a Merge pull request #3773 from ethcore/ng-enhanced-multisig
Lower gas usage for creating a Multisig Wallet
2016-12-09 19:15:46 +01:00
Arkadiy Paronyan
5758bb7cac Rust files are all non-js files 2016-12-09 19:11:00 +01:00
Gav Wood
c2b6be95c8 Fetch and place in updates path. 2016-12-09 19:02:42 +01:00
Gav Wood
9bfceeea21 Merge pull request #3761 from ethcore/io-stop
Added IO service explicit stop
2016-12-09 19:00:46 +01:00
Gav Wood
d5d9d78bd9 It's not either-or. 2016-12-09 18:58:37 +01:00
Jaco Greeff
a73e0a987e Merge branch 'master' into jg-test-ui 2016-12-09 18:34:58 +01:00
Jaco Greeff
290a4a40ff Merge branch 'master' into jg-subscription-check 2016-12-09 18:17:36 +01:00
Jaco Greeff
0cbef30508 Unsubscribe on true 2016-12-09 18:17:31 +01:00
Jaco Greeff
99846e2ad2 Merge branch 'master' into jg-subscription-check 2016-12-09 18:14:09 +01:00
Jaco Greeff
1b0945940b Test for boolean result before unsubscribe 2016-12-09 18:14:05 +01:00
GitLab Build Bot
fd23a2972c [ci skip] js-precompiled 20161209-165845 2016-12-09 17:00:59 +00:00
Jaco Greeff
ffd8314a11 Be lenient around invalid owners map (#3764)
* Be lenient around invalid owners map

* Filter invalid owners before render
2016-12-09 17:52:25 +01:00
Nicolas Gotchac
ff11634e1d PR Grumble 2016-12-09 16:55:43 +01:00
Jannis R
bc33231f7c merge master into jr-use-badge-reg 2016-12-09 16:53:14 +01:00
Jannis R
eb1429237b merge master into jr-email-verification 2016-12-09 16:52:44 +01:00
Jannis R
c249c51dd3 certification: use BadgeReg to load the contract 2016-12-09 16:40:45 +01:00
Nicolas Gotchac
bace05b154 Merge branch 'master' into ng-enhanced-multisig 2016-12-09 16:40:07 +01:00
Nicolas Gotchac
caf3a96c19 Add fallback Full Fleshed Wallet if no library 2016-12-09 16:29:57 +01:00
Nicolas Gotchac
efee55ae84 Updated Wallet Version ! Now only 500k gas for Wallet creation 2016-12-09 16:24:11 +01:00
Jannis R
452b8c9c74 split sms & email verification 3rdparty code
We might want to bundle the code in `3rdparty`.

React & presentational components don't belong in there. At the
same time, the terms of service are strictly related to the use
of these external services. We decided to not bundle them, but
still keep them in a file called `terms-of-service.js`.

The commit also moves the "how it works" section into the
presentational part in `modals/Verification`.
2016-12-09 16:23:13 +01:00
Jaco Greeff
d992c642ff Adjust to final step on rejected/completed 2016-12-09 15:55:50 +01:00
Tomasz Drwięga
cee07fef74 Trigger remove_old on new block 2016-12-09 15:54:13 +01:00
Nicolas Gotchac
63137b1548 Add enhanced Wallet solidity code 2016-12-09 15:52:28 +01:00
Jaco Greeff
d2494d1425 GasPrice selection for contract execution 2016-12-09 15:43:24 +01:00
Robert Habermeier
415fccfffb add ethcore-light cov target 2016-12-09 15:20:45 +01:00
Robert Habermeier
9a4dfbd211 Merge branch 'lightserv' of github.com:ethcore/parity into lightserv 2016-12-09 15:20:12 +01:00
Tomasz Drwięga
5d054f08c3 Clearing old transactions 2016-12-09 15:05:03 +01:00
Robert Habermeier
5f37c93659 les: use negotiated protocol version 2016-12-09 15:04:54 +01:00
keorn
56e9dab9de add Engine stop method 2016-12-09 14:52:08 +01:00
arkpar
cc8c2ea58d Reject existing tx 2016-12-09 14:37:11 +01:00
keorn
c7f1260775 Merge branch 'io-stop' of https://github.com/ethcore/parity into auth-bft 2016-12-09 14:27:39 +01:00
Jannis R
6d20592f76 remove certification on Revoke 2016-12-09 14:06:02 +01:00
GitLab Build Bot
1213ada59c [ci skip] js-precompiled 20161209-125036 2016-12-09 12:52:50 +00:00
Jaco Greeff
2582514b58 GasEditor component (#3750)
* Initial split of component (WIP)

* GasPriceEditor externalised

* Fix lint
2016-12-09 13:44:35 +01:00
Jaco Greeff
befcc9cc1a Cleanups (#3742)
* Remove unused file

* Combine tx checks into single file

* Move UI components into UI

* DRY links

* Unused rollup config

* Cleanup util paths

* Revert "Move UI components into UI"

This reverts commit 3379e61246cde635c296d31322b71e63395a5cd4.

* Re-apply ~/util/tx move

* Cleanup unused styles
2016-12-09 13:44:10 +01:00
Jaco Greeff
00c53a8d18 Merge branch 'master' into jg-test-ui 2016-12-09 13:36:50 +01:00
Jaco Greeff
bb209424ac IdentityName flags testing 2016-12-09 13:36:46 +01:00
Jannis R
fd88421e88 store id with certifiers 2016-12-09 13:35:10 +01:00
arkpar
364dd9dda4 Make stop const 2016-12-09 13:25:02 +01:00
Jannis R
3dc943e854 merge master into jr-use-badge-reg 2016-12-09 13:14:35 +01:00
Jaco Greeff
1f4c84cbf1 Theme tests 2016-12-09 13:03:46 +01:00
keorn
475d4bcf3f Merge branch 'io-stop' into auth-bft 2016-12-09 12:37:55 +01:00
Jannis R
a94bbea7a5 more user-friendly method selection 2016-12-09 12:37:36 +01:00
keorn
762e5f1e3e proposed block sync tests 2016-12-09 12:05:56 +01:00
Tomasz Drwięga
3ccdb7c143 Fixing unused imports 2016-12-09 10:52:42 +00:00
Tomasz Drwięga
c76b7cf8f8 Fixing tests submodule 2016-12-09 10:48:46 +00:00
arkpar
22a63f6fd3 Added IO Service explicit stop 2016-12-09 11:45:16 +01:00
keorn
fb71caffbd remove double registration 2016-12-09 11:05:44 +01:00
Jaco Greeff
296301e284 Extend tests for TxList 2016-12-09 10:55:46 +01:00
keorn
42c34b5c1b ignore flaky test 2016-12-09 10:53:38 +01:00
Tomasz Drwięga
930183831b Adding tests for ethstore 2016-12-09 09:45:34 +00:00
Jaco Greeff
a133e41e16 Merge branch 'master' into jg-test-ui 2016-12-09 09:53:55 +01:00
Tomasz Drwięga
8596134c0f Clearer updates handling 2016-12-09 08:31:58 +00:00
Tomasz Drwięga
93230dd4c2 Merge branch 'master' into rotating-key
Conflicts:
	ethcore/src/account_provider/mod.rs
	rpc/src/v1/types/mod.rs.in
2016-12-09 07:37:34 +00:00
GitLab Build Bot
83f791fa5d [ci skip] js-precompiled 20161209-044115 2016-12-09 04:43:19 +00:00
GitLab Build Bot
12592689dd [ci skip] js-precompiled 20161209-014235 2016-12-09 01:44:45 +00:00
Jaco Greeff
7eeac232b4 Merge branch 'master' into lightserv 2016-12-09 02:36:55 +01:00
Jaco Greeff
8f9fdb350c Merge branch 'master' into jg-subscription-check 2016-12-09 02:34:07 +01:00
Jaco Greeff
f9a24f3c8e Update babel, fix CI build due to breaking changes (#3754)
* Update babel to latest version

* Re-add circular deps plugin

* Bump for build

* Fixes for babel build
2016-12-09 02:33:12 +01:00
Jaco Greeff
6b65a1f872 Merge branch 'master' into jg-subscription-check 2016-12-09 01:41:44 +01:00
GitLab Build Bot
e1ad347cdb [ci skip] js-precompiled 20161209-003004 2016-12-09 00:32:45 +00:00
Robert Habermeier
eec1929658 Merge branch 'master' into lightserv 2016-12-09 01:29:46 +01:00
Nicolas Gotchac
09334ca3bd Small fixes to contract (#3751)
* Fix contracts execution will fallback function

* Fix contract execute modal

* Working execute from Contract

* Don't dupliacet events

* Gas * 1.2 in wallet confirmations
2016-12-09 01:21:51 +01:00
Robert Habermeier
07d7a37319 les: make peer buffer flow params optional 2016-12-09 01:06:51 +01:00
Jaco Greeff
b76a717720 Fix & with && 2016-12-09 00:58:53 +01:00
Jaco Greeff
13f962ae01 Attempt to fix ci webpack 2016-12-09 00:56:12 +01:00
Jaco Greeff
10c356de65 Simplify, consolidate uses between subscription managers 2016-12-09 00:52:21 +01:00
Jannis R
5418c56b01 remove Prepare step
The modal got really crowded and the preparation step had
only been shown for fractions of a second anyways. The
"loading" message is now part of the next step.
2016-12-09 00:39:16 +01:00
Jannis R
dfc445b6d6 fix bugs & linting issues 2016-12-09 00:39:16 +01:00
Jannis R
162420f4c2 send emailHash with request, update ABI 2016-12-09 00:39:16 +01:00
Jannis R
0e0f602d5e pass fields to query into QueryCode 2016-12-09 00:39:16 +01:00
Jannis R
052f9258a5 pass fields to query into GatherData 2016-12-09 00:39:15 +01:00
Jannis R
d3fd71d953 add email-specific contract, helpers, store 2016-12-09 00:39:15 +01:00
Jannis R
1ac3421f33 step to select verification method 2016-12-09 00:39:15 +01:00
Jannis R
1672cbad7b factor out SMS-specific logic 2016-12-09 00:39:15 +01:00
Jannis R
b5b529f8c2 modals/SMSVerification -> modals/Verification 2016-12-09 00:39:15 +01:00
Jannis R
600a7e5ccc make SMS verification contract general purpose 2016-12-09 00:39:15 +01:00
Jannis R
e536290892 fix linting issues 2016-12-09 00:38:44 +01:00
Jannis R
a84cd9143f show certifications in accounts list 2016-12-09 00:36:27 +01:00
Robert Habermeier
d53c47aa69 more tracing 2016-12-09 00:35:34 +01:00
Jannis R
5862f2a9eb Certifications: read dappsUrl from state 2016-12-09 00:34:59 +01:00
Jannis R
e1c5796a5c fetch certifications in account view 2016-12-09 00:34:59 +01:00
Jannis R
409c4adfbf fetch certifiers from BadgeReg 2016-12-09 00:34:58 +01:00
Jannis R
b32b636697 fetch certifiers by id 2016-12-09 00:34:58 +01:00
Jannis R
2b34d76b8c pull out fetchMeta 2016-12-09 00:34:58 +01:00
Jaco Greeff
3989e2642b Typo 2016-12-09 00:25:50 +01:00
Jaco Greeff
1ecda93de9 Align api.subscribe with contract 2016-12-09 00:15:39 +01:00
Jaco Greeff
4ce3142c63 Add autoRemove functionality to api.contract.subscribe 2016-12-09 00:15:27 +01:00
Jaco Greeff
ad971a444c Add autoRemove functionality for api.subscribe 2016-12-09 00:00:56 +01:00
Robert Habermeier
e7ce8c9558 light: broadcast status updates to peers 2016-12-08 23:57:09 +01:00
Robert Habermeier
6f5f1f5e26 light: integrate with sync + serve_light CLI 2016-12-08 23:21:47 +01:00
keorn
7c42241466 remove merge code 2016-12-08 22:00:26 +01:00
keorn
74770e4773 better docstrings 2016-12-08 21:49:55 +01:00
keorn
cc284dd86f Merge branch 'master' into auth-bft 2016-12-08 21:35:08 +01:00
keorn
79ef64349c remove assert 2016-12-08 21:27:49 +01:00
keorn
9ecb07434f fix informant 2016-12-08 21:13:32 +01:00
Gav Wood
2d6656fc43 Merge pull request #3725 from ethcore/engine-password
Make engine hold AccountProvider
2016-12-08 20:52:12 +01:00
keorn
dca752e9bb docs, tweaks 2016-12-08 20:09:30 +01:00
Robert Habermeier
efd66f566d ethsync: optional ipc codegen 2016-12-08 19:52:48 +01:00
Jaco Greeff
9d5de519b6 Merge remote-tracking branch 'origin/jg-test-ui' into jg-test-ui 2016-12-08 17:33:15 +01:00
Jaco Greeff
0544e0e786 Merge branch 'jg-test-ui-2' into jg-test-ui 2016-12-08 17:33:02 +01:00
Jaco Greeff
96d4569cf3 Update test describe paths 2016-12-08 17:31:41 +01:00
Jaco Greeff
ae49251c81 Remove .only 2016-12-08 17:04:21 +01:00
Jaco Greeff
507b4b68a1 Merge branch 'master' into jg-test-ui 2016-12-08 16:50:23 +01:00
Jaco Greeff
9e8fb616d3 Add store tests, fix issue with pending sort to top 2016-12-08 16:50:19 +01:00
Robert Habermeier
2e87e31157 light: no default features 2016-12-08 16:46:58 +01:00
Robert Habermeier
64ebcd0f24 fix contract code response encoding; add test 2016-12-08 16:12:00 +01:00
GitLab Build Bot
4e1b72b45c [ci skip] js-precompiled 20161208-150237 2016-12-08 15:04:38 +00:00
Jaco Greeff
a1fb1240a7 Properly delete addresses/contracts in addressbook (#3739)
* Remove previously market addresses at startup

* Remove meta.deleted checks

* Remove artifact from code move
2016-12-08 15:54:23 +01:00
Nicolas Gotchac
d38da1f3b4 Display Wallet Owners in Accounts list (#3741) 2016-12-08 15:53:46 +01:00
Nicolas Gotchac
715761a714 Edit Multisig Wallet settings (#3740)
* WIP Sending tokens in multi-sig wallet

* Working Token transfer for multi-sig wallet #3282

* Add operation hash to transfer modal

* Add existing wallet from address #3282

* Wallet delete redirect to Wallets/Accounts #3282

* Rightly check balance in Transfer // Get all accounts balances #3282

* Fix linting

* Better Header UI for Wallet

* Use the `~` webpack alias

* Use Webpack `~` alias

* Add `ETH` format to number typed input

* Fix wallet creation hint && eth input type

* Update dailylimit #3282

* Fix too long copied message

* WIP Wallet settings modification #3282

* WIP edit contract parameters #3282

* Edit Wallet parameters #3282

* Don't show wallets if none

* Fix Transfer for Wallet #3282

* Optimized version of contract code

* Fix wrong max in Wallet creation // Round gas in API
2016-12-08 15:53:29 +01:00
GitLab Build Bot
69e010bbf9 [ci skip] js-precompiled 20161208-144436 2016-12-08 14:46:49 +00:00
Jaco Greeff
328db0c124 Replace build directory completely (#3748) 2016-12-08 15:39:27 +01:00
Jaco Greeff
fb80cf6190 Add existing release files before merge (#3747) 2016-12-08 15:20:53 +01:00
Jaco Greeff
5d224df2d5 Release script back to using fetch/merge (#3746)
* Update with -X only for merge

* Release back to using fetch/merge
2016-12-08 15:02:45 +01:00
Jaco Greeff
1ab4ee3781 Update Button with correct proptypes 2016-12-08 14:53:57 +01:00
Jaco Greeff
cbd5fe7c07 Update with -X only for merge (#3745) 2016-12-08 14:48:09 +01:00
Robert Habermeier
3e8ee9d423 light IPC feature and mock state proofs 2016-12-08 13:44:17 +01:00
Jaco Greeff
a5b5277a88 Expanded basic tests for #2289 2016-12-08 13:00:29 +01:00
Jaco Greeff
543428fe5d NODE_ENV=test for all tests 2016-12-08 12:59:59 +01:00
Jaco Greeff
699a821775 Merge branch 'master' into jg-test-ui 2016-12-08 12:45:40 +01:00
Robert Habermeier
de4715bc67 Merge pull request #3732 from ethcore/jg-duplicate-accounts
Give accounts precedence over address_book entries
2016-12-08 12:27:26 +01:00
Jaco Greeff
b3f7c00780 ui/Container tests as per #2289 2016-12-08 12:22:40 +01:00
Robert Habermeier
8d16f73795 first few LES tests, fix get_header logic bug 2016-12-08 12:20:18 +01:00
Jaco Greeff
ad8a191e95 Adjust specs to show location 2016-12-08 12:19:03 +01:00
Jaco Greeff
88e5ed9ea5 Allow mocha to use webpack aliasses via babel 2016-12-08 12:18:43 +01:00
keorn
3ebfa1481d better proposal block handling 2016-12-08 12:03:34 +01:00
Arkadiy Paronyan
15ec63750e Enable Panic=abort (#3423)
* Enable panic=abort

* Update remaining crate versions to 1.5

* Run tests in release mode

* Enable panic=abort for release profile only

* Added travis_wait

* Travis timeout set to 40
2016-12-08 11:31:57 +01:00
Jaco Greeff
5f1021822d Cleanups on js-precompiled (#3738)
* Cleanups on js-precompiled

* Combined

* Adjust based on Pr comments
2016-12-07 21:38:28 +01:00
Gav Wood
8903384840 Merge branch 'master' into check-updates 2016-12-07 19:19:44 +01:00
GitLab Build Bot
9e8d90b5ba [ci skip] js-precompiled 20161207-173717 2016-12-07 17:39:18 +00:00
Gav Wood
342357302b Merge pull request #3735 from ethcore/jg-addressbook-delete
Add parity_removeAddress RPC
2016-12-07 18:31:22 +01:00
Jaco Greeff
dba8cf3a3b Add test for RPC side 2016-12-07 17:58:22 +01:00
Robert Habermeier
2d1a3ff091 les: generalize network and event contexts with traits 2016-12-07 17:52:10 +01:00
Jaco Greeff
7c054d2da0 Remove unneeded block scope 2016-12-07 17:07:28 +01:00
Jaco Greeff
46840d36c9 Add parity_removeAddress RPC 2016-12-07 16:53:46 +01:00
keorn
347634ac6c dont rebroadcast propose 2016-12-07 16:42:58 +01:00
keorn
aa9caac750 revert cli default 2016-12-07 15:36:20 +01:00
Robert Habermeier
10d75b6de0 light: implement all response handlers 2016-12-07 15:27:04 +01:00
keorn
b73689f041 Merge branch 'engine-password' into auth-bft 2016-12-07 15:17:49 +01:00
keorn
727ace0561 add test 2016-12-07 15:14:21 +01:00
keorn
e9743a3a75 Merge branch 'master' into auth-bft 2016-12-07 14:50:17 +01:00
keorn
4361cb53e7 Merge branch 'engine-password' into auth-bft 2016-12-07 14:49:42 +01:00
keorn
5faa4a85cb remove dummy type 2016-12-07 14:49:07 +01:00
keorn
6440ca2f68 move stuff around 2016-12-07 14:39:37 +01:00
Gav Wood
1f0a02b638 Merge pull request #3633 from ethcore/fix-tx-rpc
Fix up the transaction JSON serialisation for RPC.
2016-12-07 14:34:51 +01:00
Robert Habermeier
cdc758368a les: flesh out event handler 2016-12-07 13:52:45 +01:00
Robert Habermeier
89726356a3 Merge pull request #3709 from ethcore/opt-in-verifier-scaling
queue: CLI for auto-scaling and num verifiers
2016-12-07 13:40:42 +01:00
GitLab Build Bot
3388eab76a [ci skip] js-precompiled 20161207-123833 2016-12-07 12:40:35 +00:00
GitLab Build Bot
2e40a00768 [ci skip] js-precompiled 20161207-122336 2016-12-07 12:26:14 +00:00
Nicolas Gotchac
8dbd56888d Add functionalities to multi-sig wallet (#3729)
* WIP Sending tokens in multi-sig wallet

* Working Token transfer for multi-sig wallet #3282

* Add operation hash to transfer modal

* Add existing wallet from address #3282

* Wallet delete redirect to Wallets/Accounts #3282

* Rightly check balance in Transfer // Get all accounts balances #3282

* Fix linting

* Better Header UI for Wallet

* Use the `~` webpack alias

* Use Webpack `~` alias
2016-12-07 12:47:44 +01:00
Jaco Greeff
5bdb6e4f22 Ignore meta.deleted for account name display 2016-12-07 11:51:48 +01:00
Jaco Greeff
f7586109df Ignore meta.deleted for accounts 2016-12-07 11:48:08 +01:00
Jaco Greeff
21a3cf7b65 Swap order of addressbook & acocunts merge 2016-12-07 11:44:45 +01:00
keorn
c582540746 Merge branch 'engine-password' into auth-bft 2016-12-07 11:41:38 +01:00
keorn
3ae09de019 restore is_new_best 2016-12-07 11:40:46 +01:00
keorn
a296c5e226 test client message handling 2016-12-07 11:38:09 +01:00
Robert Habermeier
b38d95328d light: conditional compilation 2016-12-07 10:50:24 +01:00
Jaco Greeff
be90245ecb PropTypes as function call (#3731) 2016-12-07 10:46:46 +01:00
keorn
da030fed51 Merge branch 'master' into auth-bft 2016-12-07 10:41:07 +01:00
keorn
5c333fce31 Merge branch 'engine-password' into auth-bft 2016-12-07 10:35:52 +01:00
keorn
71a96588b0 add the methods to engines 2016-12-07 10:34:06 +01:00
Jaco Greeff
e2bb8ef6d1 Unify proptypes in util/proptypes.js (#3728)
* Unify proptypes in util/proptypes.js

* Add missing use of nodeOrStringProptype
2016-12-07 10:25:57 +01:00
keorn
d9eb5e7f1d remove uncles 2016-12-07 09:32:36 +01:00
Robert Habermeier
60680e1913 Merge pull request #3730 from ethcore/jsonrpc-ipc-bump
bump jsonrpc-ipc-server to fix windows build
2016-12-07 09:32:10 +01:00
Robert Habermeier
085b8ad553 Merge pull request #3527 from ethcore/client-provider
LES Part 2
2016-12-07 09:31:50 +01:00
GitLab Build Bot
97e60a6e9c [ci skip] js-precompiled 20161207-042556 2016-12-07 04:28:25 +00:00
Robert Habermeier
d28f615482 bump jsonrpc-ipc-server to fix windows build 2016-12-06 19:32:19 +01:00
Robert Habermeier
398b94e6e2 Merge branch 'master' into opt-in-verifier-scaling 2016-12-06 15:37:10 +01:00
keorn
8f641e67f3 Merge branch 'engine-password' into auth-bft 2016-12-06 13:13:02 +00:00
GitLab Build Bot
0f76533713 [ci skip] js-precompiled 20161206-084538 2016-12-06 08:47:58 +00:00
keorn
b089aa7a6b fix password loading 2016-12-06 08:38:41 +00:00
Nicolas Gotchac
bec3539651 First draft of the MultiSig Wallet (#3700)
* Wallet Creation Modal #3282

* Name and description to Wallet #3282

* Add Wallet to the Account Page and Wallet Page #3282

* Fix Linting

* Crete MobX store for Transfer modal

* WIP Wallet Redux Store

* Basic Details for Wallet #3282

* Fixing linting

* Refactoring Transfer store for Wallet

* Working wallet init transfer #3282

* Optional gas in MethodDecoding + better input

* Show confirmations for Wallet #3282

* Order confirmations

* Method Decoding selections

* MultiSig txs and confirm pending #3282

* MultiSig Wallet Revoke #3282

* Confirmations and Txs Update #3282

* Feedback for Confirmations #3282

* Merging master fixes...

* Remove unused CSS
2016-12-06 09:37:59 +01:00
keorn
0a2ec319ac rename to engine_signer 2016-12-05 21:31:38 +00:00
keorn
92d566c900 Merge branch 'master' into engine-password 2016-12-05 19:30:08 +00:00
keorn
46dd2543e5 rename rpc to match cli 2016-12-05 19:27:24 +00:00
keorn
5e7c21ad4a add a cli flag 2016-12-05 19:23:03 +00:00
Gav Wood
ff7b918d82 Fix build. 2016-12-05 10:55:53 -08:00
Gav Wood
5e1fdc4b11 Merge remote-tracking branch 'origin/master' into fix-tx-rpc 2016-12-05 10:44:19 -08:00
Gav Wood
ad36743122 Merge pull request #3719 from ethcore/engine-block-ordering
Engine block ordering
2016-12-05 10:37:36 -08:00
Gav Wood
d708922d29 Merge pull request #3716 from ethcore/fdlimit
Use fdlimit utility crate from crates.io
2016-12-05 10:36:42 -08:00
GitLab Build Bot
98bfbdc5cb [ci skip] js-precompiled 20161205-174841 2016-12-05 17:50:43 +00:00
Jaco Greeff
873f451df1 Move decoding for contract deployment logic earlier (#3714)
* Move decoding deployment logic earlier

* Removed rendunant isContract
2016-12-05 18:42:44 +01:00
keorn
01bf483b63 remove unnecessary impls 2016-12-05 17:29:47 +00:00
Robert Habermeier
1b6ebe1a6d possible fix for queue drop deadlock (#3702)
* possible fix for #3686

* queue: simplify conclusion, don't block on joining

* queue: park verifiers with timeout to prevent race

* more robust verification loop

* queue: re-introduce wait for verifier joining
2016-12-05 18:18:56 +01:00
NikVolf
ebd4173d21 bump version 2016-12-05 20:15:05 +03:00
keorn
81a756394a Merge branch 'master' into engine-password 2016-12-05 17:08:57 +00:00
keorn
529a7fc33c add password and AccountProvider 2016-12-05 17:08:16 +00:00
keorn
6fc943ca6d Merge branch 'master' into auth-bft 2016-12-05 16:37:35 +00:00
keorn
4f857642b5 rename set_sealer 2016-12-05 16:28:56 +00:00
Robert Habermeier
a726472023 Merge pull request #3713 from ethcore/fix-v-u64
Encode networkid as a u64.
2016-12-05 17:14:07 +01:00
Robert Habermeier
5db93cd433 light: fix compile errors 2016-12-05 17:09:05 +01:00
Robert Habermeier
a6c2408562 IPC codegen in ethcore-light; remove network dependency 2016-12-05 16:56:21 +01:00
Robert Habermeier
61c3358447 move light to its own crate again 2016-12-05 16:55:33 +01:00
keorn
53b479fb7a pass engine to snapshot service 2016-12-05 15:43:46 +00:00
keorn
94302f3f61 throw out difficulty checks 2016-12-05 15:27:44 +00:00
keorn
c61a0e97b3 make engine determine block order 2016-12-05 15:20:32 +00:00
Gav Wood
afe4cc6a05 Merge remote-tracking branch 'origin/master' into check-updates 2016-12-05 07:09:42 -08:00
GitLab Build Bot
e6ed49b2c9 [ci skip] js-precompiled 20161205-150312 2016-12-05 15:05:10 +00:00
Gav Wood
84c923ff6d Merge pull request #3717 from ethcore/spec-rlp-loading
Use valid RLP in generic genesis seal spec
2016-12-05 06:57:24 -08:00
Gav Wood
43ec3d8f79 network_id -> u64 2016-12-05 06:54:31 -08:00
Gav Wood
459babb1a8 Logging. 2016-12-05 06:39:56 -08:00
keorn
db59bd8731 update genesis seal 2016-12-05 14:28:50 +00:00
keorn
c39d504167 Merge branch 'spec-rlp-loading' into auth-bft 2016-12-05 14:11:06 +00:00
keorn
0860a3a767 ignore variable 2016-12-05 14:09:41 +00:00
keorn
22632e6324 make generic seal take valid rlp 2016-12-05 14:07:31 +00:00
NikVolf
42fc770d30 use crates.io crate 2016-12-05 16:25:03 +03:00
keorn
b30c1d5602 fix tests 2016-12-05 13:24:22 +00:00
Robert Habermeier
767d486014 fix config test 2016-12-05 14:12:40 +01:00
keorn
c946ffebf3 Merge branch 'master' into auth-bft 2016-12-05 11:30:11 +00:00
GitLab Build Bot
cf796d3ea4 [ci skip] js-precompiled 20161205-105433 2016-12-05 10:56:28 +00:00
Nicolas Gotchac
9a43e6d6c8 Update JS dependencies (#3710)
* Minor Versions NPM updates

* Remove unused packages

* No longer relevant JS test

* Update some major versions // Revert Rechartjs

* Update Redux/React-{Ace, RouterRedux}

* Updated React Tooltips

* Update mock-socket // Update tests to pass

* Updated React Router

* Removed `history` module that isn't necessary (instead of updating it)

* Updated redux-actions

* Removed commented hot store reload
2016-12-05 11:48:43 +01:00
Nicolas Gotchac
52b4ce0dd7 Use Webpack Aliases (#3711)
* Adds aliases to Webpack Build

* Use `ui` Webpack alias

* Use `views` alias

* Use `modals` aliase

* Use `providers` aliase

* Use `contracts` aliase

* Use '~' aliase

* from `ui` to from `~/ui`

* from  to from

* from `modals` to from `~/modals`

* from `providers` to from `~/redux/providers`

* from `contracts` to from `~/contracts`

* Updated Webpack App config
2016-12-05 11:47:13 +01:00
Gav Wood
9d79cac36b Cleanups. 2016-12-04 11:56:12 -08:00
keorn
f7a01b87b5 better gossip, better proposal collection 2016-12-04 19:43:24 +00:00
keorn
edef7a185f remove tracing 2016-12-04 19:42:53 +00:00
Gav Wood
2911c549e3 Encode networkid as a u64. 2016-12-04 10:48:26 -08:00
Gav Wood
b8c492644b Fix more build. 2016-12-04 10:47:05 -08:00
Gav Wood
356aca2db5 Fix build. 2016-12-04 09:13:23 -08:00
Gav Wood
90a20a217f Merge branch 'master' into check-updates 2016-12-04 09:01:50 -08:00
Gav Wood
0c7b7fc8bc Merge pull request #3627 from ethcore/rpc-middleware
Dapps-specific accounts
2016-12-04 08:46:05 -08:00
GitLab Build Bot
a9424bdf26 [ci skip] js-precompiled 20161204-042533 2016-12-04 04:27:27 +00:00
keorn
f1542b5612 better genesis seal rlp 2016-12-03 16:19:51 +00:00
GitLab Build Bot
ca4aa42615 [ci skip] js-precompiled 20161203-062111 2016-12-03 06:23:18 +00:00
Gav Wood
be7401c8bf Merge pull request #3671 from ethcore/jg-signer-decoding
Signer method parameter decoding & destination info
2016-12-02 22:13:35 -08:00
GitLab Build Bot
f093b077a4 [ci skip] js-precompiled 20161203-043512 2016-12-03 04:37:04 +00:00
GitLab Build Bot
f15906fe8d [ci skip] js-precompiled 20161202-201514 2016-12-02 20:18:10 +00:00
Jaco Greeff
b2a5d66c99 Fix slice test (#3712) 2016-12-02 21:10:22 +01:00
keorn
9084e6242d lock ordering 2016-12-02 20:04:12 +00:00
keorn
ff6240eff3 insert block into queue when sealing 2016-12-02 20:03:15 +00:00
Robert Habermeier
80f98bc8b7 fix tests 2016-12-02 18:52:02 +01:00
Robert Habermeier
cd5b6fdf59 queue: CLI for auto-scaling and num verifiers 2016-12-02 18:21:54 +01:00
GitLab Build Bot
4c32d3ced4 [ci skip] js-precompiled 20161202-142708 2016-12-02 14:29:56 +00:00
Jaco Greeff
fbd3738096 Merge branch 'master' into jg-signer-decoding 2016-12-02 15:27:56 +01:00
Jaco Greeff
b8b9086dae React library update (#3704)
* Update React & MaterialUI

* Adjust TabBar layouts for new MUI
2016-12-02 15:21:25 +01:00
Nicolas Gotchac
456b50639c Adds Loading Component (#3707) 2016-12-02 15:21:11 +01:00
Nicolas Gotchac
c892a4f7ae Refactoring Transfer Modal (#3705)
* Better Token Select in Transfer > Details

* Better Autocomplete

* Crete MobX store for Transfer modal

* Remove unused var

* Update Webpack Conf

* Small changes...

* Optional gas in MethodDecoding + better input

* New Contract `getAll` method // TxList Row component

* Method Decoding selections

* Rename `getAll` to `getAllLogs`
2016-12-02 15:21:01 +01:00
Jaco Greeff
bd2e2b630c Fix extra scrollbars in dapps (#3706)
* Fix extra scrollbars in dapps

* Dapps list padding

* spelling

* lint

* Height overflow fix
2016-12-02 15:10:38 +01:00
keorn
c8a3db4c52 new error proposal test 2016-12-02 13:59:54 +00:00
keorn
91099f62c9 add more gossip if step is stuck 2016-12-02 13:37:49 +00:00
keorn
e0f2fac441 new error type 2016-12-02 13:32:00 +00:00
keorn
0eb55cbd4d update message test 2016-12-02 13:31:28 +00:00
keorn
2c8c090598 stricter size verification 2016-12-02 13:30:43 +00:00
Jaco Greeff
2dd2004ed5 Merge branch 'master' into jg-signer-decoding
# Conflicts:
#	js/src/views/Signer/components/RequestFinished/requestFinished.js
2016-12-02 11:21:17 +01:00
Robert Habermeier
6e1a1f9dec Merge branch 'master' into client-provider 2016-12-02 10:06:09 +01:00
Robert Habermeier
3837114eb2 Merge pull request #3431 from ethcore/state-tests-indentation
indent state tests
2016-12-02 09:09:35 +01:00
GitLab Build Bot
986e8ef9a2 [ci skip] js-precompiled 20161202-052414 2016-12-02 05:26:08 +00:00
GitLab Build Bot
f30a8f79f2 [ci skip] js-precompiled 20161202-034812 2016-12-02 03:50:41 +00:00
Gav Wood
1dd13372b6 Merge remote-tracking branch 'origin/master' into rpc-middleware 2016-12-01 19:43:31 -08:00
Gav Wood
21a76c22fc Merge pull request #3698 from ethcore/jg-null-transaction
Filter null transactions for display (not available on node)
2016-12-01 19:40:16 -08:00
Gav Wood
5b829aece7 Merge pull request #3697 from ethcore/jr-move-recovery-print
move recovery phrase print button
2016-12-01 19:38:31 -08:00
keorn
f0e9eae244 remove difficulty check 2016-12-01 22:07:18 +00:00
keorn
df1cce8e7f simplify seal verification 2016-12-01 21:56:38 +00:00
keorn
e76ead40d1 update tracing message 2016-12-01 21:55:43 +00:00
keorn
39ea703c69 vote on message generation 2016-12-01 20:50:24 +00:00
arkpar
f1ef4a4935 Import sealed block immedtiatelly 2016-12-01 19:11:36 +01:00
Jannis Redmann
d4ec9049f6 merge #3701 from ethcore/ng-status-fix
Fix padding bottom needed after fixed status
2016-12-01 19:09:13 +01:00
Jannis R
9512794c7f prevent status bar overlapping 2016-12-01 19:08:19 +01:00
Nicolas Gotchac
d5c630c1d2 Fix padding bottom needed after fixed status 2016-12-01 18:45:59 +01:00
keorn
9290fdde85 fix tests 2016-12-01 17:21:51 +00:00
keorn
498b2fb0b1 show verification error 2016-12-01 17:20:16 +00:00
keorn
e40e398eaa clean up some tracing 2016-12-01 17:19:40 +00:00
arkpar
4eca687bbb Fixed network context 2016-12-01 15:49:26 +01:00
Jannis R
7049336800 show recovery print button on first run 2016-12-01 15:40:20 +01:00
Gav Wood
f77a9aa007 Merge remote-tracking branch 'origin/master' into fix-tx-rpc 2016-12-01 06:31:09 -08:00
Jannis R
a1c1746667 show recovery print button if recovered account 2016-12-01 15:19:42 +01:00
keorn
344999aaf7 return signing failure error 2016-12-01 14:10:42 +00:00
keorn
66b4f1ac47 remove unnecessary option 2016-12-01 14:10:22 +00:00
Jaco Greeff
9087560344 gumbles 2016-12-01 14:08:32 +01:00
Jaco Greeff
077f32dce6 Cater for completely empty lists 2016-12-01 13:39:38 +01:00
Jaco Greeff
d5373e26b8 Filter null transactions (not available on node) 2016-12-01 13:36:23 +01:00
Jannis R
6822433a83 recovery phrase: move print helpers 2016-12-01 12:19:12 +01:00
Jannis R
08a6be5d62 recovery phrase: move print button to modal actions 2016-12-01 12:19:09 +01:00
GitLab Build Bot
0f987a2206 [ci skip] js-precompiled 20161201-044643 2016-12-01 04:48:29 +00:00
GitLab Build Bot
3ef569329a [ci skip] js-precompiled 20161201-011624 2016-12-01 01:21:59 +00:00
Gav Wood
d3e684698a Merge remote-tracking branch 'origin/master' into fix-tx-rpc 2016-11-30 17:15:05 -08:00
Gav Wood
ec38c68e30 Merge pull request #3695 from ethcore/snapshot-share
Don't share the snapshot while downloading old blocks
2016-12-01 01:11:22 +00:00
Gav Wood
6420ea4429 Merge pull request #3694 from ethcore/jr-print-recovery-phrase
button to print recovery phrase
2016-12-01 01:11:01 +00:00
Gav Wood
9053e2f27b Merge pull request #3692 from ethcore/jr-fixed-status
fix status bar to bottom of the screen
2016-12-01 01:09:29 +00:00
Gav Wood
c630fc5c1c Merge pull request #3642 from ethcore/confirmation
Splitting serialization of signTransaction and sendTransaction confirmation requests
2016-12-01 01:09:07 +00:00
Denis S. Soldatov aka General-Beck
61eb2a9104 Update test.sh
add -j 8 for test
2016-12-01 07:48:06 +07:00
Denis S. Soldatov aka General-Beck
70c6aebca5 Update gitlab-ci
-j $(nproc) in build
2016-12-01 07:15:35 +07:00
Denis S. Soldatov aka General-Beck
c4125a84b1 Update gitlab-ci
CARGOFLAGS -> -j $(nproc)
2016-12-01 07:07:52 +07:00
arkpar
b7dc60ace5 Don't share the snapshot while downloading old blocks 2016-11-30 23:33:17 +01:00
GitLab Build Bot
4f4bfb2239 [ci skip] js-precompiled 20161130-204501 2016-11-30 20:46:47 +00:00
Jannis Redmann
784dcaff7c implement basic badges/certifications/flair (#3665)
* sms verification: Certifications component

* sms verification: actions & reducers for certifications

* sms verification: put Certifications component into place

* sms verification: show certification icons

* sms verification: show certification titles

* sms verification: default icon for certifications

* sms verificaiton: lint issue 👕, fix testnet detection

The sms verification store got created when `isTestnet` (from the
Redux state) was still `undefined`.

* move certification helpers into middleware file

* connect Certifications to Redux

* don't pass certifications as prop

* move default certification icon into assets

* separate file for BadgeReg.sol

* don't pass certifications as prop

* Fix import name

* make BadgeReg a class

* make certifications middleware a class

* Certifications: pass in certifications of account
2016-11-30 21:39:06 +01:00
Jannis R
e43457a6ce recovery page: add Parity logo 2016-11-30 20:42:55 +01:00
Jannis R
cf85d1978f recovery page: add ItendityIcon 2016-11-30 20:10:29 +01:00
Jannis R
35fe4de622 add recovery page print button 2016-11-30 20:01:35 +01:00
Jannis R
eee03b542d add account recovery phrase page 2016-11-30 19:51:03 +01:00
Jannis R
60a8aabe19 differentiate Snackbar from background 2016-11-30 17:58:18 +01:00
Jannis R
890f880a89 status bar: beautify enode icon 2016-11-30 17:46:50 +01:00
Jannis R
f9f91837c2 rework status bar layout
- floats -> Flexbox
- align to content width
2016-11-30 17:46:48 +01:00
Jannis R
cce195a98b fix status bar to bottom of the screen 2016-11-30 17:45:54 +01:00
keorn
dbf82c2e98 fix tests 2016-11-30 16:40:16 +00:00
Tomasz Drwięga
dcb7e1e638 Implementing RPC 2016-11-30 17:08:45 +01:00
keorn
d128c20dc2 remove proposer_nonce 2016-11-30 16:02:05 +00:00
keorn
bb8347477a gossip when not enough votes 2016-11-30 16:01:20 +00:00
arkpar
84cf27c3ef Advertise protocol version 2 2016-11-30 16:48:30 +01:00
Tomasz Drwięga
1d76bb7048 Fixing ethstore tests 2016-11-30 16:41:37 +01:00
Tomasz Drwięga
022ccb5bce Fixing tests 2016-11-30 16:33:42 +01:00
Tomasz Drwięga
c028f106b1 RPC for confirming with token 2016-11-30 16:11:41 +01:00
keorn
ca87d2cde9 add set_sealer rpc test 2016-11-30 15:01:43 +00:00
keorn
73e7908325 test password registration 2016-11-30 14:30:21 +00:00
Tomasz Drwięga
6397556cbb Sign with token support 2016-11-30 15:08:38 +01:00
keorn
61f1699c0e fix merge 2016-11-30 13:39:28 +00:00
keorn
155da50fcd Merge branch 'master' into auth-bft 2016-11-30 13:06:21 +00:00
keorn
34d5017950 hold password in engine, add rpc 2016-11-30 12:59:33 +00:00
keorn
4ef5badcea fix parity tests merge 2016-11-30 12:58:45 +00:00
Tomasz Drwięga
ad440a12bd EthMultiStore 2016-11-30 13:47:14 +01:00
GitLab Build Bot
837ff1bc7d [ci skip] js-precompiled 20161130-104916 2016-11-30 10:54:38 +00:00
Jannis Redmann
f1b3463015 Merge #3680 from ethcore/jg-container-title
Simplify Container title rendering
2016-11-30 11:42:23 +01:00
Tomasz Drwięga
8e2aca719f Shared hash-fetch 2016-11-30 10:16:18 +01:00
Denis S. Soldatov aka General-Beck
79e79473bf Update gitlab-ci
armv6 only triggers
2016-11-30 16:15:45 +07:00
Denis S. Soldatov aka General-Beck
21ed95d0a1 Update gitlab-ci 2016-11-30 12:57:55 +07:00
Denis S. Soldatov aka General-Beck
7a446fae05 Update gitlab-ci
tst
2016-11-30 08:45:03 +07:00
Denis S. Soldatov aka General-Beck
74f5f67055 Update gitlab-ci
test
2016-11-30 08:29:34 +07:00
Denis S. Soldatov aka General-Beck
95c2a41264 Update gitlab-ci 2016-11-30 07:48:57 +07:00
Jaco Greeff
8fd8bdf0f5 Update loading splash to fit in with l&f (#3685) 2016-11-30 00:06:58 +01:00
Denis S. Soldatov aka General-Beck
7cfec1e1c8 Update gitlab-ci
remove NIGHTLY ENV
2016-11-30 06:02:52 +07:00
Jaco Greeff
7f1391c7a2 Safari UI fixes (#3678)
* Minimum content height for overlay

* Fix Safari TabBar clicks

* Fix extra vertical scrollbar on Chrome

* Swap to em heights
2016-11-30 00:01:42 +01:00
Jaco Greeff
1a53ab78e8 Remove strict mode (work-around for upgrade) (#3681) 2016-11-29 19:26:36 +01:00
Gav Wood
d525a6d7f0 Merge pull request #3654 from ethcore/clippy-bump
Bumping clippy
2016-11-29 18:00:13 +01:00
Gav Wood
d58905ae13 fix comment 2016-11-29 17:59:17 +01:00
Jaco Greeff
6f24010424 Merge branch 'master' into jg-container-title 2016-11-29 17:50:36 +01:00
Tomasz Drwięga
df3c07b0a9 adding proof to a panicker 2016-11-29 17:14:34 +01:00
Jaco Greeff
7e2a072a2b Remove finished rendering completely 2016-11-29 16:59:44 +01:00
Jaco Greeff
0ddd33c643 Trim unused components 2016-11-29 16:55:59 +01:00
arkpar
95f81b2a2f Moved consensus networking into Parity handler 2016-11-29 16:54:30 +01:00
Gav Wood
9115214cea Merge pull request #3636 from ethcore/fatdb
Return of the Fat DB
2016-11-29 16:47:09 +01:00
Jaco Greeff
efd4e6f96a Pass MethodDecoding as to/destination view 2016-11-29 16:37:25 +01:00
Jaco Greeff
6a69e22b28 Methods use either input or data elements 2016-11-29 16:36:54 +01:00
Gav Wood
33d3287ed3 Merge pull request #3652 from ethereumproject/splix/block-ts-validation
Invalidate blocks from future
2016-11-29 16:34:29 +01:00
keorn
7929a145e7 fix deadlock 2016-11-29 14:55:54 +00:00
Gav Wood
63c28253d8 Merge remote-tracking branch 'origin/master' into fix-tx-rpc 2016-11-29 15:37:49 +01:00
Tomasz Drwięga
762d8b89d6 Removing unused imports 2016-11-29 14:03:21 +01:00
Jaco Greeff
907606ab69 Merge branch 'master' into jg-container-title 2016-11-29 13:54:30 +01:00
keorn
294e89e5c0 use EngineError instead of BlockError 2016-11-29 12:51:27 +00:00
Jannis Redmann
e667d33778 make Modal always scrollable (#3667) 2016-11-29 13:50:22 +01:00
Jaco Greeff
5e8f6f271d Display local/completed transactions (#3630)
* Initial fetch of local transactions

* Container allows for title specification

* Introduce TxList component

* Display local transactions in signer list

* Simplify

* Pass only hashes from calling components

* Simplify no pending display

* Render pending blocks at the top

* Get rid of time for 0 blocks

* Indeed sort Pending to the top

* Allow retrieval of pending transactions

* setTimeout with clearTimeout
2016-11-29 13:50:09 +01:00
Gav Wood
0e0bdc8ae9 Deduplicate code. 2016-11-29 13:48:28 +01:00
Gav Wood
436016ef02 Introduce to_hex() utility in bigint. Fix tests. 2016-11-29 13:46:06 +01:00
Konstantin
a578e10c49 added build-essential dep to dockerfiles (#3666) 2016-11-29 13:23:53 +01:00
Tomasz Drwięga
c97c59f62f returning errors with extra fields in config file (#3663) 2016-11-29 13:23:28 +01:00
keorn
e784fa906e warn on double vote 2016-11-29 12:20:38 +00:00
keorn
49b953a9f4 order invariant seal equality 2016-11-29 11:18:40 +00:00
Igor Artamonov
8ec8bcd626 fix after code review, rel [748260b] 2016-11-29 17:18:33 +06:00
Gav Wood
1166013c2b Merge pull request #3662 from ethcore/strict-rpc
Strict deserialization
2016-11-29 12:10:31 +01:00
Gav Wood
7c2cccc60c Merge pull request #3655 from ethcore/sync
Disable peer if no common block found
2016-11-29 12:10:19 +01:00
Jaco Greeff
b6efd6b1fd DRY-er Container with title 2016-11-29 11:58:00 +01:00
Tomasz Drwięga
44314c5d02 Merge branch 'master' into clippy-bump
Conflicts:
	rpc/src/v1/types/filter.rs
2016-11-29 11:56:55 +01:00
keorn
d0eab4a0d8 old message removal, avoid too many recoveries 2016-11-29 10:55:24 +00:00
Tomasz Drwięga
1a6ee533ed Addressing tiny grumbles 2016-11-29 11:52:55 +01:00
GitLab Build Bot
cfc1dabd57 [ci skip] js-precompiled 20161129-050158 2016-11-29 05:07:32 +00:00
GitLab Build Bot
261aa29db3 [ci skip] js-precompiled 20161128-232953 2016-11-28 23:31:43 +00:00
Jannis Redmann
65f4ba8372 show snackbar on password change (#3661)
* show snackbar on password change

* Swap last two words
2016-11-29 00:21:54 +01:00
keorn
61cf8b8b7e vote propose 2016-11-28 18:58:15 +00:00
keorn
0f1eefc00d disallow None seal sigs 2016-11-28 18:37:00 +00:00
Gav Wood
54b656ba05 Merge pull request #3660 from ethcore/pv62-sync
Bring back PV62 support
2016-11-28 18:19:34 +01:00
Gav Wood
77ebbedbba Merge pull request #3659 from ethcore/unlock-rpc
Unlock expecting quantity
2016-11-28 18:18:15 +01:00
Gav Wood
5cab951429 Merge pull request #3643 from ethcore/ng-webpack-update
Update Webpack => v2
2016-11-28 18:14:59 +01:00
Tomasz Drwięga
a418dcd8ea Fix manifest deserialisation 2016-11-28 17:59:50 +01:00
Nicolas Gotchac
d78de18385 Merge branch 'master' into ng-webpack-update 2016-11-28 17:56:47 +01:00
Tomasz Drwięga
24f72716b9 Strict deserialization 2016-11-28 17:55:46 +01:00
GitLab Build Bot
3c9983cf25 [ci skip] js-precompiled 20161128-164710 2016-11-28 16:48:55 +00:00
Tomasz Drwięga
64b1b898f1 Fixing compilation on stable 2016-11-28 17:43:38 +01:00
Jannis Redmann
5f570edf3b update SMS verification (#3579)
* add isTestnet helper

* sms verification: use different port on testnet

* subscribeToEvent helper

* sms verification: await Puzzled event

* sms verification: bugfixes 🐛, move awaitPuzzle

* sms verification: check upfront if code is valid

* sms verification: more helpful phone input label

* isTestnet helper -> redux state
2016-11-28 17:39:55 +01:00
Jannis Redmann
2b178d8233 simplify tx confirmations display (#3559)
* Hash component

* DRY code by using Hash component

* TxHash component: show hash inline

* TxHash component: less verbose confirmations display

* TxHash component: rename ui/Hash to ui/ShortenedHash

* signer: center message in TransactionFinished

* style fixes
2016-11-28 17:39:32 +01:00
arkpar
bae8acee74 Allow pv62 peers 2016-11-28 17:24:02 +01:00
Tomasz Drwięga
f5a899606e Merge branch 'master' into rpc-middleware 2016-11-28 17:20:02 +01:00
Nicolas Gotchac
eec99ebad8 Fixes overflow in Signer tx data #3138 (#3657) 2016-11-28 17:18:27 +01:00
Tomasz Drwięga
424638f89d Unlock expecting quantity 2016-11-28 17:15:40 +01:00
Nicolas Gotchac
1d194f9ae8 Fix linting 2016-11-28 17:00:51 +01:00
Nicolas Gotchac
9248303416 Fix Circular Deps 2016-11-28 17:00:33 +01:00
keorn
e4ff614966 remove unused tracing 2016-11-28 15:50:55 +00:00
keorn
b454f7e307 use Io queue for messages 2016-11-28 15:42:36 +00:00
arkpar
cf5b409fed Disaable peer if no common block found 2016-11-28 16:30:36 +01:00
keorn
1326c6cf5a rebroadcast unseen messages 2016-11-28 15:24:22 +00:00
keorn
7d97ba5ee0 seal sigs test 2016-11-28 15:23:39 +00:00
GitLab Build Bot
ecf283e2fc [ci skip] js-precompiled 20161128-151919 2016-11-28 15:21:01 +00:00
Nicolas Gotchac
6be08d8ce4 Fixed tab bar not updating #3631 (#3653) 2016-11-28 16:13:02 +01:00
Nicolas Gotchac
d41c60da54 Renaming webpack/config to webpack/app 2016-11-28 16:06:27 +01:00
Tomasz Drwięga
2b3d100de2 Fixing some clippy warnings 2016-11-28 15:54:22 +01:00
Igor Artamonov
748260bebe invalidate blocks from future 2016-11-28 20:14:43 +06:00
keorn
ef4ecce7bf nicer vote counting + test 2016-11-28 14:08:38 +00:00
Nicolas Gotchac
50530aec37 Default npm install to tilde #3520 2016-11-28 13:14:37 +01:00
Nicolas Gotchac
3675095201 Merge branch 'master' into ng-webpack-update 2016-11-28 13:02:03 +01:00
Nicolas Gotchac
3dd5f350f9 Webpack config update 2016-11-28 13:01:17 +01:00
keorn
09c28806d6 proper test IoHandler 2016-11-28 11:47:33 +00:00
Nicolas Gotchac
b823b675a4 Working HOT RELOAD !! 2016-11-28 12:37:13 +01:00
Tomasz Drwięga
e1e7886918 Bumping clippy 2016-11-28 12:23:06 +01:00
Tomasz Drwięga
8686339b0c Fixing UI to support both send and signTransaction 2016-11-28 12:14:14 +01:00
arkpar
dfd17949ef Added a test 2016-11-28 12:08:12 +01:00
Tomasz Drwięga
3e69ff0b88 Separating serialization of send and signTransaction 2016-11-28 11:41:46 +01:00
keorn
5c0e89ae9a Merge branch 'master' into auth-bft 2016-11-28 09:50:22 +00:00
keorn
89f0bd714d test whole transitioning 2016-11-28 09:42:50 +00:00
arkpar
fa45413a90 Extened API 2016-11-28 01:37:25 +01:00
arkpar
c7b359fcee Style 2016-11-28 01:37:25 +01:00
arkpar
d0c80a6903 Updated tests 2016-11-28 01:37:25 +01:00
arkpar
3aceac60de Use sha3 for fat key 2016-11-28 01:37:24 +01:00
arkpar
e91f7977fb Storage export 2016-11-28 01:37:24 +01:00
arkpar
b0555fbe7c State export 2016-11-28 01:37:24 +01:00
arkpar
8b3cdc513b Seekable iterator 2016-11-28 01:37:24 +01:00
Gav Wood
ce3f4911a2 Merge remote-tracking branch 'origin/master' into check-updates 2016-11-27 15:01:17 +01:00
Gav Wood
0cf8db58b8 Fix tests. 2016-11-27 14:49:30 +01:00
Gav Wood
3b6d886860 Fix up the transaction JSON serialisation for RPC. 2016-11-27 14:11:37 +01:00
Nicolas Gotchac
f9b3a98ff7 Fixing mocha tests 2016-11-26 17:27:44 +01:00
Nicolas Gotchac
44e099000d Working webpack build // Without Hot Reload 2016-11-26 17:12:52 +01:00
Nicolas Gotchac
353b6c06db Removed Circular Dependencies 2016-11-26 17:06:37 +01:00
Nicolas Gotchac
002c793f53 Added Webpack check circular deps 2016-11-26 16:53:24 +01:00
Denis S. Soldatov aka General-Beck
a7037f8e5b Update gitlab-ci
js-release &->&&
2016-11-26 03:52:29 +07:00
Tomasz Drwięga
3b595a01ad Merge branch 'master' into rpc-middleware 2016-11-25 21:46:35 +01:00
Tomasz Drwięga
a9028ca986 Merge branch 'master' into rpc-middleware
Conflicts:
	Cargo.lock
	rpc/src/v1/tests/mocked/parity_accounts.rs
2016-11-25 21:18:02 +01:00
Denis S. Soldatov aka General-Beck
8ca1781ab9 Update gitlab-ci
add js-test as diff
2016-11-26 01:57:58 +07:00
Nicolas Gotchac
f77afd072b Updated ESLINT and fixing linting issues 2016-11-25 19:48:06 +01:00
Nicolas Gotchac
8392090861 WIP - Webpack 2 building 2016-11-25 19:32:58 +01:00
Gav Wood
de8dd47ff9 Fetch binaries. 2016-11-25 19:29:13 +01:00
Gav Wood
699f462d56 Merge pull request #3617 from ethcore/default-gas-price
Set default min tx price to $0.0025
2016-11-25 18:46:29 +01:00
Gav Wood
a51066bdca Merge pull request #3618 from ethcore/jg-list-accounts
Use accountsInfo instead of eth_accounts for first check
2016-11-25 18:46:07 +01:00
Gav Wood
b274d082c3 Merge pull request #3619 from ethcore/ng-copy-clip-fix
Fix Copy to Clipboard Snackbar
2016-11-25 18:45:49 +01:00
Jaco Greeff
50585763aa Manually add \r to Windows phrases pre 1.4.5 (#3615)
* Manually add \r to Windows phrases pre 1.4.4

* < 1.4.5

* Only support 1.4.x dictionary
2016-11-25 18:43:28 +01:00
keorn
a7afbf4d25 tracing and vote test 2016-11-25 16:45:32 +00:00
keorn
8f72017bcc add transition tracing 2016-11-25 16:44:57 +00:00
keorn
f59746b2da order messages by signature 2016-11-25 16:44:18 +00:00
keorn
d2099d9f13 derive Eq for tests 2016-11-25 16:43:26 +00:00
Nicolas Gotchac
a534949b2d Updated packages version... 2016-11-25 17:33:18 +01:00
Jaco Greeff
e95ef0160f Signer layouts to flexbox (#3600)
* Use variables for signer form widths

* Simplify signer layouts with flex

* Fix styling issues with Signer
2016-11-25 17:20:16 +01:00
Nicolas Gotchac
807790ce95 Merge branch 'master' into ng-webpack-update 2016-11-25 17:17:06 +01:00
Nicolas Gotchac
7610336596 Fixing tokens sent as Array (#3621) 2016-11-25 17:10:02 +01:00
Jaco Greeff
6d6e942d9d Add dappreg link to apps list (#3568)
* Fix rendering when contract is empty

* Add registration dapp to app list
2016-11-25 16:46:57 +01:00
Nicolas Gotchac
08c507daaa Smarter balance fetching (#3605)
* Smarter dApps Manifest fetching...

* Fetching only visible accounts (and don't delete other balances) #3590

* Moved balances action into BalancesActions #3590

* Fetch balances for accounts and contracts #3590

* Add balances to contract/address/account views #3590

* Fix transaction not fetching on first load

* Remove console.warn

* Fix pending tokens not showing #3154

* Fix tokens image update

* Remove unused name in Header

* Separate Tokens and ETH fetching #3590

* Remove unused isTest

* Fetch Tokens Balance via Filter #3590

* Fix linting

* Fix updating tokens image (#3590)

* Fix contract balances

* Improved Status

* Fixing secureApi issues...

* Fetch all tokens every 2 minutes (for safety) #3590

* PR changes fix

* Fix Account error
2016-11-25 16:46:35 +01:00
Nicolas Gotchac
9fdab84305 Merge pull request #3597 from ethcore/jg-iframe-sandbox
Dapp iframe allow forms, allow target=_blank
2016-11-25 16:31:32 +01:00
Tomasz Drwięga
789d6608cf Bumping jsonrpc 2016-11-25 16:16:24 +01:00
Nicolas Gotchac
9b21c96e3a Fix Copy to Clipboard Snackbar 2016-11-25 15:52:23 +01:00
Gav Wood
8cddf9976a Better information. 2016-11-25 15:43:49 +01:00
Tomasz Drwięga
f080f33c41 JSON-RPC bump / update hyper
Conflicts:
	Cargo.lock
2016-11-25 15:21:18 +01:00
Jaco Greeff
2958546653 Use accountsInfo instead of eth_accounts for first check 2016-11-25 15:19:14 +01:00
arkpar
ffa123c949 Set default tx price to 0.0025 USD 2016-11-25 15:13:51 +01:00
Nicolas Gotchac
0d6c2dd51d Merge pull request #3604 from ethcore/jr-input-copy-button
align copy button to input field
2016-11-25 15:12:53 +01:00
Nicolas Gotchac
24bdf1cb98 Use webpack hot/dev middlewares 2016-11-25 13:14:30 +01:00
Tomasz Drwięga
9b9bdaa1b1 Appending logs by default (#3609) 2016-11-25 13:04:02 +01:00
Gav Wood
d0312b89ad Update test, fix number. (#3612) 2016-11-25 13:03:15 +01:00
Tomasz Drwięga
0e2cd1d080 Fixing phrases generated on windows (#3614) 2016-11-25 12:59:15 +01:00
GitLab Build Bot
686978fa97 [ci skip] js-precompiled 20161125-113155 2016-11-25 11:36:32 +00:00
keorn
a143da2cb8 fix complete build 2016-11-25 11:36:25 +00:00
Gav Wood
d0d01ca39b Merge pull request #3602 from ethcore/jg-network-id-match
Check for network ID for live/test matching
2016-11-25 12:28:58 +01:00
Gav Wood
befb0bf2bd Merge branch 'fix-number' into check-updates 2016-11-25 12:17:58 +01:00
keorn
1692c07ba6 Merge branch 'master' into auth-bft 2016-11-25 10:51:06 +00:00
Denis S. Soldatov aka General-Beck
86522c8f71 Update gitlab-ci
if fix
2016-11-25 07:02:54 +07:00
Denis S. Soldatov aka General-Beck
202739689d Update gitlab-ci
small fix for test's and js-build
2016-11-25 06:27:07 +07:00
GitLab Build Bot
4d9492a01d [ci skip] js-precompiled 20161124-231507 2016-11-24 23:16:52 +00:00
Denis S. Soldatov aka General-Beck
30c3b13518 Update gitlab-ci
https://github.com/ethcore/parity/issues/3185
2016-11-25 06:10:36 +07:00
Denis S. Soldatov aka General-Beck
2d79eee454 Update gitlab-ci
[ci skip]
add darwin installer in master
2016-11-25 04:10:37 +07:00
keorn
da499b0a4a self contained test proposal 2016-11-24 19:59:08 +00:00
keorn
f867372dfe increase default proposal time 2016-11-24 19:58:29 +00:00
keorn
04acdd6ca0 reuse rlp generation 2016-11-24 19:57:58 +00:00
Gav Wood
45017c599a Update test, fix number. 2016-11-24 19:11:29 +01:00
GitLab Build Bot
815cdc6ba1 [ci skip] js-precompiled 20161124-164849 2016-11-24 16:50:27 +00:00
GitLab Build Bot
51afc3afbe [ci skip] js-precompiled 20161124-163141 2016-11-24 16:40:11 +00:00
Gav Wood
735df6c30f More work. 2016-11-24 17:19:48 +01:00
Jannis R
fa1343e8af align copy button to input field 2016-11-24 17:17:14 +01:00
Gav Wood
e9197f5862 Merge pull request #3603 from ethcore/trace-fix
Always insert traces for genesis.
2016-11-24 17:16:37 +01:00
Gav Wood
46e5a84bc5 Merge pull request #3540 from ethcore/delete-accounts
Real deleting accounts
2016-11-24 17:16:26 +01:00
GitLab Build Bot
905d0c0b43 [ci skip] js-precompiled 20161124-154751 2016-11-24 15:50:50 +00:00
Nicolas Gotchac
d449b3c3f1 Merge pull request #3599 from ethcore/jg-phrase-whitespace
Trim whitespace from input recovery phrase
2016-11-24 16:22:56 +01:00
Jaco Greeff
6b9b31ad37 check for network ID for live/test matching 2016-11-24 15:46:25 +01:00
Tomasz Drwięga
aa52c72bda Traces for genesis are always present. 2016-11-24 15:05:52 +01:00
keorn
8f37807d4b seal checks 2016-11-24 13:57:54 +00:00
keorn
38f25fc195 message tests and fixes 2016-11-24 13:57:04 +00:00
Jaco Greeff
67771f39de Trim whitespace from recovery phrase 2016-11-24 14:56:39 +01:00
keorn
a3730b3042 change proposer address 2016-11-24 13:56:27 +00:00
keorn
207364929c improve error types 2016-11-24 13:55:16 +00:00
Denis S. Soldatov aka General-Beck
54ad70313c Update gitlab-ci
close https://github.com/ethcore/parity/issues/3515
2016-11-24 18:36:02 +07:00
Jaco Greeff
30526da094 Allow forms, allow target=_blank 2016-11-24 11:46:27 +01:00
Denis S. Soldatov aka General-Beck
4dc24c9e87 Update gitlab-ci
[ci skip]
fix S3_BUCKET in Windows build
2016-11-24 17:37:42 +07:00
Denis S. Soldatov aka General-Beck
6d6a2a8f1b Update gitlab-ci
[ci skip]
small fix in S# windows
2016-11-24 14:59:45 +07:00
Nicolas Gotchac
d188435fd8 Add Loading splashscreen 2016-11-24 03:40:22 +01:00
Nicolas Gotchac
e676f00dfa Wepback dapps 2016-11-24 03:26:38 +01:00
Nicolas Gotchac
259b91da50 Webpack Reuse proxies 2016-11-24 03:20:12 +01:00
Nicolas Gotchac
0750d82115 Reuse Webpack Configs 2016-11-24 03:11:54 +01:00
Nicolas Gotchac
52bd9eabb6 Don't add commons chunk in prod 2016-11-24 02:36:08 +01:00
Nicolas Gotchac
1291130f9e Simpler Webpack config : create HTML files for dapps 2016-11-24 02:28:33 +01:00
Denis S. Soldatov aka General-Beck
0bb9a4aba7 Update gitlab-ci
[ci skip]
small fix
2016-11-24 06:33:22 +07:00
Denis S. Soldatov aka General-Beck
4d1c3b2a3d Update gitlab-ci
[ci skip]
small fix for S3 windows
temp off alpine
2016-11-24 06:24:17 +07:00
Denis S. Soldatov aka General-Beck
f3512967a7 Update gitlab-ci
[ci scip]
restore test & js-build
2016-11-24 06:05:07 +07:00
Denis S. Soldatov aka General-Beck
51e771428c Update gitlab-ci
[ci skip]
small fix
2016-11-24 05:45:07 +07:00
Denis S. Soldatov aka General-Beck
f01cde89b6 Update gitlab-ci
fix windows s3 and alpine
2016-11-24 05:39:53 +07:00
Denis S. Soldatov aka General-Beck
d76081a269 Update gitlab-ci
initial support alpine linux
fix https://github.com/ethcore/parity/pull/3548
2016-11-24 05:23:26 +07:00
Jaco Greeff
97ec5053f0 PR grumbles, wording, isRequired, no close on error 2016-11-23 22:17:36 +01:00
GitLab Build Bot
8f9f5cd5a3 [ci skip] js-precompiled 20161123-205310 2016-11-23 20:55:02 +00:00
Nicolas Gotchac
d429f5526f Fix local tx requests (#3589)
* [localtx] Poll every second, dettach on unmount

* Fixed webpack config for dapps

* Fixed webpack PROXY config
2016-11-23 21:35:10 +01:00
Denis S. Soldatov aka General-Beck
2996499a06 Update gitlab-ci
[ci skip]
2016-11-24 02:48:58 +07:00
Gav Wood
6c686023e0 Use tester.accounts 2016-11-23 20:37:35 +01:00
Gav Wood
03ef95ba50 Compiles. 2016-11-23 20:35:21 +01:00
Gav Wood
9f3a042f55 Update message 2016-11-23 20:16:33 +01:00
Gav Wood
90b5d1c62d Merge remote-tracking branch 'origin/master' into check-updates 2016-11-23 20:13:47 +01:00
Gav Wood
34ab265b68 Merge pull request #3592 from ethcore/mio-cpu-fix
Fix CPU usage when idle
2016-11-23 19:58:39 +01:00
Gav Wood
0501658d1b Merge pull request #3591 from ethcore/ng-sync-ws
Don't fetch balances on every new block if syncing
2016-11-23 19:58:14 +01:00
GitLab Build Bot
273165e982 [ci skip] js-precompiled 20161123-185249 2016-11-23 18:54:40 +00:00
Gav Wood
7e800b7a63 Merge pull request #3587 from ethcore/ng-ws-improved
Work around WS in UI
2016-11-23 19:29:02 +01:00
Nicolas Gotchac
cd88f2ad1b Don't fetch balances on every new block if syncing #3582 2016-11-23 19:12:32 +01:00
arkpar
4e9c690640 Use patched MIO 2016-11-23 19:08:40 +01:00
Nicolas Gotchac
0c3d87f0d3 Removed check node up from WS #3587 2016-11-23 18:20:18 +01:00
Gav Wood
5d62cfdf6f Merge remote-tracking branch 'origin/master' into check-updates 2016-11-23 18:15:21 +01:00
Nicolas Gotchac
bb6fe16478 Fixed ping and comment #3587 2016-11-23 18:08:53 +01:00
Nicolas Gotchac
ab212fcdb5 Localstorage SignerToken first #3587 2016-11-23 17:51:08 +01:00
Nicolas Gotchac
abcccbe7cc Merge branch 'master' into ng-ws-improved 2016-11-23 17:48:06 +01:00
Nicolas Gotchac
f800dd1eee WebSocket Improvments #3544 2016-11-23 17:37:04 +01:00
Gav Wood
9d3b2352cc More work. 2016-11-23 16:29:15 +01:00
Tomasz Drwięga
cd6f565f69 RPC Middleware & Get/Set dapp-specific accounts 2016-11-23 16:27:05 +01:00
Gav Wood
820e291ac8 Merge pull request #3573 from ethcore/no-bg-download
CLI option to disable ancient block downloading
2016-11-23 16:06:45 +01:00
Gav Wood
7ed4a21a02 Merge pull request #3531 from ethcore/jg-signer-api-queries-2
Move Signer balance queries to store for component-wide re-use
2016-11-23 16:03:45 +01:00
Gav Wood
4c9bb5aa25 Merge remote-tracking branch 'origin/master' into check-updates 2016-11-23 14:45:55 +01:00
GitLab Build Bot
e7dd222142 [ci skip] js-precompiled 20161123-131908 2016-11-23 13:20:46 +00:00
Nicolas Gotchac
93f8a1494e Fix contract method name (#3580) 2016-11-23 13:59:21 +01:00
Nicolas Gotchac
a22469ade5 Fix contract method name 2016-11-23 13:56:48 +01:00
Jaco Greeff
e9eebb3088 Optimise multi-balance fetching (one set) 2016-11-23 12:32:50 +01:00
Jaco Greeff
dddb8752f2 Merge branch 'master' into jg-signer-api-queries-2 2016-11-23 12:32:21 +01:00
GitLab Build Bot
24ffb30bc2 [ci skip] js-precompiled 20161123-105837 2016-11-23 11:00:19 +00:00
GitLab Build Bot
5bd6d5e3ac [ci skip] js-precompiled 20161123-102835 2016-11-23 10:32:27 +00:00
Jaco Greeff
78ffd10236 Typo in description 2016-11-23 10:33:04 +01:00
Nicolas Gotchac
33dd49160f Smarter Tokens fetching (#3546)
* Don't auto-subscribe for contracts #3240

* Smarter Balance : don't re-instantiate contracts, fetch tokens #3240

* Smarter Balance Tokens fetching (update image when needed) #3240

* Attaching to TokenReg Events instead of fetching for each block #3240

* Unsubscribe from shapeshit... #3240

* Unsubscribe from EthFilter if used once (resolved) #3240

* Remove warning

* PR review fix

* Typo

* Better contract JS API : one subscribe for all #3546

* Fixed test
2016-11-23 10:30:47 +01:00
Arkadiy Paronyan
a969c008d1 Fix panic on importing own invalid transaction (#3550) 2016-11-23 08:46:55 +01:00
GitLab Build Bot
cbeb2dc3f9 [ci skip] js-precompiled 20161122-175502 2016-11-22 17:57:03 +00:00
arkpar
7da8f019d5 --no-ancient-blocks 2016-11-22 18:15:55 +01:00
keorn
d5b15d4560 change authorities for testing 2016-11-22 17:15:42 +00:00
keorn
8f6a464c51 new error types 2016-11-22 17:15:22 +00:00
Gav Wood
03d3e585af Merge pull request #2445 from ethcore/adaptive_queue_threads
Use an adaptive number of threads in the verification queue
2016-11-22 17:39:11 +01:00
Jaco Greeff
59f4252011 Merge branch 'master' into jg-signer-api-queries-2 2016-11-22 17:31:27 +01:00
Jaco Greeff
d8cb32d49b Typo 2016-11-22 17:31:25 +01:00
GitLab Build Bot
9f74c76f07 [ci skip] js-precompiled 20161122-162239 2016-11-22 16:25:02 +00:00
keorn
340d377930 Revert "dont keep account provider in miner"
This reverts commit 11ccacd6d0.
2016-11-22 16:05:27 +00:00
Gav Wood
490b39cc85 Merge pull request #3555 from ethcore/ng-fast-ui
Faster UI - React Tweaks
2016-11-22 17:05:23 +01:00
Gav Wood
a722bac304 Merge pull request #3512 from ethcore/jg-transact-gas-warnings
Send value & contract execute gas limit warnings
2016-11-22 17:04:13 +01:00
Jaco Greeff
7f7ffd7284 Monitor killAccount for refresh 2016-11-22 16:46:40 +01:00
Jaco Greeff
609e8912d8 Merge branch 'master' into delete-accounts 2016-11-22 16:19:40 +01:00
Jaco Greeff
cce5b217ed Delete account dialog 2016-11-22 16:19:36 +01:00
GitLab Build Bot
12ff42a513 [ci skip] js-precompiled 20161122-151225 2016-11-22 15:14:06 +00:00
Jaco Greeff
3db5e3e627 jsapi interface for parity_killAccount 2016-11-22 15:52:23 +01:00
Jaco Greeff
57ff0e5747 Add visibility specifier (not added between merges) (#3566) 2016-11-22 13:36:23 +01:00
Jaco Greeff
bd6f343cbe DappRegistry (#3405)
* Initial version, just loading

* Warning dialog

* Retrive & show applications

* Display completed

* Edit/New mode start

* Display distry state, resolve hashes to urls

* Move buttons to top-level

* Rework display

* Update error handling & dirty checks

* Formatting

* Split sections into components

* Styling updates

* Slight styling adjustments

* Start delete modal

* Add modals for register & update

* Flesh-out register modal

* Register error handling

* Register registers

* List refresh on add & remove

* Update operational

* Simplify, remove bg image

* Really remove bg

* fix case

* Collapse text-only components
2016-11-22 11:54:20 +01:00
Gav Wood
bf9ed2d444 Merge remote-tracking branch 'origin/master' into check-updates 2016-11-22 10:25:34 +01:00
Gav Wood
45dead9d49 Naming consistency and make Updater improvements.
- ID -> Id (consistency with rust libs)
2016-11-22 10:24:22 +01:00
Jaco Greeff
a475c2166c Merge branch 'master' into jg-signer-api-queries-2 2016-11-22 09:49:17 +01:00
Jaco Greeff
4c08f7ebba Merge branch 'master' into jg-signer-api-queries-2 2016-11-22 09:48:32 +01:00
GitLab Build Bot
b97763e13d [ci skip] js-precompiled 20161121-233309 2016-11-21 23:35:10 +00:00
Gav Wood
4c83eff912 Merge pull request #3552 from ethcore/import-msg
Import account message
2016-11-22 00:03:36 +01:00
Gav Wood
7e5553a872 Merge pull request #3551 from ethcore/ropsten
--testnet set to ropsten
2016-11-22 00:03:11 +01:00
Gav Wood
818e54d44e Merge pull request #3547 from ethcore/fix-flaky-auth
Fix flaky test
2016-11-22 00:01:51 +01:00
Jannis Redmann
f9ecea8f4d sms verification code style (#3564)
* sms verification: fix code style

* sms verification: move server-related code to 3rdparty

* sms verification: adapt to ropsten
2016-11-21 20:45:47 +01:00
Nicolas Gotchac
5735d948f5 [Registry] Clear input and working buttons (#3563)
* onClick to onTouchTap #3556

* onClick to onTouchTap 2 #3556

* Registry dApp clear input + check Signer #3557
2016-11-21 20:44:37 +01:00
Nicolas Gotchac
8a1b585da2 Fix peers not displaying (#3561)
* Add peers count to status polling

* Array destruct for better readability
2016-11-21 20:44:07 +01:00
keorn
32bcd08b94 test utilities 2016-11-21 18:54:16 +00:00
keorn
66526af5a8 pass engine in tests 2016-11-21 18:53:53 +00:00
GitLab Build Bot
eb94eda30b [ci skip] js-precompiled 20161121-181249 2016-11-21 18:16:10 +00:00
GitLab Build Bot
65785475f3 [ci skip] js-precompiled 20161121-173542 2016-11-21 17:37:37 +00:00
Gav Wood
10e64847a4 Merge remote-tracking branch 'origin/master' into check-updates 2016-11-21 18:17:31 +01:00
Jaco Greeff
af0db9f80e New registry contract address for ropsten (#3549)
* New registry for ropsten

* Registry address

* Registry with payable modifier
2016-11-21 18:14:23 +01:00
keorn
84fdaf966a correct seal verification 2016-11-21 16:02:26 +00:00
keorn
841d0941e0 remove WithSome block hash 2016-11-21 16:01:52 +00:00
keorn
12dbdc1d6e dont pass ap 2016-11-21 16:01:34 +00:00
Nicolas Gotchac
a6430c6086 Merge pull request #3554 from ethcore/jg-registry-fee
Use contract Registry fee, not a hard-coded value
2016-11-21 15:59:19 +01:00
Nicolas Gotchac
ba8460c65b Fix summary update 2016-11-21 15:54:51 +01:00
Jaco Greeff
42964e9a8e lint fixes 2016-11-21 15:48:46 +01:00
Jaco Greeff
e90743ecbf Use actual registry fee 2016-11-21 15:47:36 +01:00
Nicolas Gotchac
35fdbf3352 Progressive Accounts List Rendering #3240 2016-11-21 15:45:58 +01:00
arkpar
efdf017c43 Import account message 2016-11-21 15:03:20 +01:00
Robert Habermeier
53afb8d22d queue: park directly instead of through condvar 2016-11-21 14:48:25 +01:00
arkpar
8bb8ecac2d --testnet set to ropset 2016-11-21 14:39:26 +01:00
Nicolas Gotchac
a317e4fdbf Better TabBar #3240 2016-11-21 14:31:06 +01:00
Robert Habermeier
133796b7ff queue: verifier scaling tests 2016-11-21 14:23:34 +01:00
Nicolas Gotchac
47f5a6d005 Merge pull request #3524 from ethcore/jg-signer-api-queries
Don't query chain in Signer, use Redux isTest
2016-11-21 14:16:33 +01:00
Nicolas Gotchac
ca5fd0b23d React Perf in dev mode // Smarter background component #3240 2016-11-21 14:14:25 +01:00
keorn
42ef7767da delete unused message type 2016-11-21 12:23:27 +00:00
keorn
6e0bd4072b Merge branch 'master' into auth-bft 2016-11-21 12:17:00 +00:00
keorn
959ccc705a fix indent 2016-11-21 12:07:43 +00:00
keorn
c6db157554 fix flaky test, clean up specs 2016-11-21 12:06:14 +00:00
Jaco Greeff
278b1e3bd5 ropsten updates as per comment 2016-11-21 13:04:32 +01:00
keorn
e69be670de message serialization 2016-11-21 11:36:07 +00:00
Jaco Greeff
d48391d6be ropsten 2016-11-21 12:26:38 +01:00
Robert Habermeier
06f5bf809f Merge branch 'master' into client-provider 2016-11-21 12:19:11 +01:00
Gav Wood
601e0fb0fd Merge remote-tracking branch 'origin/master' into check-updates 2016-11-21 11:43:29 +01:00
Gav Wood
2d9369e5ba Introduce test. 2016-11-21 11:03:18 +01:00
GitLab Build Bot
21b2b4ac27 [ci skip] js-precompiled 20161121-093611 2016-11-21 09:37:54 +00:00
Gav Wood
9c0b630d20 Merge pull request #3543 from ethcore/hash-fetch
Moving fetching of hash-addressed dapps/content to separate crate.
2016-11-21 10:16:40 +01:00
Tomasz Drwięga
94328e9784 Fixing main 2016-11-20 22:40:23 +01:00
Tomasz Drwięga
cc8a9d410b Adding fetch API to the crate 2016-11-20 18:44:23 +01:00
Tomasz Drwięga
845bc52e36 Moving contract resolver to separate crate 2016-11-20 17:40:28 +01:00
GitLab Build Bot
92a34d9dd8 [ci skip] js-precompiled 20161120-160026 2016-11-20 16:06:52 +00:00
Arkadiy Paronyan
efd1d9bd0e Ropsten network (#3539)
* Ropsten network

* Sorted premine

* Comas

* Removed trailing coma
2016-11-20 16:38:45 +01:00
Gav Wood
2b8bed434c RPC for deleting accounts. 2016-11-20 16:17:57 +01:00
GitLab Build Bot
9832be395f [ci skip] js-precompiled 20161120-133314 2016-11-20 13:35:00 +00:00
GitLab Build Bot
ab4941b5ee [ci skip] js-precompiled 20161120-132620 2016-11-20 13:28:04 +00:00
Gav Wood
017aaa346c Merge pull request #3534 from sandakersmann/patch-2
Add simple one-line installer to README.md
2016-11-20 14:11:07 +01:00
Gav Wood
efca40a733 Merge pull request #3491 from ethcore/transactions-propagate
Propagations & local transactions tracking
2016-11-20 14:10:27 +01:00
Gav Wood
0848a9ec3c Merge branch 'master' into transactions-propagate 2016-11-20 13:24:08 +01:00
Gav Wood
27a8608624 More information in the updater. 2016-11-20 13:18:56 +01:00
sandakersmann
306ee068f5 Add simple one-line installer to README.md
Add simple one-line installer for Mac and Ubuntu to README.md
2016-11-19 19:22:26 +01:00
Gav Wood
44eda379ad Merge remote-tracking branch 'origin/master' into check-updates 2016-11-19 03:43:43 +01:00
Jaco Greeff
1c4779683f Rename Request{Pending,Finished}Web3 -> Request{Pending,Finished} 2016-11-18 22:30:36 +01:00
Jaco Greeff
d1e6b9ec5e Introduce mobx store for component balances 2016-11-18 22:26:52 +01:00
Jaco Greeff
4498fd54a4 Typo slipped through 2016-11-18 21:55:55 +01:00
GitLab Build Bot
60922b61c9 [ci skip] js-precompiled 20161118-192308 2016-11-18 19:27:32 +00:00
Gav Wood
c4f2b71f1b Merge pull request #3503 from ethcore/signTransaction-format
Correct format of eth_signTransaction
2016-11-19 02:58:53 +08:00
Gav Wood
c9d1eb085c Merge pull request #3518 from ethcore/ng-solc-combined-fix
ABI can be empty and auto-fill contract name
2016-11-19 02:50:23 +08:00
Gav Wood
be2aabc7a1 Merge pull request #3516 from ethcore/ng-fix-npm-versions
Fix versions for NPM
2016-11-19 02:50:09 +08:00
Gav Wood
a97e08fbc8 Merge pull request #3498 from ethcore/jg-ghh-info-display
Better GHH event display & tracking
2016-11-19 02:49:56 +08:00
Gav Wood
80288f8680 Merge pull request #3438 from ethcore/jg-external-dapps
Dapp section & visibility changes
2016-11-19 02:49:41 +08:00
Nicolas Gotchac
53fcfa658f Fix parity.js badly built (#3526) 2016-11-18 19:49:30 +01:00
Konstantin
d870b71636 updated the european warp bootnode addresses (#3528) 2016-11-18 19:41:39 +01:00
Robert Habermeier
58ca93c123 document lock order 2016-11-18 19:27:32 +01:00
Robert Habermeier
48df2e12fa exclusive access to each peer at a time 2016-11-18 19:26:05 +01:00
Arkadiy Paronyan
9c62dd3916 Limit sync reorg to 20 blocks (#3519)
* Limit sync reorg

* Fixed tests
2016-11-18 19:17:35 +01:00
Robert Habermeier
4fd9670b33 support request sending 2016-11-18 19:12:20 +01:00
Jaco Greeff
1686d23522 Don't query chain in Signer, use Redux isTest 2016-11-18 19:07:13 +01:00
Jaco Greeff
be1e5ae52f Updated overlay size as per comments 2016-11-18 18:20:14 +01:00
Nicolas Gotchac
128cd2a8e4 Fixing JS tests 2016-11-18 18:14:34 +01:00
Jaco Greeff
1382c3bbf4 PR grumble 2016-11-18 18:12:38 +01:00
Nicolas Gotchac
8fc1506c57 ABI can be empty and auto-fill contract name #3511 2016-11-18 17:54:25 +01:00
Arkadiy Paronyan
51012d1fae Revert "Limit sync reorganization to 20 blocks" (#3517) 2016-11-18 17:50:27 +01:00
Arkadiy Paronyan
4a3bdf13df Check transaction signature when adding to the queue (#3508) 2016-11-18 17:45:19 +01:00
Arkadiy Paronyan
15702a875c Limit sync reorg (#3509) 2016-11-18 17:45:00 +01:00
Nicolas Gotchac
ffc94343fe Fix version for NPM 2016-11-18 17:44:40 +01:00
Jaco Greeff
f827ade616 debug log removal 2016-11-18 16:32:57 +01:00
keorn
9456c160c2 Merge branch 'master' into auth-bft 2016-11-18 15:22:20 +00:00
Robert Habermeier
f1c665081a Merge branch 'master' into client-provider 2016-11-18 16:07:50 +01:00
Robert Habermeier
63aa54cfc7 trigger event handlers, update capabilities 2016-11-18 15:30:06 +01:00
Jaco Greeff
8d339ad379 Adjust styling 2016-11-18 15:13:37 +01:00
Jaco Greeff
b433e7e9a0 Updated, contract execution in-place 2016-11-18 15:05:02 +01:00
GitLab Build Bot
55a3da8f0a [ci skip] js-precompiled 20161118-134410 2016-11-18 13:46:22 +00:00
keorn
49cbd6ef98 unused imports, proposer_nonce 2016-11-18 13:38:04 +00:00
keorn
2f3b801296 rename transition 2016-11-18 13:37:47 +00:00
Jaco Greeff
bf58aab6a3 Merge branch 'master' into jg-transact-gas-warnings 2016-11-18 14:24:04 +01:00
Nicolas Gotchac
aa43990456 Merge pull request #3506 from ethcore/jg-block-gasLimit
Keep track of block gasLimit
2016-11-18 14:21:13 +01:00
Jaco Greeff
e69b7f66a3 Gas calculation & limit errors 2016-11-18 14:18:50 +01:00
keorn
e90d814193 lock rounds 2016-11-18 12:27:00 +00:00
Gav Wood
4fd575b5ec Add traces. 2016-11-18 19:52:11 +08:00
Robert Habermeier
3fabad5c0f event struct types 2016-11-18 12:36:31 +01:00
Jaco Greeff
2de38c9238 Merge branch 'master' into jg-block-gasLimit 2016-11-18 12:25:04 +01:00
Jaco Greeff
5dcb3cbffb Retrieve gasLimit on new blocks 2016-11-18 12:24:32 +01:00
Gav Wood
9f030db6fb Merge remote-tracking branch 'origin/master' into check-updates 2016-11-18 19:23:22 +08:00
Gav Wood
cd770490ff Remove unneeded file. 2016-11-18 19:22:47 +08:00
Gav Wood
3f2ba96e97 Merge pull request #3504 from ethcore/ng-faster-ui
Smarter Status Polling
2016-11-18 19:18:28 +08:00
Gav Wood
dd50c63912 Merge pull request #3496 from ethcore/ng-solc-output
Handle solc combined output
2016-11-18 19:17:49 +08:00
Gav Wood
b9add2fa6b Merge pull request #3481 from ethcore/no-auto-uuid-name
Wallet names shouldn't use UUID
2016-11-18 19:17:42 +08:00
Gav Wood
d0cbbe2ec3 Merge pull request #3475 from ethcore/ng-fix-parity-jsapi
Make parity.js usable by Node and Browser
2016-11-18 19:17:33 +08:00
Gav Wood
401a4a37c1 Initial structure for auto-updater.
- Add auto-gen'ed Operations and Registry ABIs.
- Add Updater for managing updates.
- Add fields in Client to enable update checking and registry.
2016-11-18 19:14:52 +08:00
Tomasz Drwięga
5897e01dbd Correct format of eth_signTransaction 2016-11-18 11:03:29 +01:00
Gav Wood
28aabcdb6c Merge branch 'master' into check-updates 2016-11-18 11:45:04 +08:00
keorn
c62795d09b ap registration 2016-11-17 23:36:24 +00:00
keorn
9d61071dd7 Merge branch 'miner-no-ap' into auth-bft 2016-11-17 22:04:07 +00:00
Nicolas Gotchac
1c3923c9e8 Smarter Polling #3240
Only refresh statuses when on Status Page for
  some statuses (eg. hashrate)
2016-11-17 20:19:11 +01:00
keorn
9d8ac7a09b extra line [ci skip] 2016-11-17 19:08:00 +00:00
keorn
a521fda24e update rpc module test 2016-11-17 19:04:02 +00:00
keorn
11b6578bc3 update tests 2016-11-17 18:46:50 +00:00
Jaco Greeff
0c26eddd7f Better GHH event display & tracking 2016-11-17 19:37:08 +01:00
keorn
11ccacd6d0 dont keep account provider in miner 2016-11-17 18:32:12 +00:00
Nicolas Gotchac
5fd66d2c97 Smarter pinging. Don't waster resources #3240 2016-11-17 19:20:58 +01:00
Nicolas Gotchac
868fdd68ab Smarter Status Redux fixed 2016-11-17 18:45:23 +01:00
Nicolas Gotchac
50473a69f4 Smarter Status Redux dispatch #3240 2016-11-17 18:44:01 +01:00
keorn
3bac68419a last_lock 2016-11-17 17:12:37 +00:00
Robert Habermeier
8c0e511ebe rewrite scaling logic 2016-11-17 18:10:09 +01:00
Nicolas Gotchac
18e40f3ece Merge branch 'master' into ng-solc-output 2016-11-17 17:51:32 +01:00
Nicolas Gotchac
3ec256cd7b Merge branch 'master' into ng-fix-parity-jsapi 2016-11-17 17:51:05 +01:00
Nicolas Gotchac
a1cbe449fa Use a single step and input for ABI/solc output #3196 2016-11-17 17:45:04 +01:00
GitLab Build Bot
b79d65c0f3 [ci skip] js-precompiled 20161117-160039 2016-11-17 16:02:23 +00:00
Nicolas Gotchac
4f50a63dbc Remove node_modules dir after tests 2016-11-17 16:44:19 +01:00
Nicolas Gotchac
b633631f42 Npm install in npm test 2016-11-17 16:43:41 +01:00
Gav Wood
25a7ff1433 Merge pull request #3336 from ethcore/sms-verification-modal
sms verification modal
2016-11-17 23:42:12 +08:00
Gav Wood
e02d4d9205 Fix test. 2016-11-17 23:39:48 +08:00
Nicolas Gotchac
73b4b4d241 Added library test (node only) #3471 2016-11-17 16:39:36 +01:00
Robert Habermeier
546cd00659 allocate verifiers up front, hibernate when not needed 2016-11-17 16:00:23 +01:00
Nicolas Gotchac
6fd17540f3 Use the right webpack file // Export to window.Parity #3471 2016-11-17 15:54:13 +01:00
Nicolas Gotchac
830c762b75 Working desc and name fields #3196 2016-11-17 15:24:55 +01:00
GitLab Build Bot
7b866b4a1b [ci skip] js-precompiled 20161117-141135 2016-11-17 14:13:10 +00:00
Gav Wood
5c4a9f71d7 Merge pull request #3488 from ethcore/mac-uninstall
sudo -c is not supported on Mac
2016-11-17 21:56:34 +08:00
Gav Wood
9c8b7b25c9 Merge pull request #3492 from ethcore/jg-trace-apis
Add trace_{call, rawTransaction, replayTransaction}
2016-11-17 21:56:19 +08:00
Gav Wood
8befeb29a0 Merge pull request #3490 from ethcore/scrypt-sweep-panics
Check for possible panics in scrypt key derivation
2016-11-17 21:54:35 +08:00
Gav Wood
2532b1527e Merge pull request #3477 from ethcore/sync-opt
Sync traffic optimization
2016-11-17 21:53:05 +08:00
Tomasz Drwięga
3bfd6c5998 Merge branch 'master' into transactions-propagate 2016-11-17 14:37:29 +01:00
Jannis R
4ae58f7d33 move nullable PropType helper 2016-11-17 14:31:25 +01:00
Tomasz Drwięga
afef5b5316 Mocking API for tests 2016-11-17 14:30:53 +01:00
keorn
ce711e321a remove unused vote accumulators 2016-11-17 13:28:29 +00:00
keorn
51ac38318a save proposal hash 2016-11-17 13:26:57 +00:00
Jannis R
179078d31a sms verification: loading step 2016-11-17 14:23:59 +01:00
Jannis R
fff8743ee6 sms verification: fetch contract address from Registry 2016-11-17 14:23:47 +01:00
Tomasz Drwięga
45c7a28585 Fixing JS tests 2016-11-17 14:13:59 +01:00
Nicolas Gotchac
52f3d3cccd Add solc text helper #3196 2016-11-17 14:09:02 +01:00
Jaco Greeff
1b5f7f2241 Remove dangling only 2016-11-17 14:07:34 +01:00
Jaco Greeff
139e66932d Add trace_{call, rawTransaction, replayTransaction} 2016-11-17 14:05:11 +01:00
Tomasz Drwięga
be6eb79296 Fixing JS lints 2016-11-17 14:00:53 +01:00
Nicolas Gotchac
d41efcc84e Add input from Solc compiler #3196 2016-11-17 13:59:13 +01:00
Tomasz Drwięga
5c62e38a7c Cleanup 2016-11-17 13:52:09 +01:00
Tomasz Drwięga
fc4b51fe68 Prioritizing local transactions regardless of nonce 2016-11-17 13:42:45 +01:00
Tomasz Drwięga
74bf2c75f0 Transaction queue improvements 2016-11-17 13:32:13 +01:00
NikVolf
9bbaa03932 check for sanity 2016-11-17 15:30:08 +03:00
keorn
6cb892f605 Merge remote-tracking branch 'parity/master' into bft 2016-11-17 12:19:30 +00:00
keorn
9563ccfbd2 message broadcasting methods 2016-11-17 12:18:20 +00:00
keorn
45027ea306 add new client messaging 2016-11-17 12:17:48 +00:00
Robert Habermeier
44dcd6bc3b increase readjustment period 2016-11-17 13:10:33 +01:00
Jannis R
3f0053f884 sms verification: move helper functions
- checkIfTxFailed & waitForBlockConfirmations are both general-purpose
- checkIfVerified, checkIfRequested & postToServer are sms verification-specific
2016-11-17 13:07:36 +01:00
arkpar
d890dd6f42 Updated sync algo desription 2016-11-17 13:02:44 +01:00
Robert Habermeier
ada9d2b760 Merge branch 'master' into adaptive_queue_threads 2016-11-17 13:00:24 +01:00
Jannis R
a59526099d merge master into sms-verification-modal 2016-11-17 12:40:22 +01:00
Jannis R
13448930e9 sms verification: fix styling 2016-11-17 12:31:06 +01:00
Arkadiy Paronyan
2928da07e4 sudo -c Is not supported on Mac 2016-11-17 12:30:56 +01:00
Nicolas Gotchac
c8fadbec69 Add a new RadioButtons Component #3196 2016-11-17 12:06:35 +01:00
Gav Wood
64a4b60857 Merge pull request #3378 from ethcore/fix-wallet-naming
Wallet files shouldn't give away the address
2016-11-17 18:30:04 +08:00
GitLab Build Bot
76ac87af8b [ci skip] js-precompiled 20161117-101458 2016-11-17 10:16:40 +00:00
Tomasz Drwięga
e45fa62ed5 Fixing tests, fixing refreshing precompiled (#3483)
* Fixing tests, fixing refreshing precompiled

* Commit only js and Cargo.lock

* Moving commands to the right place

* Adding js content as well
2016-11-17 10:58:07 +01:00
Tomasz Drwięga
ff27bbcb4f Simple GUI for local transactions 2016-11-17 10:15:11 +01:00
Gav Wood
4c41195d5c Merge pull request #3478 from ethcore/ng-errors-overlay
Better Errors Snackbar in UI
2016-11-17 08:34:49 +08:00
Gav Wood
a9f017648a Merge pull request #3476 from ethcore/ng-signer-reject
Handle Signer Rejection
2016-11-17 08:33:26 +08:00
Gav Wood
4fa361c988 Wallet names shouldn't include uuid.
Fixes #3368
2016-11-17 08:29:28 +08:00
Nicolas Gotchac
05dc1ab05e Better Erros Snackbar in UI #3473 2016-11-16 19:57:41 +01:00
arkpar
5bddcd8003 Sync bandwidth optimization 2016-11-16 19:34:58 +01:00
Nicolas Gotchac
3ad7e873e1 Better use of Webpack #3471 2016-11-16 19:16:55 +01:00
keorn
802d5c669d transition rules 2016-11-16 18:01:09 +00:00
Nicolas Gotchac
6c60aaec08 Merge branch 'master' into ng-fix-parity-jsapi 2016-11-16 18:58:15 +01:00
Nicolas Gotchac
7144da5d7e Handle Signer Rejection // Real Custom Errors #3153 2016-11-16 18:55:53 +01:00
Tomasz Drwięga
cd686b5d68 Merge branch 'master' into transactions-propagate 2016-11-16 18:07:44 +01:00
Nicolas Gotchac
18f570327e Enhanced MethodDecoding in Transactions list (#3454)
* Better MethodDecoding UI // No empty params #3452

* Display input if ASCII in transactions #3434

* Fixes UI for #3454

* Better MethodDecoding contract detection #3454
2016-11-16 18:03:59 +01:00
Tomasz Drwięga
2cd2b10327 Local transactions RPC 2016-11-16 17:54:54 +01:00
GitLab Build Bot
a7574a1108 [ci skip] js-precompiled 20161116-161024 2016-11-16 16:12:55 +00:00
keorn
51bbad66d0 add a path to submit seal from engine 2016-11-16 15:56:16 +00:00
Nicolas Gotchac
6fa863f2cc Make parity.js usable by Node and Browser #3471 2016-11-16 16:52:05 +01:00
Gav Wood
25950345db Merge pull request #3379 from ethcore/new-token
Signer new-token generates a link and opens browser
2016-11-16 23:48:21 +08:00
Nicolas Gotchac
6f2c818f9f Make tokenreg dapp fast again (#3474)
* Using proper TokenReg Instance in TokenReg dApp #3371

* remove unnecessary logs in tokereg dapp

* Improved Redux managment in TokeReg dApp #3371

* Fixfing linting
2016-11-16 16:43:21 +01:00
Tomasz Drwięga
66e327dfcb Keep track of local transactions 2016-11-16 15:58:14 +01:00
keorn
3b0d5503b1 fix compilation 2016-11-16 13:13:21 +00:00
Tomasz Drwięga
78b5c743f6 Stats RPC 2016-11-16 13:54:58 +01:00
keorn
2fa34fd6a8 step transition messaging 2016-11-16 12:43:21 +00:00
Jannis R
ed2b8e14fc merge master into sms-verification-modal 2016-11-16 13:29:46 +01:00
Jannis R
da8c70fbe7 sms verification: check if tx failed, minor UI fixes
- checks if the tx failed by the amount of gas used
- don't show the pending indicator if an error occured
2016-11-16 13:28:52 +01:00
Jaco Greeff
bbf6d1768d Overal + acceptance in-place 2016-11-16 13:08:08 +01:00
Jaco Greeff
d14801f4ea Merge branch 'master' into jg-external-dapps 2016-11-16 12:36:43 +01:00
Jaco Greeff
68efa70977 Update styling 2016-11-16 12:36:27 +01:00
Jaco Greeff
501c7369b0 External app overlay 2016-11-16 12:36:27 +01:00
keorn
8ac989cbeb Merge remote-tracking branch 'parity/master' into bft 2016-11-16 10:29:54 +00:00
Tomasz Drwięga
4febd0eb93 Maintaining the statistics for propagation of pending transactions 2016-11-16 10:45:55 +01:00
Tomasz Drwięga
29271383dd signer new-token doesn't open the browser 2016-11-16 09:38:09 +01:00
Arkadiy Paronyan
df1fbf50d8 Build fix (#3470) 2016-11-16 08:47:50 +01:00
Gav Wood
b7a76be23a Merge pull request #3447 from ethcore/jg-basiccoin
Display deployed Basic token addresses
2016-11-16 11:46:20 +08:00
Gav Wood
9bd6378e42 Typo 2016-11-16 11:37:25 +08:00
Gav Wood
b9e9544841 Merge pull request #2866 from ethcore/ng-accounts-backup
Export accounts as JSON or CSV
2016-11-16 11:31:18 +08:00
Gav Wood
a5c6cc34cf Merge pull request #3466 from ethcore/hf2-block-num
Set HF2 block number
2016-11-16 11:21:59 +08:00
Gav Wood
9c8a85fa4e Merge pull request #3461 from ethcore/jr-better-wordlist
better word list for secret phrase generation
2016-11-16 11:21:17 +08:00
Gav Wood
8ad2526826 Merge pull request #3460 from ethcore/drop-spec
drop spec when no longer useful
2016-11-16 11:20:13 +08:00
Gav Wood
4d5ce8fde4 Merge pull request #3459 from ethcore/ng-abi-fallback
Add fallback check in ABI validation
2016-11-16 11:19:50 +08:00
Gav Wood
130fd3f9c1 Merge pull request #3457 from ethcore/ng-save-sorting
Save sort order in LocalStorage
2016-11-16 11:19:19 +08:00
Gav Wood
06112255ae Merge pull request #3456 from ethcore/ng-paste-input-submit
Adds onPaste event to Inputs
2016-11-16 11:18:29 +08:00
Gav Wood
53cb033b17 Merge pull request #3450 from ethcore/jg-signer-overflow
Update signer to take care of text overflows
2016-11-16 11:18:20 +08:00
Gav Wood
1daba384cc Merge pull request #3426 from ethcore/auth-round
Authority round consensus engine
2016-11-16 11:18:01 +08:00
GitLab Build Bot
a9596abf5c [ci skip] js-precompiled 20161115-212437 2016-11-15 21:26:09 +00:00
arkpar
be4311540d Set HF block number 2016-11-15 22:04:25 +01:00
Jaco Greeff
df901379b3 Fix transfer token decimal calculation (#3445)
* Fix decimal calculation

* Recalc when shorcutting estimate
2016-11-15 22:00:14 +01:00
GitLab Build Bot
3addae9313 [ci skip] js-precompiled 20161115-194902 2016-11-15 19:50:43 +00:00
Arkadiy Paronyan
4464231c3d Merge pull request #3363 from ethcore/eip-170
Restrict max code size for EIP-150 and after.
2016-11-15 20:33:02 +01:00
Arkadiy Paronyan
4016c58ee9 Update test client with max code size 2016-11-15 19:48:15 +01:00
arkpar
e795f84664 fixed test 2016-11-15 19:46:25 +01:00
Jannis R
373441373d better word list for secret phrase generation 2016-11-15 19:37:45 +01:00
Jannis R
8d4b1a332b sms verification: bugfixes 🐛
- fixed imports
- renamed `uiSteps` to `phases` to make the distinction between
  actual (tiny) steps and visible UI steps clear
- lookup `requestTx` if request has already been sent
- change code regex to match ethcore/sms-verification@59acb73
2016-11-15 19:22:44 +01:00
Jaco Greeff
6efdc08044 Queries display IdentityIcons (#3453) 2016-11-15 19:08:16 +01:00
Robert Habermeier
8c8bf30de5 drop spec when no longer useful 2016-11-15 19:07:23 +01:00
Nicolas Gotchac
3b8286f474 Add fallback check in ABI validation #3392 2016-11-15 18:53:53 +01:00
Nicolas Gotchac
22e47a68a3 Save sort order in LocalStorage #3402 2016-11-15 18:39:11 +01:00
Robert Habermeier
7bfb9e4003 handle all LES requests 2016-11-15 18:19:16 +01:00
Gav Wood
b5704f8056 Update max code size. 2016-11-15 17:58:29 +01:00
Gav Wood
062d55a046 Fix test. 2016-11-15 17:58:28 +01:00
Gav Wood
30ea921329 Introduce the actual max code size. 2016-11-15 17:58:28 +01:00
Gav Wood
528bf17af5 Restrict max code size to 23999 bytes for EIP-150 and after. 2016-11-15 17:58:28 +01:00
Nicolas Gotchac
aae7af6895 Adds onPaste event to Inputs #3127 2016-11-15 17:58:11 +01:00
Jannis R
7a83fb8595 merge master into sms-verification-modal 2016-11-15 17:04:36 +01:00
Jannis R
aa8fc554fe sms verification: simplify code
- moved the steps into named exports
- moved the store creation into the Accounts component
- fix a linting issue
2016-11-15 17:04:34 +01:00
Nicolas Gotchac
039bd3c9f9 Use Babel in vendor when needed #3419 (#3451) 2016-11-15 16:46:48 +01:00
Jannis R
3e879aac35 sms verification: use Mobx store 2016-11-15 16:30:55 +01:00
keorn
1c958695c3 timeout loading 2016-11-15 15:25:30 +00:00
Jannis R
bfcc8d33d6 sms verification: make Done component dumb 2016-11-15 16:22:19 +01:00
Jannis R
90df237ca5 sms verification: make SendConfirmation component dumb 2016-11-15 16:22:19 +01:00
Jannis R
377c16cf78 sms verification: make QueryCode component dumb 2016-11-15 16:22:19 +01:00
Jannis R
f48a341c32 sms verification: make SendRequest component dumb 2016-11-15 16:22:18 +01:00
Jannis R
71986249e5 sms verification: make GatherData component dumb 2016-11-15 16:22:16 +01:00
Jannis R
8ef9fff8ba sms verification: put process into MobX store 2016-11-15 16:05:00 +01:00
Nicolas Gotchac
20185e5aac Use signature of functions instead of names (#3448)
* Use signature of functions instead of names #3411

* Fixes contract tests #3448
2016-11-15 15:58:33 +01:00
Robert Habermeier
cb54152c23 cut off headers after first missing 2016-11-15 15:47:08 +01:00
Jaco Greeff
37ebca6d34 Merge branch 'master' into jg-external-dapps 2016-11-15 15:27:27 +01:00
GitLab Build Bot
b5dedd8aeb [ci skip] js-precompiled 20161115-135402 2016-11-15 13:55:35 +00:00
Robert Habermeier
abf39fde0a implement provider for client 2016-11-15 14:53:30 +01:00
Jaco Greeff
28f11be200 Merge pull request #3430 from ethcore/ng-array-parameters
Handle contract constructor inputs
2016-11-15 14:35:10 +01:00
keorn
7d0eafd5cd fix extra_info 2016-11-15 13:33:11 +00:00
Jaco Greeff
a1ec3146eb Update signer to take care of text overflows 2016-11-15 14:32:29 +01:00
keorn
8efaf08da3 typos and warning 2016-11-15 13:02:46 +00:00
GitLab Build Bot
19b8b48579 [ci skip] js-precompiled 20161115-130035 2016-11-15 13:02:08 +00:00
Jaco Greeff
10c503b5c7 Merge pull request #3446 from ethcore/ng-tokenreg-correct-owner
Use Contract owner for unregistering Token
2016-11-15 13:45:57 +01:00
Nicolas Gotchac
125ac1a69a Better close icons in Modals 2016-11-15 12:52:37 +01:00
Nicolas Gotchac
723005635a Close and not Cancel on deploy contract #3393 2016-11-15 12:50:20 +01:00
GitLab Build Bot
771ce13ddc [ci skip] js-precompiled 20161115-114313 2016-11-15 11:44:42 +00:00
Nicolas Gotchac
2b30d4b75f Empty default Address Field #3395 2016-11-15 12:35:50 +01:00
Jaco Greeff
0181b8a245 Display token addresses 2016-11-15 12:35:43 +01:00
Nicolas Gotchac
3a01352744 Use Contract owner for unregistering Token #3440 2016-11-15 12:30:08 +01:00
Robert Habermeier
db518ecdd4 Merge pull request #3442 from ethcore/lenient-dirs
Create directories only if feature is enabled
2016-11-15 12:28:33 +01:00
keorn
06e5416537 header fns, extra_info 2016-11-15 11:27:09 +00:00
keorn
fde6ff2186 nicer extra info 2016-11-15 11:10:32 +00:00
keorn
d19e8c5505 Merge remote-tracking branch 'parity/master' into bft 2016-11-15 10:26:37 +00:00
keorn
ff2dc5dd57 vote counting 2016-11-15 10:21:49 +00:00
keorn
54e4956345 return errors from constructor 2016-11-15 10:21:18 +00:00
Tomasz Drwięga
8dc7fcbe07 Don't clear propagated transactions 2016-11-15 11:20:54 +01:00
keorn
dd8ed42270 update timeouts 2016-11-15 10:20:42 +00:00
keorn
55a5402bf5 simplify messages 2016-11-15 10:20:14 +00:00
Tomasz Drwięga
6ea4b25859 Create directories only if feature is enabled 2016-11-15 10:28:52 +01:00
GitLab Build Bot
9857f632d8 [ci skip] js-precompiled 20161115-085029 2016-11-15 08:52:53 +00:00
Jaco Greeff
601cef226b Merge branch 'master' into jg-external-dapps 2016-11-15 09:25:42 +01:00
Jaco Greeff
604be3e463 Import AddresBook from exported JSON (#3433)
* Adds error handler in Importer // Import AddressBook #2885

* More robust import #2885
2016-11-15 09:24:59 +01:00
Jaco Greeff
1e155ae548 Render selection inside areas 2016-11-14 21:57:28 +01:00
GitLab Build Bot
c4885a1423 [ci skip] js-precompiled 20161114-201022 2016-11-14 20:11:54 +00:00
Denis S. Soldatov aka General-Beck
85fdcc7bf3 Update gitlab-ci
remove -Zorbit=off
switch to rust 1.13
2016-11-14 23:45:58 +04:00
Nicolas Gotchac
b9f3c4b266 Merge branch 'master' into ng-accounts-backup 2016-11-14 20:31:10 +01:00
Nicolas Gotchac
5322727617 Fixing linting issues #3430 2016-11-14 20:29:37 +01:00
Nicolas Gotchac
09ec0c1f2f More robust import #2885 2016-11-14 20:26:21 +01:00
keorn
071e66c9a8 fix flaky test 2016-11-14 19:03:02 +00:00
keorn
9d46401626 revert to try! 2016-11-14 18:25:42 +00:00
keorn
ae5ae765a6 Merge branch 'master' into auth-round 2016-11-14 18:04:44 +00:00
GitLab Build Bot
3bfa56c72a [ci skip] js-precompiled 20161114-174654 2016-11-14 17:48:20 +00:00
keorn
06ebd5fa1a remove most panics 2016-11-14 17:42:56 +00:00
Nicolas Gotchac
134622ea3a Adds error handler in Importer // Import AddressBook #2885 2016-11-14 18:34:05 +01:00
Gav Wood
cfbd5bd713 Merge pull request #3427 from ethcore/ng-address-input-improv
Scrollable accounts in autocomplete
2016-11-14 18:30:50 +01:00
Jannis R
b5560d27a0 sms verification: pull out postToVerificationServer 2016-11-14 18:03:07 +01:00
Robert Habermeier
25b0b8641e indent state tests 2016-11-14 17:47:56 +01:00
Nicolas Gotchac
29442673f8 Clean-Up #3314 2016-11-14 17:39:45 +01:00
Nicolas Gotchac
97378daee5 Merge branch 'master' into ng-array-parameters 2016-11-14 17:06:02 +01:00
Jaco Greeff
5a6e2f89dd Hide external apps by default 2016-11-14 17:02:45 +01:00
Nicolas Gotchac
9e2214c513 Working add/remove fields for var. length #3314 2016-11-14 17:00:36 +01:00
keorn
1e3ae9fff9 typos, header functions 2016-11-14 15:56:19 +00:00
GitLab Build Bot
5127b997eb [ci skip] js-precompiled 20161114-155241 2016-11-14 15:54:09 +00:00
GitLab Build Bot
c061eae64b [ci skip] js-precompiled 20161114-154454 2016-11-14 15:46:21 +00:00
Gav Wood
ef471af4ee Merge pull request #3428 from ethcore/ws-rs
Bump ws-rs
2016-11-14 16:32:33 +01:00
Gav Wood
d98c6fb717 Merge pull request #3425 from ethcore/jg-tokenreg-decimals
Swap TokenReg dapp from base to decimals
2016-11-14 16:32:12 +01:00
Gav Wood
3eb019064b Merge pull request #3421 from ethcore/travis-beta
Change beta builds to stable on Travis
2016-11-14 16:29:34 +01:00
Gav Wood
1418c3175a Merge pull request #3420 from ethcore/refactor-copy-to-clipboard
refactor copy to clipboard functionality
2016-11-14 16:29:09 +01:00
Gav Wood
ae67bd5371 Merge pull request #3385 from ethcore/dev-chain
Dev chain
2016-11-14 16:28:58 +01:00
Gav Wood
2989ab9dfc fetch known code from the database during restoration (#3377)
* fetch known code from the database during restoration

previously it kept all seen code in memory, leading to
high memory usage by the end of state restoration

* whitespace

[ci:skip]

* test previous code fetch
2016-11-14 16:28:15 +01:00
Nicolas Gotchac
89f83b8cd7 Fixes #3397 : fake blur handled 2016-11-14 16:11:00 +01:00
Tomasz Drwięga
d66cc0907d Bump ws-rs 2016-11-14 16:10:04 +01:00
Jannis R
9df0d33709 merge master into sms-verification-modal 2016-11-14 16:00:16 +01:00
Nicolas Gotchac
ecb89d3670 Scrollable Accounts list // Tab;Enter;Keydown for first input #3396 2016-11-14 15:35:25 +01:00
keorn
0b5a9a6e60 nicer bundled spec message 2016-11-14 14:29:33 +00:00
GitLab Build Bot
6fc7c15644 [ci skip] js-precompiled 20161114-142451 2016-11-14 14:26:16 +00:00
Jaco Greeff
48b2252029 Swap from base to decimals 2016-11-14 15:16:57 +01:00
Robert Habermeier
3c7533831e Merge branch 'master' into client-provider 2016-11-14 15:16:26 +01:00
keorn
5de7d50bf8 add test for multi proposals 2016-11-14 14:15:31 +00:00
keorn
8be8b3e1cd ensure no double proposals 2016-11-14 13:35:45 +00:00
keorn
8a86c11375 enable force sealing 2016-11-14 13:35:16 +00:00
Arkadiy Paronyan
b4ef3f3255 Fixing benches (#3422) 2016-11-14 14:21:35 +01:00
Robert Habermeier
18153b8d9e Merge branch 'master' into missing-code-by-prefix 2016-11-14 14:02:19 +01:00
Tomasz Drwięga
9f002a8a94 Fixing benches 2016-11-14 13:29:49 +01:00
Tomasz Drwięga
d02afc0e40 Beta -> Stable 2016-11-14 13:21:08 +01:00
keorn
165e2bef75 modify proposer test 2016-11-14 11:34:54 +00:00
Jannis R
b1fcee73a5 sms verification: less block confirmations 2016-11-14 12:33:29 +01:00
Jannis R
8ce362b224 sms verification: add terms of service 2016-11-14 12:31:26 +01:00
Tomasz Drwięga
2795f40464 Merge branch 'new-token' of github.com:ethcore/parity into new-token 2016-11-14 12:17:29 +01:00
Tomasz Drwięga
7f011afacb Tokens retention policy 2016-11-14 12:17:05 +01:00
Jaco Greeff
665504c414 Only use #/auth token as fallback 2016-11-14 12:10:03 +01:00
keorn
b5c891814a fix merge 2016-11-14 11:09:57 +00:00
GitLab Build Bot
594bd35a5e [ci skip] js-precompiled 20161113-131856 2016-11-14 11:57:54 +01:00
GitLab Build Bot
1e696c41f7 [ci skip] js-precompiled 20161113-131228 2016-11-14 11:57:54 +01:00
Gav Wood
8db3414de9 Merge branch 'master' into sms-verification-modal 2016-11-14 11:56:37 +01:00
Gav Wood
2fa2f8342a isLatest works. 2016-11-14 11:49:56 +01:00
Jannis R
4d01fbc4c4 merge master into refactor-copy-to-clipboard 2016-11-14 11:46:58 +01:00
Jannis R
e9e9475830 CopyToClipboard: remove tooltip 2016-11-14 11:39:36 +01:00
keorn
501f6d3f49 Merge branch 'master' into auth-round 2016-11-14 10:08:14 +00:00
keorn
d8e6dbd981 Merge branch 'master' into dev-chain 2016-11-14 10:05:34 +00:00
keorn
2d4b4cf5c9 revert moves to Spec 2016-11-14 10:04:34 +00:00
Tomasz Drwięga
6957634ee7 Merge branch 'master' into new-token 2016-11-14 09:22:06 +01:00
Gav Wood
4bb4ed9551 Initial checking. 2016-11-13 15:52:33 +01:00
GitLab Build Bot
d1848117ef [ci skip] js-precompiled 20161113-131856 2016-11-13 13:20:20 +00:00
GitLab Build Bot
5a259be290 [ci skip] js-precompiled 20161113-131228 2016-11-13 13:13:54 +00:00
Gav Wood
4a92668c56 Fix chainspec storage field. (#3406)
Add a test.
2016-11-13 13:58:42 +01:00
Robert Habermeier
37f49aac1b abort snapshot restoration faster (#3356)
* abort snapshot restoration faster

* flag-checking tests
2016-11-13 13:52:53 +01:00
GitLab Build Bot
0c302376b6 [ci skip] js-precompiled 20161113-011451 2016-11-13 01:16:28 +00:00
Jaco Greeff
3ff9c3e6d6 Remove addresses, display non-refundable warning (#3403) 2016-11-12 22:28:50 +01:00
Jaco Greeff
c57738b9b6 Don't unsubscribe when subscriber callback throws (#3401) 2016-11-12 22:26:50 +01:00
Jaco Greeff
6b33899239 Fix dapp account selection (#3399)
* Fix GHH accounts (filter non accounts)

* SignatureReg handle undefined ABI names gracefully

* SignatureReg fix accounts (filter non accounts)

* TokenReg fix accounts (filter non accounts)

* Registry fix accounts (filter non accounts)
2016-11-12 22:24:55 +01:00
GitLab Build Bot
e5486f5d58 [ci skip] js-precompiled 20161112-202502 2016-11-12 20:26:39 +00:00
Robert Habermeier
ee11d104bf Merge pull request #3381 from ethcore/fix-travis
Fix travis build: remove unused import
2016-11-12 21:03:40 +01:00
Jaco Greeff
7ca317912f Set signer token via #/auth=token={} 2016-11-12 17:09:55 +01:00
Jaco Greeff
373eb6c01b Merge branch 'master' into new-token 2016-11-12 16:25:21 +01:00
Gav Wood
86eb84fd81 Switch --signer- to --ui- 2016-11-12 15:21:51 +01:00
Arkadiy Paronyan
67fa58db14 Optimize memory footprint (#3376) 2016-11-12 12:07:02 +01:00
Tomasz Drwięga
c17ef2c1a4 Fixing parsing passwords from file (#3367)
* fixing parsing passwords as inputs

* Fixing typo in test
2016-11-12 10:06:40 +01:00
keorn
15d748c2f7 Merge branch 'master' into dev-chain 2016-11-11 20:40:05 +00:00
keorn
aa296c3c0d update rpc tests 2016-11-11 19:12:32 +00:00
keorn
ea9c479fff update json_tests 2016-11-11 18:57:57 +00:00
keorn
cc39b24599 update chain name 2016-11-11 18:41:04 +00:00
keorn
4a65394269 change instant spec, update doc 2016-11-11 18:38:44 +00:00
Robert Habermeier
7e41f1c901 Fix travis build: remove unused import 2016-11-11 18:41:25 +01:00
keorn
53258cca6c add new dev spec 2016-11-11 17:27:20 +00:00
keorn
e63b7e51fb update instant_seal schedule 2016-11-11 17:26:41 +00:00
Robert Habermeier
87c668ba9c test previous code fetch 2016-11-11 18:24:12 +01:00
keorn
225d0b02e7 update parity module 2016-11-11 17:10:47 +00:00
Tomasz Drwięga
ba699fdb25 new line [ci:skip] 2016-11-11 18:02:36 +01:00
keorn
beaa014543 tix doc test 2016-11-11 16:59:22 +00:00
Tomasz Drwięga
be6023b602 Opening a browser 2016-11-11 17:56:52 +01:00
Tomasz Drwięga
aa147461b0 Generating browser link on signer new-token 2016-11-11 17:38:45 +01:00
keorn
a719b91b63 move spec constructors to spec 2016-11-11 16:37:44 +00:00
Gav Wood
a7ad75d851 whitespace
[ci:skip]
2016-11-11 17:32:54 +01:00
Gav Wood
24cb0ae905 Wallet names shouldn't include address.
(Actually wallet files shouldn't contain it either, but we'll
leave that for a later PR).
2016-11-11 17:28:03 +01:00
GitLab Build Bot
c656b53ce6 [ci skip] js-precompiled 20161111-161748 2016-11-11 16:19:10 +00:00
Robert Habermeier
ed135bb9dc fetch known code from the database during restoration
previously it kept all seen code in memory, leading to
high memory usage by the end of state restoration
2016-11-11 17:18:31 +01:00
Tomasz Drwięga
4bf75d6f2f Remove some unwraps from parity/helpers (#3364)
* Fixing no stdin

* Removing unwrap when reading passwords
2016-11-11 16:53:51 +01:00
Jaco Greeff
80606cdd7d Load external, builtin & local apps in parallel (#3340) 2016-11-11 16:53:10 +01:00
GitLab Build Bot
d5d1c1b674 [ci skip] js-precompiled 20161111-141616 2016-11-11 14:17:40 +00:00
Nicolas Gotchac
0e4ef539fc Solidity Compiler in UI (#3279)
* Added new Deploy Contract page // Use Brace in React #2276

* Adding Web Wrokers WIP

* Compiling Solidity code // Getting mandatory params #2276

* Working editor and deployment #2276

* WIP : displaying source code

* Added Solidity hightling, editor component in UI

* Re-adding the standard Deploy Modal #2276

* Using MobX in Contract Edition // Save to Localstorage #2276

* User select Solidity version #2276

* Loading Solidity versions and closing worker properly #2276

* Adds export to solidity editor #2276

* Adding Import to Contract Editor #2276

* Persistent Worker => Don't load twice Solidity Code #2276

* UI Fixes

* Editor tweaks

* Added Details with ABI in Contract view

* Adds Save capabilities to contract editor // WIP on Load #3279

* Working Load and Save contracts... #3231

* Adding loader of Snippets // Export with name #3279

* Added snippets / Importing from files and from URL

* Fix wrong ID in saved Contract

* Fix lint

* Fixed Formal errors as warning #3279

* Fixing lint issues

* Use NPM Module for valid URL (fixes linting issue too)

* Don't clobber tests.
2016-11-11 15:00:04 +01:00
Nicolas Gotchac
046d2f2333 Scrollable 2016-11-11 13:09:16 +01:00
Nicolas Gotchac
deaf863c9e Fixing linting 2016-11-11 12:41:44 +01:00
Nicolas Gotchac
b59df1d7b8 WIP // Real ABI params in Deploy Constructor #3314 2016-11-11 12:37:01 +01:00
Nicolas Gotchac
94b80cc08a Merge branch 'master' into ng-array-parameters 2016-11-11 11:18:17 +01:00
GitLab Build Bot
5d8f74ed57 [ci skip] js-precompiled 20161111-082057 2016-11-11 08:22:24 +00:00
Jaco Greeff
c7b99cd7e6 Determine real-time HTTP connected status (#3335)
* Determine real-time HTTP connected status

* Update failing tests, no polluting polling
2016-11-11 09:01:28 +01:00
Chuck LeDuc Díaz
7cc88b175f Clarify error message to indicate (#3359)
Indicate that Signer *needs* to be re-enabled, not that it *was* re-enabled.
2016-11-11 08:52:52 +01:00
Jaco Greeff
0b176e7013 Cater for home.parity hostname in dappsUrl (#3341)
* Cater for home.parity hostname

* Cater for 0.0.0.0 & default dappsInterface

* Extra check
2016-11-10 20:45:03 +01:00
Nicolas Gotchac
cd143e475a WIP refacto typed input 2016-11-10 20:35:47 +01:00
GitLab Build Bot
0456d4e5d0 [ci skip] js-precompiled 20161110-180734 2016-11-10 18:08:55 +00:00
Jannis R
522b7108f9 CopyToClipboard: show SnackBar 2016-11-10 18:47:17 +01:00
Nicolas Gotchac
eb56b82f43 Check totalBalance > 0 // Better account selection (#3347) 2016-11-10 18:46:03 +01:00
Nicolas Gotchac
cb84e61d06 Fixed Unregister for Contract Owner only #3321 (#3346) 2016-11-10 18:44:11 +01:00
Robert Habermeier
3854b8a689 LES Part 1 (#3322)
* stub implementations of light client trait

* Light provider trait

* light client sync stubs

* LES boilerplate

* stub implementation of provider for client

* skeleton and request traits

* request definitions

* new_list -> begin_list

* handle unknown packet

* revise light implementation strategy

* make verification module public

* Move all light client work to own crate

* experiment with answering requests

* buffer flow scaffolding

* remove LESv2 requests

* buffer flow basics, implement cost table

* begin status module

* implement handshake parsing and creation

* implement announcement serialization

* errors, punishment, and handshake

* handle announcements

* making announcements, clean up warnings

* allow dead code temporarily
2016-11-10 18:30:17 +01:00
Jannis R
e9b69bceab Account Header: use CopyToClipboard 2016-11-10 18:09:54 +01:00
GitLab Build Bot
529633e9b2 [ci skip] js-precompiled 20161110-163203 2016-11-10 16:33:24 +00:00
Jannis R
87c39f066c Form/Input: use CopyToClipboard 2016-11-10 17:27:53 +01:00
Jannis R
acbaed59c0 CopyToClipboard: clear timeout on unmount 2016-11-10 17:27:53 +01:00
Jaco Greeff
a97e68a030 Make transactions load (#3348) 2016-11-10 16:38:47 +01:00
Jannis R
01f14901ce merge master into sms-verification-modal 2016-11-10 16:23:43 +01:00
Jannis R
bd839d019c sms verification: polish UI, linting issues 👕 2016-11-10 16:23:09 +01:00
Jannis R
afdda48ab5 sms verification: polish UI
This introduces another "Done" step, making clear the process has finished.

Also, steps 2 ("Request") and 4 ("Confirm") now have a pending indicator.
2016-11-10 16:09:41 +01:00
GitLab Build Bot
0ed8114726 [ci skip] js-precompiled 20161110-141839 2016-11-10 14:20:08 +00:00
GitLab Build Bot
aa0f05a186 [ci skip] js-precompiled 20161110-140631 2016-11-10 14:07:52 +00:00
Jaco Greeff
561f008c91 Manual bump of package.json (#3345) 2016-11-10 15:01:07 +01:00
Arkadiy Paronyan
bb5da2379b Windows app and installer fixes (#3338)
* Windows app and installer fixes

* Sorted out comments
2016-11-10 14:49:16 +01:00
Nicolas Gotchac
6ad909e7b3 Removed unnecessary test (#3342) 2016-11-10 14:26:06 +01:00
Robert Habermeier
8c2c048444 clean up errors 2016-11-10 14:05:47 +01:00
Jannis R
2309e53fe6 sms verification: polish UI, linting issues 👕 2016-11-10 13:54:17 +01:00
Jannis R
ac80276ad8 sms verification: refactor checks & confirmation 2016-11-10 13:37:32 +01:00
Nicolas Gotchac
1deeb0d901 Git pre-push checks for UI (#3072)
* Added eslint cached option (#2291)

* Added pre-push script running linting (#2291)

* Modifies pre-push hook to run if eslint installed // auto install hook

* Update pre-push script comment

* Added husky for git hooks (#3072)
2016-11-10 11:42:00 +01:00
Arkadiy Paronyan
6ffaab15a3 Disarm the HF and add more bootnodes (#3323)
* Disarm the HF

* More bootnodes

* Updated tests
2016-11-10 11:28:27 +01:00
Nicolas Gotchac
67ac05ef39 Default contract type on UI (#3310)
* Added Token and Wallet ABI in Watch Contract #3126

* Improved ABI Validator #3281

* Select contract type on first screen #3126

* Added types decsription

* Add ABI type to Contract metadata // Custom as default type #3310
2016-11-10 11:27:35 +01:00
Tomasz Drwięga
2f98169539 In-browser signing support (#3231)
* Signer RAW confirmations

* Returning address book as eth_accounts

* UI support for in-browser signing

* Post review fixes

* Adding new methods to jsonrpc

* Fixing eth_accounts

* Deterministic accounts ordering
2016-11-10 11:27:05 +01:00
Robert Habermeier
11e6b08f02 Move ethcore-light crate into ethcore/light module 2016-11-09 23:39:56 +01:00
Robert Habermeier
ebff010d16 partial implementation of provider for client types 2016-11-09 23:25:54 +01:00
Jaco Greeff
90ff810e36 Handle redirects from /api/content on manifest.json gracefully (#3315)
* Add redirect follow mode to manifest.json

* Remove (now) unused count parameter

* autoRewrite: true for dev mode proxy redirects
2016-11-09 20:05:08 +01:00
Tomasz Drwięga
88c9cea04d Dapps interface RPC (#3311)
* Dapps Interface RPC

* Adding JS apis

* Support for signer interface in proxypac and embeds

* Fixing tests

* fixing tests again
2016-11-09 19:41:47 +01:00
Arkadiy Paronyan
eba0dd5023 Additional snapshot sync checks (#3318)
* Additional snapshot sync checks

* Proper checks

* Proper highset block check
2016-11-09 19:40:36 +01:00
Jannis R
89c1d9c25c merge master into sms-verification-modal 2016-11-09 19:04:31 +01:00
Jannis R
cde9f454eb sms verification: polish UI 2016-11-09 19:04:13 +01:00
Jannis R
8028c0fd65 sms verification: check if already requested 2016-11-09 19:02:33 +01:00
Tomasz Drwięga
915766c7bf Fix spurious signer tests failures (#3312)
* Increasing sleep time for signer tests

* Attempt re-connections instead of delaying tests execution
2016-11-09 18:26:35 +01:00
Jaco Greeff
877cfe9b53 Fix signer token updates (#3302)
* Manual bump of package.json (recovery)

* Debug

* Simplify status connections
2016-11-09 18:26:10 +01:00
GitLab Build Bot
29aecc2cff [ci skip] js-precompiled 20161109-171832 2016-11-09 17:19:59 +00:00
Nicolas Gotchac
92333ab875 Merge pull request #3316 from ethcore/jg-update-phrase
Update account recovery phrase hint
2016-11-09 18:07:13 +01:00
Robert Habermeier
60a8728121 Merge branch 'master' into les-impl 2016-11-09 18:06:12 +01:00
Robert Habermeier
6c23d53f04 allow dead code temporarily 2016-11-09 18:05:56 +01:00
Robert Habermeier
25d5efac15 making announcements, clean up warnings 2016-11-09 18:05:00 +01:00
Jannis R
01cf88d71a sms verification: merge step 1 & 2 2016-11-09 18:02:33 +01:00
Gav Wood
4712b882e5 New transaction tests (#3313)
* Add new transaction tests.

* Add new test.
2016-11-09 18:02:24 +01:00
Jannis R
a42140edde sms verification: send confirmation tx 2016-11-09 17:34:21 +01:00
Jannis R
f08e2a4b17 sms verification: query code 2016-11-09 16:56:01 +01:00
Jannis R
7996ac47ec sms verification: polish UI, fix linting issues 👕 2016-11-09 16:55:59 +01:00
Jannis R
e7113e7eb4 sms verification: show fee in consent form 2016-11-09 16:54:57 +01:00
Jannis R
e84531f31c sms verification: refactor contract call 2016-11-09 16:54:57 +01:00
Jannis R
ebf742f2af sms verification: update contract address & ABI 2016-11-09 16:54:57 +01:00
Jannis R
a56a1d3aef sms verification: request SMS 2016-11-09 16:54:56 +01:00
Jannis R
4931381e0e txHash component: add maxConfirmations prop 2016-11-09 16:54:56 +01:00
Jannis R
3ef54f9172 sms verification: wait for tx confirmations 2016-11-09 16:54:56 +01:00
Jannis R
d0d737d1e3 sms verification: post request transaction 2016-11-09 16:54:56 +01:00
Jannis R
89a2917935 boilerplate for third step 2016-11-09 16:54:56 +01:00
Jannis R
4c199ef716 sms verification: collect data 2016-11-09 16:54:55 +01:00
Jannis R
14da2d2805 sms verification: check if certified 2016-11-09 16:54:55 +01:00
Jannis R
435d3c24db SendRequest -> GatherData 2016-11-09 16:54:55 +01:00
Jannis R
1a245405e5 query phone number & consent 2016-11-09 16:54:55 +01:00
Jannis R
fc76fa9252 sms verification: basic stepper 2016-11-09 16:54:54 +01:00
Jannis R
f96e69309f SMS verification modal 2016-11-09 16:54:54 +01:00
Jannis R
7cb724bfbe put SMS verification into action bar 2016-11-09 16:54:54 +01:00
Robert Habermeier
c132775bb1 handle announcements 2016-11-09 16:21:09 +01:00
Jaco Greeff
22faee2099 Update account recovery phrase hint 2016-11-09 15:48:45 +01:00
Robert Habermeier
ec1b982b52 errors, punishment, and handshake 2016-11-09 15:36:26 +01:00
GitLab Build Bot
599f214ad9 [ci skip] js-precompiled 20161109-132407 2016-11-09 13:25:39 +00:00
Jaco Greeff
95e03f87fa Remove 127.0.0.1 references (#3303) 2016-11-09 14:01:59 +01:00
arkpar
f568730aa8 Fixed MD5 generation 2016-11-09 13:44:48 +01:00
Arkadiy Paronyan
8ecbec8d6c Fixes for open UI after installation (#3300) 2016-11-09 13:17:57 +01:00
Arkadiy Paronyan
85ade4a2ec Fixed uncle details (#3299) 2016-11-09 13:17:40 +01:00
Jaco Greeff
b17ce6c9a5 Updated blance display with max decimals (#3266) 2016-11-09 13:16:17 +01:00
Tomasz Drwięga
b33b237f76 Refactoring Signer to auto_args + eth_signTransaction (#3261)
* Sign transaction initial

* Refactoring signer to auto_args
2016-11-09 13:13:35 +01:00
Björn Wagner
3c6f148a16 Fix typo (#3298) 2016-11-09 13:12:28 +01:00
GitLab Build Bot
29add4e40a [ci skip] js-precompiled 20161109-111303 2016-11-09 11:14:24 +00:00
Jaco Greeff
6a1b17d5a9 Change to more common focused spelling (#3264) 2016-11-09 11:53:40 +01:00
keorn
49f2a72d5d Merge branch 'master' into auth-round 2016-11-09 10:35:00 +00:00
arkpar
ad18a30535 Corrected startup executable 2016-11-09 01:14:32 +01:00
GitLab Build Bot
9325fe44f3 [ci skip] js-precompiled 20161108-234705 2016-11-08 23:48:24 +00:00
Jaco Greeff
044a3f409b Manual bump of package.json (recovery) (#3295) 2016-11-09 00:07:06 +01:00
Jaco Greeff
f9dc766ae2 Fix initial token generation (#3289)
* Fix initial token generation

* Remove extra debug info
2016-11-08 23:17:33 +01:00
Gav Wood
7b5824d4a2 Fixes for 1.4 (#3260)
* Fix --geth

* Fix mac installer.

* Fix up installer.

* Additional tweaks.

* Fix for empty APIs

* Another case of empty apis
2016-11-08 21:45:22 +01:00
Arkadiy Paronyan
f1e61c87b4 Fixed IO service shutdown (#3286) 2016-11-08 21:07:18 +01:00
keorn
4e36550890 message revamp 2016-11-08 18:01:31 +00:00
Robert Habermeier
ca25deb4e6 implement announcement serialization 2016-11-08 19:00:37 +01:00
Arkadiy Paronyan
b453ae1db2 Autostart checkbox (#3269) 2016-11-08 18:52:09 +01:00
Denis S. Soldatov aka General-Beck
d8eafa91b8 Update gitlab-ci
remove ubuntu 14.04
remove tags from js-release
2016-11-09 00:32:20 +07:00
Denis S. Soldatov aka General-Beck
82990ee464 Update gitlab-ci
skip js-release in nightly builds
[ci skip]
2016-11-08 23:46:22 +07:00
Robert Habermeier
b369cdd573 Merge branch 'master' into les-impl 2016-11-08 17:14:19 +01:00
Robert Habermeier
440f5e537f implement handshake parsing and creation 2016-11-08 17:13:43 +01:00
arkpar
b2fe406666 Updated signing path 2016-11-08 11:07:18 +01:00
Arkadiy Paronyan
318a3d29e1 Build tray app for x64 (#3255)
* Build tray app for x64

* Fixed command
2016-11-08 10:23:23 +01:00
Denis S. Soldatov aka General-Beck
7a657a2e85 Update gitlab-ci
remove trigger from js-release
[ci skip]
2016-11-08 14:50:30 +07:00
Jaco Greeff
51aa0e28eb Add secure flag back (#3244) 2016-11-07 20:07:08 +01:00
Robert Habermeier
d18bb9d152 verify chunk hashes in cli restore (#3241) 2016-11-07 19:33:55 +01:00
Robert Habermeier
4ba4861734 begin status module 2016-11-07 19:16:23 +01:00
Jaco Greeff
6ab6c0709d Load network apps manifests as contentHash (no coding) (#3235)
* Add mobx

* Use mobx store for dapps

* Cleanup hidden reads

* Remove (now) unused hidden.js

* _ denotes internal functions

* s/visibleApps/visible/

* AddDapps now use the mobx store as well

* Move modalOpen state to store

* Simplify

* Complete master merge

* Remove extra indirection

* Remove unneeded check

* Readability improvements

* Remove final debug info

* Load network manifests from the network

* Swallow manifest errors

* introduce fetchManifest
2016-11-07 18:08:16 +01:00
GitLab Build Bot
418474ad27 [ci skip] js-precompiled 20161107-170338 2016-11-07 17:04:56 +00:00
Arkadiy Paronyan
108452d082 Fixed some typos (#3236) 2016-11-07 17:42:17 +01:00
keorn
52ea597d6f Rename cli and config options signer->ui (#3232)
* rename options signer->ui

* rename config signer->ui
2016-11-07 17:40:53 +01:00
Denis S. Soldatov aka General-Beck
01602ec0b5 Update gitlab-ci
prepare to nightly builds
2016-11-07 23:16:34 +07:00
Robert Habermeier
051effe9f8 buffer flow basics, implement cost table 2016-11-07 15:40:34 +01:00
GitLab Build Bot
43ec40d572 [ci skip] js-precompiled 20161107-142633 2016-11-07 14:27:49 +00:00
Jaco Greeff
f0054aa201 Add store for dapps state (#3211)
* Add mobx

* Use mobx store for dapps

* Cleanup hidden reads

* Remove (now) unused hidden.js

* _ denotes internal functions

* s/visibleApps/visible/

* AddDapps now use the mobx store as well

* Move modalOpen state to store

* Simplify

* Complete master merge

* Remove extra indirection

* Remove unneeded check

* Readability improvements

* Remove final debug info
2016-11-07 15:22:46 +01:00
Denis S. Soldatov aka General-Beck
834c0703fe Update gitlab-ci
Add i686
cache optimization
add triggers
2016-11-07 21:07:37 +07:00
keorn
ea960f1c27 Merge remote-tracking branch 'parity/master' into bft 2016-11-07 11:34:45 +00:00
GitLab Build Bot
6388c814ea [ci skip] js-precompiled 20161107-113204 2016-11-07 11:33:25 +00:00
arkpar
8cad185a57 Set version to unstable 2016-11-07 12:10:29 +01:00
Robert Habermeier
d573ef3cc2 remove LESv2 requests 2016-11-06 20:02:15 +01:00
Robert Habermeier
44e36596c9 buffer flow scaffolding 2016-11-06 19:04:30 +01:00
GitLab Build Bot
eb0c92e8c8 [ci skip] js-precompiled 20161106-165954 2016-11-06 17:01:11 +00:00
GitLab Build Bot
a453f99885 [ci skip] js-precompiled 20161106-165021 2016-11-06 16:51:51 +00:00
Jaco Greeff
a4cc6058dd Don't push empty tags to input (#3222) 2016-11-06 17:42:50 +01:00
Jaco Greeff
44266115b6 Fix /parity-utils/{web3,parity}.js webpack errors (#3221)
* Don't override library builds

* Don't override libraries on build

* Enhance working blockNumber display
2016-11-06 17:42:25 +01:00
Björn Wagner
d8a95084cb Improve 'invalid raw key' error msg (#3219) 2016-11-06 17:31:26 +01:00
GitLab Build Bot
d172c83c26 [ci skip] js-precompiled 20161106-120902 2016-11-06 12:10:21 +00:00
Tomasz Drwięga
9c4979681c Cleaning up polluted namespaces (#3143)
* Renaming ethcore_ to parity_

* Renaming files

* Renaming poluted EthSigning

* Tidy up the namespaces

* Renaming files to match new structure

* Splitting EthSigning into separate traits

* jsapi move ethcore.* -> parity.*

* Move jsonrpc parity definitions

* Update UI API calls for parity interfaces

* Move jsapi signer interfaces from personal to signer

* Update UI to use signer.* where applicable

* Updsate jsapi subscriptions for signer

* Fix dodgy merge.

* Update README.

* Fix some tests.

* Move parity-only personal.* to parity.*

* Update UI for personal -> parity API moves

* Update subscription APIs after personal -> parity move

* personal. generateAuthorizationToken -> parity. generateAuthorizationToken (UI)

* enode, dappsPort & signerPort (UI)

* Update subscription tests (accountsInfo)

* subscription update

* personal -> parity

* Additional error logging on method failures

* move postTransaction to parity

* Additional debug info with method failures

* Fix personal tests.

* Console wrning shows parameters, error object does not

* Include parity_ signing methods.

* Console log http transport info

* Fix failing tests

* Add RPC stubs for parity_accounts.

* Allow some secure built-in dapps

* Use parity_accounts in place of accountsInfo

* Improve error reporting

* Cleanup GHH error handling
2016-11-06 12:51:53 +01:00
GitLab Build Bot
78f2d88182 [ci skip] js-precompiled 20161105-173004 2016-11-05 17:31:24 +00:00
Denis S. Soldatov aka General-Beck
19406fb0fa Update gitlab-ci
add $NIGTHLY to var
2016-11-06 00:07:08 +07:00
Denis S. Soldatov aka General-Beck
022a718b6f Update gitlab-ci 2016-11-06 00:02:44 +07:00
Denis S. Soldatov aka General-Beck
cb6003f40d Update gitlab-ci
$(git --no-pager diff --name-only HEAD HEAD@{1} | grep \.js | wc -l)
2016-11-05 22:39:51 +07:00
GitLab Build Bot
f2faf3609b [ci skip] js-precompiled 20161105-144817 2016-11-05 14:49:31 +00:00
Arkadiy Paronyan
77136b8f84 Set passive mode for first run only (#3214) 2016-11-05 14:38:04 +01:00
GitLab Build Bot
2cb41f96f5 [ci skip] js-precompiled 20161105-112525 2016-11-05 11:26:40 +00:00
Jaco Greeff
458ee4cbad Parity configuration settings, i.e. mode (#3212)
* Add initial page

* Add parity icon

* opacity for parity icon

* Mode selector

* Actually set mode when value changes
2016-11-05 12:08:14 +01:00
GitLab Build Bot
7b043047f0 [ci skip] js-precompiled 20161105-095429 2016-11-05 09:55:44 +00:00
Robert Habermeier
56fd88d1e8 ethash unsafety cleanup (#3210) 2016-11-05 10:39:15 +01:00
Gav Wood
744501c454 Mode improvements for UI (#3109)
* `--mode=off` now works.

* Add Mode::Off as a persistent CLI option.

* "last" not "auto" as default.

* Commit accidentally unsaved file.

* Whitespace

[ci:skip]

* Mode CLI parse fix

* or offline

* Save mode when it gets changed.

* Fix Offline mode

* Fix up mode operations.

* Make passive default, but not overriding.

* Fix test

* Maybe not everyone wants to run an archive node...
2016-11-05 10:38:00 +01:00
GitLab Build Bot
8351c5d500 [ci skip] js-precompiled 20161105-053734 2016-11-05 05:38:51 +00:00
GitLab Build Bot
0e9d70a85d [ci skip] js-precompiled 20161105-053249 2016-11-05 05:34:04 +00:00
Robert Habermeier
52abbc0643 experiment with answering requests 2016-11-04 23:50:56 +01:00
GitLab Build Bot
08d92fe3aa [ci skip] js-precompiled 20161104-222946 2016-11-04 22:31:01 +00:00
GitLab Build Bot
67715da827 [ci skip] js-precompiled 20161104-222646 2016-11-04 22:28:04 +00:00
GitLab Build Bot
20bb0e5f59 [ci skip] js-precompiled 20161104-222329 2016-11-04 22:24:43 +00:00
Igor Artamonov
2a19c33b8d delay bomb for Classic (ECIP-1010) (#3179)
* delay bomb for classic (ECIP-1010)

* formatting fix after core review, rel [e6b5093]
2016-11-04 23:09:23 +01:00
Jaco Greeff
c2e85dc4d5 Use ethcore_dappsPort when constructing URLs (#3139)
* Upon connect, retrieve the available api ports

* Update dapps to load from dappsPort

* Update dapps summary with dappsPort

* Allow proxy to use dappsPort

* Replace /api/ping with HEAD /

* Dynamic port for available apps

* Retrieve content images with dappsPort

* Fix /

* Transfer token dropdown image fix

* IdentityIcon loads images via contentHash

* Update apps fetch to cater for dev & prod

* DRY up 127.0.0.1:${dappsPort} with ${dappsUrl}
2016-11-04 23:08:12 +01:00
Jaco Greeff
f9f37f1c84 Add copy address button to Contract deploy (#3199)
* Allow copy of deployed address

* Pre-parse/clean JSON inputs

* Revert cleanup
2016-11-04 23:06:03 +01:00
GitLab Build Bot
9db28e12ac [ci skip] js-precompiled 20161104-191028 2016-11-04 19:11:43 +00:00
Jaco Greeff
83beedc27e expose api as window.secureApi (#3207) 2016-11-04 19:52:39 +01:00
Robert Habermeier
c1a6dbe75f Move all light client work to own crate 2016-11-04 19:40:11 +01:00
Robert Habermeier
5cabb3008f make verification module public 2016-11-04 19:21:48 +01:00
GitLab Build Bot
7f0310921d [ci skip] js-precompiled 20161104-175104 2016-11-04 17:52:19 +00:00
Robert Habermeier
edf17d00c4 revise light implementation strategy 2016-11-04 18:40:31 +01:00
Tomasz Drwięga
501b2cdd18 Add error for sendRawTransaction and estimateGas (#3194)
* sendRawTransaction invalid RLP error

* Returning proper error for estimate_gas
2016-11-04 18:33:10 +01:00
GitLab Build Bot
2563189316 [ci skip] js-precompiled 20161104-170459 2016-11-04 17:06:13 +00:00
Robert Habermeier
90a2c37977 handle unknown packet 2016-11-04 17:35:31 +01:00
Tomasz Drwięga
f31d42d0c5 Exposing engine extra info in block RPC (#3169)
* Exposing extra info in RPC

* Proper serialization and client trait API
2016-11-04 17:35:02 +01:00
Arkadiy Paronyan
d37f4cc82f v1.5 (#3195) 2016-11-04 17:27:11 +01:00
GitLab Build Bot
75d100476e [ci skip] js-precompiled 20161104-162426 2016-11-04 16:25:41 +00:00
Robert Habermeier
5d011fe577 new_list -> begin_list 2016-11-04 17:25:26 +01:00
Robert Habermeier
eef9a355af request definitions 2016-11-04 17:19:01 +01:00
Jaco Greeff
858962ca0d Remove dapp logos (GHH points to dapp-assets) (#3192) 2016-11-04 17:03:28 +01:00
Tomasz Drwięga
145e766db2 Fixing possible race condition in ethcore_hashContent (#3191) 2016-11-04 16:59:42 +01:00
keorn
a8b688b469 allow permanent unlock for internal sealing 2016-11-04 15:50:56 +00:00
keorn
0e5060db18 update schedule 2016-11-04 15:04:19 +00:00
Jaco Greeff
caab72394d Bump package.json version (1.5 is master) (#3193)
* Bump package.json version (1.5 is master)

* Updated maintainers
2016-11-04 15:58:44 +01:00
Gav Wood
0f16942186 EIP-155 update with Vitalik's new test vectors (#3166)
* Vitalik's new test vectors.

* Update to latest EIP155 spec.

* Fix txs.

* Another fix.
2016-11-04 15:13:51 +01:00
Robert Habermeier
1bc124f980 Merge branch 'master' into les-impl 2016-11-04 15:00:05 +01:00
keorn
9de910cf9c Merge branch 'master' into auth-round 2016-11-04 13:47:29 +00:00
GitLab Build Bot
df33aa920b [ci skip] js-precompiled 20161104-130943 2016-11-04 13:11:00 +00:00
GitLab Build Bot
67b1bde355 [ci skip] js-precompiled 20161104-121251 2016-11-04 12:14:06 +00:00
Jaco Greeff
e80771b3ca Back to real root (#3178) 2016-11-04 12:54:23 +01:00
Jaco Greeff
6667373a80 Remove extra cd js (#3177) 2016-11-04 12:45:50 +01:00
Nicolas Gotchac
bf94a5b82b Fixes #3171 (#3175) 2016-11-04 12:38:05 +01:00
keorn
255ec0c139 Merge branch 'master' into auth-round 2016-11-04 11:35:17 +00:00
Tomasz Drwięga
2e47842d66 Exposing state root and logsBloom in RPC receipts (#3174) 2016-11-04 12:33:13 +01:00
Tomasz Drwięga
7ff73a9533 Exposing v,r,s from transaction signature in RPC (#3172) 2016-11-04 12:05:10 +01:00
Jaco Greeff
fa875aed05 Push precompiled for beta/stable, npm only master (#3163)
* Push precompiled for beta/stable, npm only master

* Release to npm before comitting updates
2016-11-04 12:02:09 +01:00
GitLab Build Bot
f9274d178b [ci skip] js-precompiled 20161104-104936 2016-11-04 10:50:43 +00:00
Denis S. Soldatov aka General-Beck
3ae5ad1bea Update gitlab-ci
add $NIGHTLY ENV for future nightly builds
2016-11-04 17:29:21 +07:00
GitLab Build Bot
4b92881592 [ci skip] js-precompiled 20161104-094125 2016-11-04 09:42:28 +00:00
Denis S. Soldatov aka General-Beck
6f046f8d84 Update gitlab-ci
stages:
  - test
  - js-build
  - build
2016-11-04 16:16:40 +07:00
GitLab Build Bot
0ee332f8e2 [ci skip] js-precompiled 20161104-090141 2016-11-04 09:02:49 +00:00
Denis S. Soldatov aka General-Beck
514d2cb7db Update gilab-ci
js-release
  only:
    - master
    - beta
    - stable
    - tags
2016-11-04 15:59:17 +07:00
Tomasz Drwięga
68f60596dc Enabling personal RPC over IPC by default (#3165) 2016-11-04 09:58:39 +01:00
Denis S. Soldatov aka General-Beck
c532032372 Update README.MD (#3164)
Add badge build status from Gitlab CI -master
2016-11-04 09:58:08 +01:00
Arkadiy Paronyan
26b09b1513 Dependencies in README (#3162) 2016-11-04 09:57:47 +01:00
Gav Wood
af9de37756 Make the footer a bit less ugly. (#3160)
* Make the footer a bit less ugly.

* Whitespace.
2016-11-04 09:57:21 +01:00
GitLab Build Bot
155eb02c69 [ci skip] js-precompiled 20161104-085547 2016-11-04 08:56:51 +00:00
Denis S. Soldatov aka General-Beck
1ac002ec4d Update gitlab-ci
rename stages
2016-11-04 15:51:35 +07:00
Denis S. Soldatov aka General-Beck
27472dfe44 Update gitlab-ci
fix lint
remove rust-beta and rust-nightly test's
add new job 'js-test' 'js-build'
2016-11-04 15:46:27 +07:00
Denis S. Soldatov aka General-Beck
38bd84257f Update gitlab-ci
change tags `rust-test` - `rust-stable` etc
add rust stable, beta, nightly test's
2016-11-04 14:29:16 +07:00
Denis S. Soldatov aka General-Beck
8575dfdea6 Update gitlab-ci
fix lint error in gitlab-ci.yml
2016-11-04 14:01:13 +07:00
Denis S. Soldatov aka General-Beck
72a1db8d01 Update gilab-ci
1. Builds only  beta, stable, tags
2. test script for check js changes in `test-linux`
3. `js-test` and `js-release` only for jg* ng* ui* brances
2016-11-04 13:59:48 +07:00
GitLab Build Bot
a892fcd723 [ci skip] js-precompiled 20161104-063713 2016-11-04 06:38:42 +00:00
Administrator
065f3644b9 Update build-server.js 2016-11-04 07:35:42 +01:00
GitLab Build Bot
e267405893 [ci skip] js-precompiled 20161104-054932 2016-11-04 05:50:39 +00:00
Administrator
8dd3d628c6 Update .gitlab-ci.yml 2016-11-04 06:49:21 +01:00
Administrator
331b1be715 Update .gitlab-ci.yml 2016-11-04 06:45:26 +01:00
GitLab Build Bot
4f548952db [ci skip] js-precompiled 20161104-033042 2016-11-04 03:31:46 +00:00
Administrator
a1f6b86945 Update .gitlab-ci.yml 2016-11-04 04:25:48 +01:00
GitLab Build Bot
471bdf7c22 [ci skip] js-precompiled 20161103-235828 2016-11-03 23:59:34 +00:00
Jaco Greeff
71512cf90d Linux build case sensitivity fix (#3161) 2016-11-04 00:35:07 +01:00
Arkadiy Paronyan
e8b2635545 Version=beta (#3157) 2016-11-04 00:24:36 +01:00
GitLab Build Bot
084492e71e [ci skip] js-precompiled 20161103-215018 2016-11-03 21:51:28 +00:00
keorn
12125dcfee Merge branch 'master' into auth-round 2016-11-03 16:51:38 +00:00
keorn
045a65c99c Merge remote-tracking branch 'auth/auth-round-no-mocknet' into auth-round 2016-11-02 17:43:54 +00:00
keorn
00a3619392 header methods 2016-11-02 17:42:56 +00:00
keorn
b2a3851972 Merge remote-tracking branch 'auth/auth-round-no-mocknet' into auth-round 2016-11-02 17:22:41 +00:00
keorn
03c9760de2 Merge remote-tracking branch 'parity/master' into auth-round-no-mocknet 2016-11-02 13:01:31 +00:00
keorn
26155f51d5 proper calculation of remaining step time 2016-11-02 12:13:47 +00:00
keorn
da3253133c ignore block timeout when sealing internally 2016-11-02 12:13:12 +00:00
keorn
3a6b56e99c check double signing, tracing 2016-11-01 18:12:06 +00:00
keorn
a33e2f2e0d fix deadlock after merge 2016-11-01 17:52:52 +00:00
keorn
fc4664ab12 Merge branch 'master' into auth-round-no-mocknet 2016-10-30 21:18:52 +00:00
keorn
37ca1fa497 Merge remote-tracking branch 'parity/master' 2016-10-30 20:45:28 +00:00
keorn
7976f46231 Merge branch 'master' into auth-round-no-mocknet 2016-10-28 17:53:23 +01:00
keorn
63cc5c0e60 Merge remote-tracking branch 'parity/master' 2016-10-28 17:52:48 +01:00
Robert Habermeier
3a5843c40f skeleton and request traits 2016-10-27 15:45:59 +02:00
Robert Habermeier
a7e420d9ec stub implementation of provider for client 2016-10-27 15:09:17 +02:00
keorn
3ff26dd544 Merge branch 'master' into auth-round-no-mocknet 2016-10-26 17:50:04 +01:00
Nicolas Gotchac
6b2cffd312 Merge branch 'master' into ng-accounts-backup 2016-10-26 18:43:05 +02:00
Nicolas Gotchac
e018739ba9 Removed unused Format => Use JSON for Export 2016-10-26 18:42:52 +02:00
keorn
4ee669b77e Merge remote-tracking branch 'parity/master' 2016-10-26 16:53:30 +01:00
Robert Habermeier
4b82392371 merge with master 2016-10-26 14:17:13 +02:00
Nicolas Gotchac
1b0a87cdde Removed CSV Export option (#2147) 2016-10-26 11:59:25 +02:00
Nicolas Gotchac
61f41cdbe2 Add exporting to CSV (#2147) 2016-10-25 18:26:47 +02:00
Nicolas Gotchac
92bdfb1234 Add Export button to Accounts (#2147) 2016-10-25 18:06:05 +02:00
keorn
aa05823afe Merge remote-tracking branch 'parity/master' into auth-round-no-mocknet 2016-10-24 15:32:30 +01:00
keorn
303f922ebd steps based on unix epoch 2016-10-15 13:55:10 +01:00
keorn
44f42ac7d3 Merge remote-tracking branch 'parity/master' into auth-round-no-mocknet
Conflicts:
	ethcore/src/state/mod.rs
	ethcore/src/tests/mod.rs
2016-10-12 18:39:31 +01:00
keorn
214916a414 new vote counter 2016-10-11 18:38:05 +01:00
keorn
e343153f06 mixed merge and changes... 2016-10-11 18:37:31 +01:00
Robert Habermeier
91f0c6896c LES boilerplate 2016-10-10 18:48:47 +02:00
keorn
1f56588b87 Merge remote-tracking branch 'parity/master' into bft
Conflicts:
	ethcore/src/client/client.rs
2016-10-05 14:57:14 +01:00
Robert Habermeier
8d7244c09f light client sync stubs 2016-10-05 15:35:31 +02:00
keorn
096b71feb2 add Vote generation 2016-10-05 14:33:07 +01:00
keorn
cb2c9938a1 keep author as validator 2016-10-05 14:32:15 +01:00
keorn
64d7bcbd0c validators -> authorities 2016-10-05 14:31:31 +01:00
keorn
a03db2ff29 add is_new_best method to engines 2016-10-05 14:30:44 +01:00
keorn
67c24dcb95 use Engine to order blockchain 2016-10-05 14:29:35 +01:00
Robert Habermeier
ed06572bd4 Light provider trait 2016-10-05 13:22:49 +02:00
Robert Habermeier
e3c4695274 stub implementations of light client trait 2016-10-05 13:21:07 +02:00
Robert Habermeier
8a5576d133 balance rates of draining and importing 2016-10-05 12:10:28 +02:00
Robert Habermeier
abbf3b3c58 verification-rate based thread scaling 2016-10-04 20:09:54 +02:00
Robert Habermeier
2d28c703d6 reuse add_verifier instrumentation, rolling sample of 5 ticks 2016-10-03 20:39:52 +02:00
Robert Habermeier
5e382602dd fix logging accuracy 2016-10-03 20:09:57 +02:00
Robert Habermeier
a7b5dff252 ethash unsafety cleanup 2016-10-03 19:47:07 +02:00
Robert Habermeier
2d907f3322 auto-adjust number of verification threads 2016-10-03 19:41:00 +02:00
keorn
76d7ec84bb new block ordering engine method 2016-09-30 14:43:52 +01:00
keorn
9ca938f740 Merge remote-tracking branch 'parity/master' into bft
Conflicts:
	ethcore/src/client/client.rs
	sync/src/api.rs
2016-09-30 12:44:52 +01:00
keorn
8a51ae02aa simplify seal 2016-09-30 12:22:46 +01:00
keorn
d59e9e816e fix tests compilation 2016-09-29 16:57:52 +01:00
keorn
d085146254 separate params out 2016-09-29 15:32:49 +01:00
keorn
6cbb859bd2 add tendermint message types and deserialization 2016-09-29 14:44:42 +01:00
keorn
7e1d7148c7 block time in decimal 2016-09-27 16:06:13 +01:00
keorn
1c801c99af revert random path drop panic 2016-09-27 15:54:10 +01:00
keorn
28cf91c7a5 remove mocknet stuff, clean up debug 2016-09-27 15:50:16 +01:00
keorn
0c69d4a1ce Merge remote-tracking branch 'parity/master' into auth-round
Conflicts:
	devtools/src/random_path.rs
2016-09-27 12:39:25 +02:00
keorn
fd6900bbb3 Merge remote-tracking branch 'parity/master' into bft
Conflicts:
	Cargo.lock
2016-09-27 12:37:43 +02:00
keorn
5fac941738 Merge remote-tracking branch 'parity/master' 2016-09-27 12:14:40 +02:00
keorn
cf88641f99 more mocknet tests 2016-09-27 12:13:21 +02:00
keorn
ec058cdb50 reseal on timeout 2016-09-27 12:12:18 +02:00
keorn
c57e3cefe4 sync check method 2016-09-21 10:29:44 +02:00
keorn
9d23915caf more simulation methods 2016-09-20 15:48:17 +02:00
keorn
44c4845d84 fix up step switching test 2016-09-19 18:40:25 +02:00
keorn
d84f94975f add proposer step to seal 2016-09-19 18:00:39 +02:00
keorn
7f177f27d8 revert dummy_client changes 2016-09-19 14:52:43 +02:00
keorn
49fba0b548 Merge branch 'master' into auth-round
Conflicts:
	ethcore/src/miner/miner.rs
	sync/Cargo.toml
2016-09-19 14:35:44 +02:00
keorn
551b5d7b6c Merge remote-tracking branch 'parity/master' 2016-09-19 14:33:59 +02:00
keorn
ce3e8750c9 additional consensus test 2016-09-19 14:33:11 +02:00
keorn
49b8e144fd initial mocknet with chain notify 2016-09-19 10:43:01 +02:00
keorn
fdcda41280 add tracing 2016-09-19 10:42:36 +02:00
keorn
6af888f9e4 disable TemporaryPath panic 2016-09-19 10:41:35 +02:00
keorn
c6c45db1d0 add devtools dependency 2016-09-19 10:41:01 +02:00
keorn
b31e732ebe temporary is_sealer check disable 2016-09-19 10:39:57 +02:00
keorn
b144bd2b84 add tracing 2016-09-19 10:38:47 +02:00
keorn
3419549c16 revamp dummy_client to take accounts 2016-09-14 17:30:57 +02:00
keorn
44fe864826 new highway to miner, set_author 2016-09-14 17:30:09 +02:00
keorn
d3ec8588c4 new constructor that takes AccountProvider 2016-09-14 17:29:35 +02:00
keorn
bb59c2288e docs on authority spec 2016-09-14 17:28:57 +02:00
keorn
c482b8ffb6 enable sealing only is authority 2016-09-14 17:28:15 +02:00
keorn
a44e2b0497 Merge remote-tracking branch 'parity/should-seal' into auth-round 2016-09-14 14:38:47 +02:00
keorn
7c82a10ecc fix typo 2016-09-14 14:34:47 +02:00
keorn
c6c951dd15 Merge remote-tracking branch 'parity/should-seal' into auth-round 2016-09-14 14:05:17 +02:00
keorn
68fd862671 simplify constructors 2016-09-14 13:56:28 +02:00
keorn
b2c0a9d531 introduce ethkey dependency to generate txs 2016-09-14 11:26:39 +02:00
keorn
faa9c7fb1b add new TestNet transaction issuing 2016-09-14 11:25:23 +02:00
keorn
7eac946fdb remove unused original TestNet method 2016-09-14 11:24:38 +02:00
keorn
28a088eea7 add client own_tx import through client 2016-09-14 11:22:43 +02:00
keorn
bedbe6e65e update test spec loading 2016-09-14 11:20:22 +02:00
keorn
ddb6fec171 add new test specs 2016-09-14 11:17:39 +02:00
keorn
7f05021075 Merge remote-tracking branch 'parity/should-seal' into auth-round 2016-09-14 10:59:33 +02:00
keorn
0880d4ad8f method to check if default address is_sealer 2016-09-14 10:49:44 +02:00
keorn
2bd82269e8 add tests, keep track of engine sealing status 2016-09-14 00:00:26 +02:00
keorn
fef94205e3 enable internal sealing based on author 2016-09-13 19:59:34 +02:00
keorn
bdba4230aa Merge remote-tracking branch 'parity/master' 2016-09-13 16:01:51 +02:00
keorn
099468107e Merge remote-tracking branch 'parity/master' into auth-round 2016-09-13 16:01:19 +02:00
keorn
da2f117aef new test_net holding Client 2016-09-13 15:58:32 +02:00
keorn
eee6be1ce3 implement new predicate trait 2016-09-13 14:23:52 +02:00
keorn
6a33f8b369 state constructor used only in tests 2016-09-13 14:22:44 +02:00
keorn
67601327af make test helpers not test, add some docs 2016-09-13 14:21:12 +02:00
keorn
8b9e7c0ba5 Merge remote-tracking branch 'parity/split-internal-seal' into auth-round 2016-09-13 12:57:52 +02:00
keorn
e41b6c410f split requires_reseal, add test and new test miner 2016-09-13 12:52:14 +02:00
keorn
1e20716bf9 Merge remote-tracking branch 'parity/split-internal-seal' into auth-round 2016-09-12 12:50:50 +02:00
keorn
4bfdeea9e5 More docs about sealing types. Bypass work in external txs. 2016-09-12 12:46:03 +02:00
keorn
d98f69cf58 Merge remote-tracking branch 'parity/split-internal-seal' into auth-round 2016-09-12 11:36:16 +02:00
keorn
d6e5637459 Merge branch 'master' into split-internal-seal 2016-09-12 11:11:42 +02:00
keorn
c0201bd891 replace cli with engine method, simplify 2016-09-12 11:07:40 +02:00
keorn
cadca6403a Split internal sealing from work sealing, add cli option 2016-09-11 13:23:32 +02:00
keorn
4e75686ef8 separate block preparation methods 2016-09-10 14:41:41 +02:00
keorn
965dde8223 enable TestNet with custom spec 2016-09-09 11:49:03 +02:00
keorn
fc3d01ec71 add tests, fixes, simplifications 2016-09-08 16:27:54 +02:00
keorn
747898d8e7 add new engine to spec 2016-09-08 12:28:59 +02:00
keorn
3a68fab066 new simple authority engine 2016-09-08 12:12:24 +02:00
keorn
c31eab53ea add non renewing timer 2016-09-08 10:36:19 +02:00
keorn
9fe62d9750 adjust default timeouts 2016-09-08 10:31:46 +02:00
keorn
4ccbec1148 Merge remote-tracking branch 'parity/master' into bft
Conflicts:
	sync/src/api.rs
	sync/src/lib.rs
2016-09-07 16:54:39 +02:00
keorn
ba21bafd7b tests and fixes 2016-09-07 16:25:42 +02:00
keorn
45e6b4ac9d seal generation and verificatio 2016-09-06 12:26:06 +02:00
keorn
91fbaf935c Merge remote-tracking branch 'parity/master' into bft
Conflicts:
	ethcore/src/client/client.rs
2016-09-05 18:16:09 +02:00
keorn
0af4bf23a9 add internal timeout service, test proposer switching 2016-09-05 17:51:29 +02:00
keorn
8851acec7c fix propose collect locking 2016-09-05 17:06:43 +02:00
keorn
83c371e6d4 add non renewing timer 2016-09-01 14:12:26 +02:00
keorn
0fcbf8d99f fix after merge 2016-08-31 18:43:24 +02:00
keorn
2f3d162f57 Merge remote-tracking branch 'parity/master' into bft 2016-08-31 18:19:24 +02:00
keorn
e475d0bf4c initial timeouts 2016-08-31 18:18:02 +02:00
keorn
d7499044e3 move seal into commit 2016-08-29 14:32:37 +02:00
keorn
4025645188 accumulate seal in precommit 2016-08-29 12:09:51 +02:00
keorn
a12a764d6c add rounds check, simplify tests 2016-08-26 19:27:50 +02:00
keorn
f60d4645ed move vote with addresses, remove recover check 2016-08-26 19:27:02 +02:00
keorn
a4ba7262ad update Signature and ipc usage 2016-08-26 13:16:56 +02:00
keorn
e7a9bf4df8 impl Clone for Signature 2016-08-26 11:27:54 +02:00
keorn
2cc2bd6518 impl Hash for Signature 2016-08-26 10:40:00 +02:00
keorn
8bd0034ced Merge remote-tracking branch 'parity/master' into bft
Conflicts:
	ethcore/src/error.rs
2016-08-25 19:24:29 +02:00
keorn
fcae03e55f propose message test 2016-08-25 19:22:10 +02:00
keorn
77f06be7fb fix error propagation 2016-08-24 15:55:47 +02:00
keorn
1cb3c164da propose step 2016-08-24 11:58:49 +02:00
keorn
99a143eb37 change broadcast interface, add basic message handling 2016-08-23 17:19:23 +02:00
arkpar
207f9d02f2 Started inf networking 2016-08-23 15:52:05 +02:00
keorn
535c502771 delete old test 2016-08-23 15:44:01 +02:00
keorn
3aa862c9c2 add test, start tendermint 2016-08-23 12:58:40 +02:00
keorn
3515a72fa0 proposal vote collector 2016-08-22 20:00:41 +02:00
keorn
89011dcc34 fix locking patterns, add simple test 2016-08-22 17:33:04 +02:00
keorn
2f5aeda44f reusable voting on hashes 2016-08-22 13:19:23 +02:00
keorn
a20a0de48f add spec 2016-08-21 15:28:40 +02:00
keorn
74939a43d6 fix types and lifetimes 2016-08-21 15:27:39 +02:00
keorn
8da38fa98b intro simple seal bft engine 2016-08-19 17:18:30 +02:00
2032 changed files with 97597 additions and 38513 deletions

2
.gitignore vendored
View File

@@ -32,3 +32,5 @@
out/
.vscode
/parity.*

View File

@@ -1,4 +1,7 @@
stages:
- test
- js-build
- push-release
- build
variables:
GIT_DEPTH: "3"
@@ -7,31 +10,36 @@ variables:
RUSTFLAGS: ""
CARGOFLAGS: ""
cache:
key: "$CI_BUILD_NAME/$CI_BUILD_REF_NAME"
key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
untracked: true
linux-stable:
stage: build
image: ethcore/rust:stable
only:
- master
- beta
- tags
- stable
- triggers
script:
- cargo build --release $CARGOFLAGS
- cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity
- md5sum target/release/parity >> parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity)
- md5sum target/release/parity > parity.md5
- sh scripts/deb-build.sh amd64
- cp target/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_amd64.deb"
- md5sum "parity_"$VER"_amd64.deb" >> "parity_"$VER"_amd64.deb.md5"
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity --body target/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity.md5 --body parity.md5
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/"parity_"$VER"_amd64.deb" --body "parity_"$VER"_amd64.deb"
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/"parity_"$VER"_amd64.deb.md5" --body "parity_"$VER"_amd64.deb.md5"
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity --body target/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/"parity_"$VER"_amd64.deb" --body "parity_"$VER"_amd64.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/"parity_"$VER"_amd64.deb.md5" --body "parity_"$VER"_amd64.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
tags:
- rust
- rust-stable
@@ -39,46 +47,51 @@ linux-stable:
paths:
- target/release/parity
name: "stable-x86_64-unknown-linux-gnu_parity"
linux-stable-14.04:
linux-stable-debian:
stage: build
image: ethcore/rust-14.04:latest
image: ethcore/rust-debian:latest
only:
- master
- beta
- tags
- stable
- triggers
script:
- cargo build --release $CARGOFLAGS
- cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity
- md5sum target/release/parity >> parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity)
- md5sum target/release/parity > parity.md5
- sh scripts/deb-build.sh amd64
- cp target/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_amd64.deb"
- md5sum "parity_"$VER"_amd64.deb" >> "parity_"$VER"_amd64.deb.md5"
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-ubuntu_14_04-gnu/parity --body target/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-ubuntu_14_04-gnu/parity.md5 --body parity.md5
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-ubuntu_14_04-gnu/"parity_"$VER"_amd64.deb" --body "parity_"$VER"_amd64.deb"
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-ubuntu_14_04-gnu/"parity_"$VER"_amd64.deb.md5" --body "parity_"$VER"_amd64.deb.md5"
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/parity --body target/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/"parity_"$VER"_amd64.deb" --body "parity_"$VER"_amd64.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu/"parity_"$VER"_amd64.deb.md5" --body "parity_"$VER"_amd64.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/x86_64-unknown-debian-gnu
tags:
- rust
- rust-14.04
- rust-debian
artifacts:
paths:
- target/release/parity
name: "stable-x86_64-unknown-ubuntu_14_04-gnu_parity"
name: "stable-x86_64-unknown-debian-gnu_parity"
linux-beta:
stage: build
image: ethcore/rust:beta
only:
- master
- beta
- tags
- stable
- triggers
script:
- cargo build --release $CARGOFLAGS
- cargo build -j $(nproc) --release $CARGOFLAGS
- strip target/release/parity
tags:
- rust
@@ -92,12 +105,12 @@ linux-nightly:
stage: build
image: ethcore/rust:nightly
only:
- master
- beta
- tags
- stable
- triggers
script:
- cargo build --release $CARGOFLAGS
- cargo build -j $(nproc) --release $CARGOFLAGS
- strip target/release/parity
tags:
- rust
@@ -111,20 +124,26 @@ linux-centos:
stage: build
image: ethcore/rust-centos:latest
only:
- master
- beta
- tags
- stable
- triggers
script:
- export CXX="g++"
- export CC="gcc"
- cargo build --release $CARGOFLAGS
- export PLATFORM=x86_64-unknown-centos-gnu
- cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity
- md5sum target/release/parity >> parity.md5
- md5sum target/release/parity > parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity)
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity --body target/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity.md5 --body parity.md5
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-centos
@@ -132,6 +151,46 @@ linux-centos:
paths:
- target/release/parity
name: "x86_64-unknown-centos-gnu_parity"
linux-i686:
stage: build
image: ethcore/rust-i686:latest
only:
- beta
- tags
- stable
- triggers
script:
- export HOST_CC=gcc
- export HOST_CXX=g++
- export COMMIT=$(git rev-parse HEAD)
- export PLATFORM=i686-unknown-linux-gnu
- cargo build -j $(nproc) --target i686-unknown-linux-gnu --features final --release $CARGOFLAGS
- strip target/$PLATFORM/release/parity
- md5sum target/$PLATFORM/release/parity > parity.md5
- export SHA3=$(target/$PLATFORM/release/parity tools hash target/$PLATFORM/release/parity)
- sh scripts/deb-build.sh i386
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_i386.deb"
- md5sum "parity_"$VER"_i386.deb" > "parity_"$VER"_i386.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_i386.deb" --body "parity_"$VER"_i386.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_i386.deb.md5" --body "parity_"$VER"_i386.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-i686
artifacts:
paths:
- target/i686-unknown-linux-gnu/release/parity
name: "i686-unknown-linux-gnu"
allow_failure: true
linux-armv7:
stage: build
image: ethcore/rust-armv7:latest
@@ -139,30 +198,37 @@ linux-armv7:
- beta
- tags
- stable
- triggers
script:
- export CC=arm-linux-gnueabihf-gcc
- export CXX=arm-linux-gnueabihf-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=armv7-unknown-linux-gnueabihf
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.armv7-unknown-linux-gnueabihf]" >> .cargo/config
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build --target armv7-unknown-linux-gnueabihf --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/armv7-unknown-linux-gnueabihf/release/parity
- md5sum target/armv7-unknown-linux-gnueabihf/release/parity >> parity.md5
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- sh scripts/deb-build.sh armhf
- cp target/armv7-unknown-linux-gnueabihf/release/parity deb/usr/bin/parity
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_armhf.deb"
- md5sum "parity_"$VER"_armhf.deb" >> "parity_"$VER"_armhf.deb.md5"
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/armv7-unknown-linux-gnueabihf/parity --body target/armv7-unknown-linux-gnueabihf/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/armv7-unknown-linux-gnueabihf/parity.md5 --body parity.md5
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/armv7-unknown-linux-gnueabihf/"parity_"$VER"_armhf.deb" --body "parity_"$VER"_armhf.deb"
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/armv7-unknown-linux-gnueabihf/"parity_"$VER"_armhf.deb.md5" --body "parity_"$VER"_armhf.deb.md5"
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb" --body "parity_"$VER"_armhf.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb.md5" --body "parity_"$VER"_armhf.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
@@ -178,30 +244,37 @@ linux-arm:
- beta
- tags
- stable
- triggers
script:
- export CC=arm-linux-gnueabihf-gcc
- export CXX=arm-linux-gnueabihf-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=arm-unknown-linux-gnueabihf
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.arm-unknown-linux-gnueabihf]" >> .cargo/config
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build --target arm-unknown-linux-gnueabihf --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/arm-unknown-linux-gnueabihf/release/parity
- md5sum target/arm-unknown-linux-gnueabihf/release/parity >> parity.md5
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- sh scripts/deb-build.sh armhf
- cp target/arm-unknown-linux-gnueabihf/release/parity deb/usr/bin/parity
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_armhf.deb"
- md5sum "parity_"$VER"_armhf.deb" >> "parity_"$VER"_armhf.deb.md5"
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/arm-unknown-linux-gnueabihf/parity --body target/arm-unknown-linux-gnueabihf/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/arm-unknown-linux-gnueabihf/parity.md5 --body parity.md5
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/arm-unknown-linux-gnueabihf/"parity_"$VER"_armhf.deb" --body "parity_"$VER"_armhf.deb"
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/arm-unknown-linux-gnueabihf/"parity_"$VER"_armhf.deb.md5" --body "parity_"$VER"_armhf.deb.md5"
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb" --body "parity_"$VER"_armhf.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb.md5" --body "parity_"$VER"_armhf.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
@@ -214,26 +287,33 @@ linux-armv6:
stage: build
image: ethcore/rust-armv6:latest
only:
- beta
- tags
- stable
# - beta
# - tags
# - stable
# - triggers
script:
- export CC=arm-linux-gnueabi-gcc
- export CXX=arm-linux-gnueabi-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=arm-unknown-linux-gnueabi
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.arm-unknown-linux-gnueabi]" >> .cargo/config
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabi-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build --target arm-unknown-linux-gnueabi --release $CARGOFLAGS
- arm-linux-gnueabi-strip target/arm-unknown-linux-gnueabi/release/parity
- md5sum target/arm-unknown-linux-gnueabi/release/parity >> parity.md5
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- arm-linux-gnueabi-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/arm-unknown-linux-gnueabi/parity --body target/arm-unknown-linux-gnueabi/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/arm-unknown-linux-gnueabi/parity.md5 --body parity.md5
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
@@ -249,30 +329,36 @@ linux-aarch64:
- beta
- tags
- stable
- triggers
script:
- export CC=aarch64-linux-gnu-gcc
- export CXX=aarch64-linux-gnu-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=aarch64-unknown-linux-gnu
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.aarch64-unknown-linux-gnu]" >> .cargo/config
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"aarch64-linux-gnu-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build --target aarch64-unknown-linux-gnu --release $CARGOFLAGS
- aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/parity
- md5sum target/aarch64-unknown-linux-gnu/release/parity >> parity.md5
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- aarch64-linux-gnu-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- sh scripts/deb-build.sh arm64
- cp target/aarch64-unknown-linux-gnu/release/parity deb/usr/bin/parity
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_arm64.deb"
- md5sum "parity_"$VER"_arm64.deb" >> "parity_"$VER"_arm64.deb.md5"
- md5sum "parity_"$VER"_arm64.deb" > "parity_"$VER"_arm64.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/aarch64-unknown-linux-gnu/parity --body target/aarch64-unknown-linux-gnu/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/aarch64-unknown-linux-gnu/parity.md5 --body parity.md5
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/aarch64-unknown-linux-gnu/"parity_"$VER"_arm64.deb" --body "parity_"$VER"_arm64.deb"
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/aarch64-unknown-linux-gnu/"parity_"$VER"_arm64.deb.md5" --body "parity_"$VER"_arm64.deb.md5"
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_arm64.deb" --body "parity_"$VER"_arm64.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_arm64.deb.md5" --body "parity_"$VER"_arm64.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
@@ -287,14 +373,29 @@ darwin:
- beta
- tags
- stable
script:
- cargo build --release $CARGOFLAGS
- rm -rf parity.md5
- md5sum target/release/parity >> parity.md5
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-apple-darwin/parity --body target/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-apple-darwin/parity.md5 --body parity.md5
- triggers
script: |
export COMMIT=$(git rev-parse HEAD)
export PLATFORM=x86_64-apple-darwin
cargo build -j 8 --features final --release #$CARGOFLAGS
cargo build -j 8 --features final --release -p ethstore #$CARGOFLAGS
rm -rf parity.md5
md5sum target/release/parity > parity.md5
export SHA3=$(target/release/parity tools hash target/release/parity)
packagesbuild -v mac/Parity.pkgproj
export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
mv target/release/Parity\ Ethereum.pkg "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg"
md5sum "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg" >> "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg.md5"
aws configure set aws_access_key_id $s3_key
aws configure set aws_secret_access_key $s3_secret
if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/release/parity
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity-"$VER"-osx-installer-EXPERIMENTAL.pkg" --body "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg"
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity-"$VER"-osx-installer-EXPERIMENTAL.pkg.md5" --body "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg.md5"
curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- osx
artifacts:
@@ -302,23 +403,30 @@ darwin:
- target/release/parity
name: "x86_64-apple-darwin_parity"
windows:
cache:
key: "%CI_BUILD_STAGE%/%CI_BUILD_REF_NAME%"
untracked: true
stage: build
only:
- beta
- tags
- stable
- triggers
script:
- set PLATFORM=x86_64-pc-windows-msvc
- set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
- set LIB=C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64
- set RUST_BACKTRACE=1
- set RUSTFLAGS=%RUSTFLAGS% -Zorbit=off
- rustup default stable-x86_64-pc-windows-msvc
- cargo build --release %CARGOFLAGS%
- set RUSTFLAGS=%RUSTFLAGS%
- rustup default 1.14.0-x86_64-pc-windows-msvc
- cargo build --features final --release #%CARGOFLAGS%
- signtool sign /f %keyfile% /p %certpass% target\release\parity.exe
- target\release\parity.exe tools hash target\release\parity.exe > parity.sha3
- set /P SHA3=<parity.sha3
- curl -sL --url "https://github.com/ethcore/win-build/raw/master/SimpleFC.dll" -o nsis\SimpleFC.dll
- curl -sL --url "https://github.com/ethcore/win-build/raw/master/vc_redist.x64.exe" -o nsis\vc_redist.x64.exe
- signtool sign /f %keyfile% /p %certpass% target\release\parity.exe
- msbuild windows\ptray\ptray.vcxproj /p:Platform=x86 /p:Configuration=Release
- signtool sign /f %keyfile% /p %certpass% windows\ptray\release\ptray.exe
- msbuild windows\ptray\ptray.vcxproj /p:Platform=x64 /p:Configuration=Release
- signtool sign /f %keyfile% /p %certpass% windows\ptray\x64\release\ptray.exe
- cd nsis
- makensis.exe installer.nsi
- copy installer.exe InstallParity.exe
@@ -334,14 +442,22 @@ windows:
- cd ..\..
- aws configure set aws_access_key_id %s3_key%
- aws configure set aws_secret_access_key %s3_secret%
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe --body target\release\parity.exe
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe.md5 --body target\release\parity.exe.md5
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.zip --body target\release\parity.zip
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.zip.md5 --body target\release\parity.zip.md5
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/InstallParity.exe --body nsis\InstallParity.exe
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/InstallParity.exe.md5 --body nsis\InstallParity.exe.md5
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/win-installer.zip --body nsis\win-installer.zip
- aws s3api put-object --bucket builds-parity --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/win-installer.zip.md5 --body nsis\win-installer.zip.md5
- echo %CI_BUILD_REF_NAME%
- echo %CI_BUILD_REF_NAME% | findstr /R "master" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
- echo %CI_BUILD_REF_NAME% | findstr /R "beta" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
- echo %CI_BUILD_REF_NAME% | findstr /R "stable" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
- echo %S3_BUCKET%
- aws s3 rm --recursive s3://%S3_BUCKET%/%CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe --body target\release\parity.exe
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe.md5 --body target\release\parity.exe.md5
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.zip --body target\release\parity.zip
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.zip.md5 --body target\release\parity.zip.md5
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/InstallParity.exe --body nsis\InstallParity.exe
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/InstallParity.exe.md5 --body nsis\InstallParity.exe.md5
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/win-installer.zip --body nsis\win-installer.zip
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/win-installer.zip.md5 --body nsis\win-installer.zip.md5
- curl --data "commit=%CI_BUILD_REF%&sha3=%SHA3%&filename=parity.exe&secret=%RELEASES_SECRET%" http://update.parity.io:1337/push-build/%CI_BUILD_REF_NAME%/%PLATFORM%
- curl --data "commit=%CI_BUILD_REF%&sha3=%SHA3%&filename=parity.exe&secret=%RELEASES_SECRET%" http://update.parity.io:1338/push-build/%CI_BUILD_REF_NAME%/%PLATFORM%
tags:
- rust-windows
artifacts:
@@ -350,54 +466,121 @@ windows:
- target/release/parity.pdb
- nsis/InstallParity.exe
name: "x86_64-pc-windows-msvc_parity"
#test-darwin:
# stage: build
# before_script:
# - git submodule update --init --recursive
# script:
# - export RUST_BACKTRACE=1
# - ./test.sh $CARGOFLAGS --no-release
# tags:
# - osx
#test-windows:
# stage: build
# before_script:
# - git submodule update --init --recursive
# script:
# - set RUST_BACKTRACE=1
# - cargo test --features json-tests -p rlp -p ethash -p ethcore -p ethcore-bigint -p ethcore-dapps -p ethcore-rpc -p ethcore-signer -p ethcore-util -p ethcore-network -p ethcore-io -p ethkey -p ethstore -p ethsync -p ethcore-ipc -p ethcore-ipc-tests -p ethcore-ipc-nano -p parity %CARGOFLAGS% --verbose --release
# tags:
# - rust-windows
# allow_failure: true
test-linux:
docker-build:
stage: build
only:
- tags
before_script:
- docker info
script:
- cd docker/hub
- docker login -u $Docker_Hub_User -p $Docker_Hub_Pass
- docker build --tag ethcore/parity:$CI_BUILD_REF_NAME .
- docker push ethcore/parity:$CI_BUILD_REF_NAME
tags:
- docker
test-darwin:
stage: test
only:
- triggers
before_script:
- git submodule update --init --recursive
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
script:
- export RUST_BACKTRACE=1
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
tags:
- osx
allow_failure: true
test-windows:
stage: test
only:
- triggers
before_script:
- git submodule update --init --recursive
script:
- export RUST_BACKTRACE=1
- ./test.sh $CARGOFLAGS --no-release
- set RUST_BACKTRACE=1
- echo cargo test --features json-tests -p rlp -p ethash -p ethcore -p ethcore-bigint -p ethcore-dapps -p ethcore-rpc -p ethcore-signer -p ethcore-util -p ethcore-network -p ethcore-io -p ethkey -p ethstore -p ethsync -p ethcore-ipc -p ethcore-ipc-tests -p ethcore-ipc-nano -p parity %CARGOFLAGS% --verbose --release
tags:
- rust-test
- rust-windows
allow_failure: true
test-rust-stable:
stage: test
image: ethcore/rust:stable
before_script:
- git submodule update --init --recursive
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
script:
- export RUST_BACKTRACE=1
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
tags:
- rust
- rust-stable
js-test:
stage: test
image: ethcore/rust:stable
before_script:
- git submodule update --init --recursive
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
script:
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS lint since no JS files modified."; else ./js/scripts/lint.sh && ./js/scripts/test.sh && ./js/scripts/build.sh; fi
tags:
- rust
- rust-stable
test-rust-beta:
stage: test
only:
- triggers
image: ethcore/rust:beta
before_script:
- git submodule update --init --recursive
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
script:
- export RUST_BACKTRACE=1
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
tags:
- rust
- rust-beta
allow_failure: true
test-rust-nightly:
stage: test
only:
- triggers
image: ethcore/rust:nightly
before_script:
- git submodule update --init --recursive
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
script:
- export RUST_BACKTRACE=1
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
tags:
- rust
- rust-nightly
allow_failure: true
js-release:
stage: build
image: ethcore/javascript:latest
stage: js-build
only:
- master
- beta
- stable
image: ethcore/rust:stable
before_script:
- ./js/scripts/install-deps.sh
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
script:
- ./js/scripts/build.sh
- ./js/scripts/release.sh
- echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS rebuild since no JS files modified."; else ./js/scripts/build.sh && ./js/scripts/release.sh; fi
tags:
- javascript
js-tests:
stage: build
image: ethcore/javascript:latest
before_script:
- ./js/scripts/install-deps.sh
push-release:
stage: push-release
only:
- tags
image: ethcore/rust:stable
script:
- ./js/scripts/lint.sh
- ./js/scripts/test.sh
- ./js/scripts/build.sh
- curl --data "secret=$RELEASES_SECRET" http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
- curl --data "secret=$RELEASES_SECRET" http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
tags:
- javascript-test
- curl

View File

@@ -16,8 +16,8 @@ git:
matrix:
include:
- rust: stable
env: RUN_TESTS="true" TEST_OPTIONS="--no-release"
- rust: beta
env: RUN_TESTS="true" TEST_OPTIONS=""
- rust: stable
env: RUN_COVERAGE="true"
- rust: stable
env: RUN_DOCS="true"
@@ -71,8 +71,7 @@ install:
script:
- if [ "$RUN_TESTS" = "true" ]; then
./js/scripts/lint.sh &&
./js/scripts/test.sh &&
./test.sh $TEST_OPTIONS --verbose;
travis_wait 40 ./test.sh $TEST_OPTIONS;
fi
- if [ "$RUN_COVERAGE" = "true" ]; then ./scripts/cov.sh "$KCOV_CMD"; fi

1032
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
[package]
description = "Ethcore client."
description = "Parity Ethereum client"
name = "parity"
version = "1.4.0"
version = "1.5.2"
license = "GPL-3.0"
authors = ["Ethcore <admin@ethcore.io>"]
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
@@ -20,7 +20,7 @@ time = "0.1"
num_cpus = "0.2"
number_prefix = "0.2"
rpassword = "0.2.1"
semver = "0.2"
semver = "0.5"
ansi_term = "0.7"
lazy_static = "0.2"
regex = "0.1"
@@ -28,25 +28,31 @@ isatty = "0.1"
toml = "0.2"
serde = "0.8.0"
serde_json = "0.8.0"
app_dirs = "1.1.1"
hyper = { version = "0.9", default-features = false }
ctrlc = { git = "https://github.com/ethcore/rust-ctrlc.git" }
json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" }
fdlimit = { path = "util/fdlimit" }
fdlimit = "0.1"
clippy = { version = "0.0.103", optional = true}
rlp = { path = "util/rlp" }
ethsync = { path = "sync" }
ethcore = { path = "ethcore" }
ethcore-util = { path = "util" }
ethsync = { path = "sync" }
ethcore-io = { path = "util/io" }
ethcore-devtools = { path = "devtools" }
ethcore-rpc = { path = "rpc" }
ethcore-signer = { path = "signer" }
ethcore-ipc-nano = { path = "ipc/nano" }
ethcore-ipc = { path = "ipc/rpc" }
ethcore-ipc-nano = { path = "ipc/nano" }
ethcore-ipc-hypervisor = { path = "ipc/hypervisor" }
ethcore-logger = { path = "logger" }
rlp = { path = "util/rlp" }
ethcore-stratum = { path = "stratum" }
ethcore-dapps = { path = "dapps", optional = true }
clippy = { version = "0.0.96", optional = true}
rpc-cli = { path = "rpc_cli" }
parity-rpc-client = { path = "rpc_client" }
ethcore-light = { path = "ethcore/light" }
parity-hash-fetch = { path = "hash-fetch" }
parity-updater = { path = "updater" }
parity-reactor = { path = "util/reactor" }
[target.'cfg(windows)'.dependencies]
winapi = "0.2"
@@ -56,7 +62,6 @@ daemonize = "0.2"
[features]
default = ["ui-precompiled"]
ui = [
"dapps",
"ethcore-dapps/ui",
@@ -67,7 +72,6 @@ ui-precompiled = [
"ethcore-signer/ui-precompiled",
"ethcore-dapps/ui-precompiled",
]
dapps = ["ethcore-dapps"]
ipc = ["ethcore/ipc", "ethsync/ipc"]
jit = ["ethcore/jit"]
@@ -80,6 +84,7 @@ ethstore-cli = ["ethcore/ethstore-cli"]
evm-debug = ["ethcore/evm-debug"]
evm-debug-tests = ["ethcore/evm-debug-tests"]
slow-blocks = ["ethcore/slow-blocks"]
final = ["ethcore-util/final"]
[[bin]]
path = "parity/main.rs"
@@ -88,4 +93,4 @@ name = "parity"
[profile.release]
debug = false
lto = false
panic = "abort"

View File

@@ -1,9 +1,12 @@
# [Parity](https://ethcore.io/parity.html)
### Fast, light, and robust Ethereum implementation
[![Join the chat at https://gitter.im/ethcore/parity.js](https://badges.gitter.im/ethcore/parity.js.svg)](https://gitter.im/ethcore/parity.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status][travis-image]][travis-url] [![build status](https://gitlab.ethcore.io/Mirrors/ethcore-parity/badges/master/build.svg)](https://gitlab.ethcore.io/Mirrors/ethcore-parity/commits/master) [![Coverage Status][coveralls-image]][coveralls-url] [![GPLv3][license-image]][license-url]
[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Join the chat at https://gitter.im/ethcore/parity][gitter-image]][gitter-url] [![GPLv3][license-image]][license-url]
### Join the chat!
Parity [![Join the chat at https://gitter.im/ethcore/parity][gitter-image]][gitter-url] and
parity.js [![Join the chat at https://gitter.im/ethcore/parity.js](https://badges.gitter.im/ethcore/parity.js.svg)](https://gitter.im/ethcore/parity.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[Internal Documentation][doc-url]
@@ -21,7 +24,7 @@ Be sure to check out [our wiki][wiki-url] for more information.
[doc-url]: https://ethcore.github.io/parity/ethcore/index.html
[wiki-url]: https://github.com/ethcore/parity/wiki
**Requires Rust version 1.12.0 to build**
**Parity requires Rust version 1.12.0 to build**
----
@@ -31,12 +34,15 @@ Be sure to check out [our wiki][wiki-url] for more information.
Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and
cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs.
By default, Parity will run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number
of RPC APIs.
Parity comes with a built-in wallet. To access [Parity Wallet](http://127.0.0.1:8080/) this simply go to http://127.0.0.1:8080/. It
includes various functionality allowing you to:
- create and manage your Ethereum accounts;
- manage your Ether and any Ethereum tokens;
- create and register your own tokens;
- and much more.
Parity also runs a server for running decentralized apps, or "Dapps", on `http://127.0.0.1:8080`.
This includes a few useful Dapps, including Ethereum Wallet, Maker OTC, and a node status page.
In a near-future release, it will be easy to install Dapps and use them through this web interface.
By default, Parity will also run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number
of RPC APIs.
If you run into an issue while using parity, feel free to file one in this repository
or hop on our [gitter chat room][gitter-url] to ask a question. We are glad to help!
@@ -52,11 +58,18 @@ Parity is fully compatible with Stable Rust.
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have rustup, you can install it like this:
- Linux and OSX:
- Linux:
```bash
$ curl https://sh.rustup.rs -sSf | sh
```
Parity also requires `gcc`, `g++`, `libssl-dev`/`openssl` and `pkg-config` packages to be installed.
- OSX:
```bash
$ curl https://sh.rustup.rs -sSf | sh
```
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
- Windows
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the rustup installer from
@@ -90,6 +103,14 @@ $ cargo build --release
This will produce an executable in the `./target/release` subdirectory.
----
## Simple one-line installer for Mac and Ubuntu
```bash
bash <(curl https://get.parity.io -Lk)
```
## Start Parity
### Manually
To start Parity manually, just run

View File

@@ -6,7 +6,7 @@ environment:
certpass:
secure: 0BgXJqxq9Ei34/hZ7121FQ==
keyfile: C:\users\appveyor\Certificates.p12
RUSTFLAGS: -Zorbit=off -D warnings
RUSTFLAGS: -D warnings
branches:
only:
@@ -19,10 +19,10 @@ branches:
install:
- git submodule update --init --recursive
- ps: Install-Product node 6
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-1.12.0-x86_64-pc-windows-msvc.exe"
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-1.13.0-x86_64-pc-windows-msvc.exe"
- ps: Start-FileDownload "https://github.com/ethcore/win-build/raw/master/SimpleFC.dll" -FileName nsis\SimpleFC.dll
- ps: Start-FileDownload "https://github.com/ethcore/win-build/raw/master/vc_redist.x64.exe" -FileName nsis\vc_redist.x64.exe
- rust-1.12.0-x86_64-pc-windows-msvc.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- rust-1.13.0-x86_64-pc-windows-msvc.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin;C:\Program Files (x86)\NSIS;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
- rustc -V
- cargo -V
@@ -38,8 +38,8 @@ after_test:
- cargo build --verbose --release
- ps: if($env:cert) { Start-FileDownload $env:cert -FileName $env:keyfile }
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass target\release\parity.exe }
- msbuild windows\ptray\ptray.vcxproj /p:Platform=x86 /p:Configuration=Release
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass windows\ptray\release\ptray.exe }
- msbuild windows\ptray\ptray.vcxproj /p:Platform=x64 /p:Configuration=Release
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass windows\ptray\x64\release\ptray.exe }
- makensis.exe nsis\installer.nsi
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass nsis\installer.exe }

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,29 +1,30 @@
[package]
description = "Parity Dapps crate"
name = "ethcore-dapps"
version = "1.4.0"
version = "1.5.0"
license = "GPL-3.0"
authors = ["Ethcore <admin@ethcore.io"]
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[lib]
[dependencies]
rand = "0.3.14"
rand = "0.3"
log = "0.3"
env_logger = "0.3"
jsonrpc-core = "3.0"
jsonrpc-http-server = { git = "https://github.com/ethcore/jsonrpc-http-server.git" }
futures = "0.1"
jsonrpc-core = { git = "https://github.com/ethcore/jsonrpc.git", branch="mio-old" }
jsonrpc-http-server = { git = "https://github.com/ethcore/jsonrpc.git", branch="mio-old" }
hyper = { default-features = false, git = "https://github.com/ethcore/hyper" }
unicase = "1.3"
url = "1.0"
rustc-serialize = "0.3"
serde = "0.8"
serde_json = "0.8"
ethabi = "0.2.2"
linked-hash-map = "0.3"
parity-dapps-glue = "1.4"
mime = "0.2"
mime_guess = "1.6.1"
time = "0.1.35"
serde_macros = { version = "0.8", optional = true }
zip = { version = "0.1", default-features = false }
@@ -32,9 +33,10 @@ ethcore-rpc = { path = "../rpc" }
ethcore-util = { path = "../util" }
fetch = { path = "../util/fetch" }
parity-ui = { path = "./ui" }
parity-hash-fetch = { path = "../hash-fetch" }
parity-reactor = { path = "../util/reactor" }
mime_guess = { version = "1.6.1" }
clippy = { version = "0.0.96", optional = true}
clippy = { version = "0.0.103", optional = true}
[build-dependencies]
serde_codegen = { version = "0.8", optional = true }

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,9 +1,9 @@
[package]
description = "Base Package for all Parity built-in dapps"
name = "parity-dapps-glue"
version = "1.4.0"
version = "1.5.0"
license = "GPL-3.0"
authors = ["Ethcore <admin@ethcore.io"]
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

BIN
dapps/res/gavcoin.zip Normal file

Binary file not shown.

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ use hyper::header::AccessControlAllowOrigin;
use api::types::{App, ApiError};
use api::response;
use apps::fetcher::ContentFetcher;
use apps::fetcher::Fetcher;
use handlers::extract_url;
use endpoint::{Endpoint, Endpoints, Handler, EndpointPath};
@@ -33,11 +33,11 @@ use jsonrpc_http_server::cors;
pub struct RestApi {
cors_domains: Option<Vec<AccessControlAllowOrigin>>,
endpoints: Arc<Endpoints>,
fetcher: Arc<ContentFetcher>,
fetcher: Arc<Fetcher>,
}
impl RestApi {
pub fn new(cors_domains: Vec<String>, endpoints: Arc<Endpoints>, fetcher: Arc<ContentFetcher>) -> Box<Endpoint> {
pub fn new(cors_domains: Vec<String>, endpoints: Arc<Endpoints>, fetcher: Arc<Fetcher>) -> Box<Endpoint> {
Box::new(RestApi {
cors_domains: Some(cors_domains.into_iter().map(AccessControlAllowOrigin::Value).collect()),
endpoints: endpoints,

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -17,6 +17,7 @@
use endpoint::EndpointInfo;
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct App {
pub id: String,
pub name: String,
@@ -54,6 +55,7 @@ impl Into<EndpointInfo> for App {
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ApiError {
pub code: String,
pub title: String,

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -17,14 +17,13 @@
//! Fetchable Dapps support.
use std::fs;
use std::sync::{Arc};
use linked_hash_map::LinkedHashMap;
use page::LocalPageEndpoint;
use handlers::FetchControl;
pub enum ContentStatus {
Fetching(Arc<FetchControl>),
Fetching(FetchControl),
Ready(LocalPageEndpoint),
}

View File

@@ -1,440 +0,0 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Fetchable Dapps support.
//! Manages downloaded (cached) Dapps and downloads them when necessary.
//! Uses `URLHint` to resolve addresses into Dapps bundle file location.
use zip;
use std::{fs, env, fmt};
use std::io::{self, Read, Write};
use std::path::PathBuf;
use std::sync::Arc;
use rustc_serialize::hex::FromHex;
use hyper;
use hyper::status::StatusCode;
use random_filename;
use SyncStatus;
use util::{Mutex, H256};
use util::sha3::sha3;
use page::{LocalPageEndpoint, PageCache};
use handlers::{ContentHandler, ContentFetcherHandler, ContentValidator};
use endpoint::{Endpoint, EndpointPath, Handler};
use apps::cache::{ContentCache, ContentStatus};
use apps::manifest::{MANIFEST_FILENAME, deserialize_manifest, serialize_manifest, Manifest};
use apps::urlhint::{URLHintContract, URLHint, URLHintResult};
/// Limit of cached dapps/content
const MAX_CACHED_DAPPS: usize = 20;
pub struct ContentFetcher<R: URLHint = URLHintContract> {
dapps_path: PathBuf,
resolver: R,
cache: Arc<Mutex<ContentCache>>,
sync: Arc<SyncStatus>,
embeddable_at: Option<u16>,
}
impl<R: URLHint> Drop for ContentFetcher<R> {
fn drop(&mut self) {
// Clear cache path
let _ = fs::remove_dir_all(&self.dapps_path);
}
}
impl<R: URLHint> ContentFetcher<R> {
pub fn new(resolver: R, sync_status: Arc<SyncStatus>, embeddable_at: Option<u16>) -> Self {
let mut dapps_path = env::temp_dir();
dapps_path.push(random_filename());
ContentFetcher {
dapps_path: dapps_path,
resolver: resolver,
sync: sync_status,
cache: Arc::new(Mutex::new(ContentCache::default())),
embeddable_at: embeddable_at,
}
}
fn still_syncing(port: Option<u16>) -> Box<Handler> {
Box::new(ContentHandler::error(
StatusCode::ServiceUnavailable,
"Sync In Progress",
"Your node is still syncing. We cannot resolve any content before it's fully synced.",
Some("<a href=\"javascript:window.location.reload()\">Refresh</a>"),
port,
))
}
#[cfg(test)]
fn set_status(&self, content_id: &str, status: ContentStatus) {
self.cache.lock().insert(content_id.to_owned(), status);
}
pub fn contains(&self, content_id: &str) -> bool {
{
let mut cache = self.cache.lock();
// Check if we already have the app
if cache.get(content_id).is_some() {
return true;
}
}
// fallback to resolver
if let Ok(content_id) = content_id.from_hex() {
// else try to resolve the app_id
let has_content = self.resolver.resolve(content_id).is_some();
// if there is content or we are syncing return true
has_content || self.sync.is_major_importing()
} else {
false
}
}
pub fn to_async_handler(&self, path: EndpointPath, control: hyper::Control) -> Box<Handler> {
let mut cache = self.cache.lock();
let content_id = path.app_id.clone();
let (new_status, handler) = {
let status = cache.get(&content_id);
match status {
// Just serve the content
Some(&mut ContentStatus::Ready(ref endpoint)) => {
(None, endpoint.to_async_handler(path, control))
},
// Content is already being fetched
Some(&mut ContentStatus::Fetching(ref fetch_control)) => {
trace!(target: "dapps", "Content fetching in progress. Waiting...");
(None, fetch_control.to_handler(control))
},
// We need to start fetching the content
None => {
trace!(target: "dapps", "Content unavailable. Fetching... {:?}", content_id);
let content_hex = content_id.from_hex().expect("to_handler is called only when `contains` returns true.");
let content = self.resolver.resolve(content_hex);
let cache = self.cache.clone();
let on_done = move |id: String, result: Option<LocalPageEndpoint>| {
let mut cache = cache.lock();
match result {
Some(endpoint) => {
cache.insert(id, ContentStatus::Ready(endpoint));
},
// In case of error
None => {
cache.remove(&id);
},
}
};
match content {
// Don't serve dapps if we are still syncing (but serve content)
Some(URLHintResult::Dapp(_)) if self.sync.is_major_importing() => {
(None, Self::still_syncing(self.embeddable_at))
},
Some(URLHintResult::Dapp(dapp)) => {
let (handler, fetch_control) = ContentFetcherHandler::new(
dapp.url(),
control,
DappInstaller {
id: content_id.clone(),
dapps_path: self.dapps_path.clone(),
on_done: Box::new(on_done),
embeddable_at: self.embeddable_at,
},
self.embeddable_at,
);
(Some(ContentStatus::Fetching(fetch_control)), Box::new(handler) as Box<Handler>)
},
Some(URLHintResult::Content(content)) => {
let (handler, fetch_control) = ContentFetcherHandler::new(
content.url,
control,
ContentInstaller {
id: content_id.clone(),
mime: content.mime,
content_path: self.dapps_path.clone(),
on_done: Box::new(on_done),
},
self.embeddable_at,
);
(Some(ContentStatus::Fetching(fetch_control)), Box::new(handler) as Box<Handler>)
},
None if self.sync.is_major_importing() => {
(None, Self::still_syncing(self.embeddable_at))
},
None => {
// This may happen when sync status changes in between
// `contains` and `to_handler`
(None, Box::new(ContentHandler::error(
StatusCode::NotFound,
"Resource Not Found",
"Requested resource was not found.",
None,
self.embeddable_at,
)) as Box<Handler>)
},
}
},
}
};
if let Some(status) = new_status {
cache.clear_garbage(MAX_CACHED_DAPPS);
cache.insert(content_id, status);
}
handler
}
}
#[derive(Debug)]
pub enum ValidationError {
Io(io::Error),
Zip(zip::result::ZipError),
InvalidContentId,
ManifestNotFound,
ManifestSerialization(String),
HashMismatch { expected: H256, got: H256, },
}
impl fmt::Display for ValidationError {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match *self {
ValidationError::Io(ref io) => write!(f, "Unexpected IO error occured: {:?}", io),
ValidationError::Zip(ref zip) => write!(f, "Unable to read ZIP archive: {:?}", zip),
ValidationError::InvalidContentId => write!(f, "ID is invalid. It should be 256 bits keccak hash of content."),
ValidationError::ManifestNotFound => write!(f, "Downloaded Dapp bundle did not contain valid manifest.json file."),
ValidationError::ManifestSerialization(ref err) => {
write!(f, "There was an error during Dapp Manifest serialization: {:?}", err)
},
ValidationError::HashMismatch { ref expected, ref got } => {
write!(f, "Hash of downloaded content did not match. Expected:{:?}, Got:{:?}.", expected, got)
},
}
}
}
impl From<io::Error> for ValidationError {
fn from(err: io::Error) -> Self {
ValidationError::Io(err)
}
}
impl From<zip::result::ZipError> for ValidationError {
fn from(err: zip::result::ZipError) -> Self {
ValidationError::Zip(err)
}
}
struct ContentInstaller {
id: String,
mime: String,
content_path: PathBuf,
on_done: Box<Fn(String, Option<LocalPageEndpoint>) + Send>,
}
impl ContentValidator for ContentInstaller {
type Error = ValidationError;
fn validate_and_install(&self, path: PathBuf) -> Result<(String, LocalPageEndpoint), ValidationError> {
// Create dir
try!(fs::create_dir_all(&self.content_path));
// Validate hash
let mut file_reader = io::BufReader::new(try!(fs::File::open(&path)));
let hash = try!(sha3(&mut file_reader));
let id = try!(self.id.as_str().parse().map_err(|_| ValidationError::InvalidContentId));
if id != hash {
return Err(ValidationError::HashMismatch {
expected: id,
got: hash,
});
}
// And prepare path for a file
let filename = path.file_name().expect("We always fetch a file.");
let mut content_path = self.content_path.clone();
content_path.push(&filename);
if content_path.exists() {
try!(fs::remove_dir_all(&content_path))
}
try!(fs::copy(&path, &content_path));
Ok((self.id.clone(), LocalPageEndpoint::single_file(content_path, self.mime.clone(), PageCache::Enabled)))
}
fn done(&self, endpoint: Option<LocalPageEndpoint>) {
(self.on_done)(self.id.clone(), endpoint)
}
}
struct DappInstaller {
id: String,
dapps_path: PathBuf,
on_done: Box<Fn(String, Option<LocalPageEndpoint>) + Send>,
embeddable_at: Option<u16>,
}
impl DappInstaller {
fn find_manifest(zip: &mut zip::ZipArchive<fs::File>) -> Result<(Manifest, PathBuf), ValidationError> {
for i in 0..zip.len() {
let mut file = try!(zip.by_index(i));
if !file.name().ends_with(MANIFEST_FILENAME) {
continue;
}
// try to read manifest
let mut manifest = String::new();
let manifest = file
.read_to_string(&mut manifest).ok()
.and_then(|_| deserialize_manifest(manifest).ok());
if let Some(manifest) = manifest {
let mut manifest_location = PathBuf::from(file.name());
manifest_location.pop(); // get rid of filename
return Ok((manifest, manifest_location));
}
}
Err(ValidationError::ManifestNotFound)
}
fn dapp_target_path(&self, manifest: &Manifest) -> PathBuf {
let mut target = self.dapps_path.clone();
target.push(&manifest.id);
target
}
}
impl ContentValidator for DappInstaller {
type Error = ValidationError;
fn validate_and_install(&self, app_path: PathBuf) -> Result<(String, LocalPageEndpoint), ValidationError> {
trace!(target: "dapps", "Opening dapp bundle at {:?}", app_path);
let mut file_reader = io::BufReader::new(try!(fs::File::open(app_path)));
let hash = try!(sha3(&mut file_reader));
let id = try!(self.id.as_str().parse().map_err(|_| ValidationError::InvalidContentId));
if id != hash {
return Err(ValidationError::HashMismatch {
expected: id,
got: hash,
});
}
let file = file_reader.into_inner();
// Unpack archive
let mut zip = try!(zip::ZipArchive::new(file));
// First find manifest file
let (mut manifest, manifest_dir) = try!(Self::find_manifest(&mut zip));
// Overwrite id to match hash
manifest.id = self.id.clone();
let target = self.dapp_target_path(&manifest);
// Remove old directory
if target.exists() {
warn!(target: "dapps", "Overwriting existing dapp: {}", manifest.id);
try!(fs::remove_dir_all(target.clone()));
}
// Unpack zip
for i in 0..zip.len() {
let mut file = try!(zip.by_index(i));
// TODO [todr] Check if it's consistent on windows.
let is_dir = file.name().chars().rev().next() == Some('/');
let file_path = PathBuf::from(file.name());
let location_in_manifest_base = file_path.strip_prefix(&manifest_dir);
// Create files that are inside manifest directory
if let Ok(location_in_manifest_base) = location_in_manifest_base {
let p = target.join(location_in_manifest_base);
// Check if it's a directory
if is_dir {
try!(fs::create_dir_all(p));
} else {
let mut target = try!(fs::File::create(p));
try!(io::copy(&mut file, &mut target));
}
}
}
// Write manifest
let manifest_str = try!(serialize_manifest(&manifest).map_err(ValidationError::ManifestSerialization));
let manifest_path = target.join(MANIFEST_FILENAME);
let mut manifest_file = try!(fs::File::create(manifest_path));
try!(manifest_file.write_all(manifest_str.as_bytes()));
// Create endpoint
let app = LocalPageEndpoint::new(target, manifest.clone().into(), PageCache::Enabled, self.embeddable_at);
// Return modified app manifest
Ok((manifest.id.clone(), app))
}
fn done(&self, endpoint: Option<LocalPageEndpoint>) {
(self.on_done)(self.id.clone(), endpoint)
}
}
#[cfg(test)]
mod tests {
use std::env;
use std::sync::Arc;
use util::Bytes;
use endpoint::EndpointInfo;
use page::LocalPageEndpoint;
use apps::cache::ContentStatus;
use apps::urlhint::{URLHint, URLHintResult};
use super::ContentFetcher;
struct FakeResolver;
impl URLHint for FakeResolver {
fn resolve(&self, _id: Bytes) -> Option<URLHintResult> {
None
}
}
#[test]
fn should_true_if_contains_the_app() {
// given
let path = env::temp_dir();
let fetcher = ContentFetcher::new(FakeResolver, Arc::new(|| false), None);
let handler = LocalPageEndpoint::new(path, EndpointInfo {
name: "fake".into(),
description: "".into(),
version: "".into(),
author: "".into(),
icon_url: "".into(),
}, Default::default(), None);
// when
fetcher.set_status("test", ContentStatus::Ready(handler));
fetcher.set_status("test2", ContentStatus::Fetching(Default::default()));
// then
assert_eq!(fetcher.contains("test"), true);
assert_eq!(fetcher.contains("test2"), true);
assert_eq!(fetcher.contains("test3"), false);
}
}

View File

@@ -0,0 +1,255 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use zip;
use std::{fs, fmt};
use std::io::{self, Read, Write};
use std::path::PathBuf;
use fetch::{self, Mime};
use util::H256;
use util::sha3::sha3;
use page::{LocalPageEndpoint, PageCache};
use handlers::{ContentValidator, ValidatorResponse};
use apps::manifest::{MANIFEST_FILENAME, deserialize_manifest, serialize_manifest, Manifest};
type OnDone = Box<Fn(Option<LocalPageEndpoint>) + Send>;
fn write_response_and_check_hash(
id: &str,
mut content_path: PathBuf,
filename: &str,
response: fetch::Response
) -> Result<(fs::File, PathBuf), ValidationError> {
// try to parse id
let id = id.parse().map_err(|_| ValidationError::InvalidContentId)?;
// check if content exists
if content_path.exists() {
warn!(target: "dapps", "Overwriting existing content at 0x{:?}", id);
fs::remove_dir_all(&content_path)?
}
// create directory
fs::create_dir_all(&content_path)?;
// append filename
content_path.push(filename);
// Now write the response
let mut file = io::BufWriter::new(fs::File::create(&content_path)?);
let mut reader = io::BufReader::new(response);
io::copy(&mut reader, &mut file)?;
file.flush()?;
// Validate hash
// TODO [ToDr] calculate sha3 in-flight while reading the response
let mut file = io::BufReader::new(fs::File::open(&content_path)?);
let hash = sha3(&mut file)?;
if id == hash {
Ok((file.into_inner(), content_path))
} else {
Err(ValidationError::HashMismatch {
expected: id,
got: hash,
})
}
}
pub struct Content {
id: String,
mime: Mime,
content_path: PathBuf,
on_done: OnDone,
}
impl Content {
pub fn new(id: String, mime: Mime, content_path: PathBuf, on_done: OnDone) -> Self {
Content {
id: id,
mime: mime,
content_path: content_path,
on_done: on_done,
}
}
}
impl ContentValidator for Content {
type Error = ValidationError;
fn validate_and_install(&self, response: fetch::Response) -> Result<ValidatorResponse, ValidationError> {
let validate = |content_path: PathBuf| {
// Create dir
let (_, content_path) = write_response_and_check_hash(self.id.as_str(), content_path.clone(), self.id.as_str(), response)?;
Ok(LocalPageEndpoint::single_file(content_path, self.mime.clone(), PageCache::Enabled))
};
// Prepare path for a file
let content_path = self.content_path.join(&self.id);
// Make sure to always call on_done (even in case of errors)!
let result = validate(content_path.clone());
// remove the file if there was an error
if result.is_err() {
// Ignore errors since the file might not exist
let _ = fs::remove_dir_all(&content_path);
}
(self.on_done)(result.as_ref().ok().cloned());
result.map(ValidatorResponse::Local)
}
}
pub struct Dapp {
id: String,
dapps_path: PathBuf,
on_done: OnDone,
embeddable_on: Option<(String, u16)>,
}
impl Dapp {
pub fn new(id: String, dapps_path: PathBuf, on_done: OnDone, embeddable_on: Option<(String, u16)>) -> Self {
Dapp {
id: id,
dapps_path: dapps_path,
on_done: on_done,
embeddable_on: embeddable_on,
}
}
fn find_manifest(zip: &mut zip::ZipArchive<fs::File>) -> Result<(Manifest, PathBuf), ValidationError> {
for i in 0..zip.len() {
let mut file = zip.by_index(i)?;
if !file.name().ends_with(MANIFEST_FILENAME) {
continue;
}
// try to read manifest
let mut manifest = String::new();
let manifest = file
.read_to_string(&mut manifest).ok()
.and_then(|_| deserialize_manifest(manifest).ok());
if let Some(manifest) = manifest {
let mut manifest_location = PathBuf::from(file.name());
manifest_location.pop(); // get rid of filename
return Ok((manifest, manifest_location));
}
}
Err(ValidationError::ManifestNotFound)
}
}
impl ContentValidator for Dapp {
type Error = ValidationError;
fn validate_and_install(&self, response: fetch::Response) -> Result<ValidatorResponse, ValidationError> {
let validate = |dapp_path: PathBuf| {
let (file, zip_path) = write_response_and_check_hash(self.id.as_str(), dapp_path.clone(), &format!("{}.zip", self.id), response)?;
trace!(target: "dapps", "Opening dapp bundle at {:?}", zip_path);
// Unpack archive
let mut zip = zip::ZipArchive::new(file)?;
// First find manifest file
let (mut manifest, manifest_dir) = Self::find_manifest(&mut zip)?;
// Overwrite id to match hash
manifest.id = self.id.clone();
// Unpack zip
for i in 0..zip.len() {
let mut file = zip.by_index(i)?;
let is_dir = file.name().chars().rev().next() == Some('/');
let file_path = PathBuf::from(file.name());
let location_in_manifest_base = file_path.strip_prefix(&manifest_dir);
// Create files that are inside manifest directory
if let Ok(location_in_manifest_base) = location_in_manifest_base {
let p = dapp_path.join(location_in_manifest_base);
// Check if it's a directory
if is_dir {
fs::create_dir_all(p)?;
} else {
let mut target = fs::File::create(p)?;
io::copy(&mut file, &mut target)?;
}
}
}
// Remove zip
fs::remove_file(&zip_path)?;
// Write manifest
let manifest_str = serialize_manifest(&manifest).map_err(ValidationError::ManifestSerialization)?;
let manifest_path = dapp_path.join(MANIFEST_FILENAME);
let mut manifest_file = fs::File::create(manifest_path)?;
manifest_file.write_all(manifest_str.as_bytes())?;
// Create endpoint
let endpoint = LocalPageEndpoint::new(dapp_path, manifest.clone().into(), PageCache::Enabled, self.embeddable_on.clone());
Ok(endpoint)
};
// Prepare directory for dapp
let target = self.dapps_path.join(&self.id);
// Validate the dapp
let result = validate(target.clone());
// remove the file if there was an error
if result.is_err() {
// Ignore errors since the file might not exist
let _ = fs::remove_dir_all(&target);
}
(self.on_done)(result.as_ref().ok().cloned());
result.map(ValidatorResponse::Local)
}
}
#[derive(Debug)]
pub enum ValidationError {
Io(io::Error),
Zip(zip::result::ZipError),
InvalidContentId,
ManifestNotFound,
ManifestSerialization(String),
HashMismatch { expected: H256, got: H256, },
}
impl fmt::Display for ValidationError {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match *self {
ValidationError::Io(ref io) => write!(f, "Unexpected IO error occured: {:?}", io),
ValidationError::Zip(ref zip) => write!(f, "Unable to read ZIP archive: {:?}", zip),
ValidationError::InvalidContentId => write!(f, "ID is invalid. It should be 256 bits keccak hash of content."),
ValidationError::ManifestNotFound => write!(f, "Downloaded Dapp bundle did not contain valid manifest.json file."),
ValidationError::ManifestSerialization(ref err) => {
write!(f, "There was an error during Dapp Manifest serialization: {:?}", err)
},
ValidationError::HashMismatch { ref expected, ref got } => {
write!(f, "Hash of downloaded content did not match. Expected:{:?}, Got:{:?}.", expected, got)
},
}
}
}
impl From<io::Error> for ValidationError {
fn from(err: io::Error) -> Self {
ValidationError::Io(err)
}
}
impl From<zip::result::ZipError> for ValidationError {
fn from(err: zip::result::ZipError) -> Self {
ValidationError::Zip(err)
}
}

View File

@@ -0,0 +1,265 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Fetchable Dapps support.
//! Manages downloaded (cached) Dapps and downloads them when necessary.
//! Uses `URLHint` to resolve addresses into Dapps bundle file location.
mod installers;
use std::{fs, env};
use std::path::PathBuf;
use std::sync::Arc;
use rustc_serialize::hex::FromHex;
use fetch::{Client as FetchClient, Fetch};
use hash_fetch::urlhint::{URLHintContract, URLHint, URLHintResult};
use parity_reactor::Remote;
use hyper;
use hyper::status::StatusCode;
use {SyncStatus, random_filename};
use util::Mutex;
use page::LocalPageEndpoint;
use handlers::{ContentHandler, ContentFetcherHandler};
use endpoint::{Endpoint, EndpointPath, Handler};
use apps::cache::{ContentCache, ContentStatus};
/// Limit of cached dapps/content
const MAX_CACHED_DAPPS: usize = 20;
pub trait Fetcher: Send + Sync + 'static {
fn contains(&self, content_id: &str) -> bool;
fn to_async_handler(&self, path: EndpointPath, control: hyper::Control) -> Box<Handler>;
}
pub struct ContentFetcher<F: Fetch = FetchClient, R: URLHint + Send + Sync + 'static = URLHintContract> {
dapps_path: PathBuf,
resolver: R,
cache: Arc<Mutex<ContentCache>>,
sync: Arc<SyncStatus>,
embeddable_on: Option<(String, u16)>,
remote: Remote,
fetch: F,
}
impl<R: URLHint + Send + Sync + 'static, F: Fetch> Drop for ContentFetcher<F, R> {
fn drop(&mut self) {
// Clear cache path
let _ = fs::remove_dir_all(&self.dapps_path);
}
}
impl<R: URLHint + Send + Sync + 'static, F: Fetch> ContentFetcher<F, R> {
pub fn new(resolver: R, sync_status: Arc<SyncStatus>, embeddable_on: Option<(String, u16)>, remote: Remote, fetch: F) -> Self {
let mut dapps_path = env::temp_dir();
dapps_path.push(random_filename());
ContentFetcher {
dapps_path: dapps_path,
resolver: resolver,
sync: sync_status,
cache: Arc::new(Mutex::new(ContentCache::default())),
embeddable_on: embeddable_on,
remote: remote,
fetch: fetch,
}
}
fn still_syncing(address: Option<(String, u16)>) -> Box<Handler> {
Box::new(ContentHandler::error(
StatusCode::ServiceUnavailable,
"Sync In Progress",
"Your node is still syncing. We cannot resolve any content before it's fully synced.",
Some("<a href=\"javascript:window.location.reload()\">Refresh</a>"),
address,
))
}
#[cfg(test)]
fn set_status(&self, content_id: &str, status: ContentStatus) {
self.cache.lock().insert(content_id.to_owned(), status);
}
}
impl<R: URLHint + Send + Sync + 'static, F: Fetch> Fetcher for ContentFetcher<F, R> {
fn contains(&self, content_id: &str) -> bool {
{
let mut cache = self.cache.lock();
// Check if we already have the app
if cache.get(content_id).is_some() {
return true;
}
}
// fallback to resolver
if let Ok(content_id) = content_id.from_hex() {
// else try to resolve the app_id
let has_content = self.resolver.resolve(content_id).is_some();
// if there is content or we are syncing return true
has_content || self.sync.is_major_importing()
} else {
false
}
}
fn to_async_handler(&self, path: EndpointPath, control: hyper::Control) -> Box<Handler> {
let mut cache = self.cache.lock();
let content_id = path.app_id.clone();
let (new_status, handler) = {
let status = cache.get(&content_id);
match status {
// Just serve the content
Some(&mut ContentStatus::Ready(ref endpoint)) => {
(None, endpoint.to_async_handler(path, control))
},
// Content is already being fetched
Some(&mut ContentStatus::Fetching(ref fetch_control)) if !fetch_control.is_deadline_reached() => {
trace!(target: "dapps", "Content fetching in progress. Waiting...");
(None, fetch_control.to_async_handler(path, control))
},
// We need to start fetching the content
_ => {
trace!(target: "dapps", "Content unavailable. Fetching... {:?}", content_id);
let content_hex = content_id.from_hex().expect("to_handler is called only when `contains` returns true.");
let content = self.resolver.resolve(content_hex);
let cache = self.cache.clone();
let id = content_id.clone();
let on_done = move |result: Option<LocalPageEndpoint>| {
let mut cache = cache.lock();
match result {
Some(endpoint) => cache.insert(id.clone(), ContentStatus::Ready(endpoint)),
// In case of error
None => cache.remove(&id),
};
};
match content {
// Don't serve dapps if we are still syncing (but serve content)
Some(URLHintResult::Dapp(_)) if self.sync.is_major_importing() => {
(None, Self::still_syncing(self.embeddable_on.clone()))
},
Some(URLHintResult::Dapp(dapp)) => {
let handler = ContentFetcherHandler::new(
dapp.url(),
path,
control,
installers::Dapp::new(
content_id.clone(),
self.dapps_path.clone(),
Box::new(on_done),
self.embeddable_on.clone(),
),
self.embeddable_on.clone(),
self.remote.clone(),
self.fetch.clone(),
);
(Some(ContentStatus::Fetching(handler.fetch_control())), Box::new(handler) as Box<Handler>)
},
Some(URLHintResult::Content(content)) => {
let handler = ContentFetcherHandler::new(
content.url,
path,
control,
installers::Content::new(
content_id.clone(),
content.mime,
self.dapps_path.clone(),
Box::new(on_done),
),
self.embeddable_on.clone(),
self.remote.clone(),
self.fetch.clone(),
);
(Some(ContentStatus::Fetching(handler.fetch_control())), Box::new(handler) as Box<Handler>)
},
None if self.sync.is_major_importing() => {
(None, Self::still_syncing(self.embeddable_on.clone()))
},
None => {
// This may happen when sync status changes in between
// `contains` and `to_handler`
(None, Box::new(ContentHandler::error(
StatusCode::NotFound,
"Resource Not Found",
"Requested resource was not found.",
None,
self.embeddable_on.clone(),
)) as Box<Handler>)
},
}
},
}
};
if let Some(status) = new_status {
cache.clear_garbage(MAX_CACHED_DAPPS);
cache.insert(content_id, status);
}
handler
}
}
#[cfg(test)]
mod tests {
use std::env;
use std::sync::Arc;
use util::Bytes;
use fetch::{Fetch, Client};
use hash_fetch::urlhint::{URLHint, URLHintResult};
use parity_reactor::Remote;
use apps::cache::ContentStatus;
use endpoint::EndpointInfo;
use page::LocalPageEndpoint;
use super::{ContentFetcher, Fetcher};
struct FakeResolver;
impl URLHint for FakeResolver {
fn resolve(&self, _id: Bytes) -> Option<URLHintResult> {
None
}
}
#[test]
fn should_true_if_contains_the_app() {
// given
let path = env::temp_dir();
let fetcher = ContentFetcher::new(FakeResolver, Arc::new(|| false), None, Remote::new_sync(), Client::new().unwrap());
let handler = LocalPageEndpoint::new(path, EndpointInfo {
name: "fake".into(),
description: "".into(),
version: "".into(),
author: "".into(),
icon_url: "".into(),
}, Default::default(), None);
// when
fetcher.set_status("test", ContentStatus::Ready(handler));
fetcher.set_status("test2", ContentStatus::Fetching(Default::default()));
// then
assert_eq!(fetcher.contains("test"), true);
assert_eq!(fetcher.contains("test2"), true);
assert_eq!(fetcher.contains("test3"), false);
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
use std::io;
use std::io::Read;
use std::fs;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use page::{LocalPageEndpoint, PageCache};
use endpoint::{Endpoints, EndpointInfo};
use apps::manifest::{MANIFEST_FILENAME, deserialize_manifest};
@@ -28,17 +28,86 @@ struct LocalDapp {
info: EndpointInfo,
}
fn local_dapps(dapps_path: String) -> Vec<LocalDapp> {
let files = fs::read_dir(dapps_path.as_str());
/// Tries to find and read manifest file in given `path` to extract `EndpointInfo`
/// If manifest is not found sensible default `EndpointInfo` is returned based on given `name`.
fn read_manifest(name: &str, mut path: PathBuf) -> EndpointInfo {
path.push(MANIFEST_FILENAME);
fs::File::open(path.clone())
.map_err(|e| format!("{:?}", e))
.and_then(|mut f| {
// Reat file
let mut s = String::new();
f.read_to_string(&mut s).map_err(|e| format!("{:?}", e))?;
// Try to deserialize manifest
deserialize_manifest(s)
})
.map(Into::into)
.unwrap_or_else(|e| {
warn!(target: "dapps", "Cannot read manifest file at: {:?}. Error: {:?}", path, e);
EndpointInfo {
name: name.into(),
description: name.into(),
version: "0.0.0".into(),
author: "?".into(),
icon_url: "icon.png".into(),
}
})
}
/// Returns Dapp Id and Local Dapp Endpoint for given filesystem path.
/// Parses the path to extract last component (for name).
/// `None` is returned when path is invalid or non-existent.
pub fn local_endpoint<P: AsRef<Path>>(path: P, signer_address: Option<(String, u16)>) -> Option<(String, Box<LocalPageEndpoint>)> {
let path = path.as_ref().to_owned();
path.canonicalize().ok().and_then(|path| {
let name = path.file_name().and_then(|name| name.to_str());
name.map(|name| {
let dapp = local_dapp(name.into(), path.clone());
(dapp.id, Box::new(LocalPageEndpoint::new(
dapp.path, dapp.info, PageCache::Disabled, signer_address.clone())
))
})
})
}
fn local_dapp(name: String, path: PathBuf) -> LocalDapp {
// try to get manifest file
let info = read_manifest(&name, path.clone());
LocalDapp {
id: name,
path: path,
info: info,
}
}
/// Returns endpoints for Local Dapps found for given filesystem path.
/// Scans the directory and collects `LocalPageEndpoints`.
pub fn local_endpoints<P: AsRef<Path>>(dapps_path: P, signer_address: Option<(String, u16)>) -> Endpoints {
let mut pages = Endpoints::new();
for dapp in local_dapps(dapps_path.as_ref()) {
pages.insert(
dapp.id,
Box::new(LocalPageEndpoint::new(dapp.path, dapp.info, PageCache::Disabled, signer_address.clone()))
);
}
pages
}
fn local_dapps(dapps_path: &Path) -> Vec<LocalDapp> {
let files = fs::read_dir(dapps_path);
if let Err(e) = files {
warn!(target: "dapps", "Unable to load local dapps from: {}. Reason: {:?}", dapps_path, e);
warn!(target: "dapps", "Unable to load local dapps from: {}. Reason: {:?}", dapps_path.display(), e);
return vec![];
}
let files = files.expect("Check is done earlier");
files.map(|dir| {
let entry = try!(dir);
let file_type = try!(entry.file_type());
let entry = dir?;
let file_type = entry.file_type()?;
// skip files
if file_type.is_file() {
@@ -59,51 +128,6 @@ fn local_dapps(dapps_path: String) -> Vec<LocalDapp> {
}
m.ok()
})
.map(|(name, path)| {
// try to get manifest file
let info = read_manifest(&name, path.clone());
LocalDapp {
id: name,
path: path,
info: info,
}
})
.map(|(name, path)| local_dapp(name, path))
.collect()
}
fn read_manifest(name: &str, mut path: PathBuf) -> EndpointInfo {
path.push(MANIFEST_FILENAME);
fs::File::open(path.clone())
.map_err(|e| format!("{:?}", e))
.and_then(|mut f| {
// Reat file
let mut s = String::new();
try!(f.read_to_string(&mut s).map_err(|e| format!("{:?}", e)));
// Try to deserialize manifest
deserialize_manifest(s)
})
.map(Into::into)
.unwrap_or_else(|e| {
warn!(target: "dapps", "Cannot read manifest file at: {:?}. Error: {:?}", path, e);
EndpointInfo {
name: name.into(),
description: name.into(),
version: "0.0.0".into(),
author: "?".into(),
icon_url: "icon.png".into(),
}
})
}
pub fn local_endpoints(dapps_path: String, signer_port: Option<u16>) -> Endpoints {
let mut pages = Endpoints::new();
for dapp in local_dapps(dapps_path) {
pages.insert(
dapp.id,
Box::new(LocalPageEndpoint::new(dapp.path, dapp.info, PageCache::Disabled, signer_port))
);
}
pages
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -14,49 +14,71 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::path::PathBuf;
use std::sync::Arc;
use endpoint::{Endpoints, Endpoint};
use page::PageEndpoint;
use proxypac::ProxyPac;
use web::Web;
use fetch::Fetch;
use parity_dapps::WebApp;
use parity_reactor::Remote;
use {WebProxyTokens};
mod cache;
mod fs;
pub mod urlhint;
pub mod fetcher;
pub mod manifest;
extern crate parity_ui;
pub const HOME_PAGE: &'static str = "home";
pub const DAPPS_DOMAIN : &'static str = ".parity";
pub const RPC_PATH : &'static str = "rpc";
pub const API_PATH : &'static str = "api";
pub const UTILS_PATH : &'static str = "parity-utils";
pub const DAPPS_DOMAIN: &'static str = ".parity";
pub const RPC_PATH: &'static str = "rpc";
pub const API_PATH: &'static str = "api";
pub const UTILS_PATH: &'static str = "parity-utils";
pub const WEB_PATH: &'static str = "web";
pub const URL_REFERER: &'static str = "__referer=";
pub fn utils() -> Box<Endpoint> {
Box::new(PageEndpoint::with_prefix(parity_ui::App::default(), UTILS_PATH.to_owned()))
}
pub fn all_endpoints(dapps_path: String, signer_port: Option<u16>) -> Endpoints {
pub fn all_endpoints<F: Fetch>(
dapps_path: PathBuf,
extra_dapps: Vec<PathBuf>,
signer_address: Option<(String, u16)>,
web_proxy_tokens: Arc<WebProxyTokens>,
remote: Remote,
fetch: F,
) -> Endpoints {
// fetch fs dapps at first to avoid overwriting builtins
let mut pages = fs::local_endpoints(dapps_path, signer_port);
let mut pages = fs::local_endpoints(dapps_path, signer_address.clone());
for path in extra_dapps {
if let Some((id, endpoint)) = fs::local_endpoint(path.clone(), signer_address.clone()) {
pages.insert(id, endpoint);
} else {
warn!(target: "dapps", "Ignoring invalid dapp at {}", path.display());
}
}
// NOTE [ToDr] Dapps will be currently embeded on 8180
insert::<parity_ui::App>(&mut pages, "ui", Embeddable::Yes(signer_port));
pages.insert("proxy".into(), ProxyPac::boxed(signer_port));
insert::<parity_ui::App>(&mut pages, "ui", Embeddable::Yes(signer_address.clone()));
pages.insert("proxy".into(), ProxyPac::boxed(signer_address.clone()));
pages.insert(WEB_PATH.into(), Web::boxed(signer_address.clone(), web_proxy_tokens.clone(), remote.clone(), fetch.clone()));
pages
}
fn insert<T : WebApp + Default + 'static>(pages: &mut Endpoints, id: &str, embed_at: Embeddable) {
pages.insert(id.to_owned(), Box::new(match embed_at {
Embeddable::Yes(port) => PageEndpoint::new_safe_to_embed(T::default(), port),
Embeddable::Yes(address) => PageEndpoint::new_safe_to_embed(T::default(), address),
Embeddable::No => PageEndpoint::new(T::default()),
}));
}
enum Embeddable {
Yes(Option<u16>),
Yes(Option<(String, u16)>),
#[allow(dead_code)]
No,
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -16,7 +16,6 @@
//! Simple Content Handler
use std::io::Write;
use hyper::{header, server, Decoder, Encoder, Next};
use hyper::net::HttpStream;
use hyper::mime::Mime;
@@ -32,7 +31,7 @@ pub struct ContentHandler {
content: String,
mimetype: Mime,
write_pos: usize,
safe_to_embed_at_port: Option<u16>,
safe_to_embed_on: Option<(String, u16)>,
}
impl ContentHandler {
@@ -44,31 +43,31 @@ impl ContentHandler {
Self::new(StatusCode::NotFound, content, mimetype)
}
pub fn html(code: StatusCode, content: String, embeddable_at: Option<u16>) -> Self {
Self::new_embeddable(code, content, mime!(Text/Html), embeddable_at)
pub fn html(code: StatusCode, content: String, embeddable_on: Option<(String, u16)>) -> Self {
Self::new_embeddable(code, content, mime!(Text/Html), embeddable_on)
}
pub fn error(code: StatusCode, title: &str, message: &str, details: Option<&str>, embeddable_at: Option<u16>) -> Self {
pub fn error(code: StatusCode, title: &str, message: &str, details: Option<&str>, embeddable_on: Option<(String, u16)>) -> Self {
Self::html(code, format!(
include_str!("../error_tpl.html"),
title=title,
message=message,
details=details.unwrap_or_else(|| ""),
version=version(),
), embeddable_at)
), embeddable_on)
}
pub fn new(code: StatusCode, content: String, mimetype: Mime) -> Self {
Self::new_embeddable(code, content, mimetype, None)
}
pub fn new_embeddable(code: StatusCode, content: String, mimetype: Mime, embeddable_at: Option<u16>) -> Self {
pub fn new_embeddable(code: StatusCode, content: String, mimetype: Mime, embeddable_on: Option<(String, u16)>) -> Self {
ContentHandler {
code: code,
content: content,
mimetype: mimetype,
write_pos: 0,
safe_to_embed_at_port: embeddable_at,
safe_to_embed_on: embeddable_on,
}
}
}
@@ -85,7 +84,7 @@ impl server::Handler<HttpStream> for ContentHandler {
fn on_response(&mut self, res: &mut server::Response) -> Next {
res.set_status(self.code);
res.headers_mut().set(header::ContentType(self.mimetype.clone()));
add_security_headers(&mut res.headers_mut(), self.safe_to_embed_at_port.clone());
add_security_headers(&mut res.headers_mut(), self.safe_to_embed_on.clone());
Next::write()
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -16,41 +16,56 @@
//! Hyper Server Handler that fetches a file during a request (proxy).
use std::{fs, fmt};
use std::path::PathBuf;
use std::fmt;
use std::sync::{mpsc, Arc};
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Instant, Duration};
use fetch::{self, Fetch};
use futures::Future;
use parity_reactor::Remote;
use util::Mutex;
use url::Url;
use fetch::{Client, Fetch, FetchResult};
use hyper::{server, Decoder, Encoder, Next, Method, Control};
use hyper::net::HttpStream;
use hyper::uri::RequestUri;
use hyper::status::StatusCode;
use handlers::{ContentHandler, Redirection, extract_url};
use page::LocalPageEndpoint;
use endpoint::EndpointPath;
use handlers::{ContentHandler, StreamingHandler};
use page::{LocalPageEndpoint, PageHandlerWaiting};
const FETCH_TIMEOUT: u64 = 30;
const FETCH_TIMEOUT: u64 = 300;
enum FetchState {
NotStarted(String),
Error(ContentHandler),
InProgress(mpsc::Receiver<FetchResult>),
Done(String, LocalPageEndpoint, Redirection),
pub enum ValidatorResponse {
Local(LocalPageEndpoint),
Streaming(StreamingHandler<fetch::Response>),
}
pub trait ContentValidator {
pub trait ContentValidator: Send + 'static {
type Error: fmt::Debug + fmt::Display;
fn validate_and_install(&self, app: PathBuf) -> Result<(String, LocalPageEndpoint), Self::Error>;
fn done(&self, Option<LocalPageEndpoint>);
fn validate_and_install(&self, fetch::Response) -> Result<ValidatorResponse, Self::Error>;
}
enum FetchState {
Waiting,
NotStarted(String),
Error(ContentHandler),
InProgress(mpsc::Receiver<FetchState>),
Streaming(StreamingHandler<fetch::Response>),
Done(LocalPageEndpoint, Box<PageHandlerWaiting>),
}
enum WaitResult {
Error(ContentHandler),
Done(LocalPageEndpoint),
NonAwaitable,
}
#[derive(Clone)]
pub struct FetchControl {
abort: Arc<AtomicBool>,
listeners: Mutex<Vec<(Control, mpsc::Sender<FetchState>)>>,
listeners: Arc<Mutex<Vec<(Control, mpsc::Sender<WaitResult>)>>>,
deadline: Instant,
}
@@ -58,16 +73,17 @@ impl Default for FetchControl {
fn default() -> Self {
FetchControl {
abort: Arc::new(AtomicBool::new(false)),
listeners: Mutex::new(Vec::new()),
listeners: Arc::new(Mutex::new(Vec::new())),
deadline: Instant::now() + Duration::from_secs(FETCH_TIMEOUT),
}
}
}
impl FetchControl {
fn notify<F: Fn() -> FetchState>(&self, status: F) {
fn notify<F: Fn() -> WaitResult>(&self, status: F) {
let mut listeners = self.listeners.lock();
for (control, sender) in listeners.drain(..) {
trace!(target: "dapps", "Resuming request waiting for content...");
if let Err(e) = sender.send(status()) {
trace!(target: "dapps", "Waiting listener notification failed: {:?}", e);
} else {
@@ -78,148 +94,246 @@ impl FetchControl {
fn set_status(&self, status: &FetchState) {
match *status {
FetchState::Error(ref handler) => self.notify(|| FetchState::Error(handler.clone())),
FetchState::Done(ref id, ref endpoint, ref handler) => self.notify(|| FetchState::Done(id.clone(), endpoint.clone(), handler.clone())),
FetchState::NotStarted(_) | FetchState::InProgress(_) => {},
FetchState::Error(ref handler) => self.notify(|| WaitResult::Error(handler.clone())),
FetchState::Done(ref endpoint, _) => self.notify(|| WaitResult::Done(endpoint.clone())),
FetchState::Streaming(_) => self.notify(|| WaitResult::NonAwaitable),
FetchState::NotStarted(_) | FetchState::InProgress(_) | FetchState::Waiting => {},
}
}
pub fn is_deadline_reached(&self) -> bool {
self.deadline < Instant::now()
}
pub fn abort(&self) {
self.abort.store(true, Ordering::SeqCst);
}
pub fn to_handler(&self, control: Control) -> Box<server::Handler<HttpStream> + Send> {
pub fn to_async_handler(&self, path: EndpointPath, control: Control) -> Box<server::Handler<HttpStream> + Send> {
let (tx, rx) = mpsc::channel();
self.listeners.lock().push((control, tx));
Box::new(WaitingHandler {
receiver: rx,
state: None,
state: FetchState::Waiting,
uri: RequestUri::default(),
path: path,
})
}
}
pub struct WaitingHandler {
receiver: mpsc::Receiver<FetchState>,
state: Option<FetchState>,
receiver: mpsc::Receiver<WaitResult>,
state: FetchState,
uri: RequestUri,
path: EndpointPath,
}
impl server::Handler<HttpStream> for WaitingHandler {
fn on_request(&mut self, _request: server::Request<HttpStream>) -> Next {
fn on_request(&mut self, request: server::Request<HttpStream>) -> Next {
self.uri = request.uri().clone();
Next::wait()
}
fn on_request_readable(&mut self, _decoder: &mut Decoder<HttpStream>) -> Next {
self.state = self.receiver.try_recv().ok();
Next::write()
fn on_request_readable(&mut self, decoder: &mut Decoder<HttpStream>) -> Next {
let result = self.receiver.try_recv().ok();
self.state = match result {
Some(WaitResult::Error(handler)) => FetchState::Error(handler),
Some(WaitResult::Done(endpoint)) => {
let mut page_handler = endpoint.to_page_handler(self.path.clone());
page_handler.set_uri(&self.uri);
FetchState::Done(endpoint, page_handler)
},
_ => {
warn!("A result for waiting request was not received.");
FetchState::Waiting
},
};
match self.state {
FetchState::Done(_, ref mut handler) => handler.on_request_readable(decoder),
FetchState::Streaming(ref mut handler) => handler.on_request_readable(decoder),
FetchState::Error(ref mut handler) => handler.on_request_readable(decoder),
_ => Next::write(),
}
}
fn on_response(&mut self, res: &mut server::Response) -> Next {
match self.state {
Some(FetchState::Done(_, _, ref mut handler)) => handler.on_response(res),
Some(FetchState::Error(ref mut handler)) => handler.on_response(res),
FetchState::Done(_, ref mut handler) => handler.on_response(res),
FetchState::Streaming(ref mut handler) => handler.on_response(res),
FetchState::Error(ref mut handler) => handler.on_response(res),
_ => Next::end(),
}
}
fn on_response_writable(&mut self, encoder: &mut Encoder<HttpStream>) -> Next {
match self.state {
Some(FetchState::Done(_, _, ref mut handler)) => handler.on_response_writable(encoder),
Some(FetchState::Error(ref mut handler)) => handler.on_response_writable(encoder),
FetchState::Done(_, ref mut handler) => handler.on_response_writable(encoder),
FetchState::Streaming(ref mut handler) => handler.on_response_writable(encoder),
FetchState::Error(ref mut handler) => handler.on_response_writable(encoder),
_ => Next::end(),
}
}
}
pub struct ContentFetcherHandler<H: ContentValidator> {
fetch_control: Arc<FetchControl>,
control: Option<Control>,
status: FetchState,
client: Option<Client>,
installer: H,
request_url: Option<Url>,
embeddable_at: Option<u16>,
#[derive(Clone)]
struct Errors {
embeddable_on: Option<(String, u16)>,
}
impl<H: ContentValidator> Drop for ContentFetcherHandler<H> {
fn drop(&mut self) {
let result = match self.status {
FetchState::Done(_, ref result, _) => Some(result.clone()),
_ => None,
};
self.installer.done(result);
impl Errors {
fn download_error<E: fmt::Debug>(&self, e: E) -> ContentHandler {
ContentHandler::error(
StatusCode::BadGateway,
"Download Error",
"There was an error when fetching the content.",
Some(&format!("{:?}", e)),
self.embeddable_on.clone(),
)
}
fn invalid_content<E: fmt::Debug>(&self, e: E) -> ContentHandler {
ContentHandler::error(
StatusCode::BadGateway,
"Invalid Dapp",
"Downloaded bundle does not contain a valid content.",
Some(&format!("{:?}", e)),
self.embeddable_on.clone(),
)
}
fn timeout_error(&self) -> ContentHandler {
ContentHandler::error(
StatusCode::GatewayTimeout,
"Download Timeout",
&format!("Could not fetch content within {} seconds.", FETCH_TIMEOUT),
None,
self.embeddable_on.clone(),
)
}
fn method_not_allowed(&self) -> ContentHandler {
ContentHandler::error(
StatusCode::MethodNotAllowed,
"Method Not Allowed",
"Only <code>GET</code> requests are allowed.",
None,
self.embeddable_on.clone(),
)
}
}
impl<H: ContentValidator> ContentFetcherHandler<H> {
pub struct ContentFetcherHandler<H: ContentValidator, F: Fetch> {
fetch_control: FetchControl,
control: Control,
remote: Remote,
status: FetchState,
fetch: F,
installer: Option<H>,
path: EndpointPath,
errors: Errors,
}
impl<H: ContentValidator, F: Fetch> ContentFetcherHandler<H, F> {
pub fn new(
url: String,
path: EndpointPath,
control: Control,
handler: H,
embeddable_at: Option<u16>,
) -> (Self, Arc<FetchControl>) {
let fetch_control = Arc::new(FetchControl::default());
let client = Client::default();
let handler = ContentFetcherHandler {
fetch_control: fetch_control.clone(),
control: Some(control),
client: Some(client),
installer: H,
embeddable_on: Option<(String, u16)>,
remote: Remote,
fetch: F,
) -> Self {
ContentFetcherHandler {
fetch_control: FetchControl::default(),
control: control,
remote: remote,
fetch: fetch,
status: FetchState::NotStarted(url),
installer: handler,
request_url: None,
embeddable_at: embeddable_at,
};
(handler, fetch_control)
installer: Some(installer),
path: path,
errors: Errors {
embeddable_on: embeddable_on,
},
}
}
fn close_client(client: &mut Option<Client>) {
client.take()
.expect("After client is closed we are going into write, hence we can never close it again")
.close();
pub fn fetch_control(&self) -> FetchControl {
self.fetch_control.clone()
}
fn fetch_content(client: &mut Client, url: &str, abort: Arc<AtomicBool>, control: Control) -> Result<mpsc::Receiver<FetchResult>, String> {
client.request(url, abort, Box::new(move || {
trace!(target: "dapps", "Fetching finished.");
fn fetch_content(&self, uri: RequestUri, url: &str, installer: H) -> mpsc::Receiver<FetchState> {
let (tx, rx) = mpsc::channel();
let abort = self.fetch_control.abort.clone();
let path = self.path.clone();
let tx2 = tx.clone();
let control = self.control.clone();
let errors = self.errors.clone();
let future = self.fetch.fetch_with_abort(url, abort.into()).then(move |result| {
trace!(target: "dapps", "Fetching content finished. Starting validation: {:?}", result);
let new_state = match result {
Ok(response) => match installer.validate_and_install(response) {
Ok(ValidatorResponse::Local(endpoint)) => {
trace!(target: "dapps", "Validation OK. Returning response.");
let mut handler = endpoint.to_page_handler(path);
handler.set_uri(&uri);
FetchState::Done(endpoint, handler)
},
Ok(ValidatorResponse::Streaming(handler)) => {
trace!(target: "dapps", "Validation OK. Streaming response.");
FetchState::Streaming(handler)
},
Err(e) => {
trace!(target: "dapps", "Error while validating content: {:?}", e);
FetchState::Error(errors.invalid_content(e))
},
},
Err(e) => {
warn!(target: "dapps", "Unable to fetch content: {:?}", e);
FetchState::Error(errors.download_error(e))
},
};
// Content may be resolved when the connection is already dropped.
let _ = tx2.send(new_state);
// Ignoring control errors
let _ = control.ready(Next::read());
})).map_err(|e| format!("{:?}", e))
Ok(()) as Result<(), ()>
});
// make sure to run within fetch thread pool.
let future = self.fetch.process(future);
// spawn to event loop
let control = self.control.clone();
let errors = self.errors.clone();
self.remote.spawn_with_timeout(|| future, Duration::from_secs(FETCH_TIMEOUT), move || {
// Notify about the timeout
let _ = tx.send(FetchState::Error(errors.timeout_error()));
// Ignoring control errors
let _ = control.ready(Next::read());
});
rx
}
}
impl<H: ContentValidator> server::Handler<HttpStream> for ContentFetcherHandler<H> {
impl<H: ContentValidator, F: Fetch> server::Handler<HttpStream> for ContentFetcherHandler<H, F> {
fn on_request(&mut self, request: server::Request<HttpStream>) -> Next {
self.request_url = extract_url(&request);
let status = if let FetchState::NotStarted(ref url) = self.status {
let uri = request.uri().clone();
let installer = self.installer.take().expect("Installer always set initialy; installer used only in on_request; on_request invoked only once; qed");
Some(match *request.method() {
// Start fetching content
Method::Get => {
trace!(target: "dapps", "Fetching content from: {:?}", url);
let control = self.control.take().expect("on_request is called only once, thus control is always Some");
let client = self.client.as_mut().expect("on_request is called before client is closed.");
let fetch = Self::fetch_content(client, url, self.fetch_control.abort.clone(), control);
match fetch {
Ok(receiver) => FetchState::InProgress(receiver),
Err(e) => FetchState::Error(ContentHandler::error(
StatusCode::BadGateway,
"Unable To Start Dapp Download",
"Could not initialize download of the dapp. It might be a problem with the remote server.",
Some(&format!("{}", e)),
self.embeddable_at,
)),
}
let receiver = self.fetch_content(uri, url, installer);
FetchState::InProgress(receiver)
},
// or return error
_ => FetchState::Error(ContentHandler::error(
StatusCode::MethodNotAllowed,
"Method Not Allowed",
"Only <code>GET</code> requests are allowed.",
None,
self.embeddable_at,
)),
_ => FetchState::Error(self.errors.method_not_allowed()),
})
} else { None };
@@ -234,60 +348,16 @@ impl<H: ContentValidator> server::Handler<HttpStream> for ContentFetcherHandler<
fn on_request_readable(&mut self, decoder: &mut Decoder<HttpStream>) -> Next {
let (status, next) = match self.status {
// Request may time out
FetchState::InProgress(_) if self.fetch_control.deadline < Instant::now() => {
FetchState::InProgress(_) if self.fetch_control.is_deadline_reached() => {
trace!(target: "dapps", "Fetching dapp failed because of timeout.");
let timeout = ContentHandler::error(
StatusCode::GatewayTimeout,
"Download Timeout",
&format!("Could not fetch content within {} seconds.", FETCH_TIMEOUT),
None,
self.embeddable_at,
);
Self::close_client(&mut self.client);
(Some(FetchState::Error(timeout)), Next::write())
(Some(FetchState::Error(self.errors.timeout_error())), Next::write())
},
FetchState::InProgress(ref receiver) => {
// Check if there is an answer
let rec = receiver.try_recv();
match rec {
// Unpack and validate
Ok(Ok(path)) => {
trace!(target: "dapps", "Fetching content finished. Starting validation ({:?})", path);
Self::close_client(&mut self.client);
// Unpack and verify
let state = match self.installer.validate_and_install(path.clone()) {
Err(e) => {
trace!(target: "dapps", "Error while validating content: {:?}", e);
FetchState::Error(ContentHandler::error(
StatusCode::BadGateway,
"Invalid Dapp",
"Downloaded bundle does not contain a valid content.",
Some(&format!("{:?}", e)),
self.embeddable_at,
))
},
Ok((id, result)) => {
let url: String = self.request_url.take()
.map(|url| url.raw.into_string())
.expect("Request URL always read in on_request; qed");
FetchState::Done(id, result, Redirection::new(&url))
},
};
// Remove temporary zip file
let _ = fs::remove_file(path);
(Some(state), Next::write())
},
Ok(Err(e)) => {
warn!(target: "dapps", "Unable to fetch content: {:?}", e);
let error = ContentHandler::error(
StatusCode::BadGateway,
"Download Error",
"There was an error when fetching the content.",
Some(&format!("{:?}", e)),
self.embeddable_at,
);
(Some(FetchState::Error(error)), Next::write())
},
// just return the new state
Ok(state) => (Some(state), Next::write()),
// wait some more
_ => (None, Next::wait())
}
@@ -306,7 +376,8 @@ impl<H: ContentValidator> server::Handler<HttpStream> for ContentFetcherHandler<
fn on_response(&mut self, res: &mut server::Response) -> Next {
match self.status {
FetchState::Done(_, _, ref mut handler) => handler.on_response(res),
FetchState::Done(_, ref mut handler) => handler.on_response(res),
FetchState::Streaming(ref mut handler) => handler.on_response(res),
FetchState::Error(ref mut handler) => handler.on_response(res),
_ => Next::end(),
}
@@ -314,7 +385,8 @@ impl<H: ContentValidator> server::Handler<HttpStream> for ContentFetcherHandler<
fn on_response_writable(&mut self, encoder: &mut Encoder<HttpStream>) -> Next {
match self.status {
FetchState::Done(_, _, ref mut handler) => handler.on_response_writable(encoder),
FetchState::Done(_, ref mut handler) => handler.on_response_writable(encoder),
FetchState::Streaming(ref mut handler) => handler.on_response_writable(encoder),
FetchState::Error(ref mut handler) => handler.on_response_writable(encoder),
_ => Next::end(),
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -17,31 +17,33 @@
//! Hyper handlers implementations.
mod auth;
mod echo;
mod content;
mod redirect;
mod echo;
mod fetch;
mod redirect;
mod streaming;
pub use self::auth::AuthRequiredHandler;
pub use self::echo::EchoHandler;
pub use self::content::ContentHandler;
pub use self::echo::EchoHandler;
pub use self::fetch::{ContentFetcherHandler, ContentValidator, FetchControl, ValidatorResponse};
pub use self::redirect::Redirection;
pub use self::fetch::{ContentFetcherHandler, ContentValidator, FetchControl};
pub use self::streaming::StreamingHandler;
use url::Url;
use hyper::{server, header, net, uri};
use signer_address;
use address;
/// Adds security-related headers to the Response.
pub fn add_security_headers(headers: &mut header::Headers, embeddable_at: Option<u16>) {
pub fn add_security_headers(headers: &mut header::Headers, embeddable_on: Option<(String, u16)>) {
headers.set_raw("X-XSS-Protection", vec![b"1; mode=block".to_vec()]);
headers.set_raw("X-Content-Type-Options", vec![b"nosniff".to_vec()]);
// Embedding header:
if let Some(port) = embeddable_at {
if let Some(embeddable_on) = embeddable_on {
headers.set_raw(
"X-Frame-Options",
vec![format!("ALLOW-FROM http://{}", signer_address(port)).into_bytes()]
vec![format!("ALLOW-FROM http://{}", address(embeddable_on)).into_bytes()]
);
} else {
// TODO [ToDr] Should we be more strict here (DENY?)?
@@ -49,20 +51,30 @@ pub fn add_security_headers(headers: &mut header::Headers, embeddable_at: Option
}
}
/// Extracts URL part from the Request.
pub fn extract_url(req: &server::Request<net::HttpStream>) -> Option<Url> {
match *req.uri() {
convert_uri_to_url(req.uri(), req.headers().get::<header::Host>())
}
/// Extracts URL given URI and Host header.
pub fn convert_uri_to_url(uri: &uri::RequestUri, host: Option<&header::Host>) -> Option<Url> {
match *uri {
uri::RequestUri::AbsoluteUri(ref url) => {
match Url::from_generic_url(url.clone()) {
Ok(url) => Some(url),
_ => None,
}
},
uri::RequestUri::AbsolutePath(ref path) => {
uri::RequestUri::AbsolutePath { ref path, ref query } => {
let query = match *query {
Some(ref query) => format!("?{}", query),
None => "".into(),
};
// Attempt to prepend the Host header (mandatory in HTTP/1.1)
let url_string = match req.headers().get::<header::Host>() {
let url_string = match host {
Some(ref host) => {
format!("http://{}:{}{}", host.hostname, host.port.unwrap_or(80), path)
format!("http://{}:{}{}{}", host.hostname, host.port.unwrap_or(80), path, query)
},
None => return None,
};

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -0,0 +1,101 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Content Stream Response
use std::io::{self, Read};
use hyper::{header, server, Decoder, Encoder, Next};
use hyper::net::HttpStream;
use hyper::mime::Mime;
use hyper::status::StatusCode;
use handlers::add_security_headers;
const BUFFER_SIZE: usize = 1024;
pub struct StreamingHandler<R: io::Read> {
buffer: [u8; BUFFER_SIZE],
buffer_leftover: usize,
status: StatusCode,
content: io::BufReader<R>,
mimetype: Mime,
safe_to_embed_on: Option<(String, u16)>,
}
impl<R: io::Read> StreamingHandler<R> {
pub fn new(content: R, status: StatusCode, mimetype: Mime, embeddable_on: Option<(String, u16)>) -> Self {
StreamingHandler {
buffer: [0; BUFFER_SIZE],
buffer_leftover: 0,
status: status,
content: io::BufReader::new(content),
mimetype: mimetype,
safe_to_embed_on: embeddable_on,
}
}
pub fn set_initial_content(&mut self, content: &str) {
assert_eq!(self.buffer_leftover, 0);
let bytes = content.as_bytes();
self.buffer_leftover = bytes.len();
self.buffer[0..self.buffer_leftover].copy_from_slice(bytes);
}
}
impl<R: io::Read> server::Handler<HttpStream> for StreamingHandler<R> {
fn on_request(&mut self, _request: server::Request<HttpStream>) -> Next {
Next::write()
}
fn on_request_readable(&mut self, _decoder: &mut Decoder<HttpStream>) -> Next {
Next::write()
}
fn on_response(&mut self, res: &mut server::Response) -> Next {
res.set_status(self.status);
res.headers_mut().set(header::ContentType(self.mimetype.clone()));
add_security_headers(&mut res.headers_mut(), self.safe_to_embed_on.clone());
Next::write()
}
fn on_response_writable(&mut self, encoder: &mut Encoder<HttpStream>) -> Next {
fn handle_error(e: io::Error) -> Next {
match e.kind() {
::std::io::ErrorKind::WouldBlock => Next::write(),
_ => Next::end(),
}
}
let write_pos = self.buffer_leftover;
match self.content.read(&mut self.buffer[write_pos..]) {
Err(e) => handle_error(e),
Ok(read) => match encoder.write(&self.buffer[..write_pos + read]) {
Err(e) => handle_error(e),
Ok(0) => Next::end(),
Ok(wrote) => {
self.buffer_leftover = write_pos + read - wrote;
if self.buffer_leftover > 0 {
for i in self.buffer_leftover..write_pos + read {
self.buffer.swap(i, i - self.buffer_leftover);
}
}
Next::write()
},
},
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -51,16 +51,19 @@ extern crate serde;
extern crate serde_json;
extern crate zip;
extern crate rand;
extern crate ethabi;
extern crate jsonrpc_core;
extern crate jsonrpc_http_server;
extern crate mime_guess;
extern crate rustc_serialize;
extern crate ethcore_rpc;
extern crate ethcore_util as util;
extern crate parity_hash_fetch as hash_fetch;
extern crate linked_hash_map;
extern crate fetch;
extern crate parity_dapps_glue as parity_dapps;
extern crate futures;
extern crate parity_reactor;
#[macro_use]
extern crate log;
#[macro_use]
@@ -81,18 +84,21 @@ mod rpc;
mod api;
mod proxypac;
mod url;
mod web;
#[cfg(test)]
mod tests;
pub use self::apps::urlhint::ContractClient;
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
use std::net::SocketAddr;
use std::collections::HashMap;
use hash_fetch::urlhint::ContractClient;
use fetch::{Fetch, Client as FetchClient};
use jsonrpc_core::{IoHandler, IoDelegate};
use router::auth::{Authorization, NoAuth, HttpBasicAuth};
use ethcore_rpc::Extendable;
use parity_reactor::Remote;
use self::apps::{HOME_PAGE, DAPPS_DOMAIN};
@@ -106,16 +112,30 @@ impl<F> SyncStatus for F where F: Fn() -> bool + Send + Sync {
fn is_major_importing(&self) -> bool { self() }
}
/// Validates Web Proxy tokens
pub trait WebProxyTokens: Send + Sync {
/// Should return true if token is a valid web proxy access token.
fn is_web_proxy_token_valid(&self, token: &String) -> bool;
}
impl<F> WebProxyTokens for F where F: Fn(String) -> bool + Send + Sync {
fn is_web_proxy_token_valid(&self, token: &String) -> bool { self(token.to_owned()) }
}
/// Webapps HTTP+RPC server build.
pub struct ServerBuilder {
dapps_path: String,
pub struct ServerBuilder<T: Fetch = FetchClient> {
dapps_path: PathBuf,
extra_dapps: Vec<PathBuf>,
handler: Arc<IoHandler>,
registrar: Arc<ContractClient>,
sync_status: Arc<SyncStatus>,
signer_port: Option<u16>,
web_proxy_tokens: Arc<WebProxyTokens>,
signer_address: Option<(String, u16)>,
remote: Remote,
fetch: Option<T>,
}
impl Extendable for ServerBuilder {
impl<T: Fetch> Extendable for ServerBuilder<T> {
fn add_delegate<D: Send + Sync + 'static>(&self, delegate: IoDelegate<D>) {
self.handler.add_delegate(delegate);
}
@@ -123,55 +143,105 @@ impl Extendable for ServerBuilder {
impl ServerBuilder {
/// Construct new dapps server
pub fn new(dapps_path: String, registrar: Arc<ContractClient>) -> Self {
pub fn new<P: AsRef<Path>>(dapps_path: P, registrar: Arc<ContractClient>, remote: Remote) -> Self {
ServerBuilder {
dapps_path: dapps_path,
dapps_path: dapps_path.as_ref().to_owned(),
extra_dapps: vec![],
handler: Arc::new(IoHandler::new()),
registrar: registrar,
sync_status: Arc::new(|| false),
signer_port: None,
web_proxy_tokens: Arc::new(|_| false),
signer_address: None,
remote: remote,
fetch: None,
}
}
}
impl<T: Fetch> ServerBuilder<T> {
/// Set a fetch client to use.
pub fn fetch<X: Fetch>(self, fetch: X) -> ServerBuilder<X> {
ServerBuilder {
dapps_path: self.dapps_path,
extra_dapps: vec![],
handler: self.handler,
registrar: self.registrar,
sync_status: self.sync_status,
web_proxy_tokens: self.web_proxy_tokens,
signer_address: self.signer_address,
remote: self.remote,
fetch: Some(fetch),
}
}
/// Change default sync status.
pub fn with_sync_status(&mut self, status: Arc<SyncStatus>) {
pub fn sync_status(mut self, status: Arc<SyncStatus>) -> Self {
self.sync_status = status;
self
}
/// Change default web proxy tokens validator.
pub fn web_proxy_tokens(mut self, tokens: Arc<WebProxyTokens>) -> Self {
self.web_proxy_tokens = tokens;
self
}
/// Change default signer port.
pub fn with_signer_port(&mut self, signer_port: Option<u16>) {
self.signer_port = signer_port;
pub fn signer_address(mut self, signer_address: Option<(String, u16)>) -> Self {
self.signer_address = signer_address;
self
}
/// Change extra dapps paths (apart from `dapps_path`)
pub fn extra_dapps<P: AsRef<Path>>(mut self, extra_dapps: &[P]) -> Self {
self.extra_dapps = extra_dapps.iter().map(|p| p.as_ref().to_owned()).collect();
self
}
/// Asynchronously start server with no authentication,
/// returns result with `Server` handle on success or an error.
pub fn start_unsecured_http(&self, addr: &SocketAddr, hosts: Option<Vec<String>>) -> Result<Server, ServerError> {
pub fn start_unsecured_http(self, addr: &SocketAddr, hosts: Option<Vec<String>>) -> Result<Server, ServerError> {
Server::start_http(
addr,
hosts,
NoAuth,
self.handler.clone(),
self.dapps_path.clone(),
self.signer_port.clone(),
self.extra_dapps.clone(),
self.signer_address.clone(),
self.registrar.clone(),
self.sync_status.clone(),
self.web_proxy_tokens.clone(),
self.remote.clone(),
self.fetch_client()?,
)
}
/// Asynchronously start server with `HTTP Basic Authentication`,
/// return result with `Server` handle on success or an error.
pub fn start_basic_auth_http(&self, addr: &SocketAddr, hosts: Option<Vec<String>>, username: &str, password: &str) -> Result<Server, ServerError> {
pub fn start_basic_auth_http(self, addr: &SocketAddr, hosts: Option<Vec<String>>, username: &str, password: &str) -> Result<Server, ServerError> {
Server::start_http(
addr,
hosts,
HttpBasicAuth::single_user(username, password),
self.handler.clone(),
self.dapps_path.clone(),
self.signer_port.clone(),
self.extra_dapps.clone(),
self.signer_address.clone(),
self.registrar.clone(),
self.sync_status.clone(),
self.web_proxy_tokens.clone(),
self.remote.clone(),
self.fetch_client()?,
)
}
fn fetch_client(&self) -> Result<T, ServerError> {
match self.fetch.clone() {
Some(fetch) => Ok(fetch),
None => T::new().map_err(|_| ServerError::FetchInitialization),
}
}
}
/// Webapps HTTP server.
@@ -197,31 +267,48 @@ impl Server {
}
/// Returns a list of CORS domains for API endpoint.
fn cors_domains(signer_port: Option<u16>) -> Vec<String> {
match signer_port {
Some(port) => vec![
fn cors_domains(signer_address: Option<(String, u16)>) -> Vec<String> {
match signer_address {
Some(signer_address) => vec![
format!("http://{}{}", HOME_PAGE, DAPPS_DOMAIN),
format!("http://{}", signer_address(port)),
format!("http://{}", address(signer_address)),
],
None => vec![],
}
}
fn start_http<A: Authorization + 'static>(
fn start_http<A: Authorization + 'static, F: Fetch>(
addr: &SocketAddr,
hosts: Option<Vec<String>>,
authorization: A,
handler: Arc<IoHandler>,
dapps_path: String,
signer_port: Option<u16>,
dapps_path: PathBuf,
extra_dapps: Vec<PathBuf>,
signer_address: Option<(String, u16)>,
registrar: Arc<ContractClient>,
sync_status: Arc<SyncStatus>,
web_proxy_tokens: Arc<WebProxyTokens>,
remote: Remote,
fetch: F,
) -> Result<Server, ServerError> {
let panic_handler = Arc::new(Mutex::new(None));
let authorization = Arc::new(authorization);
let content_fetcher = Arc::new(apps::fetcher::ContentFetcher::new(apps::urlhint::URLHintContract::new(registrar), sync_status, signer_port));
let endpoints = Arc::new(apps::all_endpoints(dapps_path, signer_port.clone()));
let cors_domains = Self::cors_domains(signer_port);
let content_fetcher = Arc::new(apps::fetcher::ContentFetcher::new(
hash_fetch::urlhint::URLHintContract::new(registrar),
sync_status,
signer_address.clone(),
remote.clone(),
fetch.clone(),
));
let endpoints = Arc::new(apps::all_endpoints(
dapps_path,
extra_dapps,
signer_address.clone(),
web_proxy_tokens,
remote.clone(),
fetch.clone(),
));
let cors_domains = Self::cors_domains(signer_address.clone());
let special = Arc::new({
let mut special = HashMap::new();
@@ -235,10 +322,10 @@ impl Server {
});
let hosts = Self::allowed_hosts(hosts, format!("{}", addr));
try!(hyper::Server::http(addr))
hyper::Server::http(addr)?
.handle(move |ctrl| router::Router::new(
ctrl,
signer_port.clone(),
signer_address.clone(),
content_fetcher.clone(),
endpoints.clone(),
special.clone(),
@@ -267,7 +354,11 @@ impl Server {
#[cfg(test)]
/// Returns address that this server is bound to.
pub fn addr(&self) -> &SocketAddr {
self.server.as_ref().expect("server is always Some at the start; it's consumed only when object is dropped; qed").addr()
self.server.as_ref()
.expect("server is always Some at the start; it's consumed only when object is dropped; qed")
.addrs()
.first()
.expect("You cannot start the server without binding to at least one address; qed")
}
}
@@ -284,6 +375,8 @@ pub enum ServerError {
IoError(std::io::Error),
/// Other `hyper` error
Other(hyper::error::Error),
/// Fetch service initialization error
FetchInitialization,
}
impl From<hyper::error::Error> for ServerError {
@@ -296,14 +389,14 @@ impl From<hyper::error::Error> for ServerError {
}
/// Random filename
pub fn random_filename() -> String {
fn random_filename() -> String {
use ::rand::Rng;
let mut rng = ::rand::OsRng::new().unwrap();
rng.gen_ascii_chars().take(12).collect()
}
fn signer_address(port: u16) -> String {
format!("127.0.0.1:{}", port)
fn address(address: (String, u16)) -> String {
format!("{}:{}", address.0, address.1)
}
#[cfg(test)]
@@ -332,7 +425,7 @@ mod util_tests {
// when
let none = Server::cors_domains(None);
let some = Server::cors_domains(Some(18180));
let some = Server::cors_domains(Some(("127.0.0.1".into(), 18180)));
// then
assert_eq!(none, Vec::<String>::new());

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@ pub struct PageEndpoint<T : WebApp + 'static> {
/// Prefix to strip from the path (when `None` deducted from `app_id`)
pub prefix: Option<String>,
/// Safe to be loaded in frame by other origin. (use wisely!)
safe_to_embed_at_port: Option<u16>,
safe_to_embed_on: Option<(String, u16)>,
info: EndpointInfo,
}
@@ -36,7 +36,7 @@ impl<T: WebApp + 'static> PageEndpoint<T> {
PageEndpoint {
app: Arc::new(app),
prefix: None,
safe_to_embed_at_port: None,
safe_to_embed_on: None,
info: EndpointInfo::from(info),
}
}
@@ -49,7 +49,7 @@ impl<T: WebApp + 'static> PageEndpoint<T> {
PageEndpoint {
app: Arc::new(app),
prefix: Some(prefix),
safe_to_embed_at_port: None,
safe_to_embed_on: None,
info: EndpointInfo::from(info),
}
}
@@ -57,12 +57,12 @@ impl<T: WebApp + 'static> PageEndpoint<T> {
/// Creates new `PageEndpoint` which can be safely used in iframe
/// even from different origin. It might be dangerous (clickjacking).
/// Use wisely!
pub fn new_safe_to_embed(app: T, port: Option<u16>) -> Self {
pub fn new_safe_to_embed(app: T, address: Option<(String, u16)>) -> Self {
let info = app.info();
PageEndpoint {
app: Arc::new(app),
prefix: None,
safe_to_embed_at_port: port,
safe_to_embed_on: address,
info: EndpointInfo::from(info),
}
}
@@ -79,9 +79,9 @@ impl<T: WebApp> Endpoint for PageEndpoint<T> {
app: BuiltinDapp::new(self.app.clone()),
prefix: self.prefix.clone(),
path: path,
file: handler::ServedFile::new(self.safe_to_embed_at_port.clone()),
file: handler::ServedFile::new(self.safe_to_embed_on.clone()),
cache: PageCache::Disabled,
safe_to_embed_at_port: self.safe_to_embed_at_port.clone(),
safe_to_embed_on: self.safe_to_embed_on.clone(),
})
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::io::Write;
use time::{self, Duration};
use hyper::header;
@@ -60,13 +59,13 @@ pub enum ServedFile<T: Dapp> {
}
impl<T: Dapp> ServedFile<T> {
pub fn new(embeddable_at: Option<u16>) -> Self {
pub fn new(embeddable_on: Option<(String, u16)>) -> Self {
ServedFile::Error(ContentHandler::error(
StatusCode::NotFound,
"404 Not Found",
"Requested dapp resource was not found.",
None,
embeddable_at,
embeddable_on,
))
}
}
@@ -84,24 +83,45 @@ impl Default for PageCache {
}
}
/// A generic type for `PageHandler` allowing to set the URL.
/// Used by dapps fetching to set the URL after the content was downloaded.
pub trait PageHandlerWaiting: server::Handler<HttpStream> + Send {
fn set_uri(&mut self, uri: &RequestUri);
}
/// A handler for a single webapp.
/// Resolves correct paths and serves as a plumbing code between
/// hyper server and dapp.
pub struct PageHandler<T: Dapp> {
/// A Dapp.
pub app: T,
/// File currently being served (or `None` if file does not exist).
/// File currently being served
pub file: ServedFile<T>,
/// Optional prefix to strip from path.
pub prefix: Option<String>,
/// Requested path.
pub path: EndpointPath,
/// Flag indicating if the file can be safely embeded (put in iframe).
pub safe_to_embed_at_port: Option<u16>,
pub safe_to_embed_on: Option<(String, u16)>,
/// Cache settings for this page.
pub cache: PageCache,
}
impl<T: Dapp> PageHandlerWaiting for PageHandler<T> {
fn set_uri(&mut self, uri: &RequestUri) {
trace!(target: "dapps", "Setting URI: {:?}", uri);
self.file = match *uri {
RequestUri::AbsolutePath { ref path, .. } => {
self.app.file(&self.extract_path(path))
},
RequestUri::AbsoluteUri(ref url) => {
self.app.file(&self.extract_path(url.path()))
},
_ => None,
}.map_or_else(|| ServedFile::new(self.safe_to_embed_on.clone()), |f| ServedFile::File(f));
}
}
impl<T: Dapp> PageHandler<T> {
fn extract_path(&self, path: &str) -> String {
let app_id = &self.path.app_id;
@@ -125,15 +145,7 @@ impl<T: Dapp> PageHandler<T> {
impl<T: Dapp> server::Handler<HttpStream> for PageHandler<T> {
fn on_request(&mut self, req: server::Request<HttpStream>) -> Next {
self.file = match *req.uri() {
RequestUri::AbsolutePath(ref path) => {
self.app.file(&self.extract_path(path))
},
RequestUri::AbsoluteUri(ref url) => {
self.app.file(&self.extract_path(url.path()))
},
_ => None,
}.map_or_else(|| ServedFile::new(self.safe_to_embed_at_port.clone()), |f| ServedFile::File(f));
self.set_uri(req.uri());
Next::write()
}
@@ -162,7 +174,7 @@ impl<T: Dapp> server::Handler<HttpStream> for PageHandler<T> {
}
// Security headers:
add_security_headers(&mut res.headers_mut(), self.safe_to_embed_at_port);
add_security_headers(&mut res.headers_mut(), self.safe_to_embed_on.clone());
Next::write()
},
ServedFile::Error(ref mut handler) => {
@@ -246,7 +258,7 @@ fn should_extract_path_with_appid() {
},
file: ServedFile::new(None),
cache: Default::default(),
safe_to_embed_at_port: None,
safe_to_embed_on: None,
};
// when

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -18,42 +18,73 @@ use mime_guess;
use std::io::{Seek, Read, SeekFrom};
use std::fs;
use std::path::{Path, PathBuf};
use page::handler::{self, PageCache};
use page::handler::{self, PageCache, PageHandlerWaiting};
use endpoint::{Endpoint, EndpointInfo, EndpointPath, Handler};
use mime::Mime;
#[derive(Debug, Clone)]
pub struct LocalPageEndpoint {
path: PathBuf,
mime: Option<String>,
mime: Option<Mime>,
info: Option<EndpointInfo>,
cache: PageCache,
embeddable_at: Option<u16>,
embeddable_on: Option<(String, u16)>,
}
impl LocalPageEndpoint {
pub fn new(path: PathBuf, info: EndpointInfo, cache: PageCache, embeddable_at: Option<u16>) -> Self {
pub fn new(path: PathBuf, info: EndpointInfo, cache: PageCache, embeddable_on: Option<(String, u16)>) -> Self {
LocalPageEndpoint {
path: path,
mime: None,
info: Some(info),
cache: cache,
embeddable_at: embeddable_at,
embeddable_on: embeddable_on,
}
}
pub fn single_file(path: PathBuf, mime: String, cache: PageCache) -> Self {
pub fn single_file(path: PathBuf, mime: Mime, cache: PageCache) -> Self {
LocalPageEndpoint {
path: path,
mime: Some(mime),
info: None,
cache: cache,
embeddable_at: None,
embeddable_on: None,
}
}
pub fn path(&self) -> PathBuf {
self.path.clone()
}
fn page_handler_with_mime(&self, path: EndpointPath, mime: &Mime) -> handler::PageHandler<LocalSingleFile> {
handler::PageHandler {
app: LocalSingleFile { path: self.path.clone(), mime: format!("{}", mime) },
prefix: None,
path: path,
file: handler::ServedFile::new(None),
safe_to_embed_on: self.embeddable_on.clone(),
cache: self.cache,
}
}
fn page_handler(&self, path: EndpointPath) -> handler::PageHandler<LocalDapp> {
handler::PageHandler {
app: LocalDapp { path: self.path.clone() },
prefix: None,
path: path,
file: handler::ServedFile::new(None),
safe_to_embed_on: self.embeddable_on.clone(),
cache: self.cache,
}
}
pub fn to_page_handler(&self, path: EndpointPath) -> Box<PageHandlerWaiting> {
if let Some(ref mime) = self.mime {
Box::new(self.page_handler_with_mime(path, mime))
} else {
Box::new(self.page_handler(path))
}
}
}
impl Endpoint for LocalPageEndpoint {
@@ -63,23 +94,9 @@ impl Endpoint for LocalPageEndpoint {
fn to_handler(&self, path: EndpointPath) -> Box<Handler> {
if let Some(ref mime) = self.mime {
Box::new(handler::PageHandler {
app: LocalSingleFile { path: self.path.clone(), mime: mime.clone() },
prefix: None,
path: path,
file: handler::ServedFile::new(None),
safe_to_embed_at_port: self.embeddable_at,
cache: self.cache,
})
Box::new(self.page_handler_with_mime(path, mime))
} else {
Box::new(handler::PageHandler {
app: LocalDapp { path: self.path.clone() },
prefix: None,
path: path,
file: handler::ServedFile::new(None),
safe_to_embed_at_port: self.embeddable_at,
cache: self.cache,
})
Box::new(self.page_handler(path))
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -21,5 +21,5 @@ mod handler;
pub use self::local::LocalPageEndpoint;
pub use self::builtin::PageEndpoint;
pub use self::handler::PageCache;
pub use self::handler::{PageCache, PageHandlerWaiting};

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -19,24 +19,24 @@
use endpoint::{Endpoint, Handler, EndpointPath};
use handlers::ContentHandler;
use apps::{HOME_PAGE, DAPPS_DOMAIN};
use signer_address;
use address;
pub struct ProxyPac {
signer_port: Option<u16>,
signer_address: Option<(String, u16)>,
}
impl ProxyPac {
pub fn boxed(signer_port: Option<u16>) -> Box<Endpoint> {
pub fn boxed(signer_address: Option<(String, u16)>) -> Box<Endpoint> {
Box::new(ProxyPac {
signer_port: signer_port
signer_address: signer_address
})
}
}
impl Endpoint for ProxyPac {
fn to_handler(&self, path: EndpointPath) -> Box<Handler> {
let signer = self.signer_port
.map(signer_address)
let signer = self.signer_address.clone()
.map(address)
.unwrap_or_else(|| format!("{}:{}", path.host, path.port));
let content = format!(

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -20,16 +20,17 @@
pub mod auth;
mod host_validation;
use signer_address;
use address;
use std::cmp;
use std::sync::Arc;
use std::collections::HashMap;
use url::{Url, Host};
use hyper::{self, server, Next, Encoder, Decoder, Control, StatusCode};
use hyper::{self, server, header, Next, Encoder, Decoder, Control, StatusCode};
use hyper::net::HttpStream;
use apps::{self, DAPPS_DOMAIN};
use apps::fetcher::ContentFetcher;
use apps::fetcher::Fetcher;
use endpoint::{Endpoint, Endpoints, EndpointPath};
use handlers::{Redirection, extract_url, ContentHandler};
use handlers::{self, Redirection, ContentHandler};
use self::auth::{Authorization, Authorized};
/// Special endpoints are accessible on every domain (every dapp)
@@ -43,9 +44,9 @@ pub enum SpecialEndpoint {
pub struct Router<A: Authorization + 'static> {
control: Option<Control>,
signer_port: Option<u16>,
signer_address: Option<(String, u16)>,
endpoints: Arc<Endpoints>,
fetch: Arc<ContentFetcher>,
fetch: Arc<Fetcher>,
special: Arc<HashMap<SpecialEndpoint, Box<Endpoint>>>,
authorization: Arc<A>,
allowed_hosts: Option<Vec<String>>,
@@ -55,11 +56,12 @@ pub struct Router<A: Authorization + 'static> {
impl<A: Authorization + 'static> server::Handler<HttpStream> for Router<A> {
fn on_request(&mut self, req: server::Request<HttpStream>) -> Next {
// Choose proper handler depending on path / domain
let url = extract_url(&req);
let url = handlers::extract_url(&req);
let endpoint = extract_endpoint(&url);
let referer = extract_referer_endpoint(&req);
let is_utils = endpoint.1 == SpecialEndpoint::Utils;
let is_get_request = *req.method() == hyper::Method::Get;
trace!(target: "dapps", "Routing request to {:?}. Details: {:?}", url, req);
@@ -83,25 +85,41 @@ impl<A: Authorization + 'static> server::Handler<HttpStream> for Router<A> {
return self.handler.on_request(req);
}
let control = self.control.take().expect("on_request is called only once; control is always defined at start; qed");
debug!(target: "dapps", "Handling endpoint request: {:?}", endpoint);
self.handler = match endpoint {
self.handler = match (endpoint.0, endpoint.1, referer) {
// Handle invalid web requests that we can recover from
(ref path, SpecialEndpoint::None, Some((ref referer, ref referer_url)))
if referer.app_id == apps::WEB_PATH
&& self.endpoints.contains_key(apps::WEB_PATH)
&& !is_web_endpoint(path)
=>
{
trace!(target: "dapps", "Redirecting to correct web request: {:?}", referer_url);
// TODO [ToDr] Some nice util for this!
let using_domain = if referer.using_dapps_domains { 0 } else { 1 };
let len = cmp::min(referer_url.path.len(), using_domain + 3); // token + protocol + hostname
let base = referer_url.path[..len].join("/");
let requested = url.map(|u| u.path.join("/")).unwrap_or_default();
Redirection::boxed(&format!("/{}/{}", base, requested))
},
// First check special endpoints
(ref path, ref endpoint) if self.special.contains_key(endpoint) => {
(ref path, ref endpoint, _) if self.special.contains_key(endpoint) => {
trace!(target: "dapps", "Resolving to special endpoint.");
self.special.get(endpoint)
.expect("special known to contain key; qed")
.to_async_handler(path.clone().unwrap_or_default(), control)
},
// Then delegate to dapp
(Some(ref path), _) if self.endpoints.contains_key(&path.app_id) => {
(Some(ref path), _, _) if self.endpoints.contains_key(&path.app_id) => {
trace!(target: "dapps", "Resolving to local/builtin dapp.");
self.endpoints.get(&path.app_id)
.expect("special known to contain key; qed")
.expect("endpoints known to contain key; qed")
.to_async_handler(path.clone(), control)
},
// Try to resolve and fetch the dapp
(Some(ref path), _) if self.fetch.contains(&path.app_id) => {
(Some(ref path), _, _) if self.fetch.contains(&path.app_id) => {
trace!(target: "dapps", "Resolving to fetchable content.");
self.fetch.to_async_handler(path.clone(), control)
},
@@ -110,29 +128,29 @@ impl<A: Authorization + 'static> server::Handler<HttpStream> for Router<A> {
// It should be safe to remove it in (near) future.
//
// 404 for non-existent content
(Some(ref path), _) if *req.method() == hyper::Method::Get && path.app_id != "home" => {
(Some(ref path), _, _) if is_get_request && path.app_id != "home" => {
trace!(target: "dapps", "Resolving to 404.");
Box::new(ContentHandler::error(
StatusCode::NotFound,
"404 Not Found",
"Requested content was not found.",
None,
self.signer_port,
self.signer_address.clone(),
))
},
// Redirect any other GET request to signer.
_ if *req.method() == hyper::Method::Get => {
if let Some(port) = self.signer_port {
_ if is_get_request => {
if let Some(signer_address) = self.signer_address.clone() {
trace!(target: "dapps", "Redirecting to signer interface.");
Redirection::boxed(&format!("http://{}", signer_address(port)))
Redirection::boxed(&format!("http://{}", address(signer_address)))
} else {
trace!(target: "dapps", "Signer disabled, returning 404.");
Box::new(ContentHandler::error(
StatusCode::NotFound,
"404 Not Found",
"Your homepage is not available when Trusted Signer is disabled.",
Some("You can still access dapps by writing a correct address, though. Re-enabled Signer to get your homepage back."),
self.signer_port,
Some("You can still access dapps by writing a correct address, though. Re-enable Signer to get your homepage back."),
self.signer_address.clone(),
))
}
},
@@ -168,8 +186,8 @@ impl<A: Authorization + 'static> server::Handler<HttpStream> for Router<A> {
impl<A: Authorization> Router<A> {
pub fn new(
control: Control,
signer_port: Option<u16>,
content_fetcher: Arc<ContentFetcher>,
signer_address: Option<(String, u16)>,
content_fetcher: Arc<Fetcher>,
endpoints: Arc<Endpoints>,
special: Arc<HashMap<SpecialEndpoint, Box<Endpoint>>>,
authorization: Arc<A>,
@@ -181,7 +199,7 @@ impl<A: Authorization> Router<A> {
.to_handler(EndpointPath::default());
Router {
control: Some(control),
signer_port: signer_port,
signer_address: signer_address,
endpoints: endpoints,
fetch: content_fetcher,
special: special,
@@ -192,6 +210,41 @@ impl<A: Authorization> Router<A> {
}
}
fn is_web_endpoint(path: &Option<EndpointPath>) -> bool {
match *path {
Some(ref path) if path.app_id == apps::WEB_PATH => true,
_ => false,
}
}
fn extract_referer_endpoint(req: &server::Request<HttpStream>) -> Option<(EndpointPath, Url)> {
let referer = req.headers().get::<header::Referer>();
let url = referer.and_then(|referer| Url::parse(&referer.0).ok());
url.and_then(|url| {
let option = Some(url);
extract_url_referer_endpoint(&option).or_else(|| {
extract_endpoint(&option).0.map(|endpoint| (endpoint, option.expect("Just wrapped; qed")))
})
})
}
fn extract_url_referer_endpoint(url: &Option<Url>) -> Option<(EndpointPath, Url)> {
let query = url.as_ref().and_then(|url| url.query.as_ref());
match (url, query) {
(&Some(ref url), Some(ref query)) if query.starts_with(apps::URL_REFERER) => {
let referer_url = format!("http://{}:{}/{}", url.host, url.port, &query[apps::URL_REFERER.len()..]);
debug!(target: "dapps", "Recovering referer from query parameter: {}", referer_url);
let referer_url = Url::parse(&referer_url).ok();
extract_endpoint(&referer_url).0.map(|endpoint| {
(endpoint, referer_url.expect("Endpoint returned only when url `is_some`").clone())
})
},
_ => None,
}
}
fn extract_endpoint(url: &Option<Url>) -> (Option<EndpointPath>, SpecialEndpoint) {
fn special_endpoint(url: &Url) -> SpecialEndpoint {
if url.path.len() <= 1 {

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -16,13 +16,14 @@
use std::sync::{Arc, Mutex};
use hyper;
use jsonrpc_core::IoHandler;
use jsonrpc_http_server::{ServerHandler, PanicHandler, AccessControlAllowOrigin};
use jsonrpc_core::{IoHandler, ResponseHandler, Request, Response};
use jsonrpc_http_server::{ServerHandler, PanicHandler, AccessControlAllowOrigin, RpcHandler};
use endpoint::{Endpoint, EndpointPath, Handler};
pub fn rpc(handler: Arc<IoHandler>, panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>) -> Box<Endpoint> {
Box::new(RpcEndpoint {
handler: handler,
handler: Arc::new(RpcMiddleware::new(handler)),
panic_handler: panic_handler,
cors_domain: None,
// NOTE [ToDr] We don't need to do any hosts validation here. It's already done in router.
@@ -31,7 +32,7 @@ pub fn rpc(handler: Arc<IoHandler>, panic_handler: Arc<Mutex<Option<Box<Fn() ->
}
struct RpcEndpoint {
handler: Arc<IoHandler>,
handler: Arc<RpcMiddleware>,
panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>,
cors_domain: Option<Vec<AccessControlAllowOrigin>>,
allowed_hosts: Option<Vec<String>>,
@@ -49,3 +50,91 @@ impl Endpoint for RpcEndpoint {
))
}
}
struct RpcMiddleware {
handler: Arc<IoHandler>,
methods: Vec<String>,
}
impl RpcMiddleware {
fn new(handler: Arc<IoHandler>) -> Self {
RpcMiddleware {
handler: handler,
methods: vec![
"eth_accounts".into(),
"eth_coinbase".into(),
"parity_accountsInfo".into(),
"parity_defaultAccount".into(),
],
}
}
/// Appends additional parameter for specific calls.
fn augment_request(&self, request: &mut Request, meta: Option<Meta>) {
use jsonrpc_core::{Call, Params, to_value};
fn augment_call(call: &mut Call, meta: Option<&Meta>, methods: &Vec<String>) {
match (call, meta) {
(&mut Call::MethodCall(ref mut method_call), Some(meta)) if methods.contains(&method_call.method) => {
let session = to_value(&meta.app_id);
let params = match method_call.params {
Some(Params::Array(ref vec)) if vec.len() == 0 => Some(Params::Array(vec![session])),
// invalid params otherwise
_ => None,
};
method_call.params = params;
},
_ => {}
}
}
match *request {
Request::Single(ref mut call) => augment_call(call, meta.as_ref(), &self.methods),
Request::Batch(ref mut vec) => {
for mut call in vec {
augment_call(call, meta.as_ref(), &self.methods)
}
},
}
}
}
#[derive(Debug)]
struct Meta {
app_id: String,
}
impl RpcHandler for RpcMiddleware {
type Metadata = Meta;
fn read_metadata(&self, request: &hyper::server::Request<hyper::net::HttpStream>) -> Option<Self::Metadata> {
request.headers().get::<hyper::header::Referer>()
.and_then(|referer| hyper::Url::parse(referer).ok())
.and_then(|url| {
url.path_segments()
.and_then(|mut split| split.next())
.map(|app_id| Meta {
app_id: app_id.to_owned(),
})
})
}
fn handle_request<H>(&self, request_str: &str, response_handler: H, meta: Option<Self::Metadata>) where
H: ResponseHandler<Option<String>, Option<String>> + 'static
{
let handler = IoHandler::convert_handler(response_handler);
let request = IoHandler::read_request(request_str);
trace!(target: "rpc", "Request metadata: {:?}", meta);
match request {
Ok(mut request) => {
self.augment_request(&mut request, meta);
self.handler.request_handler().handle_request(request, handler, None)
},
Err(error) => handler.send(Some(Response::from(error))),
}
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -14,7 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use tests::helpers::{serve_with_registrar, serve_with_registrar_and_sync, request, assert_security_headers_for_embed};
use devtools::http_client;
use rustc_serialize::hex::FromHex;
use tests::helpers::{
serve_with_registrar, serve_with_registrar_and_sync, serve_with_fetch,
serve_with_registrar_and_fetch, serve_with_registrar_and_fetch_and_threads,
request, assert_security_headers_for_embed,
};
#[test]
fn should_resolve_dapp() {
@@ -32,7 +38,7 @@ fn should_resolve_dapp() {
);
// then
assert_eq!(response.status, "HTTP/1.1 404 Not Found".to_owned());
response.assert_status("HTTP/1.1 404 Not Found");
assert_eq!(registrar.calls.lock().len(), 2);
assert_security_headers_for_embed(&response.headers);
}
@@ -41,14 +47,6 @@ fn should_resolve_dapp() {
fn should_return_503_when_syncing_but_should_make_the_calls() {
// given
let (server, registrar) = serve_with_registrar_and_sync();
{
let mut responses = registrar.responses.lock();
let res1 = responses.get(0).unwrap().clone();
let res2 = responses.get(1).unwrap().clone();
// Registrar will be called twice - fill up the responses.
responses.push(res1);
responses.push(res2);
}
// when
let response = request(server,
@@ -61,7 +59,378 @@ fn should_return_503_when_syncing_but_should_make_the_calls() {
);
// then
assert_eq!(response.status, "HTTP/1.1 503 Service Unavailable".to_owned());
response.assert_status("HTTP/1.1 503 Service Unavailable");
assert_eq!(registrar.calls.lock().len(), 4);
assert_security_headers_for_embed(&response.headers);
}
const GAVCOIN_DAPP: &'static str = "00000000000000000000000000000000000000000000000000000000000000609faf32e1e3845e237cc6efd27187cee13b3b99db000000000000000000000000000000000000000000000000d8bd350823e28ff75e74a34215faefdc8a52fd8e00000000000000000000000000000000000000000000000000000000000000116761766f66796f726b2f676176636f696e000000000000000000000000000000";
const GAVCOIN_ICON: &'static str = "00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d8bd350823e28ff75e74a34215faefdc8a52fd8e000000000000000000000000000000000000000000000000000000000000007768747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f657468636f72652f646170702d6173736574732f623838653938336162616131613661363334356238643934343863313562313137646462353430652f746f6b656e732f676176636f696e2d36347836342e706e67000000000000000000";
#[test]
fn should_return_502_on_hash_mismatch() {
// given
let (server, fetch, registrar) = serve_with_registrar_and_fetch();
let gavcoin = GAVCOIN_DAPP.from_hex().unwrap();
registrar.set_result(
"94f093625c06887d94d9fee0d5f9cc4aaa46f33d24d1c7e4b5237e7c37d547dd".parse().unwrap(),
Ok(gavcoin.clone())
);
// when
let response = request(server,
"\
GET / HTTP/1.1\r\n\
Host: 94f093625c06887d94d9fee0d5f9cc4aaa46f33d24d1c7e4b5237e7c37d547dd.parity\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
assert_eq!(registrar.calls.lock().len(), 4);
fetch.assert_requested("https://codeload.github.com/gavofyork/gavcoin/zip/9faf32e1e3845e237cc6efd27187cee13b3b99db");
fetch.assert_no_more_requests();
response.assert_status("HTTP/1.1 502 Bad Gateway");
assert!(response.body.contains("HashMismatch"), "Expected hash mismatch response, got: {:?}", response.body);
assert_security_headers_for_embed(&response.headers);
}
#[test]
fn should_return_error_for_invalid_dapp_zip() {
// given
let (server, fetch, registrar) = serve_with_registrar_and_fetch();
let gavcoin = GAVCOIN_DAPP.from_hex().unwrap();
registrar.set_result(
"2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e".parse().unwrap(),
Ok(gavcoin.clone())
);
// when
let response = request(server,
"\
GET / HTTP/1.1\r\n\
Host: 2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e.parity\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
assert_eq!(registrar.calls.lock().len(), 4);
fetch.assert_requested("https://codeload.github.com/gavofyork/gavcoin/zip/9faf32e1e3845e237cc6efd27187cee13b3b99db");
fetch.assert_no_more_requests();
response.assert_status("HTTP/1.1 502 Bad Gateway");
assert!(response.body.contains("InvalidArchive"), "Expected invalid zip response, got: {:?}", response.body);
assert_security_headers_for_embed(&response.headers);
}
#[test]
fn should_return_fetched_dapp_content() {
// given
let (server, fetch, registrar) = serve_with_registrar_and_fetch();
let gavcoin = GAVCOIN_DAPP.from_hex().unwrap();
registrar.set_result(
"9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a".parse().unwrap(),
Ok(gavcoin.clone())
);
fetch.set_response(include_bytes!("../../res/gavcoin.zip"));
// when
let response1 = http_client::request(server.addr(),
"\
GET /index.html HTTP/1.1\r\n\
Host: 9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a.parity\r\n\
Connection: close\r\n\
\r\n\
"
);
let response2 = http_client::request(server.addr(),
"\
GET /manifest.json HTTP/1.1\r\n\
Host: 9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a.parity\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
assert_eq!(registrar.calls.lock().len(), 4);
fetch.assert_requested("https://codeload.github.com/gavofyork/gavcoin/zip/9faf32e1e3845e237cc6efd27187cee13b3b99db");
fetch.assert_no_more_requests();
response1.assert_status("HTTP/1.1 200 OK");
assert_security_headers_for_embed(&response1.headers);
assert_eq!(
response1.body,
r#"18
<h1>Hello Gavcoin!</h1>
"#
);
response2.assert_status("HTTP/1.1 200 OK");
assert_security_headers_for_embed(&response2.headers);
assert_eq!(
response2.body,
r#"BE
{
"id": "9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a",
"name": "Gavcoin",
"description": "Gavcoin",
"version": "1.0.0",
"author": "",
"iconUrl": "icon.png"
}
0
"#
);
}
#[test]
fn should_return_fetched_content() {
// given
let (server, fetch, registrar) = serve_with_registrar_and_fetch();
let gavcoin = GAVCOIN_ICON.from_hex().unwrap();
registrar.set_result(
"2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e".parse().unwrap(),
Ok(gavcoin.clone())
);
// when
let response = request(server,
"\
GET / HTTP/1.1\r\n\
Host: 2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e.parity\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
assert_eq!(registrar.calls.lock().len(), 4);
fetch.assert_requested("https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/tokens/gavcoin-64x64.png");
fetch.assert_no_more_requests();
response.assert_status("HTTP/1.1 200 OK");
response.assert_security_headers_present(None);
}
#[test]
fn should_cache_content() {
// given
let (server, fetch, registrar) = serve_with_registrar_and_fetch();
let gavcoin = GAVCOIN_ICON.from_hex().unwrap();
registrar.set_result(
"2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e".parse().unwrap(),
Ok(gavcoin.clone())
);
let request_str = "\
GET / HTTP/1.1\r\n\
Host: 2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e.parity\r\n\
Connection: close\r\n\
\r\n\
";
let response = http_client::request(server.addr(), request_str);
fetch.assert_requested("https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/tokens/gavcoin-64x64.png");
fetch.assert_no_more_requests();
response.assert_status("HTTP/1.1 200 OK");
// when
let response = http_client::request(server.addr(), request_str);
// then
fetch.assert_no_more_requests();
response.assert_status("HTTP/1.1 200 OK");
}
#[test]
fn should_not_request_content_twice() {
use std::thread;
// given
let (server, fetch, registrar) = serve_with_registrar_and_fetch_and_threads(true);
let gavcoin = GAVCOIN_ICON.from_hex().unwrap();
registrar.set_result(
"2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e".parse().unwrap(),
Ok(gavcoin.clone())
);
let request_str = "\
GET / HTTP/1.1\r\n\
Host: 2be00befcf008bc0e7d9cdefc194db9c75352e8632f48498b5a6bfce9f02c88e.parity\r\n\
Connection: close\r\n\
\r\n\
";
let fire_request = || {
let addr = server.addr().to_owned();
let req = request_str.to_owned();
thread::spawn(move || {
http_client::request(&addr, &req)
})
};
let control = fetch.manual();
// when
// Fire two requests at the same time
let r1 = fire_request();
let r2 = fire_request();
// wait for single request in fetch, the second one should go into waiting state.
control.wait_for_requests(1);
control.respond();
let response1 = r1.join().unwrap();
let response2 = r2.join().unwrap();
// then
fetch.assert_requested("https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/tokens/gavcoin-64x64.png");
fetch.assert_no_more_requests();
response1.assert_status("HTTP/1.1 200 OK");
response2.assert_status("HTTP/1.1 200 OK");
}
#[test]
fn should_stream_web_content() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
GET /web/token/https/parity.io/ HTTP/1.1\r\n\
Host: localhost:8080\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
response.assert_status("HTTP/1.1 200 OK");
assert_security_headers_for_embed(&response.headers);
fetch.assert_requested("https://parity.io/");
fetch.assert_no_more_requests();
}
#[test]
fn should_return_error_on_invalid_token() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
GET /web/invalidtoken/https/parity.io/ HTTP/1.1\r\n\
Host: localhost:8080\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
response.assert_status("HTTP/1.1 400 Bad Request");
assert_security_headers_for_embed(&response.headers);
fetch.assert_no_more_requests();
}
#[test]
fn should_return_error_on_invalid_protocol() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
GET /web/token/ftp/parity.io/ HTTP/1.1\r\n\
Host: localhost:8080\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
response.assert_status("HTTP/1.1 400 Bad Request");
assert_security_headers_for_embed(&response.headers);
fetch.assert_no_more_requests();
}
#[test]
fn should_redirect_if_trailing_slash_is_missing() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
GET /web/token/https/parity.io HTTP/1.1\r\n\
Host: localhost:8080\r\n\
Connection: close\r\n\
\r\n\
"
);
// then
response.assert_status("HTTP/1.1 302 Found");
response.assert_header("Location", "/web/token/https/parity.io/");
fetch.assert_no_more_requests();
}
#[test]
fn should_disallow_non_get_requests() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
POST /token/https/parity.io/ HTTP/1.1\r\n\
Host: web.parity\r\n\
Content-Type: application/json\r\n\
Connection: close\r\n\
\r\n\
123\r\n\
\r\n\
"
);
// then
response.assert_status("HTTP/1.1 405 Method Not Allowed");
assert_security_headers_for_embed(&response.headers);
fetch.assert_no_more_requests();
}
#[test]
fn should_fix_absolute_requests_based_on_referer() {
// given
let (server, fetch) = serve_with_fetch("token");
// when
let response = request(server,
"\
GET /styles.css HTTP/1.1\r\n\
Host: localhost:8080\r\n\
Connection: close\r\n\
Referer: http://localhost:8080/web/token/https/parity.io/\r\n\
\r\n\
"
);
// then
response.assert_status("HTTP/1.1 302 Found");
response.assert_header("Location", "/web/token/https/parity.io/styles.css");
fetch.assert_no_more_requests();
}

View File

@@ -0,0 +1,122 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::{io, thread, time};
use std::sync::{atomic, mpsc, Arc};
use util::Mutex;
use futures::{self, Future};
use fetch::{self, Fetch};
pub struct FetchControl {
sender: mpsc::Sender<()>,
fetch: FakeFetch,
}
impl FetchControl {
pub fn respond(self) {
self.sender.send(())
.expect("Fetch cannot be finished without sending a response at least once.");
}
pub fn wait_for_requests(&self, len: usize) {
const MAX_TIMEOUT_MS: u64 = 5000;
const ATTEMPTS: u64 = 10;
let mut attempts_left = ATTEMPTS;
loop {
let current = self.fetch.requested.lock().len();
if current == len {
break;
} else if attempts_left == 0 {
panic!(
"Timeout reached when waiting for pending requests. Expected: {}, current: {}",
len, current
);
} else {
attempts_left -= 1;
// Should we handle spurious timeouts better?
thread::park_timeout(time::Duration::from_millis(MAX_TIMEOUT_MS / ATTEMPTS));
}
}
}
}
#[derive(Clone, Default)]
pub struct FakeFetch {
manual: Arc<Mutex<Option<mpsc::Receiver<()>>>>,
response: Arc<Mutex<Option<&'static [u8]>>>,
asserted: Arc<atomic::AtomicUsize>,
requested: Arc<Mutex<Vec<String>>>,
}
impl FakeFetch {
pub fn set_response(&self, data: &'static [u8]) {
*self.response.lock() = Some(data);
}
pub fn manual(&self) -> FetchControl {
assert!(self.manual.lock().is_none(), "Only one manual control may be active.");
let (tx, rx) = mpsc::channel();
*self.manual.lock() = Some(rx);
FetchControl {
sender: tx,
fetch: self.clone(),
}
}
pub fn assert_requested(&self, url: &str) {
let requests = self.requested.lock();
let idx = self.asserted.fetch_add(1, atomic::Ordering::SeqCst);
assert_eq!(requests.get(idx), Some(&url.to_owned()), "Expected fetch from specific URL.");
}
pub fn assert_no_more_requests(&self) {
let requests = self.requested.lock();
let len = self.asserted.load(atomic::Ordering::SeqCst);
assert_eq!(requests.len(), len, "Didn't expect any more requests, got: {:?}", &requests[len..]);
}
}
impl Fetch for FakeFetch {
type Result = futures::BoxFuture<fetch::Response, fetch::Error>;
fn new() -> Result<Self, fetch::Error> where Self: Sized {
Ok(FakeFetch::default())
}
fn fetch_with_abort(&self, url: &str, _abort: fetch::Abort) -> Self::Result {
self.requested.lock().push(url.into());
let manual = self.manual.clone();
let response = self.response.clone();
let (tx, rx) = futures::oneshot();
thread::spawn(move || {
if let Some(rx) = manual.lock().take() {
// wait for manual resume
let _ = rx.recv();
}
let data = response.lock().take().unwrap_or(b"Some content");
let cursor = io::Cursor::new(data);
tx.complete(fetch::Response::from_reader(cursor));
});
rx.map_err(|_| fetch::Error::Aborted).boxed()
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -17,68 +17,46 @@
use std::env;
use std::str;
use std::sync::Arc;
use rustc_serialize::hex::FromHex;
use env_logger::LogBuilder;
use ServerBuilder;
use Server;
use apps::urlhint::ContractClient;
use util::{Bytes, Address, Mutex, ToPretty};
use fetch::Fetch;
use devtools::http_client;
use parity_reactor::Remote;
mod registrar;
mod fetch;
use self::registrar::FakeRegistrar;
use self::fetch::FakeFetch;
const REGISTRAR: &'static str = "8e4e9b13d4b45cb0befc93c3061b1408f67316b2";
const URLHINT: &'static str = "deadbeefcafe0000000000000000000000000000";
const SIGNER_PORT: u16 = 18180;
pub struct FakeRegistrar {
pub calls: Arc<Mutex<Vec<(String, String)>>>,
pub responses: Mutex<Vec<Result<Bytes, String>>>,
}
impl FakeRegistrar {
fn new() -> Self {
FakeRegistrar {
calls: Arc::new(Mutex::new(Vec::new())),
responses: Mutex::new(
vec![
Ok(format!("000000000000000000000000{}", URLHINT).from_hex().unwrap()),
Ok(Vec::new())
]
),
}
}
}
impl ContractClient for FakeRegistrar {
fn registrar(&self) -> Result<Address, String> {
Ok(REGISTRAR.parse().unwrap())
}
fn call(&self, address: Address, data: Bytes) -> Result<Bytes, String> {
self.calls.lock().push((address.to_hex(), data.to_hex()));
self.responses.lock().remove(0)
}
}
fn init_logger() {
// Initialize logger
if let Ok(log) = env::var("RUST_LOG") {
let mut builder = LogBuilder::new();
builder.parse(&log);
builder.init().expect("Logger is initialized only once.");
let _ = builder.init(); // ignore errors since ./test.sh will call this multiple times.
}
}
pub fn init_server(hosts: Option<Vec<String>>, is_syncing: bool) -> (Server, Arc<FakeRegistrar>) {
pub fn init_server<F, B>(hosts: Option<Vec<String>>, process: F, remote: Remote) -> (Server, Arc<FakeRegistrar>) where
F: FnOnce(ServerBuilder) -> ServerBuilder<B>,
B: Fetch,
{
init_logger();
let registrar = Arc::new(FakeRegistrar::new());
let mut dapps_path = env::temp_dir();
dapps_path.push("non-existent-dir-to-prevent-fs-files-from-loading");
let mut builder = ServerBuilder::new(dapps_path.to_str().unwrap().into(), registrar.clone());
builder.with_sync_status(Arc::new(move || is_syncing));
builder.with_signer_port(Some(SIGNER_PORT));
let server = process(ServerBuilder::new(
&dapps_path, registrar.clone(), remote,
))
.signer_address(Some(("127.0.0.1".into(), SIGNER_PORT)))
.start_unsecured_http(&"127.0.0.1:0".parse().unwrap(), hosts).unwrap();
(
builder.start_unsecured_http(&"127.0.0.1:0".parse().unwrap(), hosts).unwrap(),
server,
registrar,
)
}
@@ -88,25 +66,53 @@ pub fn serve_with_auth(user: &str, pass: &str) -> Server {
let registrar = Arc::new(FakeRegistrar::new());
let mut dapps_path = env::temp_dir();
dapps_path.push("non-existent-dir-to-prevent-fs-files-from-loading");
let mut builder = ServerBuilder::new(dapps_path.to_str().unwrap().into(), registrar);
builder.with_signer_port(Some(SIGNER_PORT));
builder.start_basic_auth_http(&"127.0.0.1:0".parse().unwrap(), None, user, pass).unwrap()
ServerBuilder::new(&dapps_path, registrar.clone(), Remote::new_sync())
.signer_address(Some(("127.0.0.1".into(), SIGNER_PORT)))
.start_basic_auth_http(&"127.0.0.1:0".parse().unwrap(), None, user, pass).unwrap()
}
pub fn serve_hosts(hosts: Option<Vec<String>>) -> Server {
init_server(hosts, false).0
init_server(hosts, |builder| builder, Remote::new_sync()).0
}
pub fn serve_with_registrar() -> (Server, Arc<FakeRegistrar>) {
init_server(None, false)
init_server(None, |builder| builder, Remote::new_sync())
}
pub fn serve_with_registrar_and_sync() -> (Server, Arc<FakeRegistrar>) {
init_server(None, true)
init_server(None, |builder| {
builder.sync_status(Arc::new(|| true))
}, Remote::new_sync())
}
pub fn serve_with_registrar_and_fetch() -> (Server, FakeFetch, Arc<FakeRegistrar>) {
serve_with_registrar_and_fetch_and_threads(false)
}
pub fn serve_with_registrar_and_fetch_and_threads(multi_threaded: bool) -> (Server, FakeFetch, Arc<FakeRegistrar>) {
let fetch = FakeFetch::default();
let f = fetch.clone();
let (server, reg) = init_server(None, move |builder| {
builder.fetch(f.clone())
}, if multi_threaded { Remote::new_thread_per_future() } else { Remote::new_sync() });
(server, fetch, reg)
}
pub fn serve_with_fetch(web_token: &'static str) -> (Server, FakeFetch) {
let fetch = FakeFetch::default();
let f = fetch.clone();
let (server, _) = init_server(None, move |builder| {
builder
.fetch(f.clone())
.web_proxy_tokens(Arc::new(move |token| &token == web_token))
}, Remote::new_sync());
(server, fetch)
}
pub fn serve() -> Server {
init_server(None, false).0
init_server(None, |builder| builder, Remote::new_sync()).0
}
pub fn request(server: Server, request: &str) -> http_client::Response {

View File

@@ -0,0 +1,72 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::str;
use std::sync::Arc;
use std::collections::HashMap;
use rustc_serialize::hex::FromHex;
use hash_fetch::urlhint::ContractClient;
use util::{Bytes, Address, Mutex, H256, ToPretty};
const REGISTRAR: &'static str = "8e4e9b13d4b45cb0befc93c3061b1408f67316b2";
const URLHINT: &'static str = "deadbeefcafe0000000000000000000000000000";
const URLHINT_RESOLVE: &'static str = "267b6922";
const DEFAULT_HASH: &'static str = "1472a9e190620cdf6b31f383373e45efcfe869a820c91f9ccd7eb9fb45e4985d";
pub struct FakeRegistrar {
pub calls: Arc<Mutex<Vec<(String, String)>>>,
pub responses: Mutex<HashMap<(String, String), Result<Bytes, String>>>,
}
impl FakeRegistrar {
pub fn new() -> Self {
FakeRegistrar {
calls: Arc::new(Mutex::new(Vec::new())),
responses: Mutex::new({
let mut map = HashMap::new();
map.insert(
(REGISTRAR.into(), "6795dbcd058740ee9a5a3fb9f1cfa10752baec87e09cc45cd7027fd54708271aca300c75000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000014100000000000000000000000000000000000000000000000000000000000000".into()),
Ok(format!("000000000000000000000000{}", URLHINT).from_hex().unwrap()),
);
map.insert(
(URLHINT.into(), format!("{}{}", URLHINT_RESOLVE, DEFAULT_HASH)),
Ok(vec![])
);
map
}),
}
}
pub fn set_result(&self, hash: H256, result: Result<Bytes, String>) {
self.responses.lock().insert(
(URLHINT.into(), format!("{}{:?}", URLHINT_RESOLVE, hash)),
result
);
}
}
impl ContractClient for FakeRegistrar {
fn registrar(&self) -> Result<Address, String> {
Ok(REGISTRAR.parse().unwrap())
}
fn call(&self, address: Address, data: Bytes) -> Result<Bytes, String> {
let call = (address.to_hex(), data.to_hex());
self.calls.lock().push(call.clone());
self.responses.lock().get(&call).cloned().expect(&format!("No response for call: {:?}", call))
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -37,6 +37,9 @@ pub struct Url {
/// Empty entries of `""` correspond to trailing slashes.
pub path: Vec<String>,
/// The URL query.
pub query: Option<String>,
/// The URL username field, from the userinfo section of the URL.
///
/// `None` if the `@` character was not part of the input OR
@@ -82,15 +85,17 @@ impl Url {
_ => None,
};
let port = try!(raw_url.port_or_known_default().ok_or_else(|| format!("Unknown port for scheme: `{}`", raw_url.scheme())));
let host = try!(raw_url.host().ok_or_else(|| "Valid host, because only data:, mailto: protocols does not have host.".to_owned())).to_owned();
let path = try!(raw_url.path_segments().ok_or_else(|| "Valid path segments. In HTTP we won't get cannot-be-a-base URLs".to_owned()))
let port = raw_url.port_or_known_default().ok_or_else(|| format!("Unknown port for scheme: `{}`", raw_url.scheme()))?;
let host = raw_url.host().ok_or_else(|| "Valid host, because only data:, mailto: protocols does not have host.".to_owned())?.to_owned();
let path = raw_url.path_segments().ok_or_else(|| "Valid path segments. In HTTP we won't get cannot-be-a-base URLs".to_owned())?
.map(|part| part.to_owned()).collect();
let query = raw_url.query().map(|x| x.to_owned());
Ok(Url {
port: port,
host: host,
path: path,
query: query,
raw: raw_url,
username: username,
password: password,

229
dapps/src/web.rs Normal file
View File

@@ -0,0 +1,229 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Serving web-based content (proxying)
use std::sync::Arc;
use fetch::{self, Fetch};
use parity_reactor::Remote;
use hyper::{self, server, net, Next, Encoder, Decoder};
use hyper::status::StatusCode;
use apps;
use endpoint::{Endpoint, Handler, EndpointPath};
use handlers::{
ContentFetcherHandler, ContentHandler, ContentValidator, ValidatorResponse,
StreamingHandler, Redirection, extract_url,
};
use url::Url;
use WebProxyTokens;
pub type Embeddable = Option<(String, u16)>;
pub struct Web<F> {
embeddable_on: Embeddable,
web_proxy_tokens: Arc<WebProxyTokens>,
remote: Remote,
fetch: F,
}
impl<F: Fetch> Web<F> {
pub fn boxed(embeddable_on: Embeddable, web_proxy_tokens: Arc<WebProxyTokens>, remote: Remote, fetch: F) -> Box<Endpoint> {
Box::new(Web {
embeddable_on: embeddable_on,
web_proxy_tokens: web_proxy_tokens,
remote: remote,
fetch: fetch,
})
}
}
impl<F: Fetch> Endpoint for Web<F> {
fn to_async_handler(&self, path: EndpointPath, control: hyper::Control) -> Box<Handler> {
Box::new(WebHandler {
control: control,
state: State::Initial,
path: path,
remote: self.remote.clone(),
fetch: self.fetch.clone(),
web_proxy_tokens: self.web_proxy_tokens.clone(),
embeddable_on: self.embeddable_on.clone(),
})
}
}
struct WebInstaller {
embeddable_on: Embeddable,
referer: String,
}
impl ContentValidator for WebInstaller {
type Error = String;
fn validate_and_install(&self, response: fetch::Response) -> Result<ValidatorResponse, String> {
let status = StatusCode::from_u16(response.status().to_u16());
let is_html = response.is_html();
let mime = response.content_type().unwrap_or(mime!(Text/Html));
let mut handler = StreamingHandler::new(
response,
status,
mime,
self.embeddable_on.clone(),
);
if is_html {
handler.set_initial_content(&format!(
r#"<script src="/{}/inject.js"></script><script>history.replaceState({{}}, "", "/?{}{}")</script>"#,
apps::UTILS_PATH,
apps::URL_REFERER,
&self.referer,
));
}
Ok(ValidatorResponse::Streaming(handler))
}
}
enum State<F: Fetch> {
Initial,
Error(ContentHandler),
Redirecting(Redirection),
Fetching(ContentFetcherHandler<WebInstaller, F>),
}
struct WebHandler<F: Fetch> {
control: hyper::Control,
state: State<F>,
path: EndpointPath,
remote: Remote,
fetch: F,
web_proxy_tokens: Arc<WebProxyTokens>,
embeddable_on: Embeddable,
}
impl<F: Fetch> WebHandler<F> {
fn extract_target_url(&self, url: Option<Url>) -> Result<(String, String), State<F>> {
let (path, query) = match url {
Some(url) => (url.path, url.query),
None => {
return Err(State::Error(ContentHandler::error(
StatusCode::BadRequest, "Invalid URL", "Couldn't parse URL", None, self.embeddable_on.clone()
)));
}
};
// Support domain based routing.
let idx = match path.get(0).map(|m| m.as_ref()) {
Some(apps::WEB_PATH) => 1,
_ => 0,
};
// Check if token supplied in URL is correct.
match path.get(idx) {
Some(ref token) if self.web_proxy_tokens.is_web_proxy_token_valid(token) => {},
_ => {
return Err(State::Error(ContentHandler::error(
StatusCode::BadRequest, "Invalid Access Token", "Invalid or old web proxy access token supplied.", Some("Try refreshing the page."), self.embeddable_on.clone()
)));
}
}
// Validate protocol
let protocol = match path.get(idx + 1).map(|a| a.as_str()) {
Some("http") => "http",
Some("https") => "https",
_ => {
return Err(State::Error(ContentHandler::error(
StatusCode::BadRequest, "Invalid Protocol", "Invalid protocol used.", None, self.embeddable_on.clone()
)));
}
};
// Redirect if address to main page does not end with /
if let None = path.get(idx + 3) {
return Err(State::Redirecting(
Redirection::new(&format!("/{}/", path.join("/")))
));
}
let query = match query {
Some(query) => format!("?{}", query),
None => "".into(),
};
Ok((format!("{}://{}{}", protocol, path[idx + 2..].join("/"), query), path[0..].join("/")))
}
}
impl<F: Fetch> server::Handler<net::HttpStream> for WebHandler<F> {
fn on_request(&mut self, request: server::Request<net::HttpStream>) -> Next {
let url = extract_url(&request);
// First extract the URL (reject invalid URLs)
let (target_url, referer) = match self.extract_target_url(url) {
Ok(url) => url,
Err(error) => {
self.state = error;
return Next::write();
}
};
let mut handler = ContentFetcherHandler::new(
target_url,
self.path.clone(),
self.control.clone(),
WebInstaller {
embeddable_on: self.embeddable_on.clone(),
referer: referer,
},
self.embeddable_on.clone(),
self.remote.clone(),
self.fetch.clone(),
);
let res = handler.on_request(request);
self.state = State::Fetching(handler);
res
}
fn on_request_readable(&mut self, decoder: &mut Decoder<net::HttpStream>) -> Next {
match self.state {
State::Initial => Next::end(),
State::Error(ref mut handler) => handler.on_request_readable(decoder),
State::Redirecting(ref mut handler) => handler.on_request_readable(decoder),
State::Fetching(ref mut handler) => handler.on_request_readable(decoder),
}
}
fn on_response(&mut self, res: &mut server::Response) -> Next {
match self.state {
State::Initial => Next::end(),
State::Error(ref mut handler) => handler.on_response(res),
State::Redirecting(ref mut handler) => handler.on_response(res),
State::Fetching(ref mut handler) => handler.on_response(res),
}
}
fn on_response_writable(&mut self, encoder: &mut Encoder<net::HttpStream>) -> Next {
match self.state {
State::Initial => Next::end(),
State::Error(ref mut handler) => handler.on_response_writable(encoder),
State::Redirecting(ref mut handler) => handler.on_response_writable(encoder),
State::Fetching(ref mut handler) => handler.on_response_writable(encoder),
}
}
}

View File

@@ -1,17 +1,17 @@
[package]
description = "Ethcore Parity UI"
homepage = "http://ethcore.io"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "parity-ui"
version = "1.4.0"
authors = ["Ethcore <admin@ethcore.io>"]
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
[build-dependencies]
rustc_version = "0.1"
[dependencies]
parity-ui-dev = { path = "../../js", optional = true }
parity-ui-precompiled = { git = "https://github.com/ethcore/js-precompiled.git", optional = true }
parity-ui-precompiled = { git = "https://github.com/ethcore/js-precompiled.git", branch = "beta", optional = true }
[features]
no-precompiled-js = ["parity-ui-dev"]

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,21 +1,21 @@
[package]
description = "Ethcore Database"
homepage = "http://ethcore.io"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "ethcore-db"
version = "1.4.0"
authors = ["Ethcore <admin@ethcore.io>"]
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
ethcore-ipc-codegen = { path = "../ipc/codegen" }
[dependencies]
clippy = { version = "0.0.96", optional = true}
clippy = { version = "0.0.103", optional = true}
ethcore-devtools = { path = "../devtools" }
ethcore-ipc = { path = "../ipc/rpc" }
rocksdb = { git = "https://github.com/ethcore/rust-rocksdb" }
semver = "0.2"
semver = "0.5"
ethcore-ipc-nano = { path = "../ipc/nano" }
nanomsg = { git = "https://github.com/ethcore/nanomsg.rs.git" }
crossbeam = "0.2"

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -73,10 +73,10 @@ impl WriteCache {
match *cache_entry {
WriteCacheEntry::Write(ref val) => {
try!(batch.put(&key, val));
batch.put(&key, val)?;
},
WriteCacheEntry::Remove => {
try!(batch.delete(&key));
batch.delete(&key)?;
},
}
key.clone()
@@ -87,14 +87,14 @@ impl WriteCache {
removed_so_far = removed_so_far + 1;
}
if removed_so_far > 0 {
try!(db.write(batch));
db.write(batch)?;
}
Ok(())
}
/// flushes until cache is empty
fn flush_all(&mut self, db: &DB) -> Result<(), Error> {
while !self.is_empty() { try!(self.flush(db, FLUSH_BATCH_SIZE)); }
while !self.is_empty() { self.flush(db, FLUSH_BATCH_SIZE)?; }
Ok(())
}
@@ -104,7 +104,7 @@ impl WriteCache {
fn try_shrink(&mut self, db: &DB) -> Result<(), Error> {
if self.entries.len() > self.preferred_len {
try!(self.flush(db, FLUSH_BATCH_SIZE));
self.flush(db, FLUSH_BATCH_SIZE)?;
}
Ok(())
}
@@ -135,7 +135,7 @@ impl Database {
if db_lock.is_none() { return Ok(()); }
let db = db_lock.as_ref().unwrap();
try!(cache_lock.try_shrink(&db));
cache_lock.try_shrink(&db)?;
Ok(())
}
@@ -145,7 +145,7 @@ impl Database {
if db_lock.is_none() { return Ok(()); }
let db = db_lock.as_ref().expect("we should have exited with Ok(()) on the previous step");
try!(cache_lock.flush_all(&db));
cache_lock.flush_all(&db)?;
Ok(())
}
@@ -174,7 +174,7 @@ impl DatabaseService for Database {
opts.set_block_based_table_factory(&block_opts);
opts.set_prefix_extractor_fixed_size(size);
}
*db = Some(try!(DB::open(&opts, &path)));
*db = Some(DB::open(&opts, &path)?);
Ok(())
}
@@ -185,7 +185,7 @@ impl DatabaseService for Database {
}
fn close(&self) -> Result<(), Error> {
try!(self.flush_all());
self.flush_all()?;
let mut db = self.db.write();
if db.is_none() { return Err(Error::IsClosed); }
@@ -231,9 +231,9 @@ impl DatabaseService for Database {
}
}
let db_lock = self.db.read();
let db = try!(db_lock.as_ref().ok_or(Error::IsClosed));
let db = db_lock.as_ref().ok_or(Error::IsClosed)?;
match try!(db.get(key)) {
match db.get(key)? {
Some(db_vec) => {
Ok(Some(db_vec.to_vec()))
},
@@ -243,7 +243,7 @@ impl DatabaseService for Database {
fn get_by_prefix(&self, prefix: &[u8]) -> Result<Option<Vec<u8>>, Error> {
let db_lock = self.db.read();
let db = try!(db_lock.as_ref().ok_or(Error::IsClosed));
let db = db_lock.as_ref().ok_or(Error::IsClosed)?;
let mut iter = db.iterator(IteratorMode::From(prefix, Direction::Forward));
match iter.next() {
@@ -255,14 +255,14 @@ impl DatabaseService for Database {
fn is_empty(&self) -> Result<bool, Error> {
let db_lock = self.db.read();
let db = try!(db_lock.as_ref().ok_or(Error::IsClosed));
let db = db_lock.as_ref().ok_or(Error::IsClosed)?;
Ok(db.iterator(IteratorMode::Start).next().is_none())
}
fn iter(&self) -> Result<IteratorHandle, Error> {
let db_lock = self.db.read();
let db = try!(db_lock.as_ref().ok_or(Error::IsClosed));
let db = db_lock.as_ref().ok_or(Error::IsClosed)?;
let mut iterators = self.iterators.write();
let next_iterator = iterators.keys().last().unwrap_or(&0) + 1;
@@ -270,8 +270,7 @@ impl DatabaseService for Database {
Ok(next_iterator)
}
fn iter_next(&self, handle: IteratorHandle) -> Option<KeyValue>
{
fn iter_next(&self, handle: IteratorHandle) -> Option<KeyValue> {
let mut iterators = self.iterators.write();
let mut iterator = match iterators.get_mut(&handle) {
Some(some_iterator) => some_iterator,

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -52,27 +52,27 @@ impl std::convert::From<nanoipc::SocketError> for ServiceError {
pub fn blocks_service_url(db_path: &str) -> Result<String, std::io::Error> {
let mut path = PathBuf::from(db_path);
try!(::std::fs::create_dir_all(db_path));
::std::fs::create_dir_all(db_path)?;
path.push("blocks.ipc");
Ok(format!("ipc://{}", path.to_str().unwrap()))
}
pub fn extras_service_url(db_path: &str) -> Result<String, ::std::io::Error> {
let mut path = PathBuf::from(db_path);
try!(::std::fs::create_dir_all(db_path));
::std::fs::create_dir_all(db_path)?;
path.push("extras.ipc");
Ok(format!("ipc://{}", path.to_str().unwrap()))
}
pub fn blocks_client(db_path: &str) -> Result<DatabaseConnection, ServiceError> {
let url = try!(blocks_service_url(db_path));
let client = try!(nanoipc::generic_client::<DatabaseClient<_>>(&url));
let url = blocks_service_url(db_path)?;
let client = nanoipc::generic_client::<DatabaseClient<_>>(&url)?;
Ok(client)
}
pub fn extras_client(db_path: &str) -> Result<DatabaseConnection, ServiceError> {
let url = try!(extras_service_url(db_path));
let client = try!(nanoipc::generic_client::<DatabaseClient<_>>(&url));
let url = extras_service_url(db_path)?;
let client = nanoipc::generic_client::<DatabaseClient<_>>(&url)?;
Ok(client)
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,10 +1,10 @@
[package]
description = "Ethcore development/test/build tools"
homepage = "http://ethcore.io"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "ethcore-devtools"
version = "1.4.0"
authors = ["Ethcore <admin@ethcore.io>"]
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
rand = "0.3"

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::thread;
use std::time::Duration;
use std::io::{Read, Write};
use std::str::{self, Lines};
@@ -26,6 +27,21 @@ pub struct Response {
pub body: String,
}
impl Response {
pub fn assert_header(&self, header: &str, value: &str) {
let header = format!("{}: {}", header, value);
assert!(self.headers.iter().find(|h| *h == &header).is_some(), "Couldn't find header {} in {:?}", header, &self.headers)
}
pub fn assert_status(&self, status: &str) {
assert_eq!(self.status, status.to_owned(), "Got unexpected code. Body: {:?}", self.body);
}
pub fn assert_security_headers_present(&self, port: Option<u16>) {
assert_security_headers_present(&self.headers, port)
}
}
pub fn read_block(lines: &mut Lines, all: bool) -> String {
let mut block = String::new();
loop {
@@ -42,9 +58,29 @@ pub fn read_block(lines: &mut Lines, all: bool) -> String {
block
}
fn connect(address: &SocketAddr) -> TcpStream {
let mut retries = 0;
let mut last_error = None;
while retries < 10 {
retries += 1;
let res = TcpStream::connect(address);
match res {
Ok(stream) => {
return stream;
},
Err(e) => {
last_error = Some(e);
thread::sleep(Duration::from_millis(retries * 10));
}
}
}
panic!("Unable to connect to the server. Last error: {:?}", last_error);
}
pub fn request(address: &SocketAddr, request: &str) -> Response {
let mut req = TcpStream::connect(address).unwrap();
req.set_read_timeout(Some(Duration::from_secs(1))).unwrap();
let mut req = connect(address);
req.set_read_timeout(Some(Duration::from_secs(2))).unwrap();
req.write_all(request.as_bytes()).unwrap();
let mut response = String::new();

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

66
docker/hub/Dockerfile Normal file
View File

@@ -0,0 +1,66 @@
FROM ubuntu:14.04
WORKDIR /build
# install tools and dependencies
RUN apt-get update && \
apt-get install -y --force-yes --no-install-recommends \
# make
build-essential \
# add-apt-repository
software-properties-common \
make \
curl \
wget \
git \
g++ \
gcc \
libc6 \
libc6-dev \
binutils \
file \
openssl \
libssl-dev \
pkg-config \
dpkg-dev \
# evmjit dependencies
zlib1g-dev \
libedit-dev
# cmake and llvm ppas. then update ppas
RUN add-apt-repository -y "ppa:george-edison55/cmake-3.x" && \
add-apt-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main" && \
apt-get update && \
apt-get install -y --force-yes cmake llvm-3.7-dev
# install evmjit
RUN git clone https://github.com/debris/evmjit && \
cd evmjit && \
mkdir build && cd build && \
cmake .. && make && make install && cd
# install rustup
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# rustup directory
ENV PATH /root/.cargo/bin:$PATH
# show backtraces
ENV RUST_BACKTRACE 1
# show tools
RUN rustc -vV && \
cargo -V && \
gcc -v &&\
g++ -v
# build parity
RUN git clone https://github.com/ethcore/parity && \
cd parity && \
git pull && \
cargo build --release --features final && \
ls /build/parity/target/release/parity && \
strip /build/parity/target/release/parity
RUN file /build/parity/target/release/parity
EXPOSE 8080 8545 8180
ENTRYPOINT ["/build/parity/target/release/parity"]

View File

@@ -3,6 +3,7 @@ WORKDIR /build
# install tools and dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
g++ \
curl \
git \

View File

@@ -1,13 +1,19 @@
FROM ubuntu:14.04
WORKDIR /build
# install tools and dependencies
RUN apt-get update && \
apt-get install -y \
g++ \
curl \
git \
file \
binutils
RUN apt-get -y update && \
apt-get install -y --force-yes --no-install-recommends g++ gcc libc6 libc6-dev \
python binutils curl git make file ca-certificates zip dpkg-dev rhash openssl build-essential pkg-config libssl-dev
# install AWS CLI
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
pip install awscli
# install nodejs
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
apt-get install -y nodejs && \
apt-get clean
# install rustup
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
@@ -29,7 +35,7 @@ RUN git clone https://github.com/ethcore/parity && \
cd parity && \
git checkout beta && \
git pull && \
cargo build --release --verbose && \
cargo build --features final --release --verbose && \
ls /build/parity/target/release/parity && \
strip /build/parity/target/release/parity

View File

@@ -1,7 +1,7 @@
[package]
name = "ethash"
version = "1.4.0"
authors = ["arkpar <arkadiy@ethcore.io"]
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
[lib]

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -116,17 +116,17 @@ impl Light {
pub fn from_file(block_number: u64) -> io::Result<Light> {
let seed_compute = SeedHashCompute::new();
let path = Light::file_path(seed_compute.get_seedhash(block_number));
let mut file = try!(File::open(path));
let mut file = File::open(path)?;
let cache_size = get_cache_size(block_number);
if try!(file.metadata()).len() != cache_size as u64 {
if file.metadata()?.len() != cache_size as u64 {
return Err(io::Error::new(io::ErrorKind::Other, "Cache file size mismatch"));
}
let num_nodes = cache_size / NODE_BYTES;
let mut nodes: Vec<Node> = Vec::new();
nodes.resize(num_nodes, unsafe { mem::uninitialized() });
let buf = unsafe { slice::from_raw_parts_mut(nodes.as_mut_ptr() as *mut u8, cache_size) };
try!(file.read_exact(buf));
file.read_exact(buf)?;
Ok(Light {
cache: nodes,
block_number: block_number,
@@ -144,16 +144,16 @@ impl Light {
if deprecated.exists() {
debug!(target: "ethash", "removing: {:?}", &deprecated);
try!(fs::remove_file(deprecated));
fs::remove_file(deprecated)?;
}
}
try!(fs::create_dir_all(path.parent().unwrap()));
let mut file = try!(File::create(&path));
fs::create_dir_all(path.parent().unwrap())?;
let mut file = File::create(&path)?;
let cache_size = self.cache.len() * NODE_BYTES;
let buf = unsafe { slice::from_raw_parts(self.cache.as_ptr() as *const u8, cache_size) };
try!(file.write(buf));
file.write(buf)?;
Ok(path)
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

View File

@@ -1,10 +1,10 @@
[package]
description = "Ethcore library"
homepage = "http://ethcore.io"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "ethcore"
version = "1.4.0"
authors = ["Ethcore <admin@ethcore.io>"]
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
@@ -21,14 +21,15 @@ crossbeam = "0.2.9"
lazy_static = "0.2"
bloomchain = "0.1"
rayon = "0.4.2"
semver = "0.2"
semver = "0.5"
bit-set = "0.4"
time = "0.1"
rand = "0.3"
byteorder = "0.5"
transient-hashmap = "0.1"
linked-hash-map = "0.3.0"
evmjit = { path = "../evmjit", optional = true }
clippy = { version = "0.0.96", optional = true}
clippy = { version = "0.0.103", optional = true}
ethash = { path = "../ethash" }
ethcore-util = { path = "../util" }
ethcore-io = { path = "../util/io" }
@@ -41,6 +42,7 @@ ethcore-ipc-nano = { path = "../ipc/nano" }
rlp = { path = "../util/rlp" }
lru-cache = "0.1.0"
ethcore-bloom-journal = { path = "../util/bloom" }
ethabi = "0.2.2"
[dependencies.hyper]
git = "https://github.com/ethcore/hyper"

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify

26
ethcore/light/Cargo.toml Normal file
View File

@@ -0,0 +1,26 @@
[package]
description = "Parity LES primitives"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "ethcore-light"
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
"ethcore-ipc-codegen" = { path = "../../ipc/codegen", optional = true }
[dependencies]
log = "0.3"
ethcore = { path = ".."}
ethcore-util = { path = "../../util" }
ethcore-network = { path = "../../util/network" }
ethcore-io = { path = "../../util/io" }
ethcore-ipc = { path = "../../ipc/rpc", optional = true }
rlp = { path = "../../util/rlp" }
time = "0.1"
smallvec = "0.3.1"
[features]
default = []
ipc = ["ethcore-ipc", "ethcore-ipc-codegen"]

27
ethcore/light/build.rs Normal file
View File

@@ -0,0 +1,27 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
#[cfg(feature = "ipc")]
extern crate ethcore_ipc_codegen;
#[cfg(feature = "ipc")]
fn main() {
ethcore_ipc_codegen::derive_binary("src/types/mod.rs.in").unwrap();
ethcore_ipc_codegen::derive_ipc_cond("src/provider.rs", true).unwrap();
}
#[cfg(not(feature = "ipc"))]
fn main() { }

View File

@@ -0,0 +1,22 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//! Canonical hash trie definitions and helper functions.
/// The size of each CHT.
pub const SIZE: u64 = 2048;
/// Convert a block number to a CHT number.
pub fn block_to_cht_number(block_num: u64) -> u64 {
(block_num + 1) / SIZE
}

View File

@@ -0,0 +1,366 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Light client header chain.
//!
//! Unlike a full node's `BlockChain` this doesn't store much in the database.
//! It stores candidates for the last 2048-4096 blocks as well as CHT roots for
//! historical blocks all the way to the genesis.
//!
//! This is separate from the `BlockChain` for two reasons:
//! - It stores only headers (and a pruned subset of them)
//! - To allow for flexibility in the database layout once that's incorporated.
// TODO: use DB instead of memory. DB Layout: just the contents of `candidates`/`headers`
//
use std::collections::{BTreeMap, HashMap};
use client::cht;
use ethcore::block_status::BlockStatus;
use ethcore::error::BlockError;
use ethcore::ids::BlockId;
use ethcore::views::HeaderView;
use util::{Bytes, H256, U256, HeapSizeOf, Mutex, RwLock};
use smallvec::SmallVec;
/// Store at least this many candidate headers at all times.
/// Also functions as the delay for computing CHTs as they aren't
/// relevant to any blocks we've got in memory.
const HISTORY: u64 = 2048;
/// Information about a block.
#[derive(Debug, Clone)]
pub struct BlockDescriptor {
/// The block's hash
pub hash: H256,
/// The block's number
pub number: u64,
/// The block's total difficulty.
pub total_difficulty: U256,
}
// candidate block description.
struct Candidate {
hash: H256,
parent_hash: H256,
total_difficulty: U256,
}
struct Entry {
candidates: SmallVec<[Candidate; 3]>, // 3 arbitrarily chosen
canonical_hash: H256,
}
impl HeapSizeOf for Entry {
fn heap_size_of_children(&self) -> usize {
match self.candidates.spilled() {
false => 0,
true => self.candidates.capacity() * ::std::mem::size_of::<Candidate>(),
}
}
}
/// Header chain. See module docs for more details.
pub struct HeaderChain {
genesis_header: Bytes, // special-case the genesis.
candidates: RwLock<BTreeMap<u64, Entry>>,
headers: RwLock<HashMap<H256, Bytes>>,
best_block: RwLock<BlockDescriptor>,
cht_roots: Mutex<Vec<H256>>,
}
impl HeaderChain {
/// Create a new header chain given this genesis block.
pub fn new(genesis: &[u8]) -> Self {
let g_view = HeaderView::new(genesis);
HeaderChain {
genesis_header: genesis.to_owned(),
best_block: RwLock::new(BlockDescriptor {
hash: g_view.hash(),
number: 0,
total_difficulty: g_view.difficulty(),
}),
candidates: RwLock::new(BTreeMap::new()),
headers: RwLock::new(HashMap::new()),
cht_roots: Mutex::new(Vec::new()),
}
}
/// Insert a pre-verified header.
///
/// This blindly trusts that the data given to it is
/// a) valid RLP encoding of a header and
/// b) has sensible data contained within it.
pub fn insert(&self, header: Bytes) -> Result<(), BlockError> {
let view = HeaderView::new(&header);
let hash = view.hash();
let number = view.number();
let parent_hash = view.parent_hash();
// hold candidates the whole time to guard import order.
let mut candidates = self.candidates.write();
// find parent details.
let parent_td =
if number == 1 {
let g_view = HeaderView::new(&self.genesis_header);
g_view.difficulty()
} else {
candidates.get(&(number - 1))
.and_then(|entry| entry.candidates.iter().find(|c| c.hash == parent_hash))
.map(|c| c.total_difficulty)
.ok_or_else(|| BlockError::UnknownParent(parent_hash))?
};
let total_difficulty = parent_td + view.difficulty();
// insert headers and candidates entries.
candidates.entry(number).or_insert_with(|| Entry { candidates: SmallVec::new(), canonical_hash: hash})
.candidates.push(Candidate {
hash: hash,
parent_hash: parent_hash,
total_difficulty: total_difficulty,
});
self.headers.write().insert(hash, header.clone());
// reorganize ancestors so canonical entries are first in their
// respective candidates vectors.
if self.best_block.read().total_difficulty < total_difficulty {
let mut canon_hash = hash;
for (_, entry) in candidates.iter_mut().rev().skip_while(|&(height, _)| *height > number) {
if entry.canonical_hash == canon_hash { break; }
let canon = entry.candidates.iter().find(|x| x.hash == canon_hash)
.expect("blocks are only inserted if parent is present; or this is the block we just added; qed");
// what about reorgs > cht::SIZE + HISTORY?
// resetting to the last block of a given CHT should be possible.
canon_hash = canon.parent_hash;
}
*self.best_block.write() = BlockDescriptor {
hash: hash,
number: number,
total_difficulty: total_difficulty,
};
// produce next CHT root if it's time.
let earliest_era = *candidates.keys().next().expect("at least one era just created; qed");
if earliest_era + HISTORY + cht::SIZE <= number {
let mut values = Vec::with_capacity(cht::SIZE as usize);
{
let mut headers = self.headers.write();
for i in (0..cht::SIZE).map(|x| x + earliest_era) {
let era_entry = candidates.remove(&i)
.expect("all eras are sequential with no gaps; qed");
for ancient in &era_entry.candidates {
headers.remove(&ancient.hash);
}
values.push((
::rlp::encode(&i).to_vec(),
::rlp::encode(&era_entry.canonical_hash).to_vec(),
));
}
}
let cht_root = ::util::triehash::trie_root(values);
debug!(target: "chain", "Produced CHT {} root: {:?}", (earliest_era - 1) % cht::SIZE, cht_root);
self.cht_roots.lock().push(cht_root);
}
}
Ok(())
}
/// Get a block header. In the case of query by number, only canonical blocks
/// will be returned.
pub fn get_header(&self, id: BlockId) -> Option<Bytes> {
match id {
BlockId::Earliest | BlockId::Number(0) => Some(self.genesis_header.clone()),
BlockId::Latest if self.headers.read().is_empty() => Some(self.genesis_header.clone()),
BlockId::Hash(hash) => self.headers.read().get(&hash).map(|x| x.to_vec()),
BlockId::Number(num) => {
if self.best_block.read().number < num { return None }
self.candidates.read().get(&num).map(|entry| entry.canonical_hash)
.and_then(|hash| self.headers.read().get(&hash).map(|x| x.to_vec()))
}
BlockId::Latest | BlockId::Pending => {
let hash = self.best_block.read().hash;
self.headers.read().get(&hash).map(|x| x.to_vec())
}
}
}
/// Get the nth CHT root, if it's been computed.
///
/// CHT root 0 is from block `1..2048`.
/// CHT root 1 is from block `2049..4096`
/// and so on.
///
/// This is because it's assumed that the genesis hash is known,
/// so including it within a CHT would be redundant.
pub fn cht_root(&self, n: usize) -> Option<H256> {
self.cht_roots.lock().get(n).map(|h| h.clone())
}
/// Get the genesis hash.
pub fn genesis_hash(&self) -> H256 {
::util::Hashable::sha3(&self.genesis_header)
}
/// Get the best block's data.
pub fn best_block(&self) -> BlockDescriptor {
self.best_block.read().clone()
}
/// If there is a gap between the genesis and the rest
/// of the stored blocks, return the first post-gap block.
pub fn first_block(&self) -> Option<BlockDescriptor> {
let candidates = self.candidates.read();
match candidates.iter().next() {
None | Some((&1, _)) => None,
Some((&height, entry)) => Some(BlockDescriptor {
number: height,
hash: entry.canonical_hash,
total_difficulty: entry.candidates.iter().find(|x| x.hash == entry.canonical_hash)
.expect("entry always stores canonical candidate; qed").total_difficulty,
})
}
}
/// Get block status.
pub fn status(&self, hash: &H256) -> BlockStatus {
match self.headers.read().contains_key(hash) {
true => BlockStatus::InChain,
false => BlockStatus::Unknown,
}
}
}
impl HeapSizeOf for HeaderChain {
fn heap_size_of_children(&self) -> usize {
self.candidates.read().heap_size_of_children() +
self.headers.read().heap_size_of_children() +
self.cht_roots.lock().heap_size_of_children()
}
}
#[cfg(test)]
mod tests {
use super::HeaderChain;
use ethcore::ids::BlockId;
use ethcore::header::Header;
use ethcore::spec::Spec;
#[test]
fn basic_chain() {
let spec = Spec::new_test();
let genesis_header = spec.genesis_header();
let chain = HeaderChain::new(&::rlp::encode(&genesis_header));
let mut parent_hash = genesis_header.hash();
let mut rolling_timestamp = genesis_header.timestamp();
for i in 1..10000 {
let mut header = Header::new();
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
chain.insert(::rlp::encode(&header).to_vec()).unwrap();
parent_hash = header.hash();
rolling_timestamp += 10;
}
assert!(chain.get_header(BlockId::Number(10)).is_none());
assert!(chain.get_header(BlockId::Number(9000)).is_some());
assert!(chain.cht_root(2).is_some());
assert!(chain.cht_root(3).is_none());
}
#[test]
fn reorganize() {
let spec = Spec::new_test();
let genesis_header = spec.genesis_header();
let chain = HeaderChain::new(&::rlp::encode(&genesis_header));
let mut parent_hash = genesis_header.hash();
let mut rolling_timestamp = genesis_header.timestamp();
for i in 1..6 {
let mut header = Header::new();
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
chain.insert(::rlp::encode(&header).to_vec()).unwrap();
parent_hash = header.hash();
rolling_timestamp += 10;
}
{
let mut rolling_timestamp = rolling_timestamp;
let mut parent_hash = parent_hash;
for i in 6..16 {
let mut header = Header::new();
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * i.into());
chain.insert(::rlp::encode(&header).to_vec()).unwrap();
parent_hash = header.hash();
rolling_timestamp += 10;
}
}
assert_eq!(chain.best_block().number, 15);
{
let mut rolling_timestamp = rolling_timestamp;
let mut parent_hash = parent_hash;
// import a shorter chain which has better TD.
for i in 6..13 {
let mut header = Header::new();
header.set_parent_hash(parent_hash);
header.set_number(i);
header.set_timestamp(rolling_timestamp);
header.set_difficulty(*genesis_header.difficulty() * (i * i).into());
chain.insert(::rlp::encode(&header).to_vec()).unwrap();
parent_hash = header.hash();
rolling_timestamp += 11;
}
}
assert_eq!(chain.best_block().number, 12);
}
}

View File

@@ -0,0 +1,271 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Light client implementation. Stores data from light sync
use ethcore::block_import_error::BlockImportError;
use ethcore::block_status::BlockStatus;
use ethcore::client::ClientReport;
use ethcore::ids::BlockId;
use ethcore::header::Header;
use ethcore::views::HeaderView;
use ethcore::verification::queue::{self, HeaderQueue};
use ethcore::transaction::{PendingTransaction, Condition as TransactionCondition};
use ethcore::blockchain_info::BlockChainInfo;
use ethcore::spec::Spec;
use ethcore::service::ClientIoMessage;
use ethcore::encoded;
use io::IoChannel;
use util::hash::{H256, H256FastMap};
use util::{Bytes, Mutex, RwLock};
use provider::Provider;
use request;
use time;
use self::header_chain::HeaderChain;
pub use self::service::Service;
pub mod cht;
mod header_chain;
mod service;
/// Configuration for the light client.
#[derive(Debug, Default, Clone)]
pub struct Config {
/// Verification queue config.
pub queue: queue::Config,
}
/// Trait for interacting with the header chain abstractly.
pub trait LightChainClient: Send + Sync {
/// Get chain info.
fn chain_info(&self) -> BlockChainInfo;
/// Queue header to be verified. Required that all headers queued have their
/// parent queued prior.
fn queue_header(&self, header: Header) -> Result<H256, BlockImportError>;
/// Query whether a block is known.
fn is_known(&self, hash: &H256) -> bool;
/// Clear the queue.
fn clear_queue(&self);
/// Get queue info.
fn queue_info(&self) -> queue::QueueInfo;
/// Get the `i`th CHT root.
fn cht_root(&self, i: usize) -> Option<H256>;
}
/// Light client implementation.
pub struct Client {
queue: HeaderQueue,
chain: HeaderChain,
tx_pool: Mutex<H256FastMap<PendingTransaction>>,
report: RwLock<ClientReport>,
import_lock: Mutex<()>,
}
impl Client {
/// Create a new `Client`.
pub fn new(config: Config, spec: &Spec, io_channel: IoChannel<ClientIoMessage>) -> Self {
Client {
queue: HeaderQueue::new(config.queue, spec.engine.clone(), io_channel, true),
chain: HeaderChain::new(&::rlp::encode(&spec.genesis_header())),
tx_pool: Mutex::new(Default::default()),
report: RwLock::new(ClientReport::default()),
import_lock: Mutex::new(()),
}
}
/// Import a header to the queue for additional verification.
pub fn import_header(&self, header: Header) -> Result<H256, BlockImportError> {
self.queue.import(header).map_err(Into::into)
}
/// Import a local transaction.
pub fn import_own_transaction(&self, tx: PendingTransaction) {
self.tx_pool.lock().insert(tx.transaction.hash(), tx);
}
/// Fetch a vector of all pending transactions.
pub fn ready_transactions(&self) -> Vec<PendingTransaction> {
let best_num = self.chain.best_block().number;
self.tx_pool.lock()
.values()
.filter(|t| match t.condition {
Some(TransactionCondition::Number(ref x)) => x <= &best_num,
Some(TransactionCondition::Timestamp(ref x)) => *x <= time::get_time().sec as u64,
None => true,
})
.cloned()
.collect()
}
/// Inquire about the status of a given header.
pub fn status(&self, hash: &H256) -> BlockStatus {
match self.queue.status(hash) {
queue::Status::Unknown => self.chain.status(hash),
other => other.into(),
}
}
/// Get the chain info.
pub fn chain_info(&self) -> BlockChainInfo {
let best_block = self.chain.best_block();
let first_block = self.chain.first_block();
let genesis_hash = self.chain.genesis_hash();
BlockChainInfo {
total_difficulty: best_block.total_difficulty,
pending_total_difficulty: best_block.total_difficulty,
genesis_hash: genesis_hash,
best_block_hash: best_block.hash,
best_block_number: best_block.number,
best_block_timestamp: HeaderView::new(&self.chain.get_header(BlockId::Latest).expect("Latest hash is always in the chain")).timestamp(),
ancient_block_hash: if first_block.is_some() { Some(genesis_hash) } else { None },
ancient_block_number: if first_block.is_some() { Some(0) } else { None },
first_block_hash: first_block.as_ref().map(|first| first.hash),
first_block_number: first_block.as_ref().map(|first| first.number),
}
}
/// Get the header queue info.
pub fn queue_info(&self) -> queue::QueueInfo {
self.queue.queue_info()
}
/// Get a block header by Id.
pub fn get_header(&self, id: BlockId) -> Option<Bytes> {
self.chain.get_header(id)
}
/// Get the `i`th CHT root.
pub fn cht_root(&self, i: usize) -> Option<H256> {
self.chain.cht_root(i)
}
/// Import a set of pre-verified headers from the queue.
pub fn import_verified(&self) {
const MAX: usize = 256;
let _lock = self.import_lock.lock();
let mut bad = Vec::new();
let mut good = Vec::new();
for verified_header in self.queue.drain(MAX) {
let (num, hash) = (verified_header.number(), verified_header.hash());
match self.chain.insert(::rlp::encode(&verified_header).to_vec()) {
Ok(()) => {
good.push(hash);
self.report.write().blocks_imported += 1;
}
Err(e) => {
debug!(target: "client", "Error importing header {:?}: {}", (num, hash), e);
bad.push(hash);
}
}
}
self.queue.mark_as_bad(&bad);
self.queue.mark_as_good(&good);
}
/// Get a report about blocks imported.
pub fn report(&self) -> ClientReport {
::std::mem::replace(&mut *self.report.write(), ClientReport::default())
}
/// Get blockchain mem usage in bytes.
pub fn chain_mem_used(&self) -> usize {
use util::HeapSizeOf;
self.chain.heap_size_of_children()
}
}
impl LightChainClient for Client {
fn chain_info(&self) -> BlockChainInfo { Client::chain_info(self) }
fn queue_header(&self, header: Header) -> Result<H256, BlockImportError> {
self.import_header(header)
}
fn is_known(&self, hash: &H256) -> bool {
self.status(hash) == BlockStatus::InChain
}
fn clear_queue(&self) {
self.queue.clear()
}
fn queue_info(&self) -> queue::QueueInfo {
self.queue.queue_info()
}
fn cht_root(&self, i: usize) -> Option<H256> {
Client::cht_root(self, i)
}
}
// dummy implementation -- may draw from canonical cache further on.
impl Provider for Client {
fn chain_info(&self) -> BlockChainInfo {
Client::chain_info(self)
}
fn reorg_depth(&self, _a: &H256, _b: &H256) -> Option<u64> {
None
}
fn earliest_state(&self) -> Option<u64> {
None
}
fn block_header(&self, id: BlockId) -> Option<encoded::Header> {
self.chain.get_header(id).map(encoded::Header::new)
}
fn block_body(&self, _id: BlockId) -> Option<encoded::Body> {
None
}
fn block_receipts(&self, _hash: &H256) -> Option<Bytes> {
None
}
fn state_proof(&self, _req: request::StateProof) -> Vec<Bytes> {
Vec::new()
}
fn contract_code(&self, _req: request::ContractCode) -> Bytes {
Vec::new()
}
fn header_proof(&self, _req: request::HeaderProof) -> Option<(encoded::Header, Vec<Bytes>)> {
None
}
fn ready_transactions(&self) -> Vec<PendingTransaction> {
Vec::new()
}
}

View File

@@ -0,0 +1,73 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Minimal IO service for light client.
//! Just handles block import messages and passes them to the client.
use std::sync::Arc;
use ethcore::service::ClientIoMessage;
use ethcore::spec::Spec;
use io::{IoContext, IoError, IoHandler, IoService};
use super::{Client, Config as ClientConfig};
/// Light client service.
pub struct Service {
client: Arc<Client>,
_io_service: IoService<ClientIoMessage>,
}
impl Service {
/// Start the service: initialize I/O workers and client itself.
pub fn start(config: ClientConfig, spec: &Spec) -> Result<Self, IoError> {
let io_service = try!(IoService::<ClientIoMessage>::start());
let client = Arc::new(Client::new(config, spec, io_service.channel()));
try!(io_service.register_handler(Arc::new(ImportBlocks(client.clone()))));
Ok(Service {
client: client,
_io_service: io_service,
})
}
/// Get a handle to the client.
pub fn client(&self) -> &Arc<Client> {
&self.client
}
}
struct ImportBlocks(Arc<Client>);
impl IoHandler<ClientIoMessage> for ImportBlocks {
fn message(&self, _io: &IoContext<ClientIoMessage>, message: &ClientIoMessage) {
if let ClientIoMessage::BlockVerified = *message {
self.0.import_verified();
}
}
}
#[cfg(test)]
mod tests {
use super::Service;
use ethcore::spec::Spec;
#[test]
fn it_works() {
let spec = Spec::new_test();
Service::start(Default::default(), &spec).unwrap();
}
}

69
ethcore/light/src/lib.rs Normal file
View File

@@ -0,0 +1,69 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Light client logic and implementation.
//!
//! A "light" client stores very little chain-related data locally
//! unlike a full node, which stores all blocks, headers, receipts, and more.
//!
//! This enables the client to have a much lower resource footprint in
//! exchange for the cost of having to ask the network for state data
//! while responding to queries. This makes a light client unsuitable for
//! low-latency applications, but perfectly suitable for simple everyday
//! use-cases like sending transactions from a personal account.
//!
//! The light client performs a header-only sync, doing verification and pruning
//! historical blocks. Upon pruning, batches of 2048 blocks have a number => hash
//! mapping sealed into "canonical hash tries" which can later be used to verify
//! historical block queries from peers.
#![deny(missing_docs)]
pub mod client;
pub mod net;
#[cfg(not(feature = "ipc"))]
pub mod provider;
#[cfg(feature = "ipc")]
pub mod provider {
#![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues
include!(concat!(env!("OUT_DIR"), "/provider.rs"));
}
#[cfg(feature = "ipc")]
pub mod remote {
pub use provider::LightProviderClient;
}
mod types;
pub use self::provider::Provider;
pub use types::les_request as request;
#[macro_use]
extern crate log;
extern crate ethcore;
extern crate ethcore_util as util;
extern crate ethcore_network as network;
extern crate ethcore_io as io;
extern crate rlp;
extern crate smallvec;
extern crate time;
#[cfg(feature = "ipc")]
extern crate ethcore_ipc as ipc;

View File

@@ -0,0 +1,320 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! LES buffer flow management.
//!
//! Every request in the LES protocol leads to a reduction
//! of the requester's buffer value as a rate-limiting mechanism.
//! This buffer value will recharge at a set rate.
//!
//! This module provides an interface for configuration of buffer
//! flow costs and recharge rates.
//!
//! Current default costs are picked completely arbitrarily, not based
//! on any empirical timings or mathematical models.
use request;
use super::packet;
use super::error::Error;
use rlp::*;
use util::U256;
use time::{Duration, SteadyTime};
/// A request cost specification.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Cost(pub U256, pub U256);
/// Buffer value.
///
/// Produced and recharged using `FlowParams`.
/// Definitive updates can be made as well -- these will reset the recharge
/// point to the time of the update.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Buffer {
estimate: U256,
recharge_point: SteadyTime,
}
impl Buffer {
/// Get the current buffer value.
pub fn current(&self) -> U256 { self.estimate.clone() }
/// Make a definitive update.
/// This will be the value obtained after receiving
/// a response to a request.
pub fn update_to(&mut self, value: U256) {
self.estimate = value;
self.recharge_point = SteadyTime::now();
}
/// Attempt to apply the given cost to the buffer.
///
/// If successful, the cost will be deducted successfully.
///
/// If unsuccessful, the structure will be unaltered an an
/// error will be produced.
pub fn deduct_cost(&mut self, cost: U256) -> Result<(), Error> {
match cost > self.estimate {
true => Err(Error::BufferEmpty),
false => {
self.estimate = self.estimate - cost;
Ok(())
}
}
}
}
/// A cost table, mapping requests to base and per-request costs.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CostTable {
headers: Cost,
bodies: Cost,
receipts: Cost,
state_proofs: Cost,
contract_codes: Cost,
header_proofs: Cost,
}
impl Default for CostTable {
fn default() -> Self {
// arbitrarily chosen constants.
CostTable {
headers: Cost(100000.into(), 10000.into()),
bodies: Cost(150000.into(), 15000.into()),
receipts: Cost(50000.into(), 5000.into()),
state_proofs: Cost(250000.into(), 25000.into()),
contract_codes: Cost(200000.into(), 20000.into()),
header_proofs: Cost(150000.into(), 15000.into()),
}
}
}
impl RlpEncodable for CostTable {
fn rlp_append(&self, s: &mut RlpStream) {
fn append_cost(s: &mut RlpStream, msg_id: u8, cost: &Cost) {
s.begin_list(3)
.append(&msg_id)
.append(&cost.0)
.append(&cost.1);
}
s.begin_list(6);
append_cost(s, packet::GET_BLOCK_HEADERS, &self.headers);
append_cost(s, packet::GET_BLOCK_BODIES, &self.bodies);
append_cost(s, packet::GET_RECEIPTS, &self.receipts);
append_cost(s, packet::GET_PROOFS, &self.state_proofs);
append_cost(s, packet::GET_CONTRACT_CODES, &self.contract_codes);
append_cost(s, packet::GET_HEADER_PROOFS, &self.header_proofs);
}
}
impl RlpDecodable for CostTable {
fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder {
let rlp = decoder.as_rlp();
let mut headers = None;
let mut bodies = None;
let mut receipts = None;
let mut state_proofs = None;
let mut contract_codes = None;
let mut header_proofs = None;
for row in rlp.iter() {
let msg_id: u8 = row.val_at(0)?;
let cost = {
let base = row.val_at(1)?;
let per = row.val_at(2)?;
Cost(base, per)
};
match msg_id {
packet::GET_BLOCK_HEADERS => headers = Some(cost),
packet::GET_BLOCK_BODIES => bodies = Some(cost),
packet::GET_RECEIPTS => receipts = Some(cost),
packet::GET_PROOFS => state_proofs = Some(cost),
packet::GET_CONTRACT_CODES => contract_codes = Some(cost),
packet::GET_HEADER_PROOFS => header_proofs = Some(cost),
_ => return Err(DecoderError::Custom("Unrecognized message in cost table")),
}
}
Ok(CostTable {
headers: headers.ok_or(DecoderError::Custom("No headers cost specified"))?,
bodies: bodies.ok_or(DecoderError::Custom("No bodies cost specified"))?,
receipts: receipts.ok_or(DecoderError::Custom("No receipts cost specified"))?,
state_proofs: state_proofs.ok_or(DecoderError::Custom("No proofs cost specified"))?,
contract_codes: contract_codes.ok_or(DecoderError::Custom("No contract codes specified"))?,
header_proofs: header_proofs.ok_or(DecoderError::Custom("No header proofs cost specified"))?,
})
}
}
/// A buffer-flow manager handles costs, recharge, limits
#[derive(Debug, Clone, PartialEq)]
pub struct FlowParams {
costs: CostTable,
limit: U256,
recharge: U256,
}
impl FlowParams {
/// Create new flow parameters from a request cost table,
/// buffer limit, and (minimum) rate of recharge.
pub fn new(limit: U256, costs: CostTable, recharge: U256) -> Self {
FlowParams {
costs: costs,
limit: limit,
recharge: recharge,
}
}
/// Get a reference to the buffer limit.
pub fn limit(&self) -> &U256 { &self.limit }
/// Get a reference to the cost table.
pub fn cost_table(&self) -> &CostTable { &self.costs }
/// Get a reference to the recharge rate.
pub fn recharge_rate(&self) -> &U256 { &self.recharge }
/// Compute the actual cost of a request, given the kind of request
/// and number of requests made.
pub fn compute_cost(&self, kind: request::Kind, amount: usize) -> U256 {
let cost = match kind {
request::Kind::Headers => &self.costs.headers,
request::Kind::Bodies => &self.costs.bodies,
request::Kind::Receipts => &self.costs.receipts,
request::Kind::StateProofs => &self.costs.state_proofs,
request::Kind::Codes => &self.costs.contract_codes,
request::Kind::HeaderProofs => &self.costs.header_proofs,
};
let amount: U256 = amount.into();
cost.0 + (amount * cost.1)
}
/// Compute the maximum number of costs of a specific kind which can be made
/// with the given buffer.
/// Saturates at `usize::max()`. This is not a problem in practice because
/// this amount of requests is already prohibitively large.
pub fn max_amount(&self, buffer: &Buffer, kind: request::Kind) -> usize {
use util::Uint;
use std::usize;
let cost = match kind {
request::Kind::Headers => &self.costs.headers,
request::Kind::Bodies => &self.costs.bodies,
request::Kind::Receipts => &self.costs.receipts,
request::Kind::StateProofs => &self.costs.state_proofs,
request::Kind::Codes => &self.costs.contract_codes,
request::Kind::HeaderProofs => &self.costs.header_proofs,
};
let start = buffer.current();
if start <= cost.0 {
return 0;
} else if cost.1 == U256::zero() {
return usize::MAX;
}
let max = (start - cost.0) / cost.1;
if max >= usize::MAX.into() {
usize::MAX
} else {
max.as_u64() as usize
}
}
/// Create initial buffer parameter.
pub fn create_buffer(&self) -> Buffer {
Buffer {
estimate: self.limit,
recharge_point: SteadyTime::now(),
}
}
/// Recharge the buffer based on time passed since last
/// update.
pub fn recharge(&self, buf: &mut Buffer) {
let now = SteadyTime::now();
// recompute and update only in terms of full seconds elapsed
// in order to keep the estimate as an underestimate.
let elapsed = (now - buf.recharge_point).num_seconds();
buf.recharge_point = buf.recharge_point + Duration::seconds(elapsed);
let elapsed: U256 = elapsed.into();
buf.estimate = ::std::cmp::min(self.limit, buf.estimate + (elapsed * self.recharge));
}
/// Refund some buffer which was previously deducted.
/// Does not update the recharge timestamp.
pub fn refund(&self, buf: &mut Buffer, refund_amount: U256) {
buf.estimate = buf.estimate + refund_amount;
if buf.estimate > self.limit {
buf.estimate = self.limit
}
}
}
impl Default for FlowParams {
fn default() -> Self {
FlowParams {
limit: 50_000_000.into(),
costs: CostTable::default(),
recharge: 100_000.into(),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn should_serialize_cost_table() {
let costs = CostTable::default();
let serialized = ::rlp::encode(&costs);
let new_costs: CostTable = ::rlp::decode(&*serialized);
assert_eq!(costs, new_costs);
}
#[test]
fn buffer_mechanism() {
use std::thread;
use std::time::Duration;
let flow_params = FlowParams::new(100.into(), Default::default(), 20.into());
let mut buffer = flow_params.create_buffer();
assert!(buffer.deduct_cost(101.into()).is_err());
assert!(buffer.deduct_cost(10.into()).is_ok());
thread::sleep(Duration::from_secs(1));
flow_params.recharge(&mut buffer);
assert_eq!(buffer.estimate, 100.into());
}
}

View File

@@ -0,0 +1,192 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! I/O and event context generalizations.
use network::{NetworkContext, PeerId, NodeId};
use super::{Announcement, LightProtocol, ReqId};
use super::error::Error;
use request::{self, Request};
/// An I/O context which allows sending and receiving packets as well as
/// disconnecting peers. This is used as a generalization of the portions
/// of a p2p network which the light protocol structure makes use of.
pub trait IoContext {
/// Send a packet to a specific peer.
fn send(&self, peer: PeerId, packet_id: u8, packet_body: Vec<u8>);
/// Respond to a peer's message. Only works if this context is a byproduct
/// of a packet handler.
fn respond(&self, packet_id: u8, packet_body: Vec<u8>);
/// Disconnect a peer.
fn disconnect_peer(&self, peer: PeerId);
/// Disable a peer -- this is a disconnect + a time-out.
fn disable_peer(&self, peer: PeerId);
/// Get a peer's protocol version.
fn protocol_version(&self, peer: PeerId) -> Option<u8>;
/// Persistent peer id
fn persistent_peer_id(&self, peer: PeerId) -> Option<NodeId>;
}
impl<'a> IoContext for NetworkContext<'a> {
fn send(&self, peer: PeerId, packet_id: u8, packet_body: Vec<u8>) {
if let Err(e) = self.send(peer, packet_id, packet_body) {
debug!(target: "les", "Error sending packet to peer {}: {}", peer, e);
}
}
fn respond(&self, packet_id: u8, packet_body: Vec<u8>) {
if let Err(e) = self.respond(packet_id, packet_body) {
debug!(target: "les", "Error responding to peer message: {}", e);
}
}
fn disconnect_peer(&self, peer: PeerId) {
NetworkContext::disconnect_peer(self, peer);
}
fn disable_peer(&self, peer: PeerId) {
NetworkContext::disable_peer(self, peer);
}
fn protocol_version(&self, peer: PeerId) -> Option<u8> {
self.protocol_version(self.subprotocol_name(), peer)
}
fn persistent_peer_id(&self, peer: PeerId) -> Option<NodeId> {
self.session_info(peer).and_then(|info| info.id)
}
}
/// Basic context for a the protocol.
pub trait BasicContext {
/// Returns the relevant's peer persistent Id (aka NodeId).
fn persistent_peer_id(&self, peer: PeerId) -> Option<NodeId>;
/// Make a request from a peer.
fn request_from(&self, peer: PeerId, request: Request) -> Result<ReqId, Error>;
/// Make an announcement of new capabilities to the rest of the peers.
// TODO: maybe just put this on a timer in LightProtocol?
fn make_announcement(&self, announcement: Announcement);
/// Find the maximum number of requests of a specific type which can be made from
/// supplied peer.
fn max_requests(&self, peer: PeerId, kind: request::Kind) -> usize;
/// Disconnect a peer.
fn disconnect_peer(&self, peer: PeerId);
/// Disable a peer.
fn disable_peer(&self, peer: PeerId);
}
/// Context for a protocol event which has a peer ID attached.
pub trait EventContext: BasicContext {
/// Get the peer relevant to the event e.g. message sender,
/// disconnected/connected peer.
fn peer(&self) -> PeerId;
/// Treat the event context as a basic context.
fn as_basic(&self) -> &BasicContext;
}
/// Basic context.
pub struct TickCtx<'a> {
/// Io context to enable dispatch.
pub io: &'a IoContext,
/// Protocol implementation.
pub proto: &'a LightProtocol,
}
impl<'a> BasicContext for TickCtx<'a> {
fn persistent_peer_id(&self, id: PeerId) -> Option<NodeId> {
self.io.persistent_peer_id(id)
}
fn request_from(&self, peer: PeerId, request: Request) -> Result<ReqId, Error> {
self.proto.request_from(self.io, &peer, request)
}
fn make_announcement(&self, announcement: Announcement) {
self.proto.make_announcement(self.io, announcement);
}
fn max_requests(&self, peer: PeerId, kind: request::Kind) -> usize {
self.proto.max_requests(peer, kind)
}
fn disconnect_peer(&self, peer: PeerId) {
self.io.disconnect_peer(peer);
}
fn disable_peer(&self, peer: PeerId) {
self.io.disable_peer(peer);
}
}
/// Concrete implementation of `EventContext` over the light protocol struct and
/// an io context.
pub struct Ctx<'a> {
/// Io context to enable immediate response to events.
pub io: &'a IoContext,
/// Protocol implementation.
pub proto: &'a LightProtocol,
/// Relevant peer for event.
pub peer: PeerId,
}
impl<'a> BasicContext for Ctx<'a> {
fn persistent_peer_id(&self, id: PeerId) -> Option<NodeId> {
self.io.persistent_peer_id(id)
}
fn request_from(&self, peer: PeerId, request: Request) -> Result<ReqId, Error> {
self.proto.request_from(self.io, &peer, request)
}
fn make_announcement(&self, announcement: Announcement) {
self.proto.make_announcement(self.io, announcement);
}
fn max_requests(&self, peer: PeerId, kind: request::Kind) -> usize {
self.proto.max_requests(peer, kind)
}
fn disconnect_peer(&self, peer: PeerId) {
self.io.disconnect_peer(peer);
}
fn disable_peer(&self, peer: PeerId) {
self.io.disable_peer(peer);
}
}
impl<'a> EventContext for Ctx<'a> {
fn peer(&self) -> PeerId {
self.peer
}
fn as_basic(&self) -> &BasicContext {
&*self
}
}

View File

@@ -0,0 +1,118 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Defines error types and levels of punishment to use upon
//! encountering.
use rlp::DecoderError;
use network::NetworkError;
use std::fmt;
/// Levels of punishment.
///
/// Currently just encompasses two different kinds of disconnect and
/// no punishment, but this is where reputation systems might come into play.
// In ascending order
#[derive(Debug, PartialEq, Eq)]
pub enum Punishment {
/// Perform no punishment.
None,
/// Disconnect the peer, but don't prevent them from reconnecting.
Disconnect,
/// Disconnect the peer and prevent them from reconnecting.
Disable,
}
/// Kinds of errors which can be encountered in the course of LES.
#[derive(Debug)]
pub enum Error {
/// An RLP decoding error.
Rlp(DecoderError),
/// A network error.
Network(NetworkError),
/// Out of buffer.
BufferEmpty,
/// Unrecognized packet code.
UnrecognizedPacket(u8),
/// Unexpected handshake.
UnexpectedHandshake,
/// Peer on wrong network (wrong NetworkId or genesis hash)
WrongNetwork,
/// Unknown peer.
UnknownPeer,
/// Unsolicited response.
UnsolicitedResponse,
/// Not a server.
NotServer,
/// Unsupported protocol version.
UnsupportedProtocolVersion(u8),
/// Bad protocol version.
BadProtocolVersion,
/// Peer is overburdened.
Overburdened,
}
impl Error {
/// What level of punishment does this error warrant?
pub fn punishment(&self) -> Punishment {
match *self {
Error::Rlp(_) => Punishment::Disable,
Error::Network(_) => Punishment::None,
Error::BufferEmpty => Punishment::Disable,
Error::UnrecognizedPacket(_) => Punishment::Disconnect,
Error::UnexpectedHandshake => Punishment::Disconnect,
Error::WrongNetwork => Punishment::Disable,
Error::UnknownPeer => Punishment::Disconnect,
Error::UnsolicitedResponse => Punishment::Disable,
Error::NotServer => Punishment::Disable,
Error::UnsupportedProtocolVersion(_) => Punishment::Disable,
Error::BadProtocolVersion => Punishment::Disable,
Error::Overburdened => Punishment::None,
}
}
}
impl From<DecoderError> for Error {
fn from(err: DecoderError) -> Self {
Error::Rlp(err)
}
}
impl From<NetworkError> for Error {
fn from(err: NetworkError) -> Self {
Error::Network(err)
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Error::Rlp(ref err) => err.fmt(f),
Error::Network(ref err) => err.fmt(f),
Error::BufferEmpty => write!(f, "Out of buffer"),
Error::UnrecognizedPacket(code) => write!(f, "Unrecognized packet: 0x{:x}", code),
Error::UnexpectedHandshake => write!(f, "Unexpected handshake"),
Error::WrongNetwork => write!(f, "Wrong network"),
Error::UnknownPeer => write!(f, "Unknown peer"),
Error::UnsolicitedResponse => write!(f, "Peer provided unsolicited data"),
Error::NotServer => write!(f, "Peer not a server."),
Error::UnsupportedProtocolVersion(pv) => write!(f, "Unsupported protocol version: {}", pv),
Error::BadProtocolVersion => write!(f, "Bad protocol version in handshake"),
Error::Overburdened => write!(f, "Peer overburdened"),
}
}
}

1270
ethcore/light/src/net/mod.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,565 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Peer status and capabilities.
use rlp::{DecoderError, RlpDecodable, RlpEncodable, RlpStream, Stream, UntrustedRlp, View};
use util::{H256, U256};
use super::buffer_flow::FlowParams;
// recognized handshake/announcement keys.
// unknown keys are to be skipped, known keys have a defined order.
// their string values are defined in the LES spec.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd)]
enum Key {
ProtocolVersion,
NetworkId,
HeadTD,
HeadHash,
HeadNum,
GenesisHash,
ServeHeaders,
ServeChainSince,
ServeStateSince,
TxRelay,
BufferLimit,
BufferCostTable,
BufferRechargeRate,
}
impl Key {
// get the string value of this key.
fn as_str(&self) -> &'static str {
match *self {
Key::ProtocolVersion => "protocolVersion",
Key::NetworkId => "networkId",
Key::HeadTD => "headTd",
Key::HeadHash => "headHash",
Key::HeadNum => "headNum",
Key::GenesisHash => "genesisHash",
Key::ServeHeaders => "serveHeaders",
Key::ServeChainSince => "serveChainSince",
Key::ServeStateSince => "serveStateSince",
Key::TxRelay => "txRelay",
Key::BufferLimit => "flowControl/BL",
Key::BufferCostTable => "flowControl/MRC",
Key::BufferRechargeRate => "flowControl/MRR",
}
}
// try to parse the key value from a string.
fn from_str(s: &str) -> Option<Self> {
match s {
"protocolVersion" => Some(Key::ProtocolVersion),
"networkId" => Some(Key::NetworkId),
"headTd" => Some(Key::HeadTD),
"headHash" => Some(Key::HeadHash),
"headNum" => Some(Key::HeadNum),
"genesisHash" => Some(Key::GenesisHash),
"serveHeaders" => Some(Key::ServeHeaders),
"serveChainSince" => Some(Key::ServeChainSince),
"serveStateSince" => Some(Key::ServeStateSince),
"txRelay" => Some(Key::TxRelay),
"flowControl/BL" => Some(Key::BufferLimit),
"flowControl/MRC" => Some(Key::BufferCostTable),
"flowControl/MRR" => Some(Key::BufferRechargeRate),
_ => None
}
}
}
// helper for decoding key-value pairs in the handshake or an announcement.
struct Parser<'a> {
pos: usize,
rlp: UntrustedRlp<'a>,
}
impl<'a> Parser<'a> {
// expect a specific next key, and decode the value.
// error on unexpected key or invalid value.
fn expect<T: RlpDecodable>(&mut self, key: Key) -> Result<T, DecoderError> {
self.expect_raw(key).and_then(|item| item.as_val())
}
// expect a specific next key, and get the value's RLP.
// if the key isn't found, the position isn't advanced.
fn expect_raw(&mut self, key: Key) -> Result<UntrustedRlp<'a>, DecoderError> {
trace!(target: "les", "Expecting key {}", key.as_str());
let pre_pos = self.pos;
if let Some((k, val)) = self.get_next()? {
if k == key { return Ok(val) }
}
self.pos = pre_pos;
Err(DecoderError::Custom("Missing expected key"))
}
// get the next key and value RLP.
fn get_next(&mut self) -> Result<Option<(Key, UntrustedRlp<'a>)>, DecoderError> {
while self.pos < self.rlp.item_count() {
let pair = self.rlp.at(self.pos)?;
let k: String = pair.val_at(0)?;
self.pos += 1;
match Key::from_str(&k) {
Some(key) => return Ok(Some((key , pair.at(1)?))),
None => continue,
}
}
Ok(None)
}
}
// Helper for encoding a key-value pair
fn encode_pair<T: RlpEncodable>(key: Key, val: &T) -> Vec<u8> {
let mut s = RlpStream::new_list(2);
s.append(&key.as_str()).append(val);
s.out()
}
// Helper for encoding a flag.
fn encode_flag(key: Key) -> Vec<u8> {
let mut s = RlpStream::new_list(2);
s.append(&key.as_str()).append_empty_data();
s.out()
}
/// A peer status message.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Status {
/// Protocol version.
pub protocol_version: u32,
/// Network id of this peer.
pub network_id: u64,
/// Total difficulty of the head of the chain.
pub head_td: U256,
/// Hash of the best block.
pub head_hash: H256,
/// Number of the best block.
pub head_num: u64,
/// Genesis hash
pub genesis_hash: H256,
/// Last announced chain head and reorg depth to common ancestor.
pub last_head: Option<(H256, u64)>,
}
/// Peer capabilities.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Capabilities {
/// Whether this peer can serve headers
pub serve_headers: bool,
/// Earliest block number it can serve block/receipt requests for.
/// `None` means no requests will be servable.
pub serve_chain_since: Option<u64>,
/// Earliest block number it can serve state requests for.
/// `None` means no requests will be servable.
pub serve_state_since: Option<u64>,
/// Whether it can relay transactions to the eth network.
pub tx_relay: bool,
}
impl Default for Capabilities {
fn default() -> Self {
Capabilities {
serve_headers: true,
serve_chain_since: None,
serve_state_since: None,
tx_relay: false,
}
}
}
impl Capabilities {
/// Update the capabilities from an announcement.
pub fn update_from(&mut self, announcement: &Announcement) {
self.serve_headers = self.serve_headers || announcement.serve_headers;
self.serve_state_since = self.serve_state_since.or(announcement.serve_state_since);
self.serve_chain_since = self.serve_chain_since.or(announcement.serve_chain_since);
self.tx_relay = self.tx_relay || announcement.tx_relay;
}
}
/// Attempt to parse a handshake message into its three parts:
/// - chain status
/// - serving capabilities
/// - buffer flow parameters
pub fn parse_handshake(rlp: UntrustedRlp) -> Result<(Status, Capabilities, Option<FlowParams>), DecoderError> {
let mut parser = Parser {
pos: 0,
rlp: rlp,
};
let status = Status {
protocol_version: parser.expect(Key::ProtocolVersion)?,
network_id: parser.expect(Key::NetworkId)?,
head_td: parser.expect(Key::HeadTD)?,
head_hash: parser.expect(Key::HeadHash)?,
head_num: parser.expect(Key::HeadNum)?,
genesis_hash: parser.expect(Key::GenesisHash)?,
last_head: None,
};
let capabilities = Capabilities {
serve_headers: parser.expect_raw(Key::ServeHeaders).is_ok(),
serve_chain_since: parser.expect(Key::ServeChainSince).ok(),
serve_state_since: parser.expect(Key::ServeStateSince).ok(),
tx_relay: parser.expect_raw(Key::TxRelay).is_ok(),
};
let flow_params = match (
parser.expect(Key::BufferLimit),
parser.expect(Key::BufferCostTable),
parser.expect(Key::BufferRechargeRate)
) {
(Ok(bl), Ok(bct), Ok(brr)) => Some(FlowParams::new(bl, bct, brr)),
_ => None,
};
Ok((status, capabilities, flow_params))
}
/// Write a handshake, given status, capabilities, and flow parameters.
pub fn write_handshake(status: &Status, capabilities: &Capabilities, flow_params: Option<&FlowParams>) -> Vec<u8> {
let mut pairs = Vec::new();
pairs.push(encode_pair(Key::ProtocolVersion, &status.protocol_version));
pairs.push(encode_pair(Key::NetworkId, &(status.network_id as u64)));
pairs.push(encode_pair(Key::HeadTD, &status.head_td));
pairs.push(encode_pair(Key::HeadHash, &status.head_hash));
pairs.push(encode_pair(Key::HeadNum, &status.head_num));
pairs.push(encode_pair(Key::GenesisHash, &status.genesis_hash));
if capabilities.serve_headers {
pairs.push(encode_flag(Key::ServeHeaders));
}
if let Some(ref serve_chain_since) = capabilities.serve_chain_since {
pairs.push(encode_pair(Key::ServeChainSince, serve_chain_since));
}
if let Some(ref serve_state_since) = capabilities.serve_state_since {
pairs.push(encode_pair(Key::ServeStateSince, serve_state_since));
}
if capabilities.tx_relay {
pairs.push(encode_flag(Key::TxRelay));
}
if let Some(flow_params) = flow_params {
pairs.push(encode_pair(Key::BufferLimit, flow_params.limit()));
pairs.push(encode_pair(Key::BufferCostTable, flow_params.cost_table()));
pairs.push(encode_pair(Key::BufferRechargeRate, flow_params.recharge_rate()));
}
let mut stream = RlpStream::new_list(pairs.len());
for pair in pairs {
stream.append_raw(&pair, 1);
}
stream.out()
}
/// An announcement of new chain head or capabilities made by a peer.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Announcement {
/// Hash of the best block.
pub head_hash: H256,
/// Number of the best block.
pub head_num: u64,
/// Head total difficulty
pub head_td: U256,
/// reorg depth to common ancestor of last announced head.
pub reorg_depth: u64,
/// optional new header-serving capability. false means "no change"
pub serve_headers: bool,
/// optional new state-serving capability
pub serve_state_since: Option<u64>,
/// optional new chain-serving capability
pub serve_chain_since: Option<u64>,
/// optional new transaction-relay capability. false means "no change"
pub tx_relay: bool,
// TODO: changes in buffer flow?
}
/// Parse an announcement.
pub fn parse_announcement(rlp: UntrustedRlp) -> Result<Announcement, DecoderError> {
let mut last_key = None;
let mut announcement = Announcement {
head_hash: rlp.val_at(0)?,
head_num: rlp.val_at(1)?,
head_td: rlp.val_at(2)?,
reorg_depth: rlp.val_at(3)?,
serve_headers: false,
serve_state_since: None,
serve_chain_since: None,
tx_relay: false,
};
let mut parser = Parser {
pos: 4,
rlp: rlp,
};
while let Some((key, item)) = parser.get_next()? {
if Some(key) <= last_key { return Err(DecoderError::Custom("Invalid announcement key ordering")) }
last_key = Some(key);
match key {
Key::ServeHeaders => announcement.serve_headers = true,
Key::ServeStateSince => announcement.serve_state_since = Some(item.as_val()?),
Key::ServeChainSince => announcement.serve_chain_since = Some(item.as_val()?),
Key::TxRelay => announcement.tx_relay = true,
_ => return Err(DecoderError::Custom("Nonsensical key in announcement")),
}
}
Ok(announcement)
}
/// Write an announcement out.
pub fn write_announcement(announcement: &Announcement) -> Vec<u8> {
let mut pairs = Vec::new();
if announcement.serve_headers {
pairs.push(encode_flag(Key::ServeHeaders));
}
if let Some(ref serve_chain_since) = announcement.serve_chain_since {
pairs.push(encode_pair(Key::ServeChainSince, serve_chain_since));
}
if let Some(ref serve_state_since) = announcement.serve_state_since {
pairs.push(encode_pair(Key::ServeStateSince, serve_state_since));
}
if announcement.tx_relay {
pairs.push(encode_flag(Key::TxRelay));
}
let mut stream = RlpStream::new_list(4 + pairs.len());
stream
.append(&announcement.head_hash)
.append(&announcement.head_num)
.append(&announcement.head_td)
.append(&announcement.reorg_depth);
for item in pairs {
stream.append_raw(&item, 1);
}
stream.out()
}
#[cfg(test)]
mod tests {
use super::*;
use super::super::buffer_flow::FlowParams;
use util::{U256, H256, FixedHash};
use rlp::{RlpStream, Stream ,UntrustedRlp, View};
#[test]
fn full_handshake() {
let status = Status {
protocol_version: 1,
network_id: 1,
head_td: U256::default(),
head_hash: H256::default(),
head_num: 10,
genesis_hash: H256::zero(),
last_head: None,
};
let capabilities = Capabilities {
serve_headers: true,
serve_chain_since: Some(5),
serve_state_since: Some(8),
tx_relay: true,
};
let flow_params = FlowParams::new(
1_000_000.into(),
Default::default(),
1000.into(),
);
let handshake = write_handshake(&status, &capabilities, Some(&flow_params));
let (read_status, read_capabilities, read_flow)
= parse_handshake(UntrustedRlp::new(&handshake)).unwrap();
assert_eq!(read_status, status);
assert_eq!(read_capabilities, capabilities);
assert_eq!(read_flow.unwrap(), flow_params);
}
#[test]
fn partial_handshake() {
let status = Status {
protocol_version: 1,
network_id: 1,
head_td: U256::default(),
head_hash: H256::default(),
head_num: 10,
genesis_hash: H256::zero(),
last_head: None,
};
let capabilities = Capabilities {
serve_headers: false,
serve_chain_since: Some(5),
serve_state_since: None,
tx_relay: true,
};
let flow_params = FlowParams::new(
1_000_000.into(),
Default::default(),
1000.into(),
);
let handshake = write_handshake(&status, &capabilities, Some(&flow_params));
let (read_status, read_capabilities, read_flow)
= parse_handshake(UntrustedRlp::new(&handshake)).unwrap();
assert_eq!(read_status, status);
assert_eq!(read_capabilities, capabilities);
assert_eq!(read_flow.unwrap(), flow_params);
}
#[test]
fn skip_unknown_keys() {
let status = Status {
protocol_version: 1,
network_id: 1,
head_td: U256::default(),
head_hash: H256::default(),
head_num: 10,
genesis_hash: H256::zero(),
last_head: None,
};
let capabilities = Capabilities {
serve_headers: false,
serve_chain_since: Some(5),
serve_state_since: None,
tx_relay: true,
};
let flow_params = FlowParams::new(
1_000_000.into(),
Default::default(),
1000.into(),
);
let handshake = write_handshake(&status, &capabilities, Some(&flow_params));
let interleaved = {
let handshake = UntrustedRlp::new(&handshake);
let mut stream = RlpStream::new_list(handshake.item_count() * 3);
for item in handshake.iter() {
stream.append_raw(item.as_raw(), 1);
let (mut s1, mut s2) = (RlpStream::new_list(2), RlpStream::new_list(2));
s1.append(&"foo").append_empty_data();
s2.append(&"bar").append_empty_data();
stream.append_raw(&s1.out(), 1);
stream.append_raw(&s2.out(), 1);
}
stream.out()
};
let (read_status, read_capabilities, read_flow)
= parse_handshake(UntrustedRlp::new(&interleaved)).unwrap();
assert_eq!(read_status, status);
assert_eq!(read_capabilities, capabilities);
assert_eq!(read_flow.unwrap(), flow_params);
}
#[test]
fn announcement_roundtrip() {
let announcement = Announcement {
head_hash: H256::random(),
head_num: 100_000,
head_td: 1_000_000.into(),
reorg_depth: 4,
serve_headers: false,
serve_state_since: Some(99_000),
serve_chain_since: Some(1),
tx_relay: true,
};
let serialized = write_announcement(&announcement);
let read = parse_announcement(UntrustedRlp::new(&serialized)).unwrap();
assert_eq!(read, announcement);
}
#[test]
fn keys_out_of_order() {
use super::{Key, encode_pair, encode_flag};
let mut stream = RlpStream::new_list(6);
stream
.append(&H256::zero())
.append(&10u64)
.append(&100_000u64)
.append(&2u64)
.append_raw(&encode_pair(Key::ServeStateSince, &44u64), 1)
.append_raw(&encode_flag(Key::ServeHeaders), 1);
let out = stream.drain();
assert!(parse_announcement(UntrustedRlp::new(&out)).is_err());
let mut stream = RlpStream::new_list(6);
stream
.append(&H256::zero())
.append(&10u64)
.append(&100_000u64)
.append(&2u64)
.append_raw(&encode_flag(Key::ServeHeaders), 1)
.append_raw(&encode_pair(Key::ServeStateSince, &44u64), 1);
let out = stream.drain();
assert!(parse_announcement(UntrustedRlp::new(&out)).is_ok());
}
#[test]
fn optional_flow() {
let status = Status {
protocol_version: 1,
network_id: 1,
head_td: U256::default(),
head_hash: H256::default(),
head_num: 10,
genesis_hash: H256::zero(),
last_head: None,
};
let capabilities = Capabilities {
serve_headers: true,
serve_chain_since: Some(5),
serve_state_since: Some(8),
tx_relay: true,
};
let handshake = write_handshake(&status, &capabilities, None);
let (read_status, read_capabilities, read_flow)
= parse_handshake(UntrustedRlp::new(&handshake)).unwrap();
assert_eq!(read_status, status);
assert_eq!(read_capabilities, capabilities);
assert!(read_flow.is_none());
}
}

View File

@@ -0,0 +1,486 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Tests for the `LightProtocol` implementation.
//! These don't test of the higher level logic on top of
use ethcore::blockchain_info::BlockChainInfo;
use ethcore::client::{BlockChainClient, EachBlockWith, TestBlockChainClient};
use ethcore::ids::BlockId;
use ethcore::transaction::PendingTransaction;
use ethcore::encoded;
use network::{PeerId, NodeId};
use net::buffer_flow::FlowParams;
use net::context::IoContext;
use net::status::{Capabilities, Status, write_handshake};
use net::{encode_request, LightProtocol, Params, packet};
use provider::Provider;
use request::{self, Request, Headers};
use rlp::*;
use util::{Bytes, H256, U256};
use std::sync::Arc;
// expected result from a call.
#[derive(Debug, PartialEq, Eq)]
enum Expect {
/// Expect to have message sent to peer.
Send(PeerId, u8, Vec<u8>),
/// Expect this response.
Respond(u8, Vec<u8>),
/// Expect a punishment (disconnect/disable)
Punish(PeerId),
/// Expect nothing.
Nothing,
}
impl IoContext for Expect {
fn send(&self, peer: PeerId, packet_id: u8, packet_body: Vec<u8>) {
assert_eq!(self, &Expect::Send(peer, packet_id, packet_body));
}
fn respond(&self, packet_id: u8, packet_body: Vec<u8>) {
assert_eq!(self, &Expect::Respond(packet_id, packet_body));
}
fn disconnect_peer(&self, peer: PeerId) {
assert_eq!(self, &Expect::Punish(peer));
}
fn disable_peer(&self, peer: PeerId) {
assert_eq!(self, &Expect::Punish(peer));
}
fn protocol_version(&self, _peer: PeerId) -> Option<u8> {
Some(super::MAX_PROTOCOL_VERSION)
}
fn persistent_peer_id(&self, _peer: PeerId) -> Option<NodeId> {
None
}
}
// can't implement directly for Arc due to cross-crate orphan rules.
struct TestProvider(Arc<TestProviderInner>);
struct TestProviderInner {
client: TestBlockChainClient,
}
impl Provider for TestProvider {
fn chain_info(&self) -> BlockChainInfo {
self.0.client.chain_info()
}
fn reorg_depth(&self, a: &H256, b: &H256) -> Option<u64> {
self.0.client.tree_route(a, b).map(|route| route.index as u64)
}
fn earliest_state(&self) -> Option<u64> {
None
}
fn block_header(&self, id: BlockId) -> Option<encoded::Header> {
self.0.client.block_header(id)
}
fn block_body(&self, id: BlockId) -> Option<encoded::Body> {
self.0.client.block_body(id)
}
fn block_receipts(&self, hash: &H256) -> Option<Bytes> {
self.0.client.block_receipts(&hash)
}
fn state_proof(&self, req: request::StateProof) -> Vec<Bytes> {
match req.key2 {
Some(_) => vec![::util::sha3::SHA3_NULL_RLP.to_vec()],
None => {
// sort of a leaf node
let mut stream = RlpStream::new_list(2);
stream.append(&req.key1).append_empty_data();
vec![stream.out()]
}
}
}
fn contract_code(&self, req: request::ContractCode) -> Bytes {
req.account_key.iter().chain(req.account_key.iter()).cloned().collect()
}
fn header_proof(&self, _req: request::HeaderProof) -> Option<(encoded::Header, Vec<Bytes>)> {
None
}
fn ready_transactions(&self) -> Vec<PendingTransaction> {
self.0.client.ready_transactions()
}
}
fn make_flow_params() -> FlowParams {
FlowParams::new(5_000_000.into(), Default::default(), 100_000.into())
}
fn capabilities() -> Capabilities {
Capabilities {
serve_headers: true,
serve_chain_since: Some(1),
serve_state_since: Some(1),
tx_relay: true,
}
}
// helper for setting up the protocol handler and provider.
fn setup(flow_params: FlowParams, capabilities: Capabilities) -> (Arc<TestProviderInner>, LightProtocol) {
let provider = Arc::new(TestProviderInner {
client: TestBlockChainClient::new(),
});
let proto = LightProtocol::new(Arc::new(TestProvider(provider.clone())), Params {
network_id: 2,
flow_params: flow_params,
capabilities: capabilities,
});
(provider, proto)
}
fn status(chain_info: BlockChainInfo) -> Status {
Status {
protocol_version: 1,
network_id: 2,
head_td: chain_info.total_difficulty,
head_hash: chain_info.best_block_hash,
head_num: chain_info.best_block_number,
genesis_hash: chain_info.genesis_hash,
last_head: None,
}
}
#[test]
fn handshake_expected() {
let flow_params = make_flow_params();
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let status = status(provider.client.chain_info());
let packet_body = write_handshake(&status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body));
}
#[test]
#[should_panic]
fn genesis_mismatch() {
let flow_params = make_flow_params();
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let mut status = status(provider.client.chain_info());
status.genesis_hash = H256::default();
let packet_body = write_handshake(&status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body));
}
#[test]
fn buffer_overflow() {
let flow_params = make_flow_params();
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let status = status(provider.client.chain_info());
{
let packet_body = write_handshake(&status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body));
}
{
let my_status = write_handshake(&status, &capabilities, Some(&flow_params));
proto.handle_packet(&Expect::Nothing, &1, packet::STATUS, &my_status);
}
// 1000 requests is far too many for the default flow params.
let request = encode_request(&Request::Headers(Headers {
start: 1.into(),
max: 1000,
skip: 0,
reverse: false,
}), 111);
proto.handle_packet(&Expect::Punish(1), &1, packet::GET_BLOCK_HEADERS, &request);
}
// test the basic request types -- these just make sure that requests are parsed
// and sent to the provider correctly as well as testing response formatting.
#[test]
fn get_block_headers() {
let flow_params = FlowParams::new(5_000_000.into(), Default::default(), 0.into());
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let cur_status = status(provider.client.chain_info());
let my_status = write_handshake(&cur_status, &capabilities, Some(&flow_params));
provider.client.add_blocks(100, EachBlockWith::Nothing);
let cur_status = status(provider.client.chain_info());
{
let packet_body = write_handshake(&cur_status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body));
proto.handle_packet(&Expect::Nothing, &1, packet::STATUS, &my_status);
}
let request = Headers {
start: 1.into(),
max: 10,
skip: 0,
reverse: false,
};
let req_id = 111;
let request_body = encode_request(&Request::Headers(request.clone()), req_id);
let response = {
let headers: Vec<_> = (0..10).map(|i| provider.client.block_header(BlockId::Number(i + 1)).unwrap()).collect();
assert_eq!(headers.len(), 10);
let new_buf = *flow_params.limit() - flow_params.compute_cost(request::Kind::Headers, 10);
let mut response_stream = RlpStream::new_list(3);
response_stream.append(&req_id).append(&new_buf).begin_list(10);
for header in headers {
response_stream.append_raw(&header.into_inner(), 1);
}
response_stream.out()
};
let expected = Expect::Respond(packet::BLOCK_HEADERS, response);
proto.handle_packet(&expected, &1, packet::GET_BLOCK_HEADERS, &request_body);
}
#[test]
fn get_block_bodies() {
let flow_params = FlowParams::new(5_000_000.into(), Default::default(), 0.into());
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let cur_status = status(provider.client.chain_info());
let my_status = write_handshake(&cur_status, &capabilities, Some(&flow_params));
provider.client.add_blocks(100, EachBlockWith::Nothing);
let cur_status = status(provider.client.chain_info());
{
let packet_body = write_handshake(&cur_status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body));
proto.handle_packet(&Expect::Nothing, &1, packet::STATUS, &my_status);
}
let request = request::Bodies {
block_hashes: (0..10).map(|i| provider.client.block_hash(BlockId::Number(i)).unwrap()).collect(),
};
let req_id = 111;
let request_body = encode_request(&Request::Bodies(request.clone()), req_id);
let response = {
let bodies: Vec<_> = (0..10).map(|i| provider.client.block_body(BlockId::Number(i + 1)).unwrap()).collect();
assert_eq!(bodies.len(), 10);
let new_buf = *flow_params.limit() - flow_params.compute_cost(request::Kind::Bodies, 10);
let mut response_stream = RlpStream::new_list(3);
response_stream.append(&req_id).append(&new_buf).begin_list(10);
for body in bodies {
response_stream.append_raw(&body.into_inner(), 1);
}
response_stream.out()
};
let expected = Expect::Respond(packet::BLOCK_BODIES, response);
proto.handle_packet(&expected, &1, packet::GET_BLOCK_BODIES, &request_body);
}
#[test]
fn get_block_receipts() {
let flow_params = FlowParams::new(5_000_000.into(), Default::default(), 0.into());
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let cur_status = status(provider.client.chain_info());
let my_status = write_handshake(&cur_status, &capabilities, Some(&flow_params));
provider.client.add_blocks(1000, EachBlockWith::Nothing);
let cur_status = status(provider.client.chain_info());
{
let packet_body = write_handshake(&cur_status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body));
proto.handle_packet(&Expect::Nothing, &1, packet::STATUS, &my_status);
}
// find the first 10 block hashes starting with `f` because receipts are only provided
// by the test client in that case.
let block_hashes: Vec<_> = (0..1000).map(|i| provider.client.block_hash(BlockId::Number(i)).unwrap())
.filter(|hash| format!("{}", hash).starts_with("f")).take(10).collect();
let request = request::Receipts {
block_hashes: block_hashes.clone(),
};
let req_id = 111;
let request_body = encode_request(&Request::Receipts(request.clone()), req_id);
let response = {
let receipts: Vec<_> = block_hashes.iter()
.map(|hash| provider.client.block_receipts(hash).unwrap())
.collect();
let new_buf = *flow_params.limit() - flow_params.compute_cost(request::Kind::Receipts, receipts.len());
let mut response_stream = RlpStream::new_list(3);
response_stream.append(&req_id).append(&new_buf).begin_list(receipts.len());
for block_receipts in receipts {
response_stream.append_raw(&block_receipts, 1);
}
response_stream.out()
};
let expected = Expect::Respond(packet::RECEIPTS, response);
proto.handle_packet(&expected, &1, packet::GET_RECEIPTS, &request_body);
}
#[test]
fn get_state_proofs() {
let flow_params = FlowParams::new(5_000_000.into(), Default::default(), 0.into());
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let cur_status = status(provider.client.chain_info());
{
let packet_body = write_handshake(&cur_status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body.clone()));
proto.handle_packet(&Expect::Nothing, &1, packet::STATUS, &packet_body);
}
let req_id = 112;
let key1 = U256::from(11223344).into();
let key2 = U256::from(99988887).into();
let request = Request::StateProofs (request::StateProofs {
requests: vec![
request::StateProof { block: H256::default(), key1: key1, key2: None, from_level: 0 },
request::StateProof { block: H256::default(), key1: key1, key2: Some(key2), from_level: 0},
]
});
let request_body = encode_request(&request, req_id);
let response = {
let proofs = vec![
{ let mut stream = RlpStream::new_list(2); stream.append(&key1).append_empty_data(); vec![stream.out()] },
vec![::util::sha3::SHA3_NULL_RLP.to_vec()],
];
let new_buf = *flow_params.limit() - flow_params.compute_cost(request::Kind::StateProofs, 2);
let mut response_stream = RlpStream::new_list(3);
response_stream.append(&req_id).append(&new_buf).begin_list(2);
for proof in proofs {
response_stream.begin_list(proof.len());
for node in proof {
response_stream.append_raw(&node, 1);
}
}
response_stream.out()
};
let expected = Expect::Respond(packet::PROOFS, response);
proto.handle_packet(&expected, &1, packet::GET_PROOFS, &request_body);
}
#[test]
fn get_contract_code() {
let flow_params = FlowParams::new(5_000_000.into(), Default::default(), 0.into());
let capabilities = capabilities();
let (provider, proto) = setup(flow_params.clone(), capabilities.clone());
let cur_status = status(provider.client.chain_info());
{
let packet_body = write_handshake(&cur_status, &capabilities, Some(&flow_params));
proto.on_connect(&1, &Expect::Send(1, packet::STATUS, packet_body.clone()));
proto.handle_packet(&Expect::Nothing, &1, packet::STATUS, &packet_body);
}
let req_id = 112;
let key1 = U256::from(11223344).into();
let key2 = U256::from(99988887).into();
let request = Request::Codes (request::ContractCodes {
code_requests: vec![
request::ContractCode { block_hash: H256::default(), account_key: key1 },
request::ContractCode { block_hash: H256::default(), account_key: key2 },
],
});
let request_body = encode_request(&request, req_id);
let response = {
let codes: Vec<Vec<_>> = vec![
key1.iter().chain(key1.iter()).cloned().collect(),
key2.iter().chain(key2.iter()).cloned().collect(),
];
let new_buf = *flow_params.limit() - flow_params.compute_cost(request::Kind::Codes, 2);
let mut response_stream = RlpStream::new_list(3);
response_stream.append(&req_id).append(&new_buf).begin_list(2);
for code in codes {
response_stream.append(&code);
}
response_stream.out()
};
let expected = Expect::Respond(packet::CONTRACT_CODES, response);
proto.handle_packet(&expected, &1, packet::GET_CONTRACT_CODES, &request_body);
}

View File

@@ -0,0 +1,236 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! A provider for the LES protocol. This is typically a full node, who can
//! give as much data as necessary to its peers.
use ethcore::blockchain_info::BlockChainInfo;
use ethcore::client::{BlockChainClient, ProvingBlockChainClient};
use ethcore::transaction::PendingTransaction;
use ethcore::ids::BlockId;
use ethcore::encoded;
use util::{Bytes, H256};
use request;
/// Defines the operations that a provider for `LES` must fulfill.
///
/// These are defined at [1], but may be subject to change.
/// Requests which can't be fulfilled should return either an empty RLP list
/// or empty vector where appropriate.
///
/// [1]: https://github.com/ethcore/parity/wiki/Light-Ethereum-Subprotocol-(LES)
#[cfg_attr(feature = "ipc", ipc(client_ident="LightProviderClient"))]
pub trait Provider: Send + Sync {
/// Provide current blockchain info.
fn chain_info(&self) -> BlockChainInfo;
/// Find the depth of a common ancestor between two blocks.
/// If either block is unknown or an ancestor can't be found
/// then return `None`.
fn reorg_depth(&self, a: &H256, b: &H256) -> Option<u64>;
/// Earliest block where state queries are available.
/// If `None`, no state queries are servable.
fn earliest_state(&self) -> Option<u64>;
/// Provide a list of headers starting at the requested block,
/// possibly in reverse and skipping `skip` at a time.
///
/// The returned vector may have any length in the range [0, `max`], but the
/// results within must adhere to the `skip` and `reverse` parameters.
fn block_headers(&self, req: request::Headers) -> Vec<encoded::Header> {
use request::HashOrNumber;
if req.max == 0 { return Vec::new() }
let best_num = self.chain_info().best_block_number;
let start_num = match req.start {
HashOrNumber::Number(start_num) => start_num,
HashOrNumber::Hash(hash) => match self.block_header(BlockId::Hash(hash)) {
None => {
trace!(target: "les_provider", "Unknown block hash {} requested", hash);
return Vec::new();
}
Some(header) => {
let num = header.number();
let canon_hash = self.block_header(BlockId::Number(num))
.map(|h| h.hash());
if req.max == 1 || canon_hash != Some(hash) {
// Non-canonical header or single header requested.
return vec![header];
}
num
}
}
};
(0u64..req.max as u64)
.map(|x: u64| x.saturating_mul(req.skip + 1))
.take_while(|x| if req.reverse { x < &start_num } else { best_num - start_num >= *x })
.map(|x| if req.reverse { start_num - x } else { start_num + x })
.map(|x| self.block_header(BlockId::Number(x)))
.take_while(|x| x.is_some())
.flat_map(|x| x)
.collect()
}
/// Get a block header by id.
fn block_header(&self, id: BlockId) -> Option<encoded::Header>;
/// Provide as many as possible of the requested blocks (minus the headers) encoded
/// in RLP format.
fn block_bodies(&self, req: request::Bodies) -> Vec<Option<encoded::Body>> {
req.block_hashes.into_iter()
.map(|hash| self.block_body(BlockId::Hash(hash)))
.collect()
}
/// Get a block body by id.
fn block_body(&self, id: BlockId) -> Option<encoded::Body>;
/// Provide the receipts as many as possible of the requested blocks.
/// Returns a vector of RLP-encoded lists of receipts.
fn receipts(&self, req: request::Receipts) -> Vec<Bytes> {
req.block_hashes.into_iter()
.map(|hash| self.block_receipts(&hash))
.map(|receipts| receipts.unwrap_or_else(|| ::rlp::EMPTY_LIST_RLP.to_vec()))
.collect()
}
/// Get a block's receipts as an RLP-encoded list by block hash.
fn block_receipts(&self, hash: &H256) -> Option<Bytes>;
/// Provide a set of merkle proofs, as requested. Each request is a
/// block hash and request parameters.
///
/// Returns a vector of RLP-encoded lists satisfying the requests.
fn proofs(&self, req: request::StateProofs) -> Vec<Bytes> {
use rlp::{RlpStream, Stream};
let mut results = Vec::with_capacity(req.requests.len());
for request in req.requests {
let proof = self.state_proof(request);
let mut stream = RlpStream::new_list(proof.len());
for node in proof {
stream.append_raw(&node, 1);
}
results.push(stream.out());
}
results
}
/// Get a state proof from a request. Each proof should be a vector
/// of rlp-encoded trie nodes, in ascending order by distance from the root.
fn state_proof(&self, req: request::StateProof) -> Vec<Bytes>;
/// Provide contract code for the specified (block_hash, account_hash) pairs.
/// Each item in the resulting vector is either the raw bytecode or empty.
fn contract_codes(&self, req: request::ContractCodes) -> Vec<Bytes> {
req.code_requests.into_iter()
.map(|req| self.contract_code(req))
.collect()
}
/// Get contract code by request. Either the raw bytecode or empty.
fn contract_code(&self, req: request::ContractCode) -> Bytes;
/// Provide header proofs from the Canonical Hash Tries as well as the headers
/// they correspond to -- each element in the returned vector is a 2-tuple.
/// The first element is a block header and the second a merkle proof of
/// the header in a requested CHT.
fn header_proofs(&self, req: request::HeaderProofs) -> Vec<Bytes> {
use rlp::{self, RlpStream, Stream};
req.requests.into_iter()
.map(|req| self.header_proof(req))
.map(|maybe_proof| match maybe_proof {
None => rlp::EMPTY_LIST_RLP.to_vec(),
Some((header, proof)) => {
let mut stream = RlpStream::new_list(2);
stream.append_raw(&header.into_inner(), 1).begin_list(proof.len());
for node in proof {
stream.append_raw(&node, 1);
}
stream.out()
}
})
.collect()
}
/// Provide a header proof from a given Canonical Hash Trie as well as the
/// corresponding header. The first element is the block header and the
/// second is a merkle proof of the CHT.
fn header_proof(&self, req: request::HeaderProof) -> Option<(encoded::Header, Vec<Bytes>)>;
/// Provide pending transactions.
fn ready_transactions(&self) -> Vec<PendingTransaction>;
}
// Implementation of a light client data provider for a client.
impl<T: ProvingBlockChainClient + ?Sized> Provider for T {
fn chain_info(&self) -> BlockChainInfo {
BlockChainClient::chain_info(self)
}
fn reorg_depth(&self, a: &H256, b: &H256) -> Option<u64> {
self.tree_route(a, b).map(|route| route.index as u64)
}
fn earliest_state(&self) -> Option<u64> {
Some(self.pruning_info().earliest_state)
}
fn block_header(&self, id: BlockId) -> Option<encoded::Header> {
BlockChainClient::block_header(self, id)
}
fn block_body(&self, id: BlockId) -> Option<encoded::Body> {
BlockChainClient::block_body(self, id)
}
fn block_receipts(&self, hash: &H256) -> Option<Bytes> {
BlockChainClient::block_receipts(self, hash)
}
fn state_proof(&self, req: request::StateProof) -> Vec<Bytes> {
match req.key2 {
Some(key2) => self.prove_storage(req.key1, key2, req.from_level, BlockId::Hash(req.block)),
None => self.prove_account(req.key1, req.from_level, BlockId::Hash(req.block)),
}
}
fn contract_code(&self, req: request::ContractCode) -> Bytes {
self.code_by_hash(req.account_key, BlockId::Hash(req.block_hash))
}
fn header_proof(&self, _req: request::HeaderProof) -> Option<(encoded::Header, Vec<Bytes>)> {
None
}
fn ready_transactions(&self) -> Vec<PendingTransaction> {
BlockChainClient::ready_transactions(self)
}
}

View File

@@ -0,0 +1,197 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! LES request types.
use util::H256;
/// Either a hash or a number.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub enum HashOrNumber {
/// Block hash variant.
Hash(H256),
/// Block number variant.
Number(u64),
}
impl From<H256> for HashOrNumber {
fn from(hash: H256) -> Self {
HashOrNumber::Hash(hash)
}
}
impl From<u64> for HashOrNumber {
fn from(num: u64) -> Self {
HashOrNumber::Number(num)
}
}
/// A request for block headers.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct Headers {
/// Starting block number or hash.
pub start: HashOrNumber,
/// The maximum amount of headers which can be returned.
pub max: usize,
/// The amount of headers to skip between each response entry.
pub skip: u64,
/// Whether the headers should proceed in falling number from the initial block.
pub reverse: bool,
}
/// A request for specific block bodies.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct Bodies {
/// Hashes which bodies are being requested for.
pub block_hashes: Vec<H256>
}
/// A request for transaction receipts.
///
/// This request is answered with a list of transaction receipts for each block
/// requested.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct Receipts {
/// Block hashes to return receipts for.
pub block_hashes: Vec<H256>,
}
/// A request for a state proof
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct StateProof {
/// Block hash to query state from.
pub block: H256,
/// Key of the state trie -- corresponds to account hash.
pub key1: H256,
/// Key in that account's storage trie; if empty, then the account RLP should be
/// returned.
pub key2: Option<H256>,
/// if greater than zero, trie nodes beyond this level may be omitted.
pub from_level: u32, // could even safely be u8; trie w/ 32-byte key can be at most 64-levels deep.
}
/// A request for state proofs.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct StateProofs {
/// All the proof requests.
pub requests: Vec<StateProof>,
}
/// A request for contract code.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct ContractCode {
/// Block hash
pub block_hash: H256,
/// Account key (== sha3(address))
pub account_key: H256,
}
/// A request for contract code.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct ContractCodes {
/// Block hash and account key (== sha3(address)) pairs to fetch code for.
pub code_requests: Vec<ContractCode>,
}
/// A request for a header proof from the Canonical Hash Trie.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct HeaderProof {
/// Number of the CHT.
pub cht_number: u64,
/// Block number requested.
pub block_number: u64,
/// If greater than zero, trie nodes beyond this level may be omitted.
pub from_level: u32,
}
/// A request for header proofs from the CHT.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub struct HeaderProofs {
/// All the proof requests.
pub requests: Vec<HeaderProof>,
}
/// Kinds of requests.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub enum Kind {
/// Requesting headers.
Headers,
/// Requesting block bodies.
Bodies,
/// Requesting transaction receipts.
Receipts,
/// Requesting proofs of state trie nodes.
StateProofs,
/// Requesting contract code by hash.
Codes,
/// Requesting header proofs (from the CHT).
HeaderProofs,
}
/// Encompasses all possible types of requests in a single structure.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "ipc", binary)]
pub enum Request {
/// Requesting headers.
Headers(Headers),
/// Requesting block bodies.
Bodies(Bodies),
/// Requesting transaction receipts.
Receipts(Receipts),
/// Requesting state proofs.
StateProofs(StateProofs),
/// Requesting contract codes.
Codes(ContractCodes),
/// Requesting header proofs.
HeaderProofs(HeaderProofs),
}
impl Request {
/// Get the kind of request this is.
pub fn kind(&self) -> Kind {
match *self {
Request::Headers(_) => Kind::Headers,
Request::Bodies(_) => Kind::Bodies,
Request::Receipts(_) => Kind::Receipts,
Request::StateProofs(_) => Kind::StateProofs,
Request::Codes(_) => Kind::Codes,
Request::HeaderProofs(_) => Kind::HeaderProofs,
}
}
/// Get the amount of requests being made.
pub fn amount(&self) -> usize {
match *self {
Request::Headers(ref req) => req.max,
Request::Bodies(ref req) => req.block_hashes.len(),
Request::Receipts(ref req) => req.block_hashes.len(),
Request::StateProofs(ref req) => req.requests.len(),
Request::Codes(ref req) => req.code_requests.len(),
Request::HeaderProofs(ref req) => req.requests.len(),
}
}
}

View File

@@ -0,0 +1,24 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Types used in the public (IPC) api which require custom code generation.
#![cfg_attr(feature = "ipc", allow(dead_code, unused_assignments, unused_variables))] // codegen issues
#[cfg(feature = "ipc")]
include!(concat!(env!("OUT_DIR"), "/mod.rs.in"));
#[cfg(not(feature = "ipc"))]
include!("mod.rs.in");

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -14,4 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './ethcore';
pub mod les_request;

View File

@@ -0,0 +1,45 @@
{
"name": "TestAuthorityRound",
"engine": {
"authorityRound": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"stepDuration": 1,
"startStep": 2,
"validators": {
"list": [
"0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e",
"0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1"
]
}
}
}
},
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x69"
},
"genesis": {
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x20000",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2fefd8"
},
"accounts": {
"0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
"9cce34f7ab185c7aba1b7c8140d620b4bda941d6": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" }
}
}

View File

@@ -1,11 +1,13 @@
{
"name": "TestAuthority",
"name": "TestBasicAuthority",
"engine": {
"BasicAuthority": {
"basicAuthority": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"durationLimit": "0x0d",
"authorities" : ["0x9cce34f7ab185c7aba1b7c8140d620b4bda941d6"]
"validators": {
"list": ["0x9cce34f7ab185c7aba1b7c8140d620b4bda941d6"]
}
}
}
},
@@ -17,10 +19,7 @@
},
"genesis": {
"seal": {
"generic": {
"fields": 1,
"rlp": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"
}
"generic": "0xc180"
},
"difficulty": "0x20000",
"author": "0x0000000000000000000000000000000000000000",

View File

@@ -0,0 +1,30 @@
{
"name": "GenesisConstructor",
"engine": {
"null": null
},
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x2"
},
"genesis": {
"seal": {
"generic": "0x"
},
"difficulty": "0x20000",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2fefd8"
},
"accounts": {
"0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
"0000000000000000000000000000000000000005": { "balance": "1", "constructor": "60606040526000805460ff19166001179055346000575b6075806100246000396000f300606060405263ffffffff60e060020a60003504166394b91deb81146022575b6000565b34600057602c6040565b604080519115158252519081900360200190f35b60005460ff16815600a165627a7a723058207882eb60ebce23178b3fa06d4cd8e5adc17711937ccddacb18a04abca2a2c9ee0029" }
}
}

Some files were not shown because too many files have changed in this diff Show More