* version: bump stable to 2.1.7
* Adjust requests costs for light client (#9925)
* PIP Table Cost relative to average peers instead of max peers
* Add tracing in PIP new_cost_table
* Update stat peer_count
* Use number of leeching peers for Light serve costs
* Fix test::light_params_load_share_depends_on_max_peers (wrong type)
* Remove (now) useless test
* Remove `load_share` from LightParams.Config
Prevent div. by 0
* Add LEECHER_COUNT_FACTOR
* PR Grumble: u64 to u32 for f64 casting
* Prevent u32 overflow for avg_peer_count
* Add tests for LightSync::Statistics
* Fix empty steps (#9939)
* Don't send empty step twice or empty step then block.
* Perform basic validation of locally sealed blocks.
* Don't include empty step twice.
* prevent silent errors in daemon mode, closes#9367 (#9946)
* Fix light client informant while syncing (#9932)
* Add `is_idle` to LightSync to check importing status
* Use SyncStateWrapper to make sure is_idle gets updates
* Update is_major_import to use verified queue size as well
* Add comment for `is_idle`
* Add Debug to `SyncStateWrapper`
* `fn get` -> `fn into_inner`
* ci: rearrange pipeline by logic (#9970)
* ci: rearrange pipeline by logic
* ci: rename docs script
* Add readiness check for docker container (#9804)
* Update Dockerfile
Since parity is built for "mission critical use", I thought other operators may see the need for this.
Adding the `curl` and `jq` commands allows for an extremely simple health check to be usable in container orchestrators.
For example. Here is a health check for a parity docker container running in Kubernetes.
This can be setup as a readiness Probe that would prevent clustered nodes that aren't ready from serving traffic.
```bash
#!/bin/bash
ETH_SYNCING=$(curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545 -H 'Content-Type: application/json')
RESULT=$(echo "$ETH_SYNCING | jq -r .result)
if [ "$RESULT" == "false" ]; then
echo "Parity is ready to start accepting traffic"
exit 0
else
echo "Parity is still syncing the blockchain"
exit 1
fi
```
* add sync check script
* Fix docker script (#9854)
* Dockerfile: change source path of the newly added check_sync.sh (#9869)
* Do not use the home directory as the working dir in docker (#9834)
* Do not create a home directory.
* Re-add -m flag
* fix docker build (#9971)
* bump smallvec to 0.6 in ethcore-light, ethstore and whisper (#9588)
* bump smallvec to 0.6 in ethcore-light, ethstore and whisper
* bump transaction-pool
* Fix test.
* patch cargo to use tokio-proto from git repo
this makes sure we no longer depend on smallvec 0.2.1 which is
affected by https://github.com/servo/rust-smallvec/issues/96
* use patched version of untrusted 0.5.1
* ci: allow audit to fail
* version: bump parity beta to 2.1.4
* ethcore: bump ropsten forkblock checkpoint (#9775)
* ethcore: handle vm exception when estimating gas (#9615)
* removed "rustup" & added new runner tag (#9731)
* removed "rustup" & added new runner tag
* exchanged tag "rust-windows" with "windows"
* revert windows tag change
* sync: retry different peer after empty subchain heads response (#9753)
* If no subchain heads then try a different peer
* Add log when useless chain head
* Restrict ChainHead useless peer to ancient blocks
* sync: replace `limit_reorg` with `block_set` condition
* update jsonrpc-core to a1b2bb742ce16d1168669ffb13ffe856e8131228
* Allow zero chain id in EIP155 signing process (#9792)
* Allow zero chain id in EIP155 signing process
* Rename test
* Fix test failure
* Insert dev account before unlocking (#9813)
* produce portable binaries (#9725)
* HF in POA Core (2018-10-22) (#9724)
https://github.com/poanetwork/poa-chain-spec/pull/87
* Use static call and apparent value transfer for block reward contract code (#9603)
* Verify block syncing responses against requests (#9670)
* sync: Validate received BlockHeaders packets against stored request.
* sync: Validate received BlockBodies and BlockReceipts.
* sync: Fix broken tests.
* sync: Unit tests for BlockDownloader::import_headers.
* sync: Unit tests for import_{bodies,receipts}.
* tests: Add missing method doc.
* Fix ancient blocks sync (#9531)
* Log block set in block_sync for easier debugging
* logging macros
* Match no args in sync logging macros
* Add QueueFull error
* Only allow importing headers if the first matches requested
* WIP
* Test for chain head gaps and log
* Calc distance even with 2 heads
* Revert previous commits, preparing simple fix
This reverts commit 5f38aa885b22ebb0e3a1d60120cea69f9f322628.
* Reject headers with no gaps when ChainHead
* Reset block sync download when queue full
* Simplify check for subchain heads
* Add comment to explain subchain heads filter
* Fix is_subchain_heads check and comment
* Prevent premature round completion after restart
This is a problem on mainnet where multiple stale peer requests will
force many rounds to complete quickly, forcing the retraction.
* Reset stale old blocks request after queue full
* Revert "Reject headers with no gaps when ChainHead"
This reverts commit 0eb865539e5dee37ab34f168f5fb643300de5ace.
* Add BlockSet to BlockDownloader logging
Currently it is difficult to debug this because there are two instances,
one for OldBlocks and one for NewBlocks. This adds the BlockSet to all
log messages for easy log filtering.
* Reset OldBlocks download from last enqueued
Previously when the ancient block queue was full it would restart the
download from the last imported block, so the ones still in the queue would be
redownloaded. Keeping the existing downloader instance and just
resetting it will start again from the last enqueued block.:wq
* Ignore expired Body and Receipt requests
* Log when ancient block download being restarted
* Only request old blocks from peers with >= difficulty
https://github.com/paritytech/parity-ethereum/pull/9226 might be too
permissive and causing the behaviour of the retraction soon after the
fork block. With this change the peer difficulty has to be greater than
or euqal to our syncing difficulty, so should still fix
https://github.com/paritytech/parity-ethereum/issues/9225
* Some logging and clear stalled blocks head
* Revert "Some logging and clear stalled blocks head"
This reverts commit 757641d9b817ae8b63fec684759b0815af9c4d0e.
* Reset stalled header if useless more than once
* Store useless headers in HashSet
* Add sync target to logging macro
* Don't disable useless peer and fix log macro
* Clear useless headers on reset and comments
* Use custom error for collecting blocks
Previously we resued BlockImportError, however only the Invalid case and
this made little sense with the QueueFull error.
* Remove blank line
* Test for reset sync after consecutive useless headers
* Don't reset after consecutive headers when chain head
* Delete commented out imports
* Return DownloadAction from collect_blocks instead of error
* Don't reset after round complete, was causing test hangs
* Add comment explaining reset after useless
* Replace HashSet with counter for useless headers
* Refactor sync reset on bad block/queue full
* Add missing target for log message
* Fix compiler errors and test after merge
* ethcore: revert ethereum tests submodule update
* Add hardcoded headers (#9730)
* add foundation hardcoded header #6486017
* add ropsten hardcoded headers #4202497
* add kovan hardcoded headers #9023489
* gitlab ci: releasable_branches: change variables condition to schedule (#9729)
* parity-version: bump beta to 2.1.2
* docs(rpc): push the branch along with tags (#9578)
* docs(rpc): push the branch along with tags
* ci: remove old rpc docs script
* Remove snapcraft clean (#9585)
* Revert " add snapcraft package image (master) (#9584)"
This reverts commit ceaedbbd7f.
* Update package-snap.sh
* Update .gitlab-ci.yml
* ci: fix regex 🙄 (#9597)
* docs(rpc): annotate tag with the provided message (#9601)
* Update ropsten.json (#9602)
* HF in POA Sokol (2018-09-19) (#9607)
https://github.com/poanetwork/poa-chain-spec/pull/86
* fix(network): don't disconnect reserved peers (#9608)
The priority of && and || was borked.
* fix failing node-table tests on mac os, closes#9632 (#9633)
* ethcore-io retries failed work steal (#9651)
* ethcore-io uses newer version of crossbeam && retries failed work steal
* ethcore-io non-mio service uses newer crossbeam
* remove master from releasable branches (#9655)
* remove master from releasable branches
need backporting in beta
fix https://gitlab.parity.io/parity/parity-ethereum/-/jobs/101065 etc
* add except for snap packages for master
* Test fix for windows cache name... (#9658)
* Test fix for windows cache name...
* Fix variable name.
* fix(light_fetch): avoid race with BlockNumber::Latest (#9665)
* Calculate sha3 instead of sha256 for push-release. (#9673)
* Calculate sha3 instead of sha256 for push-release.
* Add pushes to the script.
* Hardfork the testnets (#9562)
* ethcore: propose hardfork block number 4230000 for ropsten
* ethcore: propose hardfork block number 9000000 for kovan
* ethcore: enable kip-4 and kip-6 on kovan
* etcore: bump kovan hardfork to block 9.2M
* ethcore: fix ropsten constantinople block number to 4.2M
* ethcore: disable difficulty_test_ropsten until ethereum/tests are updated upstream
* ci: fix push script (#9679)
* ci: fix push script
* Fix copying & running on windows.
* CI: Remove unnecessary pipes (#9681)
* ci: reduce gitlab pipelines significantly
* ci: build pipeline for PR
* ci: remove dead weight
* ci: remove github release script
* ci: remove forever broken aura tests
* ci: add random stuff to the end of the pipes
* ci: add wind and mac to the end of the pipe
* ci: remove snap artifacts
* ci: (re)move dockerfiles
* ci: clarify job names
* ci: add cargo audit job
* ci: make audit script executable
* ci: ignore snap and docker files for rust check
* ci: simplify audit script
* ci: rename misc to optional
* ci: add publish script to releaseable branches
* ci: more verbose cp command for windows build
* ci: fix weird binary checksum logic in push script
* ci: fix regex in push script for windows
* ci: simplify gitlab caching
* docs: align README with ci changes
* ci: specify default cargo target dir
* ci: print verbose environment
* ci: proper naming of scripts
* ci: restore docker files
* ci: use docker hub file
* ci: use cargo home instead of cargo target dir
* ci: touch random rust file to trigger real builds
* ci: set cargo target dir for audit script
* ci: remove temp file
* ci: don't export the cargo target dir in the audit script
* ci: fix windows unbound variable
* docs: fix gitlab badge path
* rename deprecated gitlab ci variables
https://docs.gitlab.com/ee/ci/variables/#9-0-renaming
* ci: fix git compare for nightly builds
* test: skip c++ example for all platforms but linux
* ci: add random rust file to trigger tests
* ci: remove random rust file
* disable cpp lib test for mac, win and beta (#9686)
* cleanup ci merge
* ci: fix tests
* fix bad-block reporting no reason (#9638)
* ethcore: fix detection of major import (#9552)
* sync: set state to idle after sync is completed
* sync: refactor sync reset
* Don't hash the init_code of CREATE. (#9688)
* Docker: run as parity user (#9689)
* Implement CREATE2 gas changes and fix some potential overflowing (#9694)
* Implement CREATE2 gas changes and fix some potential overflowing
* Ignore create2 state tests
* Split CREATE and CREATE2 in gasometer
* Generalize rounding (x + 31) / 32 to to_word_size
* make instantSeal engine backwards compatible, closes#9696 (#9700)
* ethcore: delay ropsten hardfork (#9704)
* fix (light/provider) : Make `read_only executions` read-only (#9591)
* `ExecutionsRequest` from light-clients as read-only
This changes so all `ExecutionRequests` from light-clients are executed
as read-only which the `virtual``flag == true ensures.
This boost up the current transaction to always succeed
Note, this only affects `eth_estimateGas` and `eth_call` AFAIK.
* grumbles(revert renaming) : TransactionProof
* grumbles(trace) : remove incorrect trace
* grumbles(state/prove_tx) : explicit `virt`
Remove the boolean flag to determine that a `state::prove_transaction`
whether it should be executed in a virtual context or not.
Because of that also rename the function to
`state::prove_transction_virtual` to make more clear
* CI: Skip docs job for nightly (#9693)
* ci: force-tag wiki changes
* ci: force-tag wiki changes
* ci: skip docs job for master and nightly
* ci: revert docs job checking for nightly tag
* ci: exclude docs job from nightly builds in gitlab script
* parity-version: mark 2.1.0 track beta
* ci: update branch version references
* docker: release master to latest
* Fix checkpointing when creating contract failed (#9514)
* ci: fix json docs generation (#9515)
* fix typo in version string (#9516)
* Update patricia trie to 0.2.2 crates. Default dependencies on minor
version only.
* Putting back ethereum tests to the right commit
* Enable all Constantinople hard fork changes in constantinople_test.json (#9505)
* Enable all Constantinople hard fork changes in constantinople_test.json
* Address grumbles
* Remove EIP-210 activation
* 8m -> 5m
* Temporarily add back eip210 transition so we can get test passed
* Add eip210_test and remove eip210 transition from const_test
* In create memory calculation is the same for create2 because the additional parameter was popped before. (#9522)
* deps: bump fs-swap and kvdb-rocksdb
* Multithreaded snapshot creation (#9239)
* Add Progress to Snapshot Secondary chunks creation
* Use half of CPUs to multithread snapshot creation
* Use env var to define number of threads
* info to debug logs
* Add Snapshot threads as CLI option
* Randomize chunks per thread
* Remove randomness, add debugging
* Add warning
* Add tracing
* Use parity-common fix seek branch
* Fix log
* Fix tests
* Fix tests
* PR Grumbles
* PR Grumble II
* Update Cargo.lock
* PR Grumbles
* Default snapshot threads to half number of CPUs
* Fix default snapshot threads // min 1
* correct before_script for nightly build versions (#9543)
- fix gitlab array of strings syntax error
- get proper commit id
- avoid colon in stings
* Remove initial token for WS. (#9545)
* version: mark release critical
* ci: fix rpc docs generation 2 (#9550)
* Improve P2P discovery (#9526)
* Add `target` to Rust traces
* network-devp2p: Don't remove discovery peer in main sync
* network-p2p: Refresh discovery more often
* Update Peer discovery protocol
* Run discovery more often when not enough nodes connected
* Start the first discovery early
* Update fast discovery rate
* Fix tests
* Fix `ping` tests
* Fixing remote Node address ; adding PingPong round
* Fix tests: update new +1 PingPong round
* Increase slow Discovery rate
Check in flight FindNode before pings
* Add `deprecated` to deprecated_echo_hash
* Refactor `discovery_round` branching
* net_version caches network_id to avoid redundant aquire of sync read lock (#9544)
* net_version caches network_id to avoid redundant aquire of sync read lock, #8746
* use lower_hex display formatting for net_peerCount rpc method
* Increase Gas-floor-target and Gas Cap (#9564)
+ Gas-floor-target increased to 8M by default
+ Gas-cap increased to 10M by default
* Revert to old parity-tokio-ipc.
* Downgrade named pipes.
This PR is fixing deadlock for #8918
It avoids some recursive calls on light_sync by making state check optional for Informant.
The current behavior is to display the information when informant checks if block is major version.
This change a bit the informant behavior, but not on most cases.
To remember where and how this kind of deadlock are likely to happen (not seen with Parkinglot deadlock detection because it uses std condvar), I am adding a description of the deadlock.
Also, for the reviewers there may be better solution than modifying the informant.
### Thread1
- ethcore/sync/light_sync/mod.rs
A call to the light handler through any Io (having a loop of rpc query running on like client makes the dead lock way more likely).
At the end of those calls we systematically call `maintain_sync` method.
Here maintain_sync locks `state` (it is the deadlock cause), with a write purpose
`maintain_sync` -> `begin_search` with the state locked open
`begin_search` -> lightcliennt `flush_queue` method
- ethcore/light/src/client/mod.rs
`flush_queue` -> `flush` on queue (HeaderQueue aka VerificationQueue of headers)
- ethcore/src/verification/queue/mod.rs
Condition there is some unverified or verifying content
`flush` wait on a condvar until the queue is empty. The only way to unlock condvar is that worker is empty and unlock it (so thread 2 is Verification worker).
### Thread2
A verification worker at the end of a verify loop (new block).
- ethcore/src/verification/queue/mod.rs
thread loops on `verify` method.
End of loop condition is_ready -> Import the block immediately
calls `set_sync` on QueueSignal which send a BlockVerified ClientIoMessage in inner channel (IoChannel of ClientIoMessage) using `send_sync`
- util/io/src/service_mio.rs
IoChannel `send_sync` method calls all handlers with `message` method; one of the handlers is ImportBlocks IoHandler (with a single inner Client service field)
- ethcore/light/src/client/service.rs
`message` trigger inner method `import_verified`
- core/light/src/client/mod.rs
`import_verified` at the very end notify the listeners of a new_headers, one of the listeners is Informant `listener` method
- parity/informant.rs
`newHeaders` run up to call to `is_major_importing` on its target (again clinet)
- ethcore/sync/src/light_sync/mod.rs
Here `is_major_importing` tries to get state lock (read purpose only) but cannot because of previous state lock, thus deadlock
* Verify private transaction before propagating
* Private transactions queue reworked with tx pool queue direct usage
* Styling fixed
* Prevent resending private packets to the sender
* Process signed private transaction packets via io queue
* Test fixed
* Build and test fixed after merge
* Comments after review fixed
* Signed transaction taken from verified
* Fix after merge
* Pool scoring generalized in order to use externally
* Lib refactored according to the review comments
* Ready state refactored
* Redundant bound and copying removed
* Fixed build after the merge
* Forgotten case reworked
* Review comments fixed
* Logging reworked, target added
* Fix after merge
* Add a `fastmap` crate that provides the H256FastMap specialized HashMap
* Use `fastmap` instead of `plain_hasher`
* Update submodules for Reasons™
* Submodule update
Closes#9255
This PR also removes the limit of max 64 transactions per packet, currently we only attempt to prevent the packet size to go over 8MB. This will only be the case for super-large transactions or high-block-gas-limit chains.
Patching this is important only for chains that have blocks that can fit more than 4k transactions (over 86M block gas limit)
For mainnet, we should actually see a tiny bit faster propagation since instead of computing 4k pending set, we only need `4 * 8M / 21k = 1523` transactions.
Running some tests on `dekompile` node right now, to check how it performs in the wild.
Previously we only allow downloading of old blocks if the peer
difficulty was greater than our syncing difficulty. This change allows
downloading of blocks from peers where the difficulty is greater then
the last downloaded old block.
* Bump parking_lot to 0.6
* Bump parity-wasm to 0.31 so it gets rid of parking_lot
ref https://github.com/paritytech/parity-wasm/pull/206
* Update jsonrpc versions
* Update wasmi and pwasm-utils version
* Fix compile
* Update jsonrpc crates
* Store recently rejected transactions.
* Don't cache AlreadyImported rejections.
* Make the size of transaction verification queue dependent on pool size.
* Add a test for recently rejected.
* Fix logging for recently rejected.
* Make rejection cache smaller.
* obsolete test removed
* obsolete test removed
* Construct cache with_capacity.
The `patricia_trie` crate is generic over the hasher (by way of HashDB) and node encoding scheme. Adds a new `patricia_trie_ethereum` crate with concrete impls for Keccak/RLP.
* new blooms database
* fixed conflict in Cargo.lock
* removed bloomchain
* cleanup in progress
* all tests passing in trace db with new blooms-db
* added trace_blooms to BlockChainDB interface, fixed db flushing
* BlockChainDB no longer exposes RwLock in the interface
* automatically flush blooms-db after every insert
* blooms-db uses io::BufReader to read files, wrap blooms-db into Mutex, cause fs::File is just a shared file handle
* fix json_tests
* blooms-db can filter multiple possibilities at the same time
* removed enum trace/db.rs CacheId
* lint fixes
* fixed tests
* kvdb-rocksdb uses fs-swap crate
* update Cargo.lock
* use fs::rename
* fixed failing test on linux
* fix tests
* use fs_swap
* fixed failing test on linux
* cleanup after swap
* fix tests
* fixed osx permissions
* simplify parity database opening functions
* added migration to blooms-db
* address @niklasad1 grumbles
* fix license and authors field of blooms-db Cargo.toml
* restore blooms-db after snapshot
* Unordered iterator.
* Use unordered and limited set if full not required.
* Split timeout work into smaller timers.
* Avoid collecting all pending transactions when mining
* Remove println.
* Use priority ordering in eth-filter.
* Fix ethcore-miner tests and tx propagation.
* Review grumbles addressed.
* Add test for unordered not populating the cache.
* Fix ethcore tests.
* Fix light tests.
* Fix ethcore-sync tests.
* Fix RPC tests.
* Mark test helpers and test-only specs as cfg(test)
* Use test-probe to conditionally compile test helpers
* Remove test probe and directly use features tag
* Update `add_license` script
* run script
* add `remove duplicate lines script` and run it
* Revert changes `English spaces`
* strip whitespaces
* Revert `GPL` in files with `apache/mit license`
* don't append `gpl license` in files with other lic
* Don't append `gpl header` in files with other lic.
* re-ran script
* include c and cpp files too
* remove duplicate header
* rebase nit