Commit Graph

2202 Commits

Author SHA1 Message Date
Feynman Liang 5eb8cea6e7 Tendermint epoch transitions (#6085)
* Adds signals_epoch_end to tendermint

* Adds is_epoch_end

* Adds snapshot_components

* Adds tendermint Epoch Verifier

* Fix documentation typos

* Change check_finality_proof to panic

* Fix compilation

* Adds Unconfirmed path to epoch_verifier

* Verify if address is validator in EpochVerifier

* check_finality_proof errors on failure

* Don't share combine/destructure_proofs

* Remove invalid import

* Remove duplicate epoch verifier trait

* Fix docs

* Adds recover stub to tendermint EpochVerifier

* Adds verify_light test

* Avoid boxed closure

* Style fixes
2017-07-26 16:25:32 +01:00
Robert Habermeier 2d0d7150cc remove chunk to restore from pending set only upon successful import (#6112) 2017-07-21 17:24:53 +02:00
Robert Habermeier 253bc333c7 Merge pull request #6092 from paritytech/returndata-fix
Place RETURNDATA behind block number gate
2017-07-19 15:26:28 +02:00
arkpar 9ad0ff960e Place RETURNDATA behind block number gate 2017-07-19 14:34:59 +02:00
Robert Habermeier 298ea1d748 Bump snap version and tweak importing detection logic (#6079)
* bump last tick just before printing info and restore sync detection

* bump kovan snapshot version

* Fixed sync tests

* Fixed rpc tests
2017-07-18 16:59:33 +02:00
Andre Silva c7af702270 Refactor price_info (#6003)
* refactor PriceInfo to use Fetch and reuse the client

* forget Fetch future to keep it running in the background

* update Debug message for price_info::Client

* wrap underlying errors in price_info client

* use debug_struct in price_info client debug implementation

* use global fetch service in price_info client

* rename gas_pricer parameter in RunCmd

* move price_info to its own crate

* fix price_info tests

* replace rustc_serialize with serde_json in price_info

* add documentation for price_info

* remove unused rustc-serialize dependency from ethcore

* fix price_info formatting

* re-export fetch crate in price_info

* remove unused cfg attributes in price_info

* add tests for price_info
2017-07-16 18:22:45 +02:00
Nikolay Volf 895350e77c fix error message (#6065) 2017-07-15 19:58:52 +02:00
Robert Habermeier 99075ad22a Initial Whisper implementation (#6009)
* whisper skeleton

* basic message store

* rallying and message logic

* pass host info to network protocol handlers

* choose who starts rally based on node key

* module reshuffling

* mining messages

* prune messages by low PoW until below size target

* associated error type for ethkey generators and `OsRng` generator

* beginnings of RPC

* generic message handler for whisper

* reshuffle code order

* standard payload encoding and decoding

* basic crypto

* minor restructuring of net code

* implement shh_post

* merge?

* implement filters

* rand trait for hash types

* filter RPCs for whisper

* symmetric encryption of payload

* pub-sub

* filter tests

* use only secure random IDs

* attach arbitrary protocols to network

* basic integration of whisper into Parity

* eagerly prune low PoW entries

* broadcast messages with salted topics

* node info RPC

* fix import

* fix leading zeros calculation

* address minor grumbles
2017-07-14 20:40:28 +02:00
Tomasz Drwięga 1aaafa2d11 Limit transaction queue memory & limit future queue (#6038)
* Remove confusing gas_limit in the pool.

* Change defaults

* Limit transaction queue by memory usage.

* Change defaults to something lower.

* Fix rpc test.

* Fix js issues.

* Renamed block_gas_limit
2017-07-13 15:12:25 +02:00
keorn 22261bc2d1 New contract PoA sync fixes (#5991)
* generate proofs on newly-created state

* report only missed steps after first block

* dont report skipped if not signer

* test

* finality tracing and passing valid header to `commit_block`

* avoid proposing multiple times on the same step when validator set changes

* limit benign reports

* Ordering -> AtomicOrdering

* reinstate warning now that spam is reduced

* flush pending transition changes when necessary

* ensure epochs aren't re-zoomed on every block
2017-07-13 09:48:00 +02:00
Robert Habermeier d365281cce Ethcore crate split part 1 (#6041)
* split out types into separate crate

* split out evm into its own crate
2017-07-12 13:09:17 +02:00
Joseph Mark 0fca4f95d6 Errors & warnings for inappropriate RPCs (#6029)
* Clarify function name

Function checks if sealing is currently underway, not to be confused
with checking whether the engine performs internal sealing.

* Error when work called on internal sealing engine

* Error submitting work for internal sealing engine

* Fix inverted bool and style grumbles

* Add can_produce_work_package to TestMinerService

* Error when setting engine signer on PoW chain

* Unit tests for engine signing

Setting engine signer should fail if chain does not seal internally
or client lacks account provider.

* Tweak TestMinerService

* Fix minor style grumbles
2017-07-12 08:52:18 +02:00
Axel Chalon d970237658 Add test for loading the chain specs (#6028)
* Add test for loading the json chain specs

* Remove test on Ethereum specs as it already exists
2017-07-10 19:26:10 +02:00
Nikolay Volf 62210fb932 WASM contracts MVP (#5679)
* lifetime issues

* refactor to new 'native env'

* descriptors and such

* wasm mvp continued

* finalized env/ext bindings

* descriptor -> call_args

* inject gas counter

* result processing and engine activation

* tabify some source files

* needs return new

* wasm tests initial

* erradicate warnings

* origin in the descriptor

* update test repo

* payload verification tests

* identity return payload test

* some test description

* dispersion test

* check length here

* suicidal contract

* engine params

* fix typo

* review fixes

* submodule update

* update - purge reserved space

* doc effort

* more review fixes

* fix error message

* fix dependency url

* reorg error handling

* update submodule

* update utils

* update to latest parity-wasm

* tabify

* fix wasm magic header

* update dependencies

* external create and tests

* update to latest tests

* extra trace info

* Update parity-wasm

* update wasm-utils also

* few traces and result handle change

* alter trace content

* fix issues with optimizer, update to latest parity with validator, etc

* static initialization

* license preamble

* update wasm crates and gas costs

* fix grumbles

* bring back lifetime

* fix compilation
2017-07-10 17:42:10 +02:00
Arkadiy Paronyan 15aebacbe7 --reseal-on-uncle (#5940)
* --reseal-on-uncle

* Optimized uncle check

* Additional uncle check

* Updated comment
2017-07-10 13:36:42 +02:00
Tomasz Drwięga f4453f77b8 Fix output of parity-evm in case of bad instruction (#5955)
* Fix output of evmbin.

* Use foundation chain settings by default.
2017-07-10 13:23:40 +02:00
Robert Habermeier 67c1f71b6e Proper light client informant and more verification of imported headers (#5897)
* do more validation of imported headers in light client

* generalize informant with traits

* informant implementation for light client

* make comment into TODO

* fix broken test

* disable full checking of headers in light client in sync tests
2017-07-10 13:21:11 +02:00
Tomasz Drwięga a24b6ad983 Use standard paths for Ethash cache (#5881)
* Use cache path to store ethash files.

* Fixing tests, more flexible API.

* Use AsRef<Path> everywhere.

* Fixing ethcore tests.

* Fix RPC tests.
2017-07-10 12:57:40 +02:00
Robert Habermeier 125aa0aeb4 Merge pull request #5959 from paritytech/dont-compute-hash
Defer code hash calculation.
2017-07-06 19:00:19 +02:00
debris 1c2a4c116a Merge branch 'master' into serdeup 2017-07-06 11:43:46 +02:00
debris 61d8f90530 updated serde to version 1.0 2017-07-06 11:36:15 +02:00
Marek Kotewicz 46183b1cdd bigint upgraded to version 3.0 (#5986)
* bigint upgraded to version 3.0

* fixed missing FromHex import in ethcore tests

* fixed missing FromHex import in rpc tests
2017-07-06 11:26:14 +02:00
Vurich 2e90e02a2c Fix underflow 2017-07-03 17:43:03 +02:00
Tomasz Drwięga f22745eb0a TransactionQueue improvements (#5917)
* Order by id instead of hash.

* Minimal gas price bump.

* Avoid to construct oversized transaction packets.

* Fix RPC.

* Never construct oversized transactions packet.

* Never construct oversized packets.
2017-06-30 11:57:48 +02:00
Tomasz Drwięga 5d9f5e3509
Defer code hash calculation. 2017-06-30 11:30:32 +02:00
Tomasz Drwięga 38c00fae88
Merge branch 'master' into evm-defer 2017-06-29 18:42:58 +02:00
Tomasz Drwięga 465c7eeaa2
Defer construction valid_jump_destinations. 2017-06-29 17:43:34 +02:00
Vurich 01ce28bc9a Fix tests 2017-06-29 13:05:33 +02:00
Vurich 3d8dc11442 Upgrade `elastic-array` to 0.9.0
This is a huge change, which includes some changes to replace code that
originally cloned to reuse allocations instead. The updated
`elastic-array` crate renames its consuming `Vec`-conversion method to
`into_vec`, which means that I can do a simple
`sed -i 's/to_vec/into_vec/'` and then fix the compilation errors.

This commit is probably a minor performance win and definitely a
significant readability win.
2017-06-29 13:05:33 +02:00
Robert Habermeier d069b98b45 PoA: Wait for transition finality before applying (#5774)
* final engine changes

* migration to v13

* adding and removing pending transitions

* epoch_transition_for

* port snapshot to new engine methods

* final validator set interface

* fix compiler errors

* revert v13/epoch_depth transition

* make call on new epoch

* rolling finality checker

* tests for finality checker

* constructing finality proof upon pending transition

* fix warnings and finality proof checking

* fix compiler warnings in tests

* test fixes

* don't include genesis in finality checking

* change snapshot test chain building logic

* minor refactorings

* fetch epoch transition based on parent, fix divide-by-zero in SimpleList

* fix formatting

* fix ABIs and finality checking in snapshot restoration

* encode signal number in proof

* create more blocks at the end of tests

* update gist to accurate contract code

* test for epoch_transition_for

* fix tests with immediateTransitions parameter

* disable force flag after forcing

* rename ValidatorsChanged to InitiateChange and finalizeSignal to finalizeChange

* a few more validator set tests
2017-06-28 13:17:36 +02:00
Jef 72094a8bee Reduce unnecessary allocations (#5944) 2017-06-28 09:36:42 +02:00
Arkadiy Paronyan 57626b60e7 EIP-168, 169: Dust protection (#4757)
* Dust protection

* Track touched accounts in the substate

* Minor alterations
2017-06-28 09:10:57 +02:00
Robert Habermeier 796482c129 fix minor race condition in aura seal generation (#5910) 2017-06-22 20:44:04 +02:00
Arkadiy Paronyan 4d5280e43c removed panic handlers (#5895) 2017-06-22 19:00:53 +02:00
Stewart Mackenzie d152fa3e85 Ethereum Classic Monetary Policy (#5741)
* Ethereum Classic Monetary Policy

Create a new parameter `ecip1017EraRounds`. When the block number
passes one era rounds, the reward is reduced by 20%.

See https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md

* Update rewards for uncle miners for ECIP1017

In the monetary policy, the rewards are changed from "up to 7/8 of the
reward" to "1/32 of the reward".

* Fix an off-by-one error in ECIP1017 era calculation

According to
https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md,
when in block number 5,000,000, it should still be in Era 1 (which in
our code `era == 0`). So we need to check whether the `rem` equals to
zero and act accordingly when calculating the era.

* `ecip1017_era_rounds` missing from EthashParams when run in build bot

* strip out ecip1017_eras_block_reward function and add unit test
2017-06-19 18:56:37 +02:00
Robert Habermeier bedce59a6f Merge pull request #5867 from guanqun/small-fixes
ArchiveDB and other small fixes
2017-06-19 14:03:48 +02:00
Robert Habermeier b84be93bb7 Merge pull request #5866 from guanqun/remove-try
convert try!() to ?
2017-06-19 14:02:58 +02:00
Marek Kotewicz 575c51f5a0 eip214, #4833 (#4851) 2017-06-19 11:41:46 +02:00
Guanqun Lu 4eff7abf3b StateDB: change spaces to tab 2017-06-18 23:13:27 +08:00
Guanqun Lu 41fed96d96 convert try!() to ? 2017-06-18 22:16:34 +08:00
Robert Habermeier ca27234a59 minor optimizations of the modexp builtin 2017-06-17 21:18:52 +02:00
Tomasz Drwięga 963bcba267
Merge branch 'master' into unlock 2017-06-14 12:06:27 +02:00
Tomasz Drwięga efc46e78f1
Fix description of AccountProvider setting. 2017-06-14 12:06:15 +02:00
Tomasz Drwięga fb3668f903 Adding missing documentation. (#5821) 2017-06-13 18:38:10 +03:00
arkpar 4b74f65ed8 Fixed mem write for empty slice v2 2017-06-12 22:45:57 +02:00
Arkadiy Paronyan 033a75888c Revert "Fixed mem write for empty slice (#5825)" (#5826)
This reverts commit 6b874cedb8.
2017-06-12 22:43:20 +02:00
Arkadiy Paronyan 6b874cedb8 Fixed mem write for empty slice (#5825) 2017-06-12 22:42:58 +02:00
Robert Habermeier edea41d35e enforce block signer == author field in PoA (#5808) 2017-06-12 12:54:34 +03:00
Tomasz Drwięga 75ac263961 Fix stack display in evmbin. (#5733)
* Fix stack display.

* Additional compatiblity fixes.
2017-06-09 12:31:03 +02:00
Anton Gavrilov 06eb561af5 Duration limit made optional for EthashParams (#5777)
* Duration limit made optional for EthashParams

* Forgotten space added
2017-06-09 12:24:23 +02:00