├── .cargo └── config ├── .dockerignore ├── .editorconfig ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitlab-ci.yml ├── .gitmodules ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── SECURITY.md ├── accounts ├── Cargo.toml ├── ethkey │ ├── .gitignore │ ├── .travis.yml │ ├── Cargo.toml │ ├── README.md │ ├── cli │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ └── src │ │ ├── brain.rs │ │ ├── brain_prefix.rs │ │ ├── brain_recover.rs │ │ ├── lib.rs │ │ ├── password.rs │ │ └── prefix.rs ├── ethstore │ ├── .editorconfig │ ├── .gitignore │ ├── .travis.yml │ ├── Cargo.toml │ ├── README.md │ ├── cli │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── crack.rs │ │ │ └── main.rs │ │ └── tests │ │ │ └── cli.rs │ ├── src │ │ ├── account │ │ │ ├── cipher.rs │ │ │ ├── crypto.rs │ │ │ ├── kdf.rs │ │ │ ├── mod.rs │ │ │ ├── safe_account.rs │ │ │ └── version.rs │ │ ├── accounts_dir │ │ │ ├── disk.rs │ │ │ ├── memory.rs │ │ │ ├── mod.rs │ │ │ └── vault.rs │ │ ├── error.rs │ │ ├── ethstore.rs │ │ ├── import.rs │ │ ├── json │ │ │ ├── bytes.rs │ │ │ ├── cipher.rs │ │ │ ├── crypto.rs │ │ │ ├── error.rs │ │ │ ├── hash.rs │ │ │ ├── id.rs │ │ │ ├── kdf.rs │ │ │ ├── key_file.rs │ │ │ ├── mod.rs │ │ │ ├── presale.rs │ │ │ ├── vault_file.rs │ │ │ ├── vault_key_file.rs │ │ │ └── version.rs │ │ ├── lib.rs │ │ ├── presale.rs │ │ ├── random.rs │ │ └── secret_store.rs │ └── tests │ │ ├── api.rs │ │ ├── res │ │ ├── ciphertext │ │ │ ├── 30.json │ │ │ └── 31.json │ │ ├── geth_keystore │ │ │ ├── UTC--2016-02-17T09-20-45.721400158Z--3f49624084b67849c7b4e805c5988c21a430f9d9 │ │ │ ├── UTC--2016-02-20T09-33-03.984382741Z--5ba4dcf897e97c2bdf8315b9ef26c13c085988cf │ │ │ └── UTC--2016-04-03T08-58-49.834202900Z--63121b431a52f8043c16fcf0d1df9cb7b5f66649 │ │ └── pat │ │ │ ├── p1.json │ │ │ └── p2.json │ │ └── util │ │ ├── mod.rs │ │ └── transient_dir.rs └── src │ ├── account_data.rs │ ├── error.rs │ ├── lib.rs │ └── stores.rs ├── chainspec ├── Cargo.toml └── src │ └── main.rs ├── cli-signer ├── Cargo.toml ├── rpc-client │ ├── Cargo.toml │ └── src │ │ ├── client.rs │ │ ├── lib.rs │ │ └── signer_client.rs └── src │ └── lib.rs ├── docs ├── CHANGELOG-0.9.md ├── CHANGELOG-1.0.md ├── CHANGELOG-1.1.md ├── CHANGELOG-1.10.md ├── CHANGELOG-1.11.md ├── CHANGELOG-1.2.md ├── CHANGELOG-1.3.md ├── CHANGELOG-1.4.md ├── CHANGELOG-1.5.md ├── CHANGELOG-1.6.md ├── CHANGELOG-1.7.md ├── CHANGELOG-1.8.md ├── CHANGELOG-1.9.md ├── CHANGELOG-2.0.md ├── CHANGELOG-2.1.md ├── CHANGELOG-2.2.md ├── CHANGELOG-2.3.md ├── CHANGELOG-2.4.md ├── CHANGELOG-2.5.md ├── CHANGELOG-2.6.md └── logo-parity-ethereum.svg ├── ethash ├── Cargo.toml ├── benches │ ├── basic.rs │ └── progpow.rs ├── res │ └── progpow_testvectors.json └── src │ ├── cache.rs │ ├── compute.rs │ ├── keccak.rs │ ├── lib.rs │ ├── progpow.rs │ ├── seed_compute.rs │ └── shared.rs ├── ethcore ├── Cargo.toml ├── account-db │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── account-state │ ├── Cargo.toml │ └── src │ │ ├── account.rs │ │ ├── backend.rs │ │ ├── lib.rs │ │ └── state.rs ├── benches │ └── builtin.rs ├── block-gas-limit │ ├── Cargo.toml │ ├── res │ │ └── block_gas_limit.json │ └── src │ │ └── lib.rs ├── block-reward │ ├── Cargo.toml │ ├── res │ │ └── block_reward.json │ └── src │ │ └── lib.rs ├── blockchain │ ├── Cargo.toml │ └── src │ │ ├── best_block.rs │ │ ├── blockchain.rs │ │ ├── cache.rs │ │ ├── config.rs │ │ ├── generator.rs │ │ ├── lib.rs │ │ └── update.rs ├── builtin │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── call-contract │ ├── Cargo.toml │ └── src │ │ ├── call_contract.rs │ │ └── lib.rs ├── client-traits │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── db │ ├── Cargo.toml │ └── src │ │ ├── cache_manager.rs │ │ ├── db.rs │ │ ├── keys.rs │ │ └── lib.rs ├── engine │ ├── Cargo.toml │ └── src │ │ ├── engine.rs │ │ ├── lib.rs │ │ ├── signer.rs │ │ ├── snapshot.rs │ │ └── test_helpers.rs ├── engines │ ├── authority-round │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── finality.rs │ │ │ ├── lib.rs │ │ │ ├── randomness.rs │ │ │ └── util.rs │ ├── basic-authority │ │ ├── Cargo.toml │ │ ├── res │ │ │ └── basic_authority.json │ │ └── src │ │ │ └── lib.rs │ ├── clique │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── block_state.rs │ │ │ ├── lib.rs │ │ │ ├── params.rs │ │ │ ├── tests.rs │ │ │ └── util.rs │ ├── ethash │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── instant-seal │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── null-engine │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── validator-set │ │ ├── Cargo.toml │ │ ├── res │ │ ├── validator_report.json │ │ └── validator_set.json │ │ └── src │ │ ├── contract.rs │ │ ├── lib.rs │ │ ├── multi.rs │ │ ├── safe_contract.rs │ │ ├── simple_list.rs │ │ └── test.rs ├── evm │ ├── Cargo.toml │ ├── benches │ │ └── basic.rs │ └── src │ │ ├── evm.rs │ │ ├── factory.rs │ │ ├── instructions.rs │ │ ├── interpreter │ │ ├── gasometer.rs │ │ ├── informant.rs │ │ ├── memory.rs │ │ ├── mod.rs │ │ ├── shared_cache.rs │ │ └── stack.rs │ │ ├── lib.rs │ │ └── tests.rs ├── executive-state │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── light │ ├── Cargo.toml │ └── src │ │ ├── cache.rs │ │ ├── cht.rs │ │ ├── client │ │ ├── fetch.rs │ │ ├── header_chain.rs │ │ ├── mod.rs │ │ └── service.rs │ │ ├── lib.rs │ │ ├── net │ │ ├── context.rs │ │ ├── error.rs │ │ ├── load_timer.rs │ │ ├── mod.rs │ │ ├── request_credits.rs │ │ ├── request_set.rs │ │ ├── status.rs │ │ └── tests │ │ │ └── mod.rs │ │ ├── on_demand │ │ ├── mod.rs │ │ ├── request.rs │ │ ├── request_guard.rs │ │ ├── response_guard.rs │ │ └── tests.rs │ │ ├── provider.rs │ │ ├── transaction_queue.rs │ │ └── types │ │ ├── mod.rs │ │ └── request │ │ ├── batch.rs │ │ └── mod.rs ├── machine │ ├── Cargo.toml │ ├── benches │ │ └── builtin_contract.rs │ ├── res │ │ ├── tx_acl.json │ │ ├── tx_acl_deprecated.json │ │ └── tx_acl_gas_price.json │ └── src │ │ ├── executed.rs │ │ ├── executed_block.rs │ │ ├── executive.rs │ │ ├── externalities.rs │ │ ├── lib.rs │ │ ├── machine.rs │ │ ├── substate.rs │ │ ├── test_helpers.rs │ │ ├── transaction_ext.rs │ │ └── tx_filter.rs ├── node-filter │ ├── Cargo.toml │ ├── res │ │ ├── node_filter.json │ │ └── peer_set.json │ └── src │ │ └── lib.rs ├── pod │ ├── Cargo.toml │ └── src │ │ ├── account.rs │ │ ├── lib.rs │ │ └── state.rs ├── private-tx │ ├── Cargo.toml │ ├── res │ │ ├── keys_acl.json │ │ ├── private.evm │ │ └── private.json │ ├── src │ │ ├── encryptor.rs │ │ ├── error.rs │ │ ├── key_server_keys.rs │ │ ├── lib.rs │ │ ├── log.rs │ │ ├── messages.rs │ │ ├── private_state_db.rs │ │ ├── private_transactions.rs │ │ └── state_store.rs │ └── tests │ │ └── private_contract.rs ├── res │ ├── authority_round.json │ ├── authority_round_block_reward_contract.json │ ├── authority_round_empty_steps.json │ ├── authority_round_randomness_contract.json │ ├── constructor.json │ ├── contracts │ │ ├── authority_round_random.json │ │ ├── test_authority_round_random.json │ │ ├── test_authority_round_random.sol │ │ └── test_validator_set.json │ ├── ethereum │ │ ├── builtin_multi_bench.json │ │ ├── builtin_one_activation_bench.json │ │ ├── byzantium_test.json │ │ ├── callisto.json │ │ ├── classic.json │ │ ├── constantinople_test.json │ │ ├── eip150_test.json │ │ ├── eip161_test.json │ │ ├── eip210_test.json │ │ ├── ellaism.json │ │ ├── ethercore.json │ │ ├── evancore.json │ │ ├── evantestcore.json │ │ ├── ewc.json │ │ ├── expanse.json │ │ ├── foundation.json │ │ ├── frontier_like_test.json │ │ ├── frontier_test.json │ │ ├── goerli.json │ │ ├── homestead_test.json │ │ ├── istanbul_test.json │ │ ├── kotti.json │ │ ├── kovan.json │ │ ├── kovan_wasm_test.json │ │ ├── mcip3_test.json │ │ ├── mix.json │ │ ├── morden.json │ │ ├── mordor.json │ │ ├── musicoin.json │ │ ├── poacore.json │ │ ├── poasokol.json │ │ ├── rinkeby.json │ │ ├── ropsten.json │ │ ├── st_peters_test.json │ │ ├── tests-issues │ │ │ └── currents.json │ │ ├── transition_test.json │ │ ├── volta.json │ │ └── xdai.json │ ├── instant_seal.json │ ├── null.json │ ├── null_morden.json │ ├── null_morden_with_finality.json │ ├── null_morden_with_reward.json │ ├── spec_backward_compability.json │ ├── tx_permission_tests │ │ ├── contract_ver_2_genesis.json │ │ ├── contract_ver_3.sol │ │ ├── contract_ver_3_genesis.json │ │ └── deprecated_contract_genesis.json │ ├── validator_contract.json │ ├── validator_multi.json │ └── validator_safe_contract.json ├── service │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── service.rs ├── snapshot │ ├── Cargo.toml │ ├── benches │ │ ├── state-chunk-5279-0x2032dfb6ad93f1928dac70627a8767d2232568a1a7bf1c91ea416988000f8275.rlp │ │ ├── state-chunk-5905-0x104ff12a3fda9e0cb1aeef41fe7092982134eb116292c0eec725c32a815ef0ea.rlp │ │ ├── state-chunk-6341-0x3042ea62f982fd0cea02847ff0fd103a0beef3bb19389f5e77113c3ea355f803.rlp │ │ ├── state-chunk-6720-0x2075481dccdc2c4419112bfea2d09219a7223614656722a1a05a930baf2b0dd7.rlp │ │ ├── state-chunk-6933-0x104102770901b53230e78cfc8f6edce282eb21bfa00aa1c3543c79cb3402cf2d.rlp │ │ └── to_fat_rlps.rs │ ├── snapshot-tests │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── abridged_block.rs │ │ │ ├── account.rs │ │ │ ├── helpers.rs │ │ │ ├── io.rs │ │ │ ├── lib.rs │ │ │ ├── proof_of_authority.rs │ │ │ ├── proof_of_work.rs │ │ │ ├── service.rs │ │ │ ├── state.rs │ │ │ ├── test_validator_contract.json │ │ │ └── watcher.rs │ └── src │ │ ├── account.rs │ │ ├── block.rs │ │ ├── consensus │ │ ├── authority.rs │ │ ├── mod.rs │ │ └── work.rs │ │ ├── io.rs │ │ ├── lib.rs │ │ ├── service.rs │ │ ├── traits.rs │ │ └── watcher.rs ├── spec │ ├── Cargo.toml │ └── src │ │ ├── chain.rs │ │ ├── genesis.rs │ │ ├── lib.rs │ │ ├── seal.rs │ │ └── spec.rs ├── src │ ├── block.rs │ ├── client │ │ ├── ancient_import.rs │ │ ├── bad_blocks.rs │ │ ├── client.rs │ │ ├── config.rs │ │ ├── mod.rs │ │ └── traits.rs │ ├── json_tests │ │ ├── chain.rs │ │ ├── difficulty.rs │ │ ├── executive.rs │ │ ├── mod.rs │ │ ├── skip.rs │ │ ├── state.rs │ │ ├── test_common.rs │ │ ├── transaction.rs │ │ └── trie.rs │ ├── lib.rs │ ├── miner │ │ ├── filter_options.rs │ │ ├── miner.rs │ │ ├── mod.rs │ │ ├── pool_client.rs │ │ └── stratum.rs │ ├── test_helpers │ │ ├── evm_test_client.rs │ │ ├── mod.rs │ │ └── test_client.rs │ └── tests │ │ ├── blockchain.rs │ │ ├── client.rs │ │ ├── evm.rs │ │ ├── mod.rs │ │ └── trace.rs ├── state-db │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── sync │ ├── Cargo.toml │ └── src │ │ ├── api.rs │ │ ├── block_sync.rs │ │ ├── blocks.rs │ │ ├── chain │ │ ├── handler.rs │ │ ├── mod.rs │ │ ├── propagator.rs │ │ ├── requester.rs │ │ ├── supplier.rs │ │ └── sync_packet.rs │ │ ├── lib.rs │ │ ├── light_sync │ │ ├── mod.rs │ │ ├── response.rs │ │ ├── sync_round.rs │ │ └── tests │ │ │ ├── mod.rs │ │ │ └── test_net.rs │ │ ├── private_tx.rs │ │ ├── res │ │ └── private_spec.json │ │ ├── snapshot_sync.rs │ │ ├── sync_io.rs │ │ ├── tests │ │ ├── chain.rs │ │ ├── consensus.rs │ │ ├── helpers.rs │ │ ├── mod.rs │ │ ├── private.rs │ │ ├── rpc.rs │ │ └── snapshot.rs │ │ └── transactions_stats.rs ├── trace │ ├── Cargo.toml │ └── src │ │ ├── config.rs │ │ ├── db.rs │ │ ├── executive_tracer.rs │ │ ├── import.rs │ │ ├── lib.rs │ │ ├── noop_tracer.rs │ │ └── types │ │ ├── error.rs │ │ ├── filter.rs │ │ ├── flat.rs │ │ ├── localized.rs │ │ ├── mod.rs │ │ └── trace.rs ├── trie-vm-factories │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── types │ ├── Cargo.toml │ └── src │ │ ├── account_diff.rs │ │ ├── ancestry_action.rs │ │ ├── basic_account.rs │ │ ├── block.rs │ │ ├── block_status.rs │ │ ├── blockchain_info.rs │ │ ├── call_analytics.rs │ │ ├── chain_notify.rs │ │ ├── client_types.rs │ │ ├── data_format.rs │ │ ├── encoded.rs │ │ ├── engines │ │ ├── epoch.rs │ │ ├── machine.rs │ │ ├── mod.rs │ │ └── params.rs │ │ ├── errors │ │ ├── block_error.rs │ │ ├── engine_error.rs │ │ ├── ethcore_error.rs │ │ ├── mod.rs │ │ └── snapshot_error.rs │ │ ├── filter.rs │ │ ├── header.rs │ │ ├── ids.rs │ │ ├── import_route.rs │ │ ├── io_message.rs │ │ ├── lib.rs │ │ ├── log_entry.rs │ │ ├── pruning_info.rs │ │ ├── receipt.rs │ │ ├── security_level.rs │ │ ├── snapshot.rs │ │ ├── state_diff.rs │ │ ├── trace_filter.rs │ │ ├── transaction │ │ ├── error.rs │ │ ├── mod.rs │ │ └── transaction.rs │ │ ├── tree_route.rs │ │ ├── verification.rs │ │ └── views │ │ ├── block.rs │ │ ├── body.rs │ │ ├── header.rs │ │ ├── mod.rs │ │ ├── transaction.rs │ │ └── view_rlp.rs ├── verification │ ├── Cargo.toml │ ├── benches │ │ ├── 8447675.rlp │ │ ├── 8481474-parent-to-uncle.rlp │ │ ├── 8481475.rlp │ │ ├── 8481476-one-uncle.rlp │ │ └── verification.rs │ └── src │ │ ├── lib.rs │ │ ├── queue │ │ ├── kind.rs │ │ └── mod.rs │ │ ├── test_helpers.rs │ │ └── verification.rs ├── vm │ ├── Cargo.toml │ └── src │ │ ├── action_params.rs │ │ ├── action_type.rs │ │ ├── env_info.rs │ │ ├── error.rs │ │ ├── ext.rs │ │ ├── lib.rs │ │ ├── return_data.rs │ │ ├── schedule.rs │ │ └── tests.rs └── wasm │ ├── Cargo.toml │ ├── run │ ├── Cargo.toml │ ├── res │ │ ├── sample-fixture.json │ │ ├── sample1.wasm │ │ ├── sample2.wasm │ │ └── sample3.wasm │ └── src │ │ ├── fixture.rs │ │ ├── main.rs │ │ └── runner.rs │ └── src │ ├── env.rs │ ├── lib.rs │ ├── panic_payload.rs │ ├── parser.rs │ ├── runtime.rs │ └── tests.rs ├── evmbin ├── Cargo.toml ├── README.md ├── benches │ └── mod.rs ├── res │ ├── create2callPrecompiles.json │ ├── testchain.json │ └── teststate.json └── src │ ├── display │ ├── json.rs │ ├── mod.rs │ ├── simple.rs │ └── std_json.rs │ ├── info.rs │ └── main.rs ├── ipfs ├── Cargo.toml └── src │ ├── error.rs │ ├── lib.rs │ └── route.rs ├── json ├── Cargo.toml └── src │ ├── bytes.rs │ ├── hash.rs │ ├── lib.rs │ ├── maybe.rs │ ├── spec │ ├── account.rs │ ├── authority_round.rs │ ├── basic_authority.rs │ ├── builtin.rs │ ├── clique.rs │ ├── engine.rs │ ├── ethash.rs │ ├── genesis.rs │ ├── hardcoded_sync.rs │ ├── instant_seal.rs │ ├── mod.rs │ ├── null_engine.rs │ ├── params.rs │ ├── seal.rs │ ├── spec.rs │ ├── state.rs │ ├── step_duration.rs │ └── validator_set.rs │ ├── state.rs │ ├── test_helpers │ ├── blockchain │ │ ├── block.rs │ │ ├── header.rs │ │ └── mod.rs │ ├── difficulty.rs │ ├── mod.rs │ ├── skip.rs │ ├── state.rs │ ├── tester.rs │ ├── transaction.rs │ └── trie │ │ ├── input.rs │ │ └── mod.rs │ ├── transaction.rs │ ├── uint.rs │ └── vm.rs ├── license_header ├── miner ├── Cargo.toml ├── local-store │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── price-info │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── res │ └── contracts │ │ └── service_transaction.json ├── src │ ├── external.rs │ ├── gas_price_calibrator.rs │ ├── gas_pricer.rs │ ├── lib.rs │ ├── local_accounts.rs │ ├── pool │ │ ├── client.rs │ │ ├── listener.rs │ │ ├── local_transactions.rs │ │ ├── mod.rs │ │ ├── queue.rs │ │ ├── ready.rs │ │ ├── replace.rs │ │ ├── res │ │ │ └── big_transaction.data │ │ ├── scoring.rs │ │ ├── tests │ │ │ ├── client.rs │ │ │ ├── mod.rs │ │ │ └── tx.rs │ │ └── verifier.rs │ ├── service_transaction_checker.rs │ └── work_notify.rs ├── stratum │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── traits.rs └── using-queue │ ├── Cargo.toml │ └── src │ └── lib.rs ├── parity ├── account.rs ├── account_utils.rs ├── blockchain.rs ├── cache.rs ├── cli │ ├── mod.rs │ ├── presets │ │ ├── config.dev-insecure.toml │ │ ├── config.dev.toml │ │ ├── config.insecure.toml │ │ ├── config.mining.toml │ │ ├── config.non-standard-ports.toml │ │ └── mod.rs │ ├── tests │ │ ├── config.full.toml │ │ ├── config.invalid1.toml │ │ ├── config.invalid2.toml │ │ ├── config.invalid3.toml │ │ ├── config.invalid4.toml │ │ ├── config.stratum_disabled.toml │ │ ├── config.stratum_enabled.toml │ │ ├── config.stratum_missing_field.toml │ │ ├── config.stratum_missing_section.toml │ │ └── config.toml │ ├── usage.rs │ ├── usage_header.txt │ └── version.txt ├── configuration.rs ├── db │ ├── mod.rs │ └── rocksdb │ │ ├── blooms.rs │ │ ├── helpers.rs │ │ ├── migration.rs │ │ └── mod.rs ├── deprecated.rs ├── export_hardcoded_sync.rs ├── helpers.rs ├── informant.rs ├── ipfs.rs ├── lib.rs ├── light_helpers │ ├── epoch_fetch.rs │ └── mod.rs ├── logger │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── rotating.rs ├── main.rs ├── modules.rs ├── params.rs ├── presale.rs ├── rpc.rs ├── rpc_apis.rs ├── run.rs ├── secretstore │ ├── blockchain.rs │ ├── mod.rs │ ├── nodekeypair.rs │ └── server.rs ├── signer.rs ├── snapshot_cmd.rs ├── stratum.rs ├── upgrade.rs └── user_defaults.rs ├── rpc ├── Cargo.toml └── src │ ├── authcodes.rs │ ├── http_common.rs │ ├── lib.rs │ ├── tests │ ├── helpers.rs │ ├── http_client.rs │ ├── mod.rs │ ├── rpc.rs │ └── ws.rs │ └── v1 │ ├── extractors.rs │ ├── helpers │ ├── block_import.rs │ ├── deprecated.rs │ ├── dispatch │ │ ├── full.rs │ │ ├── light.rs │ │ ├── mod.rs │ │ ├── prospective_signer.rs │ │ └── signing.rs │ ├── eip191.rs │ ├── engine_signer.rs │ ├── errors.rs │ ├── external_signer │ │ ├── mod.rs │ │ ├── oneshot.rs │ │ └── signing_queue.rs │ ├── fake_sign.rs │ ├── ipfs.rs │ ├── light_fetch.rs │ ├── mod.rs │ ├── network_settings.rs │ ├── nonce.rs │ ├── poll_filter.rs │ ├── poll_manager.rs │ ├── requests.rs │ ├── secretstore.rs │ ├── signature.rs │ ├── subscribers.rs │ ├── subscription_manager.rs │ └── work.rs │ ├── impls │ ├── debug.rs │ ├── eth.rs │ ├── eth_filter.rs │ ├── eth_pubsub.rs │ ├── light │ │ ├── eth.rs │ │ ├── mod.rs │ │ ├── net.rs │ │ ├── parity.rs │ │ ├── parity_set.rs │ │ └── trace.rs │ ├── mod.rs │ ├── net.rs │ ├── parity.rs │ ├── parity_accounts.rs │ ├── parity_set.rs │ ├── personal.rs │ ├── private.rs │ ├── pubsub.rs │ ├── rpc.rs │ ├── secretstore.rs │ ├── signer.rs │ ├── signing.rs │ ├── signing_unsafe.rs │ ├── traces.rs │ ├── transactions_pool.rs │ └── web3.rs │ ├── informant.rs │ ├── metadata.rs │ ├── mod.rs │ ├── tests │ ├── eth.rs │ ├── helpers │ │ ├── miner_service.rs │ │ ├── mod.rs │ │ ├── snapshot_service.rs │ │ ├── sync_provider.rs │ │ └── update_service.rs │ ├── mocked │ │ ├── debug.rs │ │ ├── eth.rs │ │ ├── eth_pubsub.rs │ │ ├── manage_network.rs │ │ ├── mod.rs │ │ ├── net.rs │ │ ├── parity.rs │ │ ├── parity_accounts.rs │ │ ├── parity_set.rs │ │ ├── personal.rs │ │ ├── pubsub.rs │ │ ├── rpc.rs │ │ ├── secretstore.rs │ │ ├── signer.rs │ │ ├── signing.rs │ │ ├── signing_unsafe.rs │ │ ├── traces.rs │ │ └── web3.rs │ └── mod.rs │ ├── traits │ ├── debug.rs │ ├── eth.rs │ ├── eth_pubsub.rs │ ├── eth_signing.rs │ ├── mod.rs │ ├── net.rs │ ├── parity.rs │ ├── parity_accounts.rs │ ├── parity_set.rs │ ├── parity_signing.rs │ ├── personal.rs │ ├── private.rs │ ├── pubsub.rs │ ├── rpc.rs │ ├── secretstore.rs │ ├── signer.rs │ ├── traces.rs │ ├── transactions_pool.rs │ └── web3.rs │ └── types │ ├── account_info.rs │ ├── block.rs │ ├── block_number.rs │ ├── bytes.rs │ ├── call_request.rs │ ├── confirmations.rs │ ├── consensus_status.rs │ ├── derivation.rs │ ├── eip191.rs │ ├── eth_types.rs │ ├── filter.rs │ ├── histogram.rs │ ├── index.rs │ ├── log.rs │ ├── mod.rs │ ├── node_kind.rs │ ├── private_log.rs │ ├── private_receipt.rs │ ├── provenance.rs │ ├── pubsub.rs │ ├── receipt.rs │ ├── rpc_settings.rs │ ├── secretstore.rs │ ├── sync.rs │ ├── trace.rs │ ├── trace_filter.rs │ ├── transaction.rs │ ├── transaction_condition.rs │ ├── transaction_request.rs │ └── work.rs ├── rustfmt.toml ├── scripts ├── add_license.sh ├── doc.sh ├── docker │ ├── README.md │ ├── alpine │ │ └── Dockerfile │ ├── centos │ │ ├── Dockerfile │ │ ├── Dockerfile.build │ │ └── build.sh │ ├── hub │ │ ├── Dockerfile │ │ ├── check_sync.sh │ │ └── publish-docker.sh │ ├── ubuntu-aarch64 │ │ └── Dockerfile │ └── ubuntu-arm │ │ └── Dockerfile ├── evm_jsontests_bench.sh ├── evm_uint_bench.sh ├── gitlab │ ├── build-linux.sh │ ├── build-windows.sh │ ├── publish-av-whitelists.sh │ ├── publish-docs.sh │ ├── publish-onchain.sh │ ├── publish-snap.sh │ ├── rust-changes.sh │ ├── safe-curl.sh │ ├── sign-win.cmd │ ├── test-linux.sh │ └── validate-chainspecs.sh ├── hook.sh ├── parity.service ├── remove_duplicate_empty_lines.sh └── snap │ ├── icon.png │ ├── parity.desktop │ └── snapcraft.template.yaml ├── secret-store ├── Cargo.toml ├── res │ ├── acl_storage.json │ ├── key_server_set.json │ └── service.json └── src │ ├── acl_storage.rs │ ├── blockchain.rs │ ├── key_server.rs │ ├── key_server_cluster │ ├── admin_sessions │ │ ├── key_version_negotiation_session.rs │ │ ├── mod.rs │ │ ├── servers_set_change_session.rs │ │ ├── sessions_queue.rs │ │ ├── share_add_session.rs │ │ └── share_change_session.rs │ ├── client_sessions │ │ ├── decryption_session.rs │ │ ├── encryption_session.rs │ │ ├── generation_session.rs │ │ ├── mod.rs │ │ ├── signing_session_ecdsa.rs │ │ └── signing_session_schnorr.rs │ ├── cluster.rs │ ├── cluster_connections.rs │ ├── cluster_connections_net.rs │ ├── cluster_message_processor.rs │ ├── cluster_sessions.rs │ ├── cluster_sessions_creator.rs │ ├── connection_trigger.rs │ ├── connection_trigger_with_migration.rs │ ├── io │ │ ├── deadline.rs │ │ ├── handshake.rs │ │ ├── message.rs │ │ ├── mod.rs │ │ ├── read_header.rs │ │ ├── read_message.rs │ │ ├── read_payload.rs │ │ ├── shared_tcp_stream.rs │ │ └── write_message.rs │ ├── jobs │ │ ├── consensus_session.rs │ │ ├── decryption_job.rs │ │ ├── dummy_job.rs │ │ ├── job_session.rs │ │ ├── key_access_job.rs │ │ ├── mod.rs │ │ ├── servers_set_change_access_job.rs │ │ ├── signing_job_ecdsa.rs │ │ ├── signing_job_schnorr.rs │ │ └── unknown_sessions_job.rs │ ├── math.rs │ ├── message.rs │ ├── mod.rs │ └── net │ │ ├── accept_connection.rs │ │ ├── connect.rs │ │ ├── connection.rs │ │ └── mod.rs │ ├── key_server_set.rs │ ├── key_storage.rs │ ├── lib.rs │ ├── listener │ ├── http_listener.rs │ ├── mod.rs │ ├── service_contract.rs │ ├── service_contract_aggregate.rs │ ├── service_contract_listener.rs │ └── tasks_queue.rs │ ├── migration.rs │ ├── node_key_pair.rs │ ├── serialization.rs │ ├── traits.rs │ └── types │ ├── all.rs │ ├── error.rs │ └── mod.rs ├── updater ├── Cargo.toml ├── hash-fetch │ ├── Cargo.toml │ ├── res │ │ └── urlhint.json │ └── src │ │ ├── client.rs │ │ ├── lib.rs │ │ └── urlhint.rs ├── res │ └── operations.json └── src │ ├── lib.rs │ ├── service.rs │ ├── types │ ├── all.rs │ ├── mod.rs │ ├── release_track.rs │ └── version_info.rs │ └── updater.rs └── util ├── EIP-152 ├── Cargo.toml ├── LICENSE ├── benches │ └── bench.rs └── src │ ├── avx2.rs │ ├── lib.rs │ └── portable.rs ├── EIP-712 ├── Cargo.toml ├── README.md └── src │ ├── eip712.rs │ ├── encode.rs │ ├── error.rs │ ├── lib.rs │ └── parser.rs ├── bloom ├── Cargo.toml └── src │ └── lib.rs ├── blooms-db ├── Cargo.toml ├── benches │ └── blooms.rs └── src │ ├── db.rs │ ├── file.rs │ └── lib.rs ├── dir ├── Cargo.toml └── src │ ├── helpers.rs │ └── lib.rs ├── fake-fetch ├── Cargo.toml └── src │ └── lib.rs ├── fastmap ├── Cargo.toml └── src │ └── lib.rs ├── fetch ├── Cargo.toml └── src │ ├── client.rs │ └── lib.rs ├── io ├── Cargo.toml └── src │ ├── lib.rs │ ├── service_mio.rs │ ├── service_non_mio.rs │ └── worker.rs ├── journaldb ├── Cargo.toml └── src │ ├── archivedb.rs │ ├── as_hash_db_impls.rs │ ├── earlymergedb.rs │ ├── lib.rs │ ├── overlaydb.rs │ ├── overlayrecentdb.rs │ ├── refcounteddb.rs │ └── util.rs ├── keccak-hasher ├── Cargo.toml └── src │ └── lib.rs ├── len-caching-lock ├── Cargo.toml └── src │ ├── lib.rs │ ├── mutex.rs │ └── rwlock.rs ├── macros ├── Cargo.toml └── src │ └── lib.rs ├── memory-cache ├── Cargo.toml └── src │ └── lib.rs ├── migration-rocksdb ├── Cargo.toml ├── src │ └── lib.rs └── tests │ └── tests.rs ├── network-devp2p ├── Cargo.toml ├── src │ ├── connection.rs │ ├── discovery.rs │ ├── handshake.rs │ ├── host.rs │ ├── ip_utils.rs │ ├── lib.rs │ ├── node_table.rs │ ├── service.rs │ └── session.rs └── tests │ └── tests.rs ├── network ├── Cargo.toml └── src │ ├── client_version.rs │ ├── connection_filter.rs │ ├── error.rs │ └── lib.rs ├── panic-hook ├── Cargo.toml └── src │ └── lib.rs ├── patricia-trie-ethereum ├── Cargo.toml ├── benches │ └── rlp_node_codec.rs └── src │ ├── lib.rs │ └── rlp_node_codec.rs ├── registrar ├── Cargo.toml ├── res │ └── registrar.json └── src │ ├── lib.rs │ └── registrar.rs ├── rlp-compress ├── Cargo.toml ├── src │ ├── common.rs │ └── lib.rs └── tests │ └── compress.rs ├── rlp-derive ├── Cargo.toml ├── src │ ├── de.rs │ ├── en.rs │ └── lib.rs └── tests │ └── rlp.rs ├── runtime ├── Cargo.toml └── src │ └── lib.rs ├── stats ├── Cargo.toml └── src │ └── lib.rs ├── time-utils ├── Cargo.toml └── src │ └── lib.rs ├── triehash-ethereum ├── Cargo.toml └── src │ └── lib.rs ├── unexpected ├── Cargo.toml └── src │ └── lib.rs └── version ├── Cargo.toml ├── build.rs └── src └── lib.rs /.cargo/config: -------------------------------------------------------------------------------- 1 | # NOTE: if you make changes here, remember to also update: 2 | # scripts/test-linux.sh 3 | # scripts/build-linux.sh 4 | # scripts/build-windows.sh 5 | 6 | # Using 'cfg` is broken, see https://github.com/rust-lang/cargo/issues/6858 7 | #[target.'cfg(target_arch = "x86_64")'] 8 | #rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"] 9 | 10 | # …so instead we list all target triples (Tier 1 64-bit platforms) 11 | [target.x86_64-unknown-linux-gnu] 12 | # Enables the aes-ni instructions for RustCrypto dependency. 13 | rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"] 14 | 15 | [target.x86_64-pc-windows-gnu] 16 | # Enables the aes-ni instructions for RustCrypto dependency. 17 | rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"] 18 | 19 | [target.x86_64-pc-windows-msvc] 20 | # Enables the aes-ni instructions for RustCrypto dependency. 21 | # Link the C runtime statically ; https://github.com/paritytech/parity-ethereum/issues/6643 22 | rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3", "-Ctarget-feature=+crt-static"] 23 | 24 | [target.x86_64-apple-darwin] 25 | # Enables the aes-ni instructions for RustCrypto dependency. 26 | rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"] 27 | 28 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | target 4 | 5 | *.swp 6 | *.swo 7 | *.swn 8 | *.DS_Store 9 | 10 | # Visual Studio Code stuff 11 | .vscode 12 | 13 | # GitEye stuff 14 | .project 15 | 16 | # idea ide 17 | .idea 18 | 19 | # git stuff 20 | .git 21 | 22 | ethcore/res/ethereum/tests 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | [*] 3 | indent_style=tab 4 | indent_size=tab 5 | tab_width=4 6 | end_of_line=lf 7 | charset=utf-8 8 | trim_trailing_whitespace=true 9 | max_line_length=120 10 | insert_final_newline=true 11 | 12 | [*.{yml,sh}] 13 | indent_style=space 14 | indent_size=2 15 | tab_width=8 16 | end_of_line=lf 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | _Before filing a new issue, please **provide the following information**._ 2 | 3 | _If you think that your issue is an exploitable security vulnerability, please mail your bugreport to security@parity.io instead; your submission might be eligible for our Bug Bounty._ 4 | _You can find mode info on the reporting process in [SECURITY.md](https://github.com/paritytech/parity-ethereum/blob/master/SECURITY.md)_ 5 | 6 | 7 | - **Parity Ethereum version**: 0.0.0 8 | - **Operating system**: Windows / MacOS / Linux 9 | - **Installation**: homebrew / one-line installer / built from source 10 | - **Fully synchronized**: no / yes 11 | - **Network**: ethereum / ropsten / goerli / ... 12 | - **Restarted**: no / yes 13 | 14 | _Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._ 15 | 16 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for your Pull Request! 2 | 3 | Before you submitting, please check that: 4 | 5 | - [ ] You added a brief description of the PR, e.g.: 6 | - What does it do? 7 | - What important points reviewers should know? 8 | - Is there something left for follow-up PRs? 9 | - [ ] You labeled the PR with appropriate labels if you have permissions to do so. 10 | - [ ] You mentioned a related issue if this PR related to it, e.g. `Fixes #228` or `Related #1337`. 11 | - [ ] You asked any particular reviewers to review. If you aren't sure, start with GH suggestions. 12 | - [ ] Your PR adheres [the style guide](https://wiki.parity.io/Coding-guide) 13 | - In particular, mind the maximal line length. 14 | - There is no commented code checked in unless necessary. 15 | - Any panickers have a proof or removed. 16 | - [ ] You updated any rustdocs which may have changed 17 | 18 | After you've read this notice feel free to remove it. 19 | Thank you! 20 | 21 | ✄ ----------------------------------------------------------------------------- 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled files 2 | *.o 3 | *.so 4 | *.rlib 5 | *.dll 6 | 7 | # Executables 8 | *.exe 9 | 10 | # Cargo lock in subs 11 | **/Cargo.lock 12 | 13 | # Generated by Cargo 14 | **/target/ 15 | 16 | # vim stuff 17 | *.swp 18 | *.swo 19 | 20 | # mac stuff 21 | .DS_Store 22 | 23 | # npm stuff 24 | npm-debug.log 25 | node_modules 26 | 27 | # js build artifacts 28 | .git-release.log 29 | 30 | # gdb files 31 | .gdb_history 32 | 33 | /json-tests/target/ 34 | 35 | # jetbrains ide stuff 36 | .idea 37 | *.iml 38 | 39 | # Build artifacts 40 | out/ 41 | parity-clib-examples/cpp/build/ 42 | 43 | .vscode 44 | rls/ 45 | /parity.* 46 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ethcore/res/ethereum/tests"] 2 | path = ethcore/res/ethereum/tests 3 | url = https://github.com/ethereum/tests.git 4 | branch = develop 5 | [submodule "ethcore/res/wasm-tests"] 6 | path = ethcore/res/wasm-tests 7 | url = https://github.com/paritytech/wasm-tests 8 | -------------------------------------------------------------------------------- /accounts/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Account Management" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "ethcore-accounts" 6 | version = "0.1.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | 10 | [dependencies] 11 | ethkey = { path = "ethkey" } 12 | ethstore = { path = "ethstore" } 13 | log = "0.4" 14 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 15 | parking_lot = "0.9" 16 | serde = "1.0" 17 | serde_derive = "1.0" 18 | serde_json = "1.0" 19 | 20 | [dev-dependencies] 21 | ethereum-types = "0.8.0" 22 | tempdir = "0.3" 23 | -------------------------------------------------------------------------------- /accounts/ethkey/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | -------------------------------------------------------------------------------- /accounts/ethkey/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: rust 3 | branches: 4 | only: 5 | - master 6 | matrix: 7 | fast_finish: false 8 | include: 9 | - rust: stable 10 | - rust: beta 11 | - rust: nightly 12 | after_success: | 13 | [ $TRAVIS_BRANCH = master ] && 14 | [ $TRAVIS_PULL_REQUEST = false ] && 15 | [ $TRAVIS_RUST_VERSION = stable ] && 16 | cargo doc --no-deps --verbose && 17 | echo '' > target/doc/index.html && 18 | pip install --user ghp-import && 19 | /home/travis/.local/bin/ghp-import -n target/doc && 20 | git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages 21 | env: 22 | global: 23 | - secure: LBkFAH5fAhzHRP7kYQZnOCavOuPS2vEDv49KGfTsY/7MmW0De4c0sz0a3/0IdFqqIMLYLV2uMO86S0p6FBaq6/GIdobLsGZZ3cFReYFI+vb8sylYF/+D/aQ/UOjpEOD8HP6G3YmV5buSyL8uiPlmYbqwBAe4z6ELEbh/16gRuIqQLYQtpYPxMCD3tZzSux81b45K2khETZ7E+ap3LUG3rFTXxjEgx9leIZlVY+Qk4U5D9gFnJnjmxDPyIqzn2dORnw5jcpp3eSUEvSvSgjz4TAVg7Gw789jDl2dyr26U1wp1E5bB9AqZVYOb4l8vcQ6QiHrCvu7Wgl32O6XYkwMjDaDUB68bm5MTsUrwDWgKGx4xeurIBil5doHFlCGZ98RrzPxdgoCd6hCI459dA8jEwdXAfOkZ80RycZlryHCwn68x3dlnJoqVyg8viYo6H6G0GdH/dIhuwbnLDdWZsODehN8eJEy9KKQ4tPp+PjBcgKm1Wz5MzKFSIwfFInic7hjTVXGozHSvgvXJE0BI2bPbjVNCdZa5kGAAUAhBNXyTn7PbC7hYbmwAalzaOIjoYcdQLmUEz2J2gSOK8xW2gMU0Z2I+IylA0oh8xB/r2Q5sqLHT3LPLdzoETsyzaQjWFcFdXdsbbcG59DnFC9s2Jq7KqeODp6EJG4cw0ofKpBuDRes= 24 | -------------------------------------------------------------------------------- /accounts/ethkey/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Keys Generator" 3 | name = "ethkey" 4 | version = "0.4.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | edit-distance = "2.0" 9 | log = "0.4" 10 | serde = "1.0" 11 | serde_derive = "1.0" 12 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 13 | parity-wordlist = "1.3" 14 | -------------------------------------------------------------------------------- /accounts/ethkey/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Keys Generator CLI" 3 | name = "ethkey-cli" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | docopt = "1.0" 9 | env_logger = "0.5" 10 | ethkey = { path = "../" } 11 | panic_hook = { path = "../../../util/panic-hook" } 12 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 13 | parity-wordlist="1.2" 14 | rustc-hex = "1.0" 15 | serde = "1.0" 16 | serde_derive = "1.0" 17 | threadpool = "1.7" 18 | 19 | [[bin]] 20 | name = "ethkey" 21 | path = "src/main.rs" 22 | doc = false 23 | -------------------------------------------------------------------------------- /accounts/ethkey/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | // #![warn(missing_docs)] 18 | 19 | extern crate edit_distance; 20 | extern crate parity_crypto; 21 | extern crate parity_wordlist; 22 | extern crate serde; 23 | 24 | #[macro_use] 25 | extern crate log; 26 | #[macro_use] 27 | extern crate serde_derive; 28 | 29 | mod brain; 30 | mod brain_prefix; 31 | mod password; 32 | mod prefix; 33 | 34 | pub mod brain_recover; 35 | 36 | pub use self::parity_wordlist::Error as WordlistError; 37 | pub use self::brain::Brain; 38 | pub use self::brain_prefix::BrainPrefix; 39 | pub use self::password::Password; 40 | pub use self::prefix::Prefix; -------------------------------------------------------------------------------- /accounts/ethstore/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | [*] 3 | indent_style=tab 4 | indent_size=tab 5 | tab_width=4 6 | end_of_line=lf 7 | charset=utf-8 8 | trim_trailing_whitespace=true 9 | max_line_length=120 10 | insert_final_newline=true 11 | 12 | -------------------------------------------------------------------------------- /accounts/ethstore/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | -------------------------------------------------------------------------------- /accounts/ethstore/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: rust 3 | branches: 4 | only: 5 | - master 6 | matrix: 7 | fast_finish: false 8 | include: 9 | - rust: stable 10 | - rust: beta 11 | - rust: nightly 12 | after_success: | 13 | [ $TRAVIS_BRANCH = master ] && 14 | [ $TRAVIS_PULL_REQUEST = false ] && 15 | [ $TRAVIS_RUST_VERSION = stable ] && 16 | cargo doc --no-deps --verbose && 17 | echo '' > target/doc/index.html && 18 | pip install --user ghp-import && 19 | /home/travis/.local/bin/ghp-import -n target/doc && 20 | git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages 21 | env: 22 | global: 23 | - secure: C4l7WR0jS84WNmd3MvmpPXQz4wRh4CLDS6bP3BqSHXadz8FPKejtMJZscLYAk5kIkDcVsTAYb88RsEFRrYOA4wkS6vhZBtryYRaJ68MlkyEU/77SYwm86rkQINIDw65O73dUD5LbWWCUoYkenGu26u/UnfayHfJBAyKw5IHkVKf6eDqu7E8ojKSEOXbWgBHjq6uixI8IESb15UjIE0AQ1Od+6cqhsz/caPhTMT3CJGjoCoVGWChwWSQZ+Ppb+xB83C/1h58UVwE9sZEyIPKwVP6socnHPmtR+VEUI6a7YIsOk6ZadKLtyy4523w4HqHNx1/dYjmsknbGpkF4D0DRp5L3D4t4J6URCkJIHfSRrBF5l2QbLMMuSf+KWMWuFOrOF5DBryobRKAVmIL5AjfvFsxtBNzYLPyVBs0ntbPuN5WeUPhadam00za9Z1ZvOUJxfNfyy9R67u6FdD9xkw2m/9hO7KJLDeZ4TSCRFrzfl/7WQprfjCwhZ+reKPgHH0Ufy1/Kh/WEuEBfZDa+z3mWWHlslqH2uBPH3+pvhzdVQGLB/5GZdJNeg/nJYJDCqHyWUKxkw+OMSvI0J8W0GiHV4TuY9V3p+rYjU2Zj69u3/xO/IvKrFtB9xdeJMrLiFQ2cD5vgzQOLCKo80f53NitUjdVSoWrY/NcYopBU4VHZMlk= 24 | -------------------------------------------------------------------------------- /accounts/ethstore/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Key Management" 3 | name = "ethstore" 4 | version = "0.2.1" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | log = "0.4" 9 | libc = "0.2" 10 | rand = "0.7" 11 | ethkey = { path = "../ethkey" } 12 | serde = "1.0" 13 | serde_json = "1.0" 14 | serde_derive = "1.0" 15 | rustc-hex = "1.0" 16 | tiny-keccak = "1.4" 17 | time = "0.1.34" 18 | itertools = "0.5" 19 | parking_lot = "0.9" 20 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 21 | ethereum-types = "0.8.0" 22 | dir = { path = "../../util/dir" } 23 | smallvec = "0.6" 24 | parity-wordlist = "1.0" 25 | tempdir = "0.3" 26 | 27 | [dev-dependencies] 28 | matches = "0.1" 29 | 30 | [lib] 31 | -------------------------------------------------------------------------------- /accounts/ethstore/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Key Management CLI" 3 | name = "ethstore-cli" 4 | version = "0.1.1" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | docopt = "1.0" 9 | env_logger = "0.5" 10 | num_cpus = "1.6" 11 | rustc-hex = "1.0" 12 | serde = "1.0" 13 | serde_derive = "1.0" 14 | parking_lot = "0.9" 15 | ethstore = { path = "../" } 16 | ethkey = { path = "../../ethkey" } 17 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 18 | dir = { path = '../../../util/dir' } 19 | panic_hook = { path = "../../../util/panic-hook" } 20 | 21 | [[bin]] 22 | name = "ethstore" 23 | path = "src/main.rs" 24 | doc = false 25 | 26 | [dev-dependencies] 27 | tempdir = "0.3" 28 | -------------------------------------------------------------------------------- /accounts/ethstore/src/account/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | mod cipher; 18 | mod crypto; 19 | mod kdf; 20 | mod safe_account; 21 | mod version; 22 | 23 | pub use self::cipher::{Cipher, Aes128Ctr}; 24 | pub use self::crypto::Crypto; 25 | pub use self::kdf::{Kdf, Pbkdf2, Scrypt, Prf}; 26 | pub use self::safe_account::SafeAccount; 27 | pub use self::version::Version; 28 | -------------------------------------------------------------------------------- /accounts/ethstore/src/account/version.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | use json; 18 | 19 | #[derive(Debug, PartialEq, Clone)] 20 | pub enum Version { 21 | V3, 22 | } 23 | 24 | impl From for Version { 25 | fn from(json: json::Version) -> Self { 26 | match json { 27 | json::Version::V3 => Version::V3, 28 | } 29 | } 30 | } 31 | 32 | impl Into for Version { 33 | fn into(self) -> json::Version { 34 | match self { 35 | Version::V3 => json::Version::V3, 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /accounts/ethstore/src/random.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | use rand::{Rng, RngCore, rngs::OsRng, distributions::Alphanumeric}; 18 | 19 | pub trait Random { 20 | fn random() -> Self where Self: Sized; 21 | } 22 | 23 | impl Random for [u8; 16] { 24 | fn random() -> Self { 25 | let mut result = [0u8; 16]; 26 | let mut rng = OsRng; 27 | rng.fill_bytes(&mut result); 28 | result 29 | } 30 | } 31 | 32 | impl Random for [u8; 32] { 33 | fn random() -> Self { 34 | let mut result = [0u8; 32]; 35 | let mut rng = OsRng; 36 | rng.fill_bytes(&mut result); 37 | result 38 | } 39 | } 40 | 41 | /// Generate a random string of given length. 42 | pub fn random_string(length: usize) -> String { 43 | let rng = OsRng; 44 | rng.sample_iter(&Alphanumeric).take(length).collect() 45 | } 46 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/ciphertext/30.json: -------------------------------------------------------------------------------- 1 | { 2 | "address" : "31e9d1e6d844bd3a536800ef8d8be6a9975db509", 3 | "crypto" : { 4 | "cipher" : "aes-128-ctr", 5 | "cipherparams" : { 6 | "iv" : "3ca92af36ad7c2cd92454c59cea5ef00" 7 | }, 8 | "ciphertext" : "108b7d34f3442fc26ab1ab90ca91476ba6bfa8c00975a49ef9051dc675aa", 9 | "kdf" : "scrypt", 10 | "kdfparams" : { 11 | "dklen" : 32, 12 | "n" : 2, 13 | "r" : 8, 14 | "p" : 1, 15 | "salt" : "d0769e608fb86cda848065642a9c6fa046845c928175662b8e356c77f914cd3b" 16 | }, 17 | "mac" : "75d0e6759f7b3cefa319c3be41680ab6beea7d8328653474bd06706d4cc67420" 18 | }, 19 | "id" : "a37e1559-5955-450d-8075-7b8931b392b2", 20 | "version" : 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/ciphertext/31.json: -------------------------------------------------------------------------------- 1 | { 2 | "address" : "d1e64e5480bfaf733ba7d48712decb8227797a4e", 3 | "crypto" : { 4 | "cipher" : "aes-128-ctr", 5 | "cipherparams" : { 6 | "iv" : "e0c41130a323adc1446fc82f724bca2f" 7 | }, 8 | "ciphertext" : "9517cd5bdbe69076f9bf5057248c6c050141e970efa36ce53692d5d59a3984", 9 | "kdf" : "scrypt", 10 | "kdfparams" : { 11 | "dklen" : 32, 12 | "n" : 2, 13 | "r" : 8, 14 | "p" : 1, 15 | "salt" : "711f816911c92d649fb4c84b047915679933555030b3552c1212609b38208c63" 16 | }, 17 | "mac" : "d5e116151c6aa71470e67a7d42c9620c75c4d23229847dcc127794f0732b0db5" 18 | }, 19 | "id" : "fecfc4ce-e956-48fd-953b-30f8b52ed66c", 20 | "version" : 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/geth_keystore/UTC--2016-02-17T09-20-45.721400158Z--3f49624084b67849c7b4e805c5988c21a430f9d9: -------------------------------------------------------------------------------- 1 | { 2 | "address": "3f49624084b67849c7b4e805c5988c21a430f9d9", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "9f27e3dd4fc73e7103ed61e5493662189a3eb52223ae49e3d1deacc04c889eae", 6 | "cipherparams": { 7 | "iv": "457494bf05f2618c397dc74dbb5181c0" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "db14edb18c41ee7f5ec4397df89c3a2ae4d0af60884c52bb54ce490574f8df33" 16 | }, 17 | "mac": "572d24532438d31fdf513c744a3ff26c933ffda5744ee42bc71661cbe3f2112e" 18 | }, 19 | "id": "62a0ad73-556d-496a-8e1c-0783d30d3ace", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/geth_keystore/UTC--2016-02-20T09-33-03.984382741Z--5ba4dcf897e97c2bdf8315b9ef26c13c085988cf: -------------------------------------------------------------------------------- 1 | { 2 | "address": "5ba4dcf897e97c2bdf8315b9ef26c13c085988cf", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "d4a08ec930163778273920f6ad1d49b71836337be6fd9863993ac700a612fddd", 6 | "cipherparams": { 7 | "iv": "89ce5ec129fc27cd5bcbeb8c92bdad50" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "612ab108dc37e69ee8af37a7b24bf7f2234086d7bbf945bacdeccce331f7f84a" 16 | }, 17 | "mac": "4152caa7444e06784223d735cea80cd2690b4c587ad8db3d5529442227b25695" 18 | }, 19 | "id": "35086353-fb12-4029-b56b-033cd61ce35b", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/geth_keystore/UTC--2016-04-03T08-58-49.834202900Z--63121b431a52f8043c16fcf0d1df9cb7b5f66649: -------------------------------------------------------------------------------- 1 | {"address":"63121b431a52f8043c16fcf0d1df9cb7b5f66649","crypto":{"cipher":"aes-128-ctr","ciphertext":"1dd21926c644b9983916d646f3a4f2c7f9362f7e1c9fb1abcb42494dae06fa01","cipherparams":{"iv":"c52c6ee66d89a7aa8c6839f4b6ed29c8"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"96f17c17bbf48db2dc4da00b3e7decce8e21f44a5d7963dadeeff70e1d38ad75"},"mac":"f279f3444585c2817701225e2196c1176386ad549ebaec2bcc4f94f309727fe6"},"id":"15e49cd2-51fb-4316-ba46-c3cf8db4ae44","version":3} 2 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/pat/p1.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "3f49624084b67849c7b4e805c5988c21a430f9d9", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "9f27e3dd4fc73e7103ed61e5493662189a3eb52223ae49e3d1deacc04c889eae", 6 | "cipherparams": { 7 | "iv": "457494bf05f2618c397dc74dbb5181c0" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "db14edb18c41ee7f5ec4397df89c3a2ae4d0af60884c52bb54ce490574f8df33" 16 | }, 17 | "mac": "572d24532438d31fdf513c744a3ff26c933ffda5744ee42bc71661cbe3f2112e" 18 | }, 19 | "id": "62a0ad73-556d-496a-8e1c-0783d30d3ace", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/pat/p2.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "5ba4dcf897e97c2bdf8315b9ef26c13c085988cf", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "d4a08ec930163778273920f6ad1d49b71836337be6fd9863993ac700a612fddd", 6 | "cipherparams": { 7 | "iv": "89ce5ec129fc27cd5bcbeb8c92bdad50" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "612ab108dc37e69ee8af37a7b24bf7f2234086d7bbf945bacdeccce331f7f84a" 16 | }, 17 | "mac": "4152caa7444e06784223d735cea80cd2690b4c587ad8db3d5529442227b25695" 18 | }, 19 | "id": "35086353-fb12-4029-b56b-033cd61ce35b", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/util/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | mod transient_dir; 18 | 19 | pub use self::transient_dir::TransientDir; 20 | -------------------------------------------------------------------------------- /accounts/src/error.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity. 3 | 4 | // Parity is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity. If not, see . 16 | 17 | use std::fmt; 18 | 19 | use ethstore::{Error as SSError}; 20 | 21 | /// Signing error 22 | #[derive(Debug)] 23 | pub enum SignError { 24 | /// Account is not unlocked 25 | NotUnlocked, 26 | /// Account does not exist. 27 | NotFound, 28 | /// Low-level error from store 29 | SStore(SSError), 30 | } 31 | 32 | impl fmt::Display for SignError { 33 | fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { 34 | match *self { 35 | SignError::NotUnlocked => write!(f, "Account is locked"), 36 | SignError::NotFound => write!(f, "Account does not exist"), 37 | SignError::SStore(ref e) => write!(f, "{}", e), 38 | } 39 | } 40 | } 41 | 42 | impl From for SignError { 43 | fn from(e: SSError) -> Self { 44 | SignError::SStore(e) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /chainspec/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Chain Specification" 3 | name = "chainspec" 4 | version = "0.1.0" 5 | authors = ["Marek Kotewicz "] 6 | 7 | [dependencies] 8 | ethjson = { path = "../json" } 9 | serde_json = "1.0" 10 | -------------------------------------------------------------------------------- /cli-signer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum CLI Signer Tool" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "cli-signer" 6 | version = "1.4.0" 7 | authors = ["Parity "] 8 | 9 | [dependencies] 10 | ethereum-types = "0.8.0" 11 | futures = "0.1" 12 | rpassword = "1.0" 13 | parity-rpc = { path = "../rpc" } 14 | parity-rpc-client = { path = "rpc-client" } 15 | -------------------------------------------------------------------------------- /cli-signer/rpc-client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum RPC Client" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "parity-rpc-client" 6 | version = "1.4.0" 7 | authors = ["Parity "] 8 | 9 | [dependencies] 10 | ethereum-types = "0.8.0" 11 | futures = "0.1" 12 | log = "0.4" 13 | serde = "1.0" 14 | serde_json = "1.0" 15 | url = "2.1.0" 16 | matches = "0.1" 17 | parking_lot = "0.9" 18 | jsonrpc-core = "14.0.3" 19 | jsonrpc-ws-server = "14.0.3" 20 | parity-rpc = { path = "../../rpc" } 21 | keccak-hash = "0.4.0" 22 | -------------------------------------------------------------------------------- /ethash/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Ethash & ProgPoW Implementations" 3 | name = "ethash" 4 | version = "1.12.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | common-types = { path = "../ethcore/types" } 9 | either = "1.0.0" 10 | ethereum-types = "0.8.0" 11 | keccak-hash = "0.4.0" 12 | log = "0.4" 13 | memmap = "0.6" 14 | parking_lot = "0.9" 15 | primal = "0.2.3" 16 | static_assertions = "0.3.3" 17 | 18 | [dev-dependencies] 19 | criterion = "0.3" 20 | rustc-hex = "1.0" 21 | serde_json = "1.0" 22 | tempdir = "0.3" 23 | 24 | [features] 25 | default = [] 26 | bench = [] 27 | 28 | [[bench]] 29 | name = "basic" 30 | harness = false 31 | required-features = ['bench'] 32 | 33 | [[bench]] 34 | name = "progpow" 35 | harness = false 36 | required-features = ['bench'] 37 | -------------------------------------------------------------------------------- /ethcore/account-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "account-db" 3 | description = "DB backend wrapper for Account trie" 4 | authors = ["Parity Technologies "] 5 | license = "GPL-3.0" 6 | version = "0.1.0" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | ethereum-types = "0.8.0" 11 | hash-db = "0.15.0" 12 | keccak-hash = "0.4.0" 13 | keccak-hasher = { path = "../../util/keccak-hasher" } 14 | kvdb = "0.3.1" 15 | rlp = "0.4" 16 | -------------------------------------------------------------------------------- /ethcore/account-state/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "account-state" 3 | description = "Ethereum accounts, keeps track of changes to the code and storage" 4 | authors = ["Parity Technologies "] 5 | license = "GPL-3.0" 6 | version = "0.1.0" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | common-types = { path = "../types"} 11 | derive_more = "0.15.0" 12 | ethereum-types = "0.8.0" 13 | ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" } 14 | trie-vm-factories = { path = "../trie-vm-factories" } 15 | hash-db = "0.15.0" 16 | journaldb = { path = "../../util/journaldb" } 17 | keccak-hash = "0.4.0" 18 | keccak-hasher = { path = "../../util/keccak-hasher" } 19 | kvdb = "0.3.1" 20 | log = "0.4" 21 | lru-cache = "0.1.2" 22 | memory-db = "0.18.0" 23 | parity-bytes = "0.1.0" 24 | parity-util-mem = "0.3.0" 25 | parking_lot = "0.9" 26 | pod = { path = "../pod" } 27 | rlp = "0.4.0" 28 | serde = { version = "1.0", features = ["derive"] } 29 | trie-db = "0.18.0" 30 | 31 | [dev-dependencies] 32 | account-db = { path = "../account-db" } 33 | journaldb = { path = "../../util/journaldb" } 34 | parity-bytes = "0.1.0" 35 | rlp_compress = { path = "../../util/rlp-compress" } 36 | -------------------------------------------------------------------------------- /ethcore/account-state/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Account state 18 | //! This crate contains code used to create, convert, and update Accounts and the code and storage 19 | //! associated with it. It also defines the trait used to construct a backend to build a complete 20 | //! caching state database. 21 | //! Note: the code that needs access to `ethcore` types such as `Machine` and `Executive` is found in 22 | //! the `executive_state` module in `ethcore`. Most tests for the `State` module in this crate are 23 | //! also found in `executive_state` (for the same reason). 24 | 25 | pub mod account; 26 | pub mod backend; 27 | pub mod state; 28 | 29 | pub use { 30 | account::Account, 31 | backend::Backend, 32 | state::{State, CleanupMode}, 33 | }; 34 | -------------------------------------------------------------------------------- /ethcore/block-gas-limit/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "A crate to interact with the block gas limit contract" 3 | name = "block-gas-limit" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | client-traits = { path = "../client-traits" } 11 | common-types = { path = "../types" } 12 | ethabi = "9.0.1" 13 | ethabi-derive = "9.0.1" 14 | ethabi-contract = "9.0.0" 15 | ethereum-types = "0.8.0" 16 | log = "0.4" 17 | 18 | [dev-dependencies] 19 | ethcore = { path = "..", features = ["test-helpers"] } 20 | spec = { path = "../spec" } 21 | -------------------------------------------------------------------------------- /ethcore/block-gas-limit/res/block_gas_limit.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "blockGasLimit", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "uint256" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function" 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /ethcore/block-reward/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "A crate to interact with the block rewards contract." 3 | name = "block-reward" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | common-types = { path = "../types" } 11 | engine = { path = "../engine" } 12 | ethabi = "9.0.1" 13 | ethabi-derive = "9.0.1" 14 | ethabi-contract = "9.0.0" 15 | ethereum-types = "0.8.0" 16 | keccak-hash = "0.4.0" 17 | machine = { path = "../machine" } 18 | trace = { path = "../trace" } 19 | 20 | [dev-dependencies] 21 | ethcore = { path = "..", features = ["test-helpers"] } 22 | spec = { path = "../spec" } 23 | -------------------------------------------------------------------------------- /ethcore/block-reward/res/block_reward.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": false, 4 | "inputs": [ 5 | { 6 | "name": "benefactors", 7 | "type": "address[]" 8 | }, 9 | { 10 | "name": "kind", 11 | "type": "uint16[]" 12 | } 13 | ], 14 | "name": "reward", 15 | "outputs": [ 16 | { 17 | "name": "", 18 | "type": "address[]" 19 | }, 20 | { 21 | "name": "", 22 | "type": "uint256[]" 23 | } 24 | ], 25 | "payable": false, 26 | "stateMutability": "nonpayable", 27 | "type": "function" 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /ethcore/blockchain/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Blockchain Database, Test Generator, Configuration, Caching, Importing Blocks, and Block Information" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "ethcore-blockchain" 6 | version = "0.1.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | 10 | [dependencies] 11 | ansi_term = "0.11" 12 | blooms-db = { path = "../../util/blooms-db" } 13 | common-types = { path = "../types" } 14 | ethcore-db = { path = "../db" } 15 | ethereum-types = "0.8.0" 16 | keccak-hash = "0.4.0" 17 | parity-util-mem = "0.3.0" 18 | itertools = "0.5" 19 | kvdb = "0.3.1" 20 | log = "0.4" 21 | parity-bytes = "0.1" 22 | rand = "0.7" 23 | parking_lot = "0.9" 24 | rayon = "1.0" 25 | rlp = "0.4.0" 26 | rlp_compress = { path = "../../util/rlp-compress" } 27 | rlp_derive = { path = "../../util/rlp-derive" } 28 | triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } 29 | 30 | [dev-dependencies] 31 | env_logger = "0.5" 32 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 33 | rustc-hex = "1.0" 34 | tempdir = "0.3" 35 | kvdb-memorydb = "0.3.1" 36 | -------------------------------------------------------------------------------- /ethcore/blockchain/src/cache.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | /// Represents blockchain's in-memory cache size in bytes. 18 | #[derive(Debug)] 19 | pub struct CacheSize { 20 | /// Blocks cache size. 21 | pub blocks: usize, 22 | /// BlockDetails cache size. 23 | pub block_details: usize, 24 | /// Transaction addresses cache size. 25 | pub transaction_addresses: usize, 26 | /// Block receipts size. 27 | pub block_receipts: usize, 28 | } 29 | 30 | impl CacheSize { 31 | /// Total amount used by the cache. 32 | pub fn total(&self) -> usize { 33 | self.blocks + self.block_details + self.transaction_addresses + self.block_receipts 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ethcore/blockchain/src/config.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Blockchain configuration. 18 | 19 | /// Blockchain configuration. 20 | #[derive(Debug, PartialEq, Clone)] 21 | pub struct Config { 22 | /// Preferred cache size in bytes. 23 | pub pref_cache_size: usize, 24 | /// Maximum cache size in bytes. 25 | pub max_cache_size: usize, 26 | } 27 | 28 | impl Default for Config { 29 | fn default() -> Self { 30 | Config { 31 | pref_cache_size: 1 << 14, 32 | max_cache_size: 1 << 20, 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ethcore/blockchain/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Blockchain database. 18 | 19 | #![warn(missing_docs)] 20 | 21 | extern crate parity_util_mem as util_mem; 22 | extern crate parity_util_mem as malloc_size_of; 23 | 24 | mod best_block; 25 | mod blockchain; 26 | mod cache; 27 | mod config; 28 | mod update; 29 | 30 | pub mod generator; 31 | 32 | pub use crate::{ 33 | blockchain::{BlockProvider, BlockChain, BlockChainDB, BlockChainDBHandler}, 34 | cache::CacheSize, 35 | config::Config, 36 | update::ExtrasInsert, 37 | }; 38 | pub use ethcore_db::keys::{BlockReceipts, BlockDetails, TransactionAddress, BlockNumberKey}; 39 | pub use common_types::tree_route::TreeRoute; 40 | 41 | -------------------------------------------------------------------------------- /ethcore/builtin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "ethereum vm builtin" 3 | name = "ethcore-builtin" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [dependencies] 9 | bn = { git = "https://github.com/paritytech/bn", default-features = false } 10 | byteorder = "1.3.2" 11 | common-types = { path = "../types" } 12 | eip-152 = { path = "../../util/EIP-152" } 13 | ethereum-types = "0.8.0" 14 | ethjson = { path = "../../json" } 15 | keccak-hash = "0.4.0" 16 | log = "0.4" 17 | num = { version = "0.1", default-features = false, features = ["bigint"] } 18 | parity-bytes = "0.1" 19 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 20 | 21 | [dev-dependencies] 22 | hex-literal = "0.2.1" 23 | macros = { path = "../../util/macros" } 24 | -------------------------------------------------------------------------------- /ethcore/call-contract/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information" 3 | name = "ethcore-call-contract" 4 | version = "0.1.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | edition = "2018" 8 | 9 | [dependencies] 10 | types = { path = "../types", package = "common-types" } 11 | ethereum-types = "0.8.0" 12 | bytes = { version = "0.1", package = "parity-bytes" } 13 | -------------------------------------------------------------------------------- /ethcore/call-contract/src/call_contract.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Provides CallContract trait 18 | 19 | use bytes::Bytes; 20 | use ethereum_types::Address; 21 | use types::ids::BlockId; 22 | 23 | /// Provides `call_contract` method 24 | pub trait CallContract { 25 | /// Like `call`, but with various defaults. Designed to be used for calling contracts. 26 | fn call_contract( 27 | &self, 28 | block_id: BlockId, 29 | address: Address, 30 | data: Bytes 31 | ) -> Result; 32 | } 33 | -------------------------------------------------------------------------------- /ethcore/call-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | #![warn(missing_docs)] 18 | 19 | //! Call Contract module 20 | //! 21 | //! This crate exposes traits required to call contracts at particular block. 22 | //! All utilities that depend on on-chain data should use those traits to access it. 23 | 24 | pub mod call_contract; 25 | 26 | // Re-export 27 | pub use self::call_contract::*; 28 | -------------------------------------------------------------------------------- /ethcore/client-traits/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Trait definitions relative the ethereum client" 3 | name = "client-traits" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | account-state = { path = "../account-state" } 11 | blockchain = { package = "ethcore-blockchain", path = "../blockchain" } 12 | bytes = { package = "parity-bytes", version = "0.1.0" } 13 | call-contract = { package = "ethcore-call-contract", path = "../call-contract" } 14 | common-types = { path = "../types" } 15 | ethcore-db = { path = "../db" } 16 | ethcore-miner = { path = "../../miner" } 17 | ethereum-types = "0.8.0" 18 | kvdb = "0.3.1" 19 | registrar = { path = "../../util/registrar" } 20 | stats = { path = "../../util/stats" } 21 | trace = { path = "../trace" } 22 | vm = { path = "../vm" } 23 | -------------------------------------------------------------------------------- /ethcore/db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethcore DB access utilities" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "ethcore-db" 6 | version = "0.1.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | 10 | [dependencies] 11 | common-types = { path = "../types" } 12 | ethereum-types = "0.8.0" 13 | kvdb = "0.3.1" 14 | parity-util-mem = "0.3.0" 15 | parking_lot = "0.9" 16 | rlp = "0.4.0" 17 | rlp_derive = { path = "../../util/rlp-derive" } 18 | -------------------------------------------------------------------------------- /ethcore/db/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Parity Ethereum database access utilities. 18 | 19 | #![warn(missing_docs)] 20 | 21 | extern crate parity_util_mem as mem; 22 | extern crate parity_util_mem as malloc_size_of; 23 | 24 | mod db; 25 | 26 | pub mod keys; 27 | pub mod cache_manager; 28 | 29 | pub use self::db::*; 30 | -------------------------------------------------------------------------------- /ethcore/engine/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethereum engine trait definition" 3 | name = "engine" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | blockchain = { package = "ethcore-blockchain", path = "../blockchain" } 11 | builtin = { path = "../builtin", package = "ethcore-builtin" } 12 | bytes = { package = "parity-bytes", version = "0.1.0" } 13 | client-traits = { path = "../client-traits" } 14 | common-types = { path = "../types" } 15 | ethereum-types = "0.8.0" 16 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 17 | machine = { path = "../machine" } 18 | vm = { path = "../vm" } 19 | 20 | # used from test-helpers 21 | accounts = { package = "ethcore-accounts", path = "../../accounts", optional = true } 22 | log = { version = "0.4.8", optional = true } 23 | ethkey = { path = "../../accounts/ethkey", optional = true } 24 | 25 | [dev-dependencies] 26 | accounts = { package = "ethcore-accounts", path = "../../accounts" } 27 | ethkey = { path = "../../accounts/ethkey" } 28 | log = "0.4.8" 29 | 30 | [features] 31 | test-helpers = ["accounts", "log", "ethkey"] 32 | -------------------------------------------------------------------------------- /ethcore/engine/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! This crate defines the Engine trait and related types. 18 | 19 | mod engine; 20 | pub mod signer; 21 | 22 | pub use crate::engine::{ 23 | Engine, 24 | EpochVerifier, 25 | StateDependentProof, 26 | ConstructedVerifier, 27 | EpochChange, 28 | Proof, 29 | SystemCall, 30 | SystemOrCodeCall, 31 | SystemOrCodeCallKind, 32 | default_system_or_code_call, 33 | }; 34 | 35 | #[cfg(any(test, feature = "test-helpers"))] 36 | pub mod test_helpers; 37 | -------------------------------------------------------------------------------- /ethcore/engines/basic-authority/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Basic PoA blockchain engine." 3 | name = "basic-authority" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | client-traits = { path = "../../client-traits" } 11 | common-types = { path = "../../types" } 12 | engine = { path = "../../engine" } 13 | ethereum-types = "0.8.0" 14 | ethjson = { path = "../../../json" } 15 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 16 | log = "0.4.8" 17 | machine = { path = "../../machine" } 18 | parking_lot = "0.9" 19 | rlp = "0.4.2" 20 | validator-set = { path = "../validator-set" } 21 | 22 | [dev-dependencies] 23 | accounts = { package = "ethcore-accounts", path = "../../../accounts" } 24 | engine = { path = "../../engine", features = ["test-helpers"] } 25 | ethcore = { path = "../..", features = ["test-helpers"] } 26 | keccak-hash = "0.4.0" 27 | tempdir = "0.3" 28 | spec = { path = "../../spec" } 29 | 30 | [features] 31 | test-helpers = [] 32 | -------------------------------------------------------------------------------- /ethcore/engines/clique/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Clique consensus engine" 3 | name = "clique" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | client-traits = { path = "../../client-traits" } 11 | common-types = { path = "../../types" } 12 | ethereum-types = "0.8.0" 13 | ethjson = { path = "../../../json" } 14 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 15 | engine = { path = "../../engine" } 16 | keccak-hash = "0.4.0" 17 | lazy_static = "1.3.0" 18 | log = "0.4" 19 | lru-cache = "0.1" 20 | machine = { path = "../../machine" } 21 | macros = { path = "../../../util/macros" } 22 | rand = "0.7" 23 | parking_lot = "0.9" 24 | rlp = "0.4.0" 25 | time-utils = { path = "../../../util/time-utils" } 26 | unexpected = { path = "../../../util/unexpected" } 27 | 28 | [dev-dependencies] 29 | ethcore = { path = "../..", features = ["test-helpers"] } 30 | spec = { path = "../../spec" } 31 | state-db = { path = "../../state-db" } 32 | -------------------------------------------------------------------------------- /ethcore/engines/clique/src/params.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Clique specific parameters. 18 | 19 | use ethjson; 20 | 21 | /// `Clique` params. 22 | pub struct CliqueParams { 23 | /// Period as defined in EIP 24 | pub period: u64, 25 | /// Epoch length as defined in EIP 26 | pub epoch: u64, 27 | } 28 | 29 | impl From for CliqueParams { 30 | fn from(p: ethjson::spec::CliqueParams) -> Self { 31 | let period = p.period.map_or_else(|| 30000 as u64, Into::into); 32 | let epoch = p.epoch.map_or_else(|| 15 as u64, Into::into); 33 | 34 | assert!(epoch > 0); 35 | 36 | CliqueParams { 37 | period, 38 | epoch, 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ethcore/engines/ethash/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethash PoW blockchain engine" 3 | name = "ethash-engine" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | block-reward = { path = "../../block-reward" } 11 | common-types = { path = "../../types" } 12 | engine = { path = "../../engine" } 13 | ethash= { path = "../../../ethash" } 14 | ethereum-types = "0.8.0" 15 | ethjson = { path = "../../../json" } 16 | keccak-hash = "0.4.0" 17 | log = "0.4.8" 18 | machine = { path = "../../machine" } 19 | macros = { path = "../../../util/macros" } 20 | unexpected = { path = "../../../util/unexpected" } 21 | 22 | [dev-dependencies] 23 | ethcore = { path = "../..", features = ["test-helpers"] } 24 | keccak-hash = "0.4.0" 25 | rlp = "0.4.2" 26 | spec = { path = "../../spec" } 27 | tempdir = "0.3" 28 | -------------------------------------------------------------------------------- /ethcore/engines/instant-seal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Engine that seals instantly" 3 | name = "instant-seal" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | client-traits = { path = "../../client-traits" } 11 | common-types = { path = "../../types" } 12 | engine = { path = "../../engine" } 13 | ethjson = { path = "../../../json" } 14 | ethereum-types = "0.8.0" 15 | keccak-hash = "0.4.0" 16 | machine = { path = "../../machine" } 17 | trace = { path = "../../trace" } 18 | 19 | [dev-dependencies] 20 | ethcore = { path = "../..", features = ["test-helpers"] } 21 | spec = { path = "../../spec" } 22 | rlp = "0.4.2" 23 | -------------------------------------------------------------------------------- /ethcore/engines/null-engine/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "An ethereum engine which does not provide any consensus mechanism and does not seal blocks." 3 | name = "null-engine" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | common-types = { path = "../../types" } 11 | block-reward = { path = "../../block-reward" } 12 | engine = { path = "../../engine" } 13 | ethjson = { path = "../../../json" } 14 | ethereum-types = "0.8.0" 15 | machine = { path = "../../machine" } 16 | -------------------------------------------------------------------------------- /ethcore/engines/validator-set/res/validator_report.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":false,"inputs":[{"name":"validator","type":"address"},{"name":"blockNumber","type":"uint256"},{"name":"proof","type":"bytes"}],"name":"reportMalicious","outputs":[],"payable":false,"type":"function"}, 3 | {"constant":false,"inputs":[{"name":"validator","type":"address"},{"name":"blockNumber","type":"uint256"}],"name":"reportBenign","outputs":[],"payable":false,"type":"function"} 4 | ] 5 | -------------------------------------------------------------------------------- /ethcore/engines/validator-set/res/validator_set.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":false,"inputs":[],"name":"finalizeChange","outputs":[],"payable":false,"type":"function"}, 3 | {"constant":true,"inputs":[],"name":"getValidators","outputs":[{"name":"validators","type":"address[]"}],"payable":false,"type":"function"}, 4 | {"anonymous":false,"inputs":[{"indexed":true,"name":"_parent_hash","type":"bytes32"},{"indexed":false,"name":"_new_set","type":"address[]"}],"name":"InitiateChange","type":"event"} 5 | ] 6 | -------------------------------------------------------------------------------- /ethcore/evm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Virtual Machine (EVM) Rust Implementation" 3 | name = "evm" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | bit-set = "0.4" 9 | parity-bytes = "0.1" 10 | ethereum-types = "0.8.0" 11 | parity-util-mem = "0.3.0" 12 | lazy_static = "1.0" 13 | log = "0.4" 14 | vm = { path = "../vm" } 15 | keccak-hash = "0.4.0" 16 | parking_lot = "0.9" 17 | memory-cache = { path = "../../util/memory-cache" } 18 | 19 | [dev-dependencies] 20 | rustc-hex = "1.0" 21 | criterion = "0.3" 22 | hex-literal = "0.2.0" 23 | 24 | [features] 25 | evm-debug = [] 26 | evm-debug-tests = ["evm-debug"] 27 | 28 | [[bench]] 29 | name = "basic" 30 | harness = false 31 | -------------------------------------------------------------------------------- /ethcore/executive-state/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Execute transactions producing a receipt and an optional trace." 3 | name = "executive-state" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | account-db = { path = "../account-db" } 11 | account-state = { path = "../account-state" } 12 | bytes = { package = "parity-bytes", version = "0.1.0" } 13 | common-types = { path = "../types" } 14 | ethereum-types = "0.8.0" 15 | hash-db = "0.15.0" 16 | keccak-hasher = { path = "../../util/keccak-hasher" } 17 | kvdb = "0.3.1" 18 | log = "0.4.8" 19 | machine = { path = "../machine" } 20 | trace = { path = "../trace" } 21 | trie-vm-factories = { path = "../trie-vm-factories" } 22 | vm = { path = "../vm" } 23 | 24 | [dev-dependencies] 25 | env_logger = "0.5" 26 | ethcore = { path = "..", features = ["test-helpers"] } 27 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 28 | evm = { path = "../evm" } 29 | keccak-hash = "0.4.0" 30 | pod = { path = "../pod" } 31 | rustc-hex = "1.0" 32 | spec = { path = "../spec" } 33 | trie-db = "0.18.0" 34 | ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" } 35 | -------------------------------------------------------------------------------- /ethcore/light/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | pub mod request; 18 | -------------------------------------------------------------------------------- /ethcore/machine/res/tx_acl.json: -------------------------------------------------------------------------------- 1 | [ { "constant": true, "inputs": [], "name": "contractNameHash", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "contractName", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "contractVersion", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "sender", "type": "address" }, { "name": "to", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "allowedTxTypes", "outputs": [ { "name": "", "type": "uint32" }, { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ] 2 | -------------------------------------------------------------------------------- /ethcore/machine/res/tx_acl_deprecated.json: -------------------------------------------------------------------------------- 1 | [{"constant":true,"inputs":[{"name":"sender","type":"address"}],"name":"allowedTxTypes","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] 2 | -------------------------------------------------------------------------------- /ethcore/machine/res/tx_acl_gas_price.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "contractNameHash", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "bytes32" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function" 15 | }, 16 | { 17 | "constant": true, 18 | "inputs": [], 19 | "name": "contractName", 20 | "outputs": [ 21 | { 22 | "name": "", 23 | "type": "string" 24 | } 25 | ], 26 | "payable": false, 27 | "stateMutability": "view", 28 | "type": "function" 29 | }, 30 | { 31 | "constant": true, 32 | "inputs": [], 33 | "name": "contractVersion", 34 | "outputs": [ 35 | { 36 | "name": "", 37 | "type": "uint256" 38 | } 39 | ], 40 | "payable": false, 41 | "stateMutability": "view", 42 | "type": "function" 43 | }, 44 | { 45 | "constant": true, 46 | "inputs": [ 47 | { 48 | "name": "sender", 49 | "type": "address" 50 | }, 51 | { 52 | "name": "to", 53 | "type": "address" 54 | }, 55 | { 56 | "name": "value", 57 | "type": "uint256" 58 | }, 59 | { 60 | "name": "gasPrice", 61 | "type": "uint256" 62 | }, 63 | { 64 | "name": "data", 65 | "type": "bytes" 66 | } 67 | ], 68 | "name": "allowedTxTypes", 69 | "outputs": [ 70 | { 71 | "name": "", 72 | "type": "uint32" 73 | }, 74 | { 75 | "name": "", 76 | "type": "bool" 77 | } 78 | ], 79 | "payable": false, 80 | "stateMutability": "view", 81 | "type": "function" 82 | } 83 | ] 84 | -------------------------------------------------------------------------------- /ethcore/machine/src/executed.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Transaction execution format module. 18 | 19 | use trace::{VMTrace, FlatTrace}; 20 | use common_types::{ 21 | engines::machine, 22 | errors::ExecutionError, 23 | }; 24 | 25 | /// /// Transaction execution receipt, parametrised with convenient defaults. 26 | pub type Executed = machine::Executed; 27 | 28 | /// Transaction execution result. 29 | pub type ExecutionResult = Result, ExecutionError>; 30 | -------------------------------------------------------------------------------- /ethcore/machine/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! This crate provides a state machine and the facilities needed to execute transactions and the 18 | //! code contained therein, as well as contract based transaction permissions. All ethereum 19 | //! engines embed a `Machine`. 20 | 21 | pub mod executed; 22 | pub mod executed_block; 23 | pub mod executive; 24 | pub mod externalities; 25 | pub mod machine; 26 | pub mod substate; 27 | pub mod transaction_ext; 28 | pub mod tx_filter; 29 | 30 | pub use crate::{ 31 | executed_block::ExecutedBlock, 32 | machine::Machine 33 | }; 34 | 35 | #[cfg(any(test, feature = "test-helpers"))] 36 | pub mod test_helpers; 37 | -------------------------------------------------------------------------------- /ethcore/node-filter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Smart Contract based Node Filter, Manage Permissions of Network Connections" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "node-filter" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | client-traits = { path = "../client-traits" } 11 | common-types = { path = "../types" } 12 | ethcore = { path = ".."} 13 | ethcore-network = { path = "../../util/network" } 14 | ethcore-network-devp2p = { path = "../../util/network-devp2p" } 15 | ethereum-types = "0.8.0" 16 | log = "0.4" 17 | parking_lot = "0.9" 18 | ethabi = "9.0.1" 19 | ethabi-derive = "9.0.1" 20 | ethabi-contract = "9.0.0" 21 | lru-cache = "0.1" 22 | 23 | [dev-dependencies] 24 | ethcore = { path = "..", features = ["test-helpers"] } 25 | kvdb-memorydb = "0.3.1" 26 | ethcore-io = { path = "../../util/io" } 27 | spec = { path = "../spec" } 28 | tempdir = "0.3" 29 | -------------------------------------------------------------------------------- /ethcore/node-filter/res/peer_set.json: -------------------------------------------------------------------------------- 1 | [{"constant":true,"inputs":[{"name":"sl","type":"bytes32"},{"name":"sh","type":"bytes32"},{"name":"pl","type":"bytes32"},{"name":"ph","type":"bytes32"}],"name":"connectionAllowed","outputs":[{"name":"res","type":"bool"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}] 2 | -------------------------------------------------------------------------------- /ethcore/pod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pod" 3 | description = "State/Account system expressed in Plain Old Data." 4 | authors = ["Parity Technologies "] 5 | license = "GPL-3.0" 6 | version = "0.1.0" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | common-types = { path = "../types" } 11 | ethereum-types = "0.8.0" 12 | ethjson = { path = "../../json" } 13 | ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" } 14 | hash-db = "0.15.0" 15 | itertools = "0.8" 16 | keccak-hash = "0.4.0" 17 | keccak-hasher = { path = "../../util/keccak-hasher" } 18 | kvdb = "0.3.1" 19 | log = "0.4" 20 | parity-bytes = "0.1.0" 21 | rlp = "0.4" 22 | rustc-hex = "1" 23 | serde = { version = "1.0", features = ["derive"] } 24 | trie-db = "0.18.0" 25 | triehash = { package = "triehash-ethereum", version = "0.2", path = "../../util/triehash-ethereum" } 26 | 27 | [dev-dependencies] 28 | macros = { path = "../../util/macros" } 29 | -------------------------------------------------------------------------------- /ethcore/pod/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | pub mod account; 18 | pub mod state; 19 | 20 | pub use { 21 | account::PodAccount, 22 | state::PodState, 23 | }; 24 | -------------------------------------------------------------------------------- /ethcore/private-tx/res/keys_acl.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [ 5 | { 6 | "name":"user", 7 | "type":"address" 8 | } 9 | ], 10 | "name": "availableKeys", 11 | "outputs": [ 12 | { 13 | "name": "", 14 | "type": "bytes32[]" 15 | } 16 | ], 17 | "payable": false, 18 | "stateMutability": "view", 19 | "type": "function" 20 | }, 21 | { 22 | "constant":true, 23 | "inputs": [ 24 | { 25 | "name":"user", 26 | "type":"address" 27 | }, 28 | { 29 | "name":"document", 30 | "type":"bytes32" 31 | } 32 | ], 33 | "name":"checkPermissions", 34 | "outputs": [ 35 | { 36 | "name":"", 37 | "type":"bool" 38 | } 39 | ], 40 | "payable":false, 41 | "type":"function" 42 | } 43 | ] 44 | -------------------------------------------------------------------------------- /ethcore/res/contracts/test_validator_set.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":false,"inputs":[{"name":"_validators","type":"address[]"}],"name":"setValidators","outputs":[],"payable":false,"type":"function"}, 3 | {"constant":false,"inputs":[{"name":"","type":"address"},{"name":"","type":"bytes"}],"name":"reportMalicious","outputs":[],"payable":false,"type":"function"}, 4 | {"constant":false,"inputs":[],"name":"finalizeChange","outputs":[],"payable":false,"type":"function"}, 5 | {"constant":true,"inputs":[],"name":"getValidators","outputs":[{"name":"_validators","type":"address[]"}],"payable":false,"type":"function"}, 6 | {"constant":false,"inputs":[{"name":"","type":"address"}],"name":"reportBenign","outputs":[],"payable":false,"type":"function"}, 7 | {"anonymous":false,"inputs":[{"indexed":true,"name":"_parent_hash","type":"bytes32"},{"indexed":false,"name":"_new_set","type":"address[]"}],"name":"InitiateChange","type":"event"} 8 | ] 9 | -------------------------------------------------------------------------------- /ethcore/service/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem" 3 | name = "ethcore-service" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | ansi_term = "0.11" 9 | client-traits = { path = "../client-traits" } 10 | common-types = { path = "../types" } 11 | ethcore = { path = ".." } 12 | ethcore-blockchain = { path = "../blockchain" } 13 | ethcore-io = { path = "../../util/io" } 14 | ethcore-private-tx = { path = "../private-tx" } 15 | ethcore-sync = { path = "../sync" } 16 | ethereum-types = "0.8.0" 17 | kvdb = "0.3.1" 18 | log = "0.4" 19 | snapshot = { path = "../snapshot" } 20 | spec = { path = "../spec" } 21 | trace-time = "0.1" 22 | 23 | [dev-dependencies] 24 | ethcore = { path = "..", features = ["test-helpers"] } 25 | ethcore-db = { path = "../db" } 26 | kvdb-rocksdb = "0.4.1" 27 | tempdir = "0.3" 28 | -------------------------------------------------------------------------------- /ethcore/service/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | extern crate ansi_term; 18 | extern crate common_types; 19 | extern crate client_traits; 20 | extern crate ethcore; 21 | extern crate ethcore_blockchain as blockchain; 22 | extern crate ethcore_io as io; 23 | extern crate ethcore_private_tx; 24 | extern crate ethcore_sync as sync; 25 | extern crate ethereum_types; 26 | extern crate kvdb; 27 | extern crate spec; 28 | extern crate snapshot; 29 | 30 | #[macro_use] 31 | extern crate log; 32 | #[macro_use] 33 | extern crate trace_time; 34 | 35 | #[cfg(test)] 36 | extern crate ethcore_db; 37 | #[cfg(test)] 38 | extern crate tempdir; 39 | 40 | mod service; 41 | 42 | #[cfg(test)] 43 | extern crate kvdb_rocksdb; 44 | 45 | pub use service::{ClientService, PrivateTxService}; 46 | -------------------------------------------------------------------------------- /ethcore/snapshot/benches/state-chunk-5279-0x2032dfb6ad93f1928dac70627a8767d2232568a1a7bf1c91ea416988000f8275.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/snapshot/benches/state-chunk-5279-0x2032dfb6ad93f1928dac70627a8767d2232568a1a7bf1c91ea416988000f8275.rlp -------------------------------------------------------------------------------- /ethcore/snapshot/benches/state-chunk-5905-0x104ff12a3fda9e0cb1aeef41fe7092982134eb116292c0eec725c32a815ef0ea.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/snapshot/benches/state-chunk-5905-0x104ff12a3fda9e0cb1aeef41fe7092982134eb116292c0eec725c32a815ef0ea.rlp -------------------------------------------------------------------------------- /ethcore/snapshot/benches/state-chunk-6341-0x3042ea62f982fd0cea02847ff0fd103a0beef3bb19389f5e77113c3ea355f803.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/snapshot/benches/state-chunk-6341-0x3042ea62f982fd0cea02847ff0fd103a0beef3bb19389f5e77113c3ea355f803.rlp -------------------------------------------------------------------------------- /ethcore/snapshot/benches/state-chunk-6720-0x2075481dccdc2c4419112bfea2d09219a7223614656722a1a05a930baf2b0dd7.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/snapshot/benches/state-chunk-6720-0x2075481dccdc2c4419112bfea2d09219a7223614656722a1a05a930baf2b0dd7.rlp -------------------------------------------------------------------------------- /ethcore/snapshot/benches/state-chunk-6933-0x104102770901b53230e78cfc8f6edce282eb21bfa00aa1c3543c79cb3402cf2d.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/snapshot/benches/state-chunk-6933-0x104102770901b53230e78cfc8f6edce282eb21bfa00aa1c3543c79cb3402cf2d.rlp -------------------------------------------------------------------------------- /ethcore/snapshot/snapshot-tests/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Snapshot tests. 18 | 19 | #![cfg(test)] 20 | 21 | mod abridged_block; 22 | mod account; 23 | mod io; 24 | mod proof_of_work; 25 | mod proof_of_authority; 26 | mod state; 27 | mod service; 28 | mod watcher; 29 | 30 | mod helpers; 31 | 32 | #[test] 33 | fn manifest_rlp() { 34 | use common_types::snapshot::ManifestData; 35 | let manifest = ManifestData { 36 | version: 2, 37 | block_hashes: Vec::new(), 38 | state_hashes: Vec::new(), 39 | block_number: 1234567, 40 | state_root: Default::default(), 41 | block_hash: Default::default(), 42 | }; 43 | let raw = manifest.clone().into_rlp(); 44 | assert_eq!(ManifestData::from_rlp(&raw).unwrap(), manifest); 45 | } 46 | -------------------------------------------------------------------------------- /ethcore/spec/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethereum engine specification" 3 | name = "spec" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | account-state = { path = "../account-state" } 11 | authority-round = { path = "../engines/authority-round" } 12 | basic-authority = { path = "../engines/basic-authority" } 13 | builtin = { package = "ethcore-builtin", path = "../builtin" } 14 | bytes = { package = "parity-bytes", version = "0.1.0" } 15 | clique = { path = "../engines/clique" } 16 | common-types = { path = "../types" } 17 | engine = { path = "../engine" } 18 | ethash = { path = "../../ethash" } 19 | ethash-engine = { path = "../engines/ethash" } 20 | ethereum-types = "0.8.0" 21 | ethjson = { path = "../../json" } 22 | evm = { path = "../evm" } 23 | executive-state = { path = "../executive-state" } 24 | hash-db = "0.15.0" 25 | instant-seal = { path = "../engines/instant-seal" } 26 | journaldb = { path = "../../util/journaldb" } 27 | keccak-hash = "0.4.0" 28 | kvdb-memorydb = "0.3.1" 29 | log = "0.4.8" 30 | machine = { path = "../machine" } 31 | null-engine = { path = "../engines/null-engine" } 32 | pod = { path = "../pod" } 33 | rlp = "0.4.2" 34 | trace = { path = "../trace" } 35 | trie-vm-factories = { path = "../trie-vm-factories" } 36 | vm = { path = "../vm" } 37 | 38 | [dev-dependencies] 39 | ethcore = { path = "..", features = ["test-helpers"] } 40 | env_logger = "0.5" 41 | tempdir = "0.3.7" 42 | -------------------------------------------------------------------------------- /ethcore/spec/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Blockchain params. 18 | 19 | mod chain; 20 | mod genesis; 21 | mod seal; 22 | mod spec; 23 | 24 | pub use self::chain::*; 25 | pub use self::genesis::Genesis; 26 | pub use self::spec::{Spec, SpecHardcodedSync, SpecParams}; 27 | -------------------------------------------------------------------------------- /ethcore/src/client/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Blockchain database client. 18 | 19 | mod ancient_import; 20 | mod bad_blocks; 21 | mod client; 22 | mod config; 23 | mod traits; 24 | 25 | pub use self::client::Client; 26 | pub use self::config::{ClientConfig, DatabaseCompactionProfile}; 27 | pub use self::traits::{ 28 | ReopenBlock, PrepareOpenBlock, ImportSealedBlock, BroadcastProposalBlock, 29 | Call, EngineInfo, BlockProducer, SealedBlockImporter, 30 | }; 31 | -------------------------------------------------------------------------------- /ethcore/src/json_tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Helpers and tests for operating on jsontests. 18 | 19 | #[macro_use] 20 | mod test_common; 21 | 22 | mod transaction; 23 | mod executive; 24 | mod state; 25 | mod chain; 26 | mod trie; 27 | mod skip; 28 | 29 | #[cfg(test)] 30 | mod difficulty; 31 | 32 | pub use self::test_common::HookType; 33 | pub use self::executive::run_test_path as run_executive_test_path; 34 | pub use self::executive::run_test_file as run_executive_test_file; 35 | 36 | use self::skip::SKIP_TESTS; 37 | -------------------------------------------------------------------------------- /ethcore/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | mod client; 18 | mod blockchain; 19 | mod evm; 20 | mod trace; 21 | -------------------------------------------------------------------------------- /ethcore/state-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "state-db" 3 | description = "State database" 4 | authors = ["Parity Technologies "] 5 | license = "GPL-3.0" 6 | version = "0.1.0" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | account-state = { path = "../account-state" } 11 | bloom_journal = { package = "ethcore-bloom-journal", path = "../../util/bloom" } 12 | common-types = { path = "../types"} 13 | ethcore-db = { path = "../db" } 14 | ethereum-types = "0.8.0" 15 | hash-db = "0.15.0" 16 | keccak-hash = "0.4.0" 17 | keccak-hasher = { path = "../../util/keccak-hasher" } 18 | journaldb = { path = "../../util/journaldb" } 19 | kvdb = "0.3.1" 20 | log = "0.4.6" 21 | lru-cache = "0.1.2" 22 | memory-cache = { path = "../../util/memory-cache" } 23 | parking_lot = "0.9" 24 | 25 | [dev-dependencies] 26 | env_logger = "0.5" 27 | # Used for test helpers 28 | ethcore = { path = "..", features = ["test-helpers"] } 29 | -------------------------------------------------------------------------------- /ethcore/sync/src/res/private_spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PrivateTransactions", 3 | "engine": { 4 | "instantSeal": { 5 | "params": {} 6 | } 7 | }, 8 | "params": { 9 | "gasLimitBoundDivisor": "0x0400", 10 | "accountStartNonce": "0x0", 11 | "maximumExtraDataSize": "0x20", 12 | "minGasLimit": "0x1388", 13 | "networkID" : "0x11" 14 | }, 15 | "genesis": { 16 | "seal": { 17 | "generic": "0x0" 18 | }, 19 | "difficulty": "0x20000", 20 | "author": "0x0000000000000000000000000000000000000000", 21 | "timestamp": "0x00", 22 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 23 | "extraData": "0x", 24 | "gasLimit": "0x989680" 25 | }, 26 | "accounts": { 27 | "0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, 28 | "0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, 29 | "0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, 30 | "0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ethcore/sync/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | pub mod helpers; 18 | pub mod snapshot; 19 | mod chain; 20 | mod consensus; 21 | mod private; 22 | 23 | #[cfg(feature = "ipc")] 24 | mod rpc; 25 | -------------------------------------------------------------------------------- /ethcore/sync/src/tests/rpc.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | use super::super::NetworkConfiguration; 18 | use network::NetworkConfiguration as BasicNetworkConfiguration; 19 | use std::convert::From; 20 | use ipc::binary::{serialize, deserialize}; 21 | 22 | #[test] 23 | fn network_settings_serialize() { 24 | let net_cfg = NetworkConfiguration::from(BasicNetworkConfiguration::new_local()); 25 | let serialized = serialize(&net_cfg).unwrap(); 26 | let deserialized = deserialize::(&serialized).unwrap(); 27 | 28 | assert_eq!(net_cfg.udp_port, deserialized.udp_port); 29 | } 30 | -------------------------------------------------------------------------------- /ethcore/trace/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "trace" 3 | description = "Transaction tracing" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | license = "GPL-3.0" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | ethcore-blockchain = { path = "../blockchain" } 11 | ethcore-db = { path = "../db" } 12 | ethereum-types = "0.8.0" 13 | evm = { path = "../evm" } 14 | kvdb = "0.3.1" 15 | log = "0.4" 16 | parity-bytes = "0.1.0" 17 | parity-util-mem = "0.3.0" 18 | parking_lot = "0.9" 19 | rlp = "0.4.0" 20 | rlp_derive = { path = "../../util/rlp-derive" } 21 | vm = { path = "../vm" } 22 | 23 | [dev-dependencies] 24 | # Used for test helpers 25 | ethcore = { path = "..", features = ["test-helpers"] } 26 | -------------------------------------------------------------------------------- /ethcore/trace/src/config.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Traces config. 18 | 19 | /// Traces config. 20 | #[derive(Debug, PartialEq, Clone)] 21 | pub struct Config { 22 | /// Indicates if tracing should be enabled or not. 23 | /// If it's None, it will be automatically configured. 24 | pub enabled: bool, 25 | /// Preferred cache-size. 26 | pub pref_cache_size: usize, 27 | /// Max cache-size. 28 | pub max_cache_size: usize, 29 | } 30 | 31 | impl Default for Config { 32 | fn default() -> Self { 33 | Config { 34 | enabled: false, 35 | pref_cache_size: 15 * 1024 * 1024, 36 | max_cache_size: 20 * 1024 * 1024, 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ethcore/trace/src/import.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Traces import request. 18 | use ethereum_types::H256; 19 | 20 | use crate::{FlatBlockTraces, BlockNumber}; 21 | 22 | /// Traces import request. 23 | pub struct ImportRequest { 24 | /// Traces to import. 25 | pub traces: FlatBlockTraces, 26 | /// Hash of traces block. 27 | pub block_hash: H256, 28 | /// Number of traces block. 29 | pub block_number: BlockNumber, 30 | /// Blocks enacted by this import. 31 | /// 32 | /// They should be ordered from oldest to newest. 33 | pub enacted: Vec, 34 | /// Number of blocks retracted by this import. 35 | pub retracted: usize, 36 | } 37 | -------------------------------------------------------------------------------- /ethcore/trie-vm-factories/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Collection of factories for VM and Tries" 3 | name = "trie-vm-factories" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [dependencies] 9 | trie-db = "0.18.0" 10 | ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" } 11 | account-db = { path = "../account-db" } 12 | evm = { path = "../evm" } 13 | vm = { path = "../vm" } 14 | wasm = { path = "../wasm" } 15 | keccak-hasher = { path = "../../util/keccak-hasher" } 16 | -------------------------------------------------------------------------------- /ethcore/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Common Types" 3 | name = "common-types" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | derive_more = "0.15.0" 9 | ethbloom = "0.8.0" 10 | ethcore-io = { path = "../../util/io" } 11 | ethereum-types = "0.8.0" 12 | ethjson = { path = "../../json" } 13 | keccak-hash = "0.4.0" 14 | parity-bytes = "0.1" 15 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 16 | parity-util-mem = "0.3.0" 17 | parity-snappy = "0.1" 18 | patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } 19 | rlp = "0.4.0" 20 | rlp_derive = { path = "../../util/rlp-derive" } 21 | unexpected = { path = "../../util/unexpected" } 22 | vm = { path = "../vm"} 23 | 24 | [dev-dependencies] 25 | rustc-hex = "2.0" 26 | 27 | [features] 28 | test-helpers = [] 29 | -------------------------------------------------------------------------------- /ethcore/types/src/ancestry_action.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Actions on ancestry blocks when working on a new block. 18 | 19 | use ethereum_types::H256; 20 | 21 | #[derive(Debug, PartialEq, Eq, Clone)] 22 | /// Actions on a live block's parent block. Only committed when the live block is committed. Those actions here must 23 | /// respect the normal blockchain reorganization rules. 24 | pub enum AncestryAction { 25 | /// Mark an ancestry block as finalized. 26 | MarkFinalized(H256), 27 | } 28 | -------------------------------------------------------------------------------- /ethcore/types/src/block_status.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! General block status 18 | 19 | /// General block status 20 | #[derive(Debug, Eq, PartialEq)] 21 | pub enum BlockStatus { 22 | /// Part of the blockchain. 23 | InChain, 24 | /// Queued for import. 25 | Queued, 26 | /// Known as bad. 27 | Bad, 28 | /// Unknown. 29 | Unknown, 30 | } 31 | -------------------------------------------------------------------------------- /ethcore/types/src/call_analytics.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Call analytics related types 18 | 19 | /// Options concerning what analytics we run on the call. 20 | #[derive(Eq, PartialEq, Default, Clone, Copy, Debug)] 21 | pub struct CallAnalytics { 22 | /// Make a transaction trace. 23 | pub transaction_tracing: bool, 24 | /// Make a VM trace. 25 | pub vm_tracing: bool, 26 | /// Make a diff. 27 | pub state_diffing: bool, 28 | } 29 | -------------------------------------------------------------------------------- /ethcore/types/src/data_format.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Data format for importing/exporting blocks from disk 18 | use std::str::FromStr; 19 | 20 | /// Format for importing/exporting blocks 21 | #[derive(Debug, PartialEq)] 22 | pub enum DataFormat { 23 | /// Hexadecimal format 24 | Hex, 25 | /// Binary format 26 | Binary, 27 | } 28 | 29 | impl Default for DataFormat { 30 | fn default() -> Self { 31 | DataFormat::Binary 32 | } 33 | } 34 | 35 | impl FromStr for DataFormat { 36 | type Err = String; 37 | 38 | fn from_str(s: &str) -> Result { 39 | match s { 40 | "binary" | "bin" => Ok(DataFormat::Binary), 41 | "hex" => Ok(DataFormat::Hex), 42 | x => Err(format!("Invalid format: {}", x)) 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ethcore/types/src/errors/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! General error types for use in parity-ethereum. 18 | 19 | mod block_error; 20 | mod engine_error; 21 | mod ethcore_error; 22 | mod snapshot_error; 23 | 24 | pub use self::{ 25 | block_error::{BlockError, ImportError}, 26 | engine_error::EngineError, 27 | ethcore_error::{EthcoreError, ExecutionError, EthcoreResult}, 28 | snapshot_error::SnapshotError, 29 | }; 30 | -------------------------------------------------------------------------------- /ethcore/types/src/pruning_info.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Information about portions of the state and chain which the client may serve. 18 | //! 19 | //! Currently assumes that a client will store everything past a certain point 20 | //! or everything. Will be extended in the future to support a definition 21 | //! of which portions of the ancient chain and current state trie are stored as well. 22 | 23 | /// Client pruning info. See module-level docs for more details. 24 | #[derive(Debug, Clone)] 25 | pub struct PruningInfo { 26 | /// The first block which everything can be served after. 27 | pub earliest_chain: u64, 28 | /// The first block where state requests may be served. 29 | pub earliest_state: u64, 30 | } 31 | -------------------------------------------------------------------------------- /ethcore/types/src/state_diff.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! State diff module. 18 | 19 | use std::collections::BTreeMap; 20 | use account_diff::AccountDiff; 21 | use ethereum_types::Address; 22 | 23 | /// Expression for the delta between two system states. Encoded the 24 | /// delta of every altered account. 25 | #[derive(Debug, PartialEq, Eq, Clone)] 26 | pub struct StateDiff { 27 | /// Raw diff key-value 28 | pub raw: BTreeMap 29 | } 30 | -------------------------------------------------------------------------------- /ethcore/types/src/trace_filter.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Trace filter related types 18 | 19 | use std::ops::Range; 20 | use ethereum_types::Address; 21 | use ids::BlockId; 22 | 23 | /// Easy to use trace filter. 24 | pub struct Filter { 25 | /// Range of filtering. 26 | pub range: Range, 27 | /// From address. 28 | pub from_address: Vec
, 29 | /// To address. 30 | pub to_address: Vec
, 31 | /// Output offset 32 | pub after: Option, 33 | /// Output amount 34 | pub count: Option, 35 | } 36 | -------------------------------------------------------------------------------- /ethcore/types/src/transaction/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Ethereum Transactions 18 | 19 | mod error; 20 | mod transaction; 21 | 22 | pub use self::error::{Error, CallError}; 23 | pub use self::transaction::*; 24 | -------------------------------------------------------------------------------- /ethcore/types/src/tree_route.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Tree route info type definition 18 | 19 | use ethereum_types::H256; 20 | 21 | /// Represents a tree route between `from` block and `to` block: 22 | #[derive(Debug)] 23 | pub struct TreeRoute { 24 | /// A vector of hashes of all blocks, ordered from `from` to `to`. 25 | pub blocks: Vec, 26 | /// Best common ancestor of these blocks. 27 | pub ancestor: H256, 28 | /// An index where best common ancestor would be. 29 | pub index: usize, 30 | /// Whether it has finalized blocks from `from` (inclusive) to `ancestor` (exclusive). 31 | pub is_from_route_finalized: bool, 32 | } 33 | -------------------------------------------------------------------------------- /ethcore/types/src/views/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Block oriented views onto rlp. 18 | 19 | #[macro_use] 20 | mod view_rlp; 21 | mod block; 22 | mod body; 23 | mod header; 24 | mod transaction; 25 | 26 | pub use self::view_rlp::ViewRlp; 27 | pub use self::block::BlockView; 28 | pub use self::body::BodyView; 29 | pub use self::header::HeaderView; 30 | pub use self::transaction::TransactionView; 31 | 32 | #[cfg(test)] 33 | mod tests { 34 | use super::HeaderView; 35 | 36 | #[test] 37 | #[should_panic] 38 | fn should_include_file_line_number_in_panic_for_invalid_rlp() { 39 | let _ = view!(HeaderView, &[]).parent_hash(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ethcore/verification/benches/8447675.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/verification/benches/8447675.rlp -------------------------------------------------------------------------------- /ethcore/verification/benches/8481474-parent-to-uncle.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/verification/benches/8481474-parent-to-uncle.rlp -------------------------------------------------------------------------------- /ethcore/verification/benches/8481475.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/verification/benches/8481475.rlp -------------------------------------------------------------------------------- /ethcore/verification/benches/8481476-one-uncle.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/verification/benches/8481476-one-uncle.rlp -------------------------------------------------------------------------------- /ethcore/vm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Virtual Machines (VM) Support Library" 3 | name = "vm" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | parity-bytes = "0.1" 9 | ethereum-types = "0.8.0" 10 | patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } 11 | ethjson = { path = "../../json" } 12 | rlp = "0.4.0" 13 | keccak-hash = "0.4.0" 14 | -------------------------------------------------------------------------------- /ethcore/wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "WASM Interpreter" 3 | name = "wasm" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | byteorder = "1.0" 9 | ethereum-types = "0.8.0" 10 | log = "0.4" 11 | parity-wasm = "0.31" 12 | libc = "0.2" 13 | pwasm-utils = "0.6.1" 14 | vm = { path = "../vm" } 15 | wasmi = "0.3.0" 16 | 17 | [dev-dependencies] 18 | env_logger = "0.5" 19 | -------------------------------------------------------------------------------- /ethcore/wasm/run/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity WASM Test Run" 3 | name = "pwasm-run-test" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | serde = "1" 9 | serde_json = "1" 10 | serde_derive = "1" 11 | ethereum-types = "0.8.0" 12 | ethjson = { path = "../../../json" } 13 | vm = { path = "../../vm" } 14 | wasm = { path = "../" } 15 | clap = "2.24" 16 | env_logger = "0.5" 17 | rustc-hex = "1" 18 | 19 | [features] 20 | default = ["ethereum-types/std"] 21 | -------------------------------------------------------------------------------- /ethcore/wasm/run/res/sample1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/wasm/run/res/sample1.wasm -------------------------------------------------------------------------------- /ethcore/wasm/run/res/sample2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/wasm/run/res/sample2.wasm -------------------------------------------------------------------------------- /ethcore/wasm/run/res/sample3.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/ethcore/wasm/run/res/sample3.wasm -------------------------------------------------------------------------------- /evmbin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity EVM Implementation" 3 | name = "evmbin" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [[bin]] 9 | name = "parity-evm" 10 | path = "./src/main.rs" 11 | 12 | [dependencies] 13 | account-state = { path = "../ethcore/account-state" } 14 | common-types = { path = "../ethcore/types", features = ["test-helpers"] } 15 | docopt = "1.0" 16 | env_logger = "0.5" 17 | ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests"] } 18 | ethereum-types = "0.8.0" 19 | ethjson = { path = "../json", features = ["test-helpers"] } 20 | evm = { path = "../ethcore/evm" } 21 | panic_hook = { path = "../util/panic-hook" } 22 | parity-bytes = "0.1" 23 | pod = { path = "../ethcore/pod" } 24 | rustc-hex = "1.0" 25 | serde = { version = "1.0", features = ["derive"] } 26 | serde_json = "1.0" 27 | spec = { path = "../ethcore/spec" } 28 | trace = { path = "../ethcore/trace" } 29 | vm = { path = "../ethcore/vm" } 30 | 31 | [dev-dependencies] 32 | criterion = "0.3" 33 | tempdir = "0.3" 34 | 35 | [features] 36 | evm-debug = ["ethcore/evm-debug-tests"] 37 | 38 | [[bench]] 39 | name = "mod" 40 | harness = false 41 | -------------------------------------------------------------------------------- /evmbin/res/testchain.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lab", 3 | "engine": { 4 | "Ethash": { 5 | "params": { 6 | "minimumDifficulty": "0x1", 7 | "difficultyBoundDivisor": "0x800" 8 | } 9 | } 10 | }, 11 | "accounts": { 12 | "0000000000000000000000000000000000000020": { 13 | "nonce": "0x0", 14 | "balance": "0x64", 15 | "code": "0x62aaaaaa60aa60aa5060aa60aa60aa60aa60aa60aa" 16 | } 17 | }, 18 | "params":{ 19 | "networkID": "0x42", 20 | "maximumExtraDataSize": "0x20", 21 | "minGasLimit": "0x1", 22 | "gasLimitBoundDivisor": "0x400" 23 | }, 24 | "genesis": { 25 | "gasLimit": "0x8000000", 26 | "seal": { 27 | "ethereum": { 28 | "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 29 | "nonce": "0x0000000000000042" 30 | } 31 | }, 32 | "difficulty": "0x400", 33 | "extraData": "0x0", 34 | "author": "0x3333333333333333333333333333333333333333", 35 | "timestamp": "0x0", 36 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /evmbin/src/display/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! EVM output display utils. 18 | 19 | use std::time::Duration; 20 | 21 | pub mod json; 22 | pub mod std_json; 23 | pub mod simple; 24 | 25 | /// Formats duration into human readable format. 26 | pub fn format_time(time: &Duration) -> String { 27 | format!("{}.{:09}s", time.as_secs(), time.subsec_nanos()) 28 | } 29 | 30 | /// Formats the time as microseconds. 31 | pub fn as_micros(time: &Duration) -> u64 { 32 | time.as_secs() * 1_000_000 + time.subsec_nanos() as u64 / 1_000 33 | } 34 | -------------------------------------------------------------------------------- /ipfs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum IPFS-compatible API" 3 | name = "parity-ipfs-api" 4 | version = "1.12.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | edition = "2018" 8 | 9 | [dependencies] 10 | client-traits = { path = "../ethcore/client-traits" } 11 | common-types = { path = "../ethcore/types" } 12 | bytes = { package = "parity-bytes", version = "0.1"} 13 | ethereum-types = "0.8.0" 14 | jsonrpc-core = "14.0.3" 15 | http = { package = "jsonrpc-http-server", version = "14.0.3"} 16 | rlp = "0.4.0" 17 | cid = "0.3" 18 | multihash = "0.8" 19 | unicase = "2.0" 20 | 21 | [dev-dependencies] 22 | ethcore = { path = "../ethcore", features = ["test-helpers"] } 23 | -------------------------------------------------------------------------------- /json/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum JSON Deserialization" 3 | name = "ethjson" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [dependencies] 9 | ethereum-types = "0.8.0" 10 | rustc-hex = "1.0" 11 | serde = { version = "1.0", features = ["derive"] } 12 | serde_json = "1.0" 13 | 14 | [dev-dependencies] 15 | macros = { path = "../util/macros" } 16 | 17 | [features] 18 | test-helpers = [] 19 | -------------------------------------------------------------------------------- /json/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! JSON deserialization library 18 | 19 | #![warn(missing_docs)] 20 | 21 | pub mod bytes; 22 | pub mod hash; 23 | pub mod maybe; 24 | pub mod spec; 25 | pub mod uint; 26 | pub mod vm; 27 | pub mod transaction; 28 | pub mod state; 29 | 30 | #[cfg(any(test, feature = "test-helpers"))] 31 | pub mod test_helpers; 32 | -------------------------------------------------------------------------------- /json/src/spec/instant_seal.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Instant seal engine params deserialization. 18 | 19 | use serde::Deserialize; 20 | 21 | /// Instant seal engine params deserialization. 22 | #[derive(Debug, PartialEq, Deserialize)] 23 | #[serde(deny_unknown_fields)] 24 | #[serde(rename_all = "camelCase")] 25 | pub struct InstantSealParams { 26 | /// Whether to enable millisecond timestamp. 27 | #[serde(default)] 28 | pub millisecond_timestamp: bool, 29 | } 30 | 31 | /// Instant seal engine descriptor. 32 | #[derive(Debug, PartialEq, Deserialize)] 33 | #[serde(deny_unknown_fields)] 34 | pub struct InstantSeal { 35 | /// Instant seal parameters. 36 | pub params: InstantSealParams, 37 | } 38 | -------------------------------------------------------------------------------- /json/src/spec/step_duration.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity. 3 | 4 | // Parity is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity. If not, see . 16 | 17 | //! Step duration configuration parameter 18 | 19 | use std::collections::BTreeMap; 20 | 21 | use serde::Deserialize; 22 | 23 | use crate::uint::Uint; 24 | 25 | /// Step duration can be specified either as a `Uint` (in seconds), in which case it will be 26 | /// constant, or as a list of pairs consisting of a timestamp of type `Uint` and a duration, in 27 | /// which case the duration of a step will be determined by a mapping arising from that list. 28 | #[derive(Debug, PartialEq, Deserialize)] 29 | #[serde(deny_unknown_fields)] 30 | #[serde(untagged)] 31 | pub enum StepDuration { 32 | /// Duration of all steps. 33 | Single(Uint), 34 | /// Step duration transitions: a mapping of timestamp to step durations. 35 | Transitions(BTreeMap), 36 | } 37 | -------------------------------------------------------------------------------- /json/src/test_helpers/difficulty.rs: -------------------------------------------------------------------------------- 1 | use crate::{hash::H256, uint::Uint}; 2 | use serde::Deserialize; 3 | 4 | /// Blockchain test header deserializer. 5 | #[derive(Debug, PartialEq, Deserialize)] 6 | #[serde(rename_all = "camelCase")] 7 | pub struct DifficultyTestCase { 8 | /// Parent timestamp. 9 | pub parent_timestamp: Uint, 10 | /// Parent difficulty. 11 | pub parent_difficulty: Uint, 12 | /// Parent uncle hash. 13 | pub parent_uncles: H256, 14 | /// Current timestamp. 15 | pub current_timestamp: Uint, 16 | /// Current difficulty. 17 | pub current_difficulty: Uint, 18 | /// Current block number. 19 | pub current_block_number: Uint, 20 | } 21 | 22 | /// Type for running `Difficulty` tests 23 | pub type DifficultyTest = super::tester::GenericTester; 24 | -------------------------------------------------------------------------------- /json/src/test_helpers/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Test structures for JSON deserialization. 18 | 19 | /// Blockchain test helpers 20 | pub mod blockchain; 21 | /// Difficulty test helpers 22 | pub mod difficulty; 23 | /// Tests to skip helpers 24 | pub mod skip; 25 | /// State test helpers 26 | pub mod state; 27 | /// Test primitives 28 | pub mod tester; 29 | /// Transaction test helpers 30 | pub mod transaction; 31 | /// Trie test helpers 32 | pub mod trie; 33 | /// Vm test helpers 34 | pub mod vm { 35 | /// Type for running `vm` tests 36 | pub type Test = super::tester::GenericTester; 37 | } 38 | -------------------------------------------------------------------------------- /json/src/test_helpers/skip.rs: -------------------------------------------------------------------------------- 1 | use std::collections::BTreeMap; 2 | use serde::Deserialize; 3 | 4 | /// Test to skip (only if issue ongoing) 5 | #[derive(Debug, PartialEq, Deserialize)] 6 | pub struct SkipTests { 7 | /// Block tests 8 | pub block: Vec, 9 | /// State tests 10 | pub state: Vec, 11 | 12 | } 13 | 14 | /// Block test to skip. 15 | #[derive(Debug, PartialEq, Deserialize)] 16 | pub struct SkipBlockchainTest { 17 | /// Issue reference. 18 | pub reference: String, 19 | /// Test failing name. 20 | pub failing: String, 21 | /// Items failing for the test. 22 | pub subtests: Vec, 23 | } 24 | 25 | /// State test to skip. 26 | #[derive(Debug, PartialEq, Deserialize)] 27 | pub struct SkipStateTest { 28 | /// Issue reference. 29 | pub reference: String, 30 | /// Test failing name. 31 | pub failing: String, 32 | /// Items failing for the test. 33 | pub subtests: BTreeMap 34 | } 35 | 36 | /// State subtest to skip. 37 | #[derive(Debug, PartialEq, Deserialize)] 38 | pub struct StateSkipSubStates { 39 | /// State test number of this item. Or '*' for all state. 40 | pub subnumbers: Vec, 41 | /// Chain for this items. 42 | pub chain: String, 43 | } 44 | 45 | impl SkipTests { 46 | /// Empty skip states. 47 | pub fn empty() -> Self { 48 | SkipTests { 49 | block: Vec::new(), 50 | state: Vec::new(), 51 | } 52 | } 53 | 54 | /// Loads test from json. 55 | pub fn load(reader: R) -> Result where R: std::io::Read { 56 | serde_json::from_reader(reader) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /json/src/test_helpers/tester.rs: -------------------------------------------------------------------------------- 1 | use std::collections::BTreeMap; 2 | use serde::Deserialize; 3 | use serde::de::DeserializeOwned; 4 | 5 | /// A genric wrapper over a `BTreeMap` for tests 6 | #[derive(Deserialize)] 7 | pub struct GenericTester(BTreeMap); 8 | 9 | impl IntoIterator for GenericTester { 10 | type Item = as IntoIterator>::Item; 11 | type IntoIter = as IntoIterator>::IntoIter; 12 | 13 | fn into_iter(self) -> Self::IntoIter { 14 | self.0.into_iter() 15 | } 16 | } 17 | 18 | impl GenericTester 19 | where 20 | T: DeserializeOwned + Ord, 21 | U: DeserializeOwned 22 | { 23 | /// Loads test from json. 24 | pub fn load(reader: R) -> Result where R: std::io::Read { 25 | serde_json::from_reader(reader) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /json/src/test_helpers/trie/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Trie test deserialization. 18 | 19 | mod input; 20 | 21 | pub use self::input::Input; 22 | 23 | /// Type used by `trie` tests 24 | pub type Test = super::tester::GenericTester; 25 | 26 | use serde::Deserialize; 27 | use crate::hash::H256; 28 | 29 | /// Trie test deserialization. 30 | #[derive(Debug, Deserialize, PartialEq)] 31 | pub struct Trie { 32 | /// Trie test input. 33 | #[serde(rename = "in")] 34 | pub input: Input, 35 | /// Trie root hash. 36 | pub root: H256, 37 | } 38 | -------------------------------------------------------------------------------- /license_header: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | -------------------------------------------------------------------------------- /miner/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Miner Interface." 3 | name = "ethcore-miner" 4 | homepage = "http://parity.io" 5 | license = "GPL-3.0" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | # Only work_notify, consider a separate crate 11 | ethash = { path = "../ethash", optional = true } 12 | fetch = { path = "../util/fetch", optional = true } 13 | hyper = { version = "0.12", optional = true } 14 | url = { version = "2", optional = true } 15 | 16 | # Miner 17 | ansi_term = "0.11" 18 | common-types = { path = "../ethcore/types" } 19 | ethabi = "9.0.1" 20 | ethabi-derive = "9.0.1" 21 | ethabi-contract = "9.0.0" 22 | ethcore-call-contract = { path = "../ethcore/call-contract" } 23 | ethereum-types = "0.8.0" 24 | futures = "0.1" 25 | parity-util-mem = "0.3.0" 26 | keccak-hash = "0.4.0" 27 | linked-hash-map = "0.5" 28 | log = "0.4" 29 | parity-runtime = { path = "../util/runtime" } 30 | parking_lot = "0.9" 31 | price-info = { path = "./price-info", optional = true } 32 | registrar = { path = "../util/registrar" } 33 | rlp = "0.4.0" 34 | serde = "1.0" 35 | serde_derive = "1.0" 36 | serde_json = "1.0" 37 | trace-time = "0.1" 38 | transaction-pool = "2.0.1" 39 | 40 | [dev-dependencies] 41 | env_logger = "0.5" 42 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 43 | rustc-hex = "1.0" 44 | 45 | [features] 46 | work-notify = ["ethash", "fetch", "hyper", "url"] 47 | -------------------------------------------------------------------------------- /miner/local-store/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "parity-local-store" 3 | description = "Manages persistent local node data." 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [dependencies] 9 | common-types = { path = "../../ethcore/types" } 10 | ethcore-io = { path = "../../util/io" } 11 | kvdb = "0.3.1" 12 | log = "0.4" 13 | rlp = "0.4.0" 14 | serde = "1.0" 15 | serde_derive = "1.0" 16 | serde_json = "1.0" 17 | 18 | [dev-dependencies] 19 | ethkey = { path = "../../accounts/ethkey" } 20 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 21 | kvdb-memorydb = "0.3.1" 22 | -------------------------------------------------------------------------------- /miner/price-info/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Fetch current ETH price" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "price-info" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | 10 | [dependencies] 11 | fetch = { path = "../../util/fetch" } 12 | futures = "0.1" 13 | log = "0.4" 14 | parity-runtime = { path = "../../util/runtime" } 15 | serde_json = "1.0" 16 | 17 | [dev-dependencies] 18 | fake-fetch = { path = "../../util/fake-fetch" } 19 | -------------------------------------------------------------------------------- /miner/res/contracts/service_transaction.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"}, 3 | {"constant":false,"inputs":[{"name":"_who","type":"address"}],"name":"certify","outputs":[],"payable":false,"type":"function"}, 4 | {"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_field","type":"string"}],"name":"getAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}, 5 | {"constant":false,"inputs":[{"name":"_who","type":"address"}],"name":"revoke","outputs":[],"payable":false,"type":"function"}, 6 | {"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}, 7 | {"constant":true,"inputs":[],"name":"delegate","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}, 8 | {"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_field","type":"string"}],"name":"getUint","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"}, 9 | {"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setDelegate","outputs":[],"payable":false,"type":"function"}, 10 | {"constant":true,"inputs":[{"name":"_who","type":"address"}],"name":"certified","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"}, 11 | {"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_field","type":"string"}],"name":"get","outputs":[{"name":"","type":"bytes32"}],"payable":false,"type":"function"} 12 | ] 13 | -------------------------------------------------------------------------------- /miner/src/local_accounts.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Local Accounts checker 18 | 19 | use std::collections::HashSet; 20 | 21 | use ethereum_types::Address; 22 | 23 | /// Local accounts checker 24 | pub trait LocalAccounts: Send + Sync { 25 | /// Returns true if given address should be considered local account. 26 | fn is_local(&self, &Address) -> bool; 27 | } 28 | 29 | impl LocalAccounts for HashSet
{ 30 | fn is_local(&self, address: &Address) -> bool { 31 | self.contains(address) 32 | } 33 | } 34 | 35 | impl LocalAccounts for (A, B) where 36 | A: LocalAccounts, 37 | B: LocalAccounts, 38 | { 39 | fn is_local(&self, address: &Address) -> bool { 40 | self.0.is_local(address) || self.1.is_local(address) 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /miner/stratum/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethcore stratum lib" 3 | name = "ethcore-stratum" 4 | version = "1.12.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | ethereum-types = "0.8.0" 10 | keccak-hash = "0.4.0" 11 | jsonrpc-core = "14.0.3" 12 | jsonrpc-tcp-server = "14.0.3" 13 | log = "0.4" 14 | parking_lot = "0.9" 15 | 16 | [dev-dependencies] 17 | env_logger = "0.5" 18 | tokio = "0.1" 19 | tokio-io = "0.1" 20 | -------------------------------------------------------------------------------- /miner/using-queue/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "using_queue" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /parity/cli/presets/config.dev-insecure.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | no_consensus = true 3 | chain = "dev" 4 | 5 | [mining] 6 | reseal_min_period = 0 7 | min_gas_price = 0 8 | 9 | [rpc] 10 | interface = "all" 11 | apis = ["all"] 12 | hosts = ["all"] 13 | 14 | [ipfs] 15 | enable = false # this is the default 16 | hosts = ["all"] 17 | -------------------------------------------------------------------------------- /parity/cli/presets/config.dev.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | chain = "dev" 3 | 4 | [mining] 5 | reseal_min_period = 0 6 | min_gas_price = 0 7 | -------------------------------------------------------------------------------- /parity/cli/presets/config.insecure.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | no_consensus = true 3 | 4 | [rpc] 5 | interface = "all" 6 | apis = ["all"] 7 | hosts = ["all"] 8 | 9 | [ipfs] 10 | enable = false # this is the default 11 | hosts = ["all"] 12 | -------------------------------------------------------------------------------- /parity/cli/presets/config.mining.toml: -------------------------------------------------------------------------------- 1 | [network] 2 | # Parity will try to maintain connection to at least 50 peers. 3 | min_peers = 50 4 | # Parity will maintain at most 100 peers. 5 | max_peers = 100 6 | 7 | [ipc] 8 | # You won't be able to use IPC to interact with Parity. 9 | disable = true 10 | 11 | [dapps] 12 | # You won't be able to access any web Dapps. 13 | disable = true 14 | 15 | [mining] 16 | # Prepare a block to seal even when there are no miners connected. 17 | force_sealing = true 18 | # New pending block will be created for all transactions (both local and external). 19 | reseal_on_txs = "all" 20 | # New pending block will be created only once per 4000 milliseconds. 21 | reseal_min_period = 4000 22 | # Parity will keep/relay at most 8192 transactions in queue. 23 | tx_queue_size = 8192 24 | tx_queue_per_sender = 128 25 | 26 | [footprint] 27 | # If defined will never use more then 1024MB for all caches. (Overrides other cache settings). 28 | cache_size = 1024 29 | 30 | [misc] 31 | # Logging pattern (`=`, e.g. `own_tx=trace`). 32 | logging = "miner=trace,own_tx=trace" 33 | -------------------------------------------------------------------------------- /parity/cli/presets/config.non-standard-ports.toml: -------------------------------------------------------------------------------- 1 | [network] 2 | # Parity will listen for connections on port 30305. 3 | port = 30305 4 | 5 | [rpc] 6 | # JSON-RPC over HTTP will be accessible on port 8645. 7 | port = 8645 8 | -------------------------------------------------------------------------------- /parity/cli/presets/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | use std::io::{Error, ErrorKind}; 18 | 19 | pub fn preset_config_string(arg: &str) -> Result<&'static str, Error> { 20 | match arg.to_lowercase().as_ref() { 21 | "dev" => Ok(include_str!("./config.dev.toml")), 22 | "mining" => Ok(include_str!("./config.mining.toml")), 23 | "non-standard-ports" => Ok(include_str!("./config.non-standard-ports.toml")), 24 | "insecure" => Ok(include_str!("./config.insecure.toml")), 25 | "dev-insecure" => Ok(include_str!("./config.dev-insecure.toml")), 26 | _ => Err(Error::new(ErrorKind::InvalidInput, "Config doesn't match any presets [dev, mining, non-standard-ports, insecure, dev-insecure]")) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid1.toml: -------------------------------------------------------------------------------- 1 | [account 2 | unlock = "0x1" 3 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid2.toml: -------------------------------------------------------------------------------- 1 | [account] 2 | unlock = "0x1" 3 | passwd = [] 4 | 5 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid3.toml: -------------------------------------------------------------------------------- 1 | [signer] 2 | passwd = [] 3 | 4 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid4.toml: -------------------------------------------------------------------------------- 1 | [account] 2 | invalid = 5 3 | -------------------------------------------------------------------------------- /parity/cli/tests/config.stratum_disabled.toml: -------------------------------------------------------------------------------- 1 | [stratum] 2 | disable = true -------------------------------------------------------------------------------- /parity/cli/tests/config.stratum_enabled.toml: -------------------------------------------------------------------------------- 1 | [stratum] 2 | disable = false 3 | interface = "some_interface" 4 | port = 8007 5 | secret = "Yellow" -------------------------------------------------------------------------------- /parity/cli/tests/config.stratum_missing_field.toml: -------------------------------------------------------------------------------- 1 | [stratum] -------------------------------------------------------------------------------- /parity/cli/tests/config.stratum_missing_section.toml: -------------------------------------------------------------------------------- 1 | # No `[stratum]` section -------------------------------------------------------------------------------- /parity/cli/usage_header.txt: -------------------------------------------------------------------------------- 1 | Parity Ethereum Client. 2 | By Wood/Paronyan/Kotewicz/Drwięga/Volf/Greeff 3 | Habermeier/Czaban/Gotchac/Redman/Nikolsky 4 | Schoedon/Tang/Adolfsson/Silva/Palm/Hirsz et al. 5 | Copyright 2015-2020 Parity Technologies (UK) Ltd. 6 | License GPLv3+: GNU GPL version 3 or later . 7 | -------------------------------------------------------------------------------- /parity/cli/version.txt: -------------------------------------------------------------------------------- 1 | Parity Ethereum Client. 2 | version {} 3 | Copyright 2015-2020 Parity Technologies (UK) Ltd. 4 | License GPLv3+: GNU GPL version 3 or later . 5 | This is free software: you are free to change and redistribute it. 6 | There is NO WARRANTY, to the extent permitted by law. 7 | 8 | By Wood/Paronyan/Kotewicz/Drwięga/Volf/Greeff 9 | Habermeier/Czaban/Gotchac/Redman/Nikolsky 10 | Schoedon/Tang/Adolfsson/Silva/Palm/Hirsz et al. 11 | -------------------------------------------------------------------------------- /parity/db/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Database-related operations. 18 | 19 | #[path="rocksdb/mod.rs"] 20 | mod impls; 21 | 22 | pub use self::impls::{open_db_light, restoration_db_handler, migrate}; 23 | -------------------------------------------------------------------------------- /parity/light_helpers/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Utilities and helpers for the light client. 18 | 19 | mod epoch_fetch; 20 | 21 | pub use self::epoch_fetch::EpochFetch; 22 | -------------------------------------------------------------------------------- /parity/logger/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Logger Implementation" 3 | name = "ethcore-logger" 4 | version = "1.12.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | log = "0.4" 10 | env_logger = "0.5" 11 | atty = "0.2" 12 | lazy_static = "1.0" 13 | regex = "1.0" 14 | time = "0.1" 15 | parking_lot = "0.9" 16 | arrayvec = "0.4" 17 | ansi_term = "0.11" 18 | -------------------------------------------------------------------------------- /parity/secretstore/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Secret store related components. 18 | 19 | mod server; 20 | 21 | #[cfg(feature = "secretstore")] 22 | mod blockchain; 23 | 24 | #[cfg(all(feature = "accounts", feature = "secretstore"))] 25 | mod nodekeypair; 26 | 27 | pub use self::server::{Configuration, NodeSecretKey, ContractAddress, Dependencies, start}; 28 | #[cfg(feature = "secretstore")] 29 | use self::blockchain::TrustedClient; 30 | #[cfg(all(feature = "accounts", feature = "secretstore"))] 31 | use self::nodekeypair::KeyStoreNodeKeyPair; -------------------------------------------------------------------------------- /rpc/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! RPC integration tests. 18 | 19 | mod helpers; 20 | mod http_client; 21 | #[cfg(test)] mod rpc; 22 | pub mod ws; 23 | -------------------------------------------------------------------------------- /rpc/src/v1/helpers/ipfs.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! IPFS utility functions 18 | 19 | use multihash; 20 | use cid::{Cid, Codec, Version}; 21 | use crypto::digest; 22 | use jsonrpc_core::Error; 23 | use v1::types::Bytes; 24 | use super::errors; 25 | 26 | /// Compute CIDv0 from protobuf encoded bytes. 27 | pub fn cid(content: Bytes) -> Result { 28 | let hash = digest::sha256(&content.0); 29 | let mh = multihash::encode(multihash::Hash::SHA2256, &*hash).map_err(errors::encoding)?; 30 | let cid = Cid::new(Codec::DagProtobuf, Version::V0, &mh); 31 | Ok(cid.to_string()) 32 | } 33 | -------------------------------------------------------------------------------- /rpc/src/v1/impls/light/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! RPC implementations for the light client. 18 | //! 19 | //! This doesn't re-implement all of the RPC APIs, just those which aren't 20 | //! significantly generic to be reused. 21 | 22 | pub mod eth; 23 | pub mod parity; 24 | pub mod parity_set; 25 | pub mod trace; 26 | pub mod net; 27 | 28 | pub use self::eth::EthClient; 29 | pub use self::parity::ParityClient; 30 | pub use self::parity_set::ParitySetClient; 31 | pub use self::net::NetClient; 32 | pub use self::trace::TracesClient; 33 | -------------------------------------------------------------------------------- /rpc/src/v1/impls/web3.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Web3 rpc implementation. 18 | use ethereum_types::H256; 19 | use hash::keccak; 20 | use jsonrpc_core::Result; 21 | use version::version; 22 | use v1::traits::Web3; 23 | use v1::types::Bytes; 24 | 25 | /// Web3 rpc implementation. 26 | #[derive(Default)] 27 | pub struct Web3Client; 28 | 29 | impl Web3 for Web3Client { 30 | fn client_version(&self) -> Result { 31 | Ok(version().to_owned().replacen("/", "//", 1)) 32 | } 33 | 34 | fn sha3(&self, data: Bytes) -> Result { 35 | Ok(keccak(&data.0)) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rpc/src/v1/metadata.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Parity RPC requests Metadata. 18 | use std::sync::Arc; 19 | 20 | use jsonrpc_core; 21 | use jsonrpc_pubsub::{Session, PubSubMetadata}; 22 | 23 | use v1::types::Origin; 24 | 25 | /// RPC methods metadata. 26 | #[derive(Clone, Default, Debug)] 27 | pub struct Metadata { 28 | /// Request origin 29 | pub origin: Origin, 30 | /// Request PubSub Session 31 | pub session: Option>, 32 | } 33 | 34 | impl jsonrpc_core::Metadata for Metadata {} 35 | impl PubSubMetadata for Metadata { 36 | fn session(&self) -> Option> { 37 | self.session.clone() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rpc/src/v1/tests/helpers/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Test rpc services. 18 | 19 | mod miner_service; 20 | mod snapshot_service; 21 | mod sync_provider; 22 | mod update_service; 23 | 24 | pub use self::miner_service::TestMinerService; 25 | pub use self::snapshot_service::TestSnapshotService; 26 | pub use self::sync_provider::{Config, TestSyncProvider}; 27 | pub use self::update_service::TestUpdater; 28 | -------------------------------------------------------------------------------- /rpc/src/v1/tests/mocked/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! RPC mocked tests. Most of these test that the RPC server is serializing and forwarding 18 | //! method calls properly. 19 | 20 | mod debug; 21 | mod eth; 22 | mod eth_pubsub; 23 | mod manage_network; 24 | mod net; 25 | mod parity; 26 | #[cfg(any(test, feature = "accounts"))] 27 | mod parity_accounts; 28 | mod parity_set; 29 | #[cfg(any(test, feature = "accounts"))] 30 | mod personal; 31 | mod pubsub; 32 | mod rpc; 33 | #[cfg(any(test, feature = "accounts"))] 34 | mod secretstore; 35 | mod signer; 36 | #[cfg(any(test, feature = "accounts"))] 37 | mod signing; 38 | #[cfg(any(test, feature = "accounts"))] 39 | mod signing_unsafe; 40 | mod traces; 41 | mod web3; 42 | -------------------------------------------------------------------------------- /rpc/src/v1/traits/debug.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Debug RPC interface. 18 | 19 | use jsonrpc_core::Result; 20 | use jsonrpc_derive::rpc; 21 | 22 | use v1::types::RichBlock; 23 | 24 | /// Debug RPC interface. 25 | #[rpc(server)] 26 | pub trait Debug { 27 | /// Returns recently seen bad blocks. 28 | #[rpc(name = "debug_getBadBlocks")] 29 | fn bad_blocks(&self) -> Result>; 30 | } 31 | -------------------------------------------------------------------------------- /rpc/src/v1/traits/net.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Net rpc interface. 18 | use jsonrpc_core::Result; 19 | use jsonrpc_derive::rpc; 20 | 21 | /// Net rpc interface. 22 | #[rpc(server)] 23 | pub trait Net { 24 | /// Returns protocol version. 25 | #[rpc(name = "net_version")] 26 | fn version(&self) -> Result; 27 | 28 | /// Returns number of peers connected to node. 29 | #[rpc(name = "net_peerCount")] 30 | fn peer_count(&self) -> Result; 31 | 32 | /// Returns true if client is actively listening for network connections. 33 | /// Otherwise false. 34 | #[rpc(name = "net_listening")] 35 | fn is_listening(&self) -> Result; 36 | } 37 | -------------------------------------------------------------------------------- /rpc/src/v1/traits/rpc.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! RPC interface. 18 | 19 | use std::collections::BTreeMap; 20 | 21 | use jsonrpc_core::Result; 22 | use jsonrpc_derive::rpc; 23 | 24 | /// RPC Interface. 25 | #[rpc(server)] 26 | pub trait Rpc { 27 | /// Returns supported modules for Geth 1.3.6 28 | /// @ignore 29 | #[rpc(name = "modules")] 30 | fn modules(&self) -> Result>; 31 | 32 | /// Returns supported modules for Geth 1.4.0 33 | /// @ignore 34 | #[rpc(name = "rpc_modules")] 35 | fn rpc_modules(&self) -> Result>; 36 | } 37 | -------------------------------------------------------------------------------- /rpc/src/v1/traits/transactions_pool.rs: -------------------------------------------------------------------------------- 1 | //! Transactions pool PUB-SUB rpc interface. 2 | 3 | use jsonrpc_core::Result; 4 | use jsonrpc_pubsub::{typed, SubscriptionId}; 5 | use jsonrpc_derive::rpc; 6 | use miner::pool::TxStatus; 7 | 8 | use ethereum_types::H256; 9 | 10 | /// Transactions Pool PUB-SUB rpc interface. 11 | #[rpc(server)] 12 | pub trait TransactionsPool { 13 | /// Pub/Sub Metadata 14 | type Metadata; 15 | 16 | /// Subscribe to Transactions Pool subscription. 17 | #[pubsub(subscription = "parity_watchTransactionsPool", subscribe, name = "parity_watchTransactionsPool")] 18 | fn subscribe(&self, _: Self::Metadata, _: typed::Subscriber<(H256, TxStatus)>); 19 | 20 | /// Unsubscribe from existing Transactions Pool subscription. 21 | #[pubsub(subscription = "parity_watchTransactionsPool", unsubscribe, name = "parity_unwatchTransactionsPool")] 22 | fn unsubscribe(&self, _: Option, _: SubscriptionId) -> Result; 23 | } 24 | -------------------------------------------------------------------------------- /rpc/src/v1/traits/web3.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Web3 rpc interface. 18 | use ethereum_types::H256; 19 | use jsonrpc_core::Result; 20 | use jsonrpc_derive::rpc; 21 | 22 | use v1::types::Bytes; 23 | 24 | /// Web3 rpc interface. 25 | #[rpc(server)] 26 | pub trait Web3 { 27 | /// Returns current client version. 28 | #[rpc(name = "web3_clientVersion")] 29 | fn client_version(&self) -> Result; 30 | 31 | /// Returns sha3 of the given data 32 | #[rpc(name = "web3_sha3")] 33 | fn sha3(&self, _: Bytes) -> Result; 34 | } 35 | -------------------------------------------------------------------------------- /rpc/src/v1/types/histogram.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Gas prices histogram. 18 | 19 | use ethereum_types::U256; 20 | use stats; 21 | 22 | /// Values of RPC settings. 23 | #[derive(Serialize, Deserialize)] 24 | #[serde(deny_unknown_fields)] 25 | #[serde(rename_all = "camelCase")] 26 | pub struct Histogram { 27 | /// Gas prices for bucket edges. 28 | pub bucket_bounds: Vec, 29 | /// Transaction counts for each bucket. 30 | pub counts: Vec, 31 | } 32 | 33 | impl From> for Histogram { 34 | fn from(h: stats::Histogram) -> Self { 35 | Histogram { 36 | bucket_bounds: h.bucket_bounds.into_iter().map(Into::into).collect(), 37 | counts: h.counts 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rpc/src/v1/types/rpc_settings.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! RPC Settings data. 18 | 19 | /// Values of RPC settings. 20 | #[derive(Serialize, Deserialize)] 21 | #[serde(deny_unknown_fields)] 22 | pub struct RpcSettings { 23 | /// Whether RPC is enabled. 24 | pub enabled: bool, 25 | /// The interface being listened on. 26 | pub interface: String, 27 | /// The port being listened on. 28 | pub port: u64, 29 | } 30 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | verbose=false 2 | max_width=100 3 | comment_width=100 4 | tab_spaces=4 5 | fn_call_width=100 6 | struct_lit_width=32 7 | fn_call_style="Visual" 8 | single_line_if_else_max_width=100 9 | trailing_comma="Vertical" 10 | chain_indent="Visual" 11 | chain_one_line_max=100 12 | reorder_imports=true 13 | format_strings=false 14 | hard_tabs=true 15 | wrap_match_arms=false 16 | error_on_line_overflow=false -------------------------------------------------------------------------------- /scripts/add_license.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | PAT_GPL="^// Copyright.*If not, see \.$" 4 | PAT_OTHER="^// Copyright" 5 | 6 | for f in $(find . -type f | egrep '\.(c|cpp|rs)$'); do 7 | HEADER=$(head -16 $f) 8 | if [[ $HEADER =~ $PAT_GPL ]]; then 9 | BODY=$(tail -n +17 $f) 10 | cat license_header > temp 11 | echo "$BODY" >> temp 12 | mv temp $f 13 | elif [[ $HEADER =~ $PAT_OTHER ]]; then 14 | echo "Other license was found do nothing" 15 | else 16 | echo "$f was missing header" 17 | cat license_header $f > temp 18 | mv temp $f 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /scripts/doc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # generate documentation only for partiy and ethcore libraries 3 | 4 | cargo doc --no-deps --verbose --all --exclude parity-ipfs-api && 5 | echo '' > target/doc/index.html 6 | -------------------------------------------------------------------------------- /scripts/docker/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | ```docker build -f docker/ubuntu/Dockerfile --tag ethcore/parity:branch_or_tag_name .``` 4 | 5 | ## Usage - CentOS 6 | 7 | Builds a lightweight non-root Parity docker image: 8 | ``` 9 | git clone https://github.com/paritytech/parity-ethereum.git 10 | cd parity-ethereum 11 | ./scripts/docker/centos/build.sh 12 | ``` 13 | 14 | Fully customised build: 15 | ``` 16 | PARITY_IMAGE_REPO=my-personal/parity \ 17 | PARITY_BUILDER_IMAGE_TAG=build-latest \ 18 | PARITY_RUNNER_IMAGE_TAG=centos-parity-experimental \ 19 | ./scripts/docker/centos/build.sh 20 | ``` 21 | 22 | Default values: 23 | ``` 24 | # The image name 25 | PARITY_IMAGE_REPO - parity/parity 26 | 27 | # The tag to be used for builder image, git commit sha will be appended 28 | PARITY_BUILDER_IMAGE_TAG - build 29 | 30 | # The tag to be used for runner image 31 | PARITY_RUNNER_IMAGE_TAG - latest 32 | ``` 33 | 34 | All default ports you might use will be exposed: 35 | ``` 36 | # secret 37 | # ipfs store ui rpc ws listener discovery 38 | # ↓ ↓ ↓ ↓ ↓ ↓ ↓ 39 | EXPOSE 5001 8082 8083 8180 8545 8546 30303/tcp 30303/udp 40 | ``` 41 | -------------------------------------------------------------------------------- /scripts/docker/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge AS builder 2 | 3 | # show backtraces 4 | ENV RUST_BACKTRACE 1 5 | 6 | RUN apk add --no-cache \ 7 | build-base \ 8 | cargo \ 9 | cmake \ 10 | eudev-dev \ 11 | linux-headers \ 12 | perl \ 13 | rust 14 | 15 | WORKDIR /parity 16 | COPY . /parity 17 | RUN cargo build --release --target x86_64-alpine-linux-musl --verbose 18 | RUN strip target/x86_64-alpine-linux-musl/release/parity 19 | 20 | 21 | FROM alpine:edge 22 | 23 | # show backtraces 24 | ENV RUST_BACKTRACE 1 25 | 26 | RUN apk add --no-cache \ 27 | libstdc++ \ 28 | eudev-libs \ 29 | libgcc 30 | 31 | RUN addgroup -g 1000 parity \ 32 | && adduser -u 1000 -G parity -s /bin/sh -D parity 33 | 34 | USER parity 35 | 36 | EXPOSE 8080 8545 8180 37 | 38 | WORKDIR /home/parity 39 | 40 | RUN mkdir -p /home/parity/.local/share/io.parity.ethereum/ 41 | COPY --chown=parity:parity --from=builder /parity/target/x86_64-alpine-linux-musl/release/parity ./ 42 | 43 | ENTRYPOINT ["./parity"] 44 | -------------------------------------------------------------------------------- /scripts/docker/centos/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:latest 2 | 3 | RUN mkdir -p /opt/parity/data && \ 4 | chmod g+rwX /opt/parity/data && \ 5 | mkdir -p /opt/parity/release 6 | 7 | COPY parity/parity /opt/parity/release 8 | 9 | WORKDIR /opt/parity/data 10 | 11 | # exposing default ports 12 | # 13 | # secret 14 | # ipfs store ui rpc ws listener discovery 15 | # ↓ ↓ ↓ ↓ ↓ ↓ ↓ 16 | EXPOSE 5001 8082 8083 8180 8545 8546 30303/tcp 30303/udp 17 | 18 | # switch to non-root user 19 | USER 1001 20 | 21 | #if no base path provided, assume it's current workdir 22 | CMD ["--base-path","."] 23 | ENTRYPOINT ["/opt/parity/release/parity"] 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /scripts/docker/centos/Dockerfile.build: -------------------------------------------------------------------------------- 1 | FROM centos:latest 2 | 3 | WORKDIR /build 4 | 5 | ADD . /build/parity-ethereum 6 | 7 | RUN yum -y update && \ 8 | yum install -y systemd-devel git make gcc-c++ gcc file binutils && \ 9 | curl -L "https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz" -o cmake.tar.gz && \ 10 | tar -xzf cmake.tar.gz && \ 11 | cp -r cmake-3.12.0-Linux-x86_64/* /usr/ && \ 12 | curl https://sh.rustup.rs -sSf | sh -s -- -y && \ 13 | PATH=/root/.cargo/bin:$PATH && \ 14 | RUST_BACKTRACE=1 && \ 15 | rustc -vV && \ 16 | cargo -V && \ 17 | gcc -v && \ 18 | g++ -v && \ 19 | cmake --version && \ 20 | cd parity-ethereum && \ 21 | cargo build --verbose --release --features final && \ 22 | strip /build/parity-ethereum/target/release/parity && \ 23 | file /build/parity-ethereum/target/release/parity 24 | 25 | 26 | -------------------------------------------------------------------------------- /scripts/docker/centos/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # The image name 4 | PARITY_IMAGE_REPO=${PARITY_IMAGE_REPO:-parity/parity} 5 | # The tag to be used for builder image 6 | PARITY_BUILDER_IMAGE_TAG=${PARITY_BUILDER_IMAGE_TAG:-build} 7 | # The tag to be used for runner image 8 | PARITY_RUNNER_IMAGE_TAG=${PARITY_RUNNER_IMAGE_TAG:-latest} 9 | 10 | echo Building $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") 11 | docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") . -f scripts/docker/centos/Dockerfile.build 12 | 13 | echo Creating $PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H"), extracting binary 14 | docker create --name extract $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") 15 | mkdir scripts/docker/centos/parity 16 | docker cp extract:/build/parity-ethereum/target/release/parity scripts/docker/centos/parity 17 | 18 | echo Building $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG 19 | docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG scripts/docker/centos/ -f scripts/docker/centos/Dockerfile 20 | 21 | echo Cleaning up ... 22 | rm -rf scripts/docker/centos/parity 23 | docker rm -f extract 24 | docker rmi -f $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") 25 | 26 | echo Echoing Parity version: 27 | docker run $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG --version 28 | 29 | echo Done. 30 | -------------------------------------------------------------------------------- /scripts/docker/hub/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:xenial 2 | 3 | # metadata 4 | ARG VCS_REF 5 | ARG BUILD_DATE 6 | 7 | LABEL io.parity.image.authors="devops-team@parity.io" \ 8 | io.parity.image.vendor="Parity Technologies" \ 9 | io.parity.image.title="parity/parity" \ 10 | io.parity.image.description="Parity Ethereum. The Fastest and most Advanced Ethereum Client." \ 11 | io.parity.image.source="https://github.com/paritytech/parity-ethereum/blob/${VCS_REF}/\ 12 | scripts/docker/hub/Dockerfile" \ 13 | io.parity.image.documentation="https://wiki.parity.io/Parity-Ethereum" \ 14 | io.parity.image.revision="${VCS_REF}" \ 15 | io.parity.image.created="${BUILD_DATE}" 16 | 17 | # show backtraces 18 | ENV RUST_BACKTRACE 1 19 | 20 | # install tools and dependencies 21 | RUN set -eux; \ 22 | apt-get update; \ 23 | apt-get install -y --no-install-recommends \ 24 | file curl jq; \ 25 | # apt cleanup 26 | apt-get autoremove -y; \ 27 | apt-get clean; \ 28 | rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*; \ 29 | # add user 30 | groupadd -g 1000 parity; \ 31 | useradd -m -u 1000 -g parity -s /bin/sh parity 32 | 33 | WORKDIR /home/parity 34 | 35 | # add parity-ethereum binary to docker image 36 | COPY artifacts/x86_64-unknown-linux-gnu/parity /bin/parity 37 | COPY tools/check_sync.sh /check_sync.sh 38 | 39 | # switch to user parity here 40 | USER parity 41 | 42 | # check if executable works in this container 43 | RUN parity --version 44 | 45 | EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp 46 | 47 | ENTRYPOINT ["/bin/parity"] 48 | -------------------------------------------------------------------------------- /scripts/docker/hub/check_sync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # checks if parity has a fully synced blockchain 3 | 4 | ETH_SYNCING=$(curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545 -H 'Content-Type: application/json') 5 | RESULT=$(echo "$ETH_SYNCING" | jq -r .result) 6 | 7 | if [ "$RESULT" == "false" ]; then 8 | echo "Parity is ready to start accepting traffic" 9 | exit 0 10 | else 11 | echo "Parity is still syncing the blockchain" 12 | exit 1 13 | fi 14 | -------------------------------------------------------------------------------- /scripts/evm_jsontests_bench.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cargo build --release -p evmbin 4 | 5 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmArithmeticTest 6 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmBitwiseLogicOperation 7 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmBlockInfoTest 8 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmEnvironmentalInfo 9 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmIOandFlowOperations 10 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmLogTest 11 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmPerformance 12 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmPushDupSwapTest 13 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmRandomTest 14 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmSha3Test 15 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmSystemOperations 16 | ./target/release/parity-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmTests 17 | -------------------------------------------------------------------------------- /scripts/evm_uint_bench.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cargo build --release -p evmbin 4 | 5 | # LOOP TEST 6 | CODE1=606060405260005b620f42408112156019575b6001016007565b600081905550600680602b6000396000f3606060405200 7 | if [ -x "$(command -v ethvm)" ]; then 8 | ethvm --code $CODE1 9 | echo "^^^^ ethvm" 10 | fi 11 | ./target/release/parity-evm stats --code $CODE1 --gas 4402000 12 | echo "^^^^ usize" 13 | ./target/release/parity-evm stats --code $CODE1 14 | echo "^^^^ U256" 15 | 16 | # RNG TEST 17 | CODE2=6060604052600360056007600b60005b620f4240811215607f5767ffe7649d5eca84179490940267f47ed85c4b9a6379019367f8e5dd9a5c994bba9390930267f91d87e4b8b74e55019267ff97f6f3b29cda529290920267f393ada8dd75c938019167fe8d437c45bb3735830267f47d9a7b5428ffec019150600101600f565b838518831882186000555050505050600680609a6000396000f3606060405200 18 | if [ -x "$(command -v ethvm)" ]; then 19 | ethvm --code $CODE2 20 | echo "^^^^ ethvm" 21 | fi 22 | ./target/release/parity-evm stats --code $CODE2 --gas 143020115 23 | echo "^^^^ usize" 24 | ./target/release/parity-evm stats --code $CODE2 25 | echo "^^^^ U256" 26 | -------------------------------------------------------------------------------- /scripts/gitlab/publish-av-whitelists.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | target_filename="parity-${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}}.exe" 5 | apt -y update 6 | apt -y install ftp 7 | 8 | echo "__________Publish Windows binaries to Avast Whitelisting program__________" 9 | 10 | ftp -pinv whitelisting.avast.com < $FILE 5 | # Exit on any error 6 | echo "set -e" >> $FILE 7 | # Run release build 8 | echo "cargo build --features dev" >> $FILE 9 | # Build tests 10 | echo "cargo test --no-run --features dev --all --exclude parity-ipfs-api" >> $FILE 11 | echo "" >> $FILE 12 | chmod +x $FILE 13 | -------------------------------------------------------------------------------- /scripts/parity.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Parity Ethereum Daemon 3 | After=network.target 4 | 5 | [Service] 6 | # run as root, set base_path in config.toml 7 | ExecStart=/usr/bin/parity --config /etc/parity/config.toml 8 | # To run as user, comment out above and uncomment below, fill in user and group 9 | # picks up users default config.toml in $HOME/.local/share/io.parity.ethereum/ 10 | # User=username 11 | # Group=groupname 12 | # ExecStart=/usr/bin/parity 13 | Restart=on-failure 14 | 15 | # Specifies which signal to use when killing a service. Defaults to SIGTERM. 16 | # SIGHUP gives parity time to exit cleanly before SIGKILL (default 90s) 17 | KillSignal=SIGHUP 18 | 19 | [Install] 20 | WantedBy=default.target 21 | 22 | 23 | -------------------------------------------------------------------------------- /scripts/remove_duplicate_empty_lines.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | for f in $(find . -name '*.rs'); do 4 | cat -s $f > $f.temp 5 | mv $f.temp $f 6 | done 7 | -------------------------------------------------------------------------------- /scripts/snap/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openethereum/parity-ethereum/55c90d4016505317034e3e98f699af07f5404b63/scripts/snap/icon.png -------------------------------------------------------------------------------- /scripts/snap/parity.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Encoding=UTF-8 4 | Name=Parity Ethereum 5 | Comment=The fastest and most advanced Ethereum client. 6 | Exec=parity 7 | Icon=/usr/share/pixmaps/icon.png 8 | Terminal=true 9 | -------------------------------------------------------------------------------- /secret-store/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum (EthCore) Secret Store" 3 | name = "ethcore-secretstore" 4 | version = "1.0.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | byteorder = "1.0" 10 | ethabi = "9.0.1" 11 | ethabi-contract = "9.0.0" 12 | ethabi-derive = "9.0.1" 13 | ethereum-types = "0.8.0" 14 | ethkey = { path = "../accounts/ethkey", optional = true } 15 | futures = "0.1" 16 | hyper = { version = "0.12", default-features = false } 17 | keccak-hash = "0.4.0" 18 | kvdb = "0.3.1" 19 | kvdb-rocksdb = "0.4.1" 20 | lazy_static = "1.0" 21 | log = "0.4" 22 | parity-bytes = "0.1" 23 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 24 | parity-runtime = { path = "../util/runtime" } 25 | parking_lot = "0.9" 26 | percent-encoding = "2.1.0" 27 | rustc-hex = "1.0" 28 | serde = "1.0" 29 | serde_derive = "1.0" 30 | serde_json = "1.0" 31 | tiny-keccak = "1.4" 32 | tokio = "0.1.22" 33 | tokio-io = "0.1" 34 | tokio-service = "0.1" 35 | url = "2.1.0" 36 | jsonrpc-server-utils = "14.0.3" 37 | 38 | [dev-dependencies] 39 | env_logger = "0.5" 40 | tempdir = "0.3" 41 | kvdb-rocksdb = "0.4.1" 42 | -------------------------------------------------------------------------------- /secret-store/res/acl_storage.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":true,"inputs":[{"name":"user","type":"address"},{"name":"document","type":"bytes32"}],"name":"checkPermissions","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"} 3 | ] 4 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/client_sessions/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | pub mod decryption_session; 18 | pub mod encryption_session; 19 | pub mod generation_session; 20 | pub mod signing_session_ecdsa; 21 | pub mod signing_session_schnorr; 22 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/jobs/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | pub mod consensus_session; 18 | pub mod decryption_job; 19 | pub mod dummy_job; 20 | pub mod job_session; 21 | pub mod key_access_job; 22 | pub mod servers_set_change_access_job; 23 | pub mod signing_job_ecdsa; 24 | pub mod signing_job_schnorr; 25 | pub mod unknown_sessions_job; 26 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/net/connection.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | use std::net; 18 | use crypto::publickey::KeyPair; 19 | use key_server_cluster::NodeId; 20 | use key_server_cluster::io::SharedTcpStream; 21 | 22 | /// Established connection data 23 | pub struct Connection { 24 | /// Peer address. 25 | pub address: net::SocketAddr, 26 | /// Connection stream. 27 | pub stream: SharedTcpStream, 28 | /// Peer node id. 29 | pub node_id: NodeId, 30 | /// Encryption key. 31 | pub key: KeyPair, 32 | } 33 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/net/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | mod accept_connection; 18 | mod connect; 19 | mod connection; 20 | 21 | pub use self::accept_connection::{AcceptConnection, accept_connection}; 22 | pub use self::connect::{Connect, connect}; 23 | pub use self::connection::Connection; 24 | -------------------------------------------------------------------------------- /secret-store/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Types used in the public api 18 | 19 | mod all; 20 | mod error; 21 | 22 | pub use self::all::*; 23 | pub use self::error::*; 24 | -------------------------------------------------------------------------------- /updater/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Updater Service." 3 | name = "parity-updater" 4 | version = "1.12.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | client-traits = { path = "../ethcore/client-traits" } 10 | common-types = { path = "../ethcore/types" } 11 | ethabi = "9.0.1" 12 | ethabi-contract = "9.0.0" 13 | ethabi-derive = "9.0.1" 14 | ethcore = { path = "../ethcore" } 15 | ethcore-sync = { path = "../ethcore/sync" } 16 | ethereum-types = "0.8.0" 17 | keccak-hash = "0.4.0" 18 | lazy_static = "1.0" 19 | log = "0.4" 20 | parity-bytes = "0.1" 21 | parity-hash-fetch = { path = "hash-fetch" } 22 | parity-path = "0.1" 23 | parity-version = { path = "../util/version" } 24 | rand = "0.7" 25 | parking_lot = "0.9" 26 | semver = "0.9" 27 | target_info = "0.1" 28 | 29 | [dev-dependencies] 30 | ethcore = { path = "../ethcore", features = ["test-helpers"] } 31 | tempdir = "0.3" 32 | matches = "0.1" 33 | 34 | [features] 35 | # hardcode version number 1.3.7 of parity to force an update 36 | # in order to manually test that parity fall-over to the local version 37 | # in case of invalid or deprecated command line arguments are entered 38 | test-updater = [] 39 | -------------------------------------------------------------------------------- /updater/hash-fetch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Fetching hash-addressed content." 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "parity-hash-fetch" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | call-contract = { package = "ethcore-call-contract", path = "../../ethcore/call-contract" } 11 | futures = "0.1" 12 | log = "0.4" 13 | mime = "0.3" 14 | mime_guess = "2.0.0-alpha.2" 15 | rand = "0.7" 16 | rustc-hex = "1.0" 17 | fetch = { path = "../../util/fetch" } 18 | parity-bytes = "0.1" 19 | ethereum-types = "0.8.0" 20 | parity-runtime = { path = "../../util/runtime" } 21 | keccak-hash = "0.4.0" 22 | registrar = { path = "../../util/registrar" } 23 | types = { path = "../../ethcore/types", package = "common-types" } 24 | 25 | ethabi = "9.0.1" 26 | ethabi-derive = "9.0.1" 27 | ethabi-contract = "9.0.0" 28 | 29 | [dev-dependencies] 30 | parking_lot = "0.9" 31 | fake-fetch = { path = "../../util/fake-fetch" } 32 | -------------------------------------------------------------------------------- /updater/hash-fetch/res/urlhint.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":false,"inputs":[{"name":"_content","type":"bytes32"},{"name":"_url","type":"string"}],"name":"hintURL","outputs":[],"type":"function"}, 3 | {"constant":false,"inputs":[{"name":"_content","type":"bytes32"},{"name":"_accountSlashRepo","type":"string"},{"name":"_commit","type":"bytes20"}],"name":"hint","outputs":[],"type":"function"}, 4 | {"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"entries","outputs":[{"name":"accountSlashRepo","type":"string"},{"name":"commit","type":"bytes20"},{"name":"owner","type":"address"}],"type":"function"}, 5 | {"constant":false,"inputs":[{"name":"_content","type":"bytes32"}],"name":"unhint","outputs":[],"type":"function"} 6 | ] 7 | -------------------------------------------------------------------------------- /updater/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Types used in the public api 18 | 19 | mod all; 20 | mod release_track; 21 | mod version_info; 22 | 23 | pub use self::all::{ReleaseInfo, OperationsInfo, CapState}; 24 | pub use self::release_track::ReleaseTrack; 25 | pub use self::version_info::VersionInfo; 26 | -------------------------------------------------------------------------------- /util/EIP-152/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eip-152" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | repository = "https://github.com/paritytech/parity-ethereum" 6 | documentation = "https://docs.rs/eip-152" 7 | readme = "README.md" 8 | description = "eip-512 blake2 F compression function" 9 | keywords = ["eip-152", "eip152", "eip"] 10 | license = "GPL-3.0" 11 | edition = "2018" 12 | 13 | [dependencies] 14 | arrayref = "0.3.5" 15 | 16 | [dev-dependencies] 17 | criterion = "0.3" 18 | rustc-hex = "2.0.1" 19 | 20 | [[bench]] 21 | name = "bench" 22 | harness = false 23 | -------------------------------------------------------------------------------- /util/EIP-152/LICENSE: -------------------------------------------------------------------------------- 1 | This program is copyright 2020 Parity Technologies Limited and its licensors. 2 | 3 | GNU GENERAL PUBLIC LICENSE 4 | Version 3, 29 June 2007 5 | 6 | Some portions of the program (“the Software”) are Copyright (c) 2018 Jack O'Connor 7 | and the following relates solely to such portions: 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | -------------------------------------------------------------------------------- /util/EIP-712/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eip-712" 3 | version = "0.1.1" 4 | authors = ["Parity Technologies "] 5 | repository = "https://github.com/paritytech/parity-ethereum" 6 | documentation = "https://docs.rs/eip-712" 7 | readme = "README.md" 8 | description = "eip-712 encoding" 9 | keywords = ["eip-712", "eip712", "eip"] 10 | license = "GPL-3.0" 11 | edition = "2018" 12 | 13 | [dependencies] 14 | serde_derive = "1.0" 15 | serde = "1.0" 16 | serde_json = "1.0" 17 | ethabi = "9.0.1" 18 | keccak-hash = "0.4.0" 19 | ethereum-types = "0.8.0" 20 | failure = "0.1" 21 | itertools = "0.7" 22 | lazy_static = "1.1" 23 | regex = "1.0" 24 | validator = "0.8" 25 | validator_derive = "0.8" 26 | lunarity-lexer = "0.2" 27 | rustc-hex = "2.0" 28 | indexmap = "1.0.2" 29 | -------------------------------------------------------------------------------- /util/bloom/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ethcore-bloom-journal" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Journaling bloom filter" 6 | license = "GPL3" 7 | edition = "2018" 8 | 9 | [lib] 10 | path = "src/lib.rs" 11 | 12 | [dependencies] 13 | siphasher = "0.3" 14 | -------------------------------------------------------------------------------- /util/blooms-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "blooms-db" 3 | version = "0.1.0" 4 | license = "GPL-3.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [dependencies] 9 | ethbloom = "0.8.0" 10 | parking_lot = "0.9" 11 | 12 | [dev-dependencies] 13 | criterion = "0.3" 14 | tempdir = "0.3" 15 | 16 | [[bench]] 17 | name = "blooms" 18 | harness = false 19 | -------------------------------------------------------------------------------- /util/dir/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dir" 3 | version = "0.1.2" 4 | authors = ["Parity Technologies "] 5 | license = "GPL3" 6 | 7 | [dependencies] 8 | ethereum-types = "0.8.0" 9 | journaldb = { path = "../journaldb" } 10 | app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" } 11 | home = "0.3" 12 | -------------------------------------------------------------------------------- /util/fake-fetch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Mock fetcher for testing" 3 | name = "fake-fetch" 4 | version = "0.0.1" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | fetch = { path = "../fetch" } 10 | futures = "0.1" 11 | hyper = "0.12" 12 | -------------------------------------------------------------------------------- /util/fastmap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fastmap" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Specialized version of `HashMap` with H256 keys and fast hashing function." 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | ethereum-types = "0.8.0" 10 | plain_hasher = "0.2" 11 | -------------------------------------------------------------------------------- /util/fetch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "HTTP/HTTPS fetching library" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "fetch" 6 | version = "0.1.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | futures = "0.1" 11 | hyper = "~0.12.9" 12 | hyper-rustls = "0.18" 13 | http = "0.1" 14 | log = "0.4" 15 | tokio = "0.1.22" 16 | url = "2" 17 | bytes = "0.4" 18 | 19 | [features] 20 | default = [] 21 | -------------------------------------------------------------------------------- /util/fetch/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! A service to fetch any HTTP / HTTPS content. 18 | 19 | #![warn(missing_docs)] 20 | 21 | #[macro_use] 22 | extern crate log; 23 | 24 | #[macro_use] 25 | extern crate futures; 26 | 27 | extern crate hyper; 28 | extern crate hyper_rustls; 29 | extern crate http; 30 | 31 | extern crate tokio; 32 | extern crate url; 33 | extern crate bytes; 34 | 35 | /// Fetch client implementation. 36 | pub mod client; 37 | 38 | pub use url::Url; 39 | pub use self::client::{Client, Fetch, Error, Response, Request, Abort, BodyReader}; 40 | pub use hyper::Method; 41 | -------------------------------------------------------------------------------- /util/io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ethcore-io" 3 | description = "Ethcore IO library" 4 | version = "1.12.0" 5 | homepage = "http://parity.io" 6 | license = "GPL-3.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | 10 | [dependencies] 11 | fnv = "1.0" 12 | mio = { version = "0.6.19", optional = true } 13 | crossbeam-deque = "0.6" 14 | parking_lot = "0.9" 15 | log = "0.4" 16 | slab = "0.4" 17 | num_cpus = "1.8" 18 | timer = "0.2" 19 | time = "0.1" 20 | tokio = "0.1" 21 | futures = "0.1" 22 | 23 | -------------------------------------------------------------------------------- /util/journaldb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "journaldb" 3 | version = "0.2.0" 4 | authors = ["Parity Technologies "] 5 | description = "A `HashDB` which can manage a short-term journal potentially containing many forks of mutually exclusive actions" 6 | license = "GPL3" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | parity-bytes = "0.1" 11 | ethereum-types = "0.8.0" 12 | hash-db = "0.15.0" 13 | malloc_size_of = { version = "0.3.0", package = "parity-util-mem" } 14 | keccak-hasher = { path = "../keccak-hasher" } 15 | kvdb = "0.3.1" 16 | log = "0.4" 17 | memory-db = "0.18.0" 18 | parking_lot = "0.9" 19 | fastmap = { path = "../../util/fastmap" } 20 | rlp = "0.4.0" 21 | 22 | [dev-dependencies] 23 | env_logger = "0.5" 24 | keccak-hash = "0.4.0" 25 | kvdb-memorydb = "0.3.1" 26 | -------------------------------------------------------------------------------- /util/keccak-hasher/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "keccak-hasher" 3 | version = "0.1.1" 4 | edition = "2018" 5 | authors = ["Parity Technologies "] 6 | description = "Keccak-256 implementation of the Hasher trait" 7 | license = "GPL-3.0" 8 | 9 | [dependencies] 10 | ethereum-types = "0.8.0" 11 | tiny-keccak = "1.4.2" 12 | hash-db = "0.15.0" 13 | plain_hasher = "0.2" 14 | -------------------------------------------------------------------------------- /util/keccak-hasher/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Hasher implementation for the Keccak-256 hash 18 | 19 | #![warn(missing_docs)] 20 | 21 | use hash_db::Hasher; 22 | use ethereum_types::H256; 23 | use tiny_keccak::Keccak; 24 | use plain_hasher::PlainHasher; 25 | 26 | /// Concrete `Hasher` impl for the Keccak-256 hash 27 | #[derive(Default, Debug, Clone, PartialEq)] 28 | pub struct KeccakHasher; 29 | impl Hasher for KeccakHasher { 30 | type Out = H256; 31 | type StdHasher = PlainHasher; 32 | const LENGTH: usize = 32; 33 | fn hash(x: &[u8]) -> Self::Out { 34 | let mut out = [0; 32]; 35 | Keccak::keccak256(x, &mut out); 36 | out.into() 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /util/len-caching-lock/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Atomically cached len(), for use with collections contained in parking_lot Mutex and RwLock" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "len-caching-lock" 6 | version = "0.1.1" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | parking_lot = "0.9" 11 | -------------------------------------------------------------------------------- /util/macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "macros" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | -------------------------------------------------------------------------------- /util/memory-cache/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "memory-cache" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "An LRU-cache which operates on memory used" 6 | license = "GPL3" 7 | 8 | [dependencies] 9 | parity-util-mem = "0.3.0" 10 | lru-cache = "0.1" 11 | -------------------------------------------------------------------------------- /util/migration-rocksdb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "migration-rocksdb" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | 6 | [dependencies] 7 | log = "0.4" 8 | macros = { path = "../macros" } 9 | kvdb = "0.3.1" 10 | kvdb-rocksdb = "0.4.1" 11 | 12 | [dev-dependencies] 13 | tempdir = "0.3" 14 | -------------------------------------------------------------------------------- /util/network-devp2p/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "DevP2P implementation of the ethcore network library" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "ethcore-network-devp2p" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | edition = "2018" 9 | 10 | [dependencies] 11 | log = "0.4" 12 | mio = "0.6.8" 13 | bytes = "0.4" 14 | rand = "0.7" 15 | tiny-keccak = "1.4" 16 | slab = "0.2" 17 | igd = "0.9" 18 | libc = "0.2.7" 19 | parking_lot = "0.9" 20 | ansi_term = "0.11" 21 | rustc-hex = "1.0" 22 | ethcore-io = { path = "../io", features = ["mio"] } 23 | parity-bytes = "0.1" 24 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 25 | network = { package = "ethcore-network", path = "../network" } 26 | ethereum-types = "0.8.0" 27 | rlp = "0.4.0" 28 | parity-path = "0.1" 29 | ipnetwork = "0.12.6" 30 | keccak-hash = "0.4.0" 31 | parity-snappy = "0.1" 32 | serde = { version = "1.0", features = ["derive"] } 33 | serde_json = "1.0" 34 | lru-cache = "0.1" 35 | natpmp = "0.2" 36 | 37 | [dev-dependencies] 38 | env_logger = "0.5" 39 | tempdir = "0.3" 40 | assert_matches = "1.2" 41 | 42 | [features] 43 | default = [] 44 | -------------------------------------------------------------------------------- /util/network/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethcore network library" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "ethcore-network" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | derive_more = "0.14.0" 11 | parity-crypto = { version = "0.4.2", features = ["publickey"] } 12 | ethcore-io = { path = "../io" } 13 | ethereum-types = "0.8.0" 14 | ipnetwork = "0.12.6" 15 | lazy_static = "1.0" 16 | rlp = "0.4.0" 17 | libc = "0.2" 18 | parity-snappy = "0.1" 19 | semver = {version="0.9.0", features=["serde"]} 20 | serde = "1.0" 21 | serde_derive = "1.0" 22 | 23 | [dev-dependencies] 24 | assert_matches = "1.2" 25 | -------------------------------------------------------------------------------- /util/network/src/connection_filter.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | //! Connection filter trait. 18 | 19 | use super::NodeId; 20 | 21 | /// Filtered connection direction. 22 | pub enum ConnectionDirection { 23 | Inbound, 24 | Outbound, 25 | } 26 | 27 | /// Connection filter. Each connection is checked against `connection_allowed`. 28 | pub trait ConnectionFilter : Send + Sync { 29 | /// Filter a connection. Returns `true` if connection should be allowed. `false` if rejected. 30 | fn connection_allowed(&self, own_id: &NodeId, connecting_id: &NodeId, direction: ConnectionDirection) -> bool; 31 | } 32 | -------------------------------------------------------------------------------- /util/panic-hook/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity custom panic hook" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "panic_hook" 6 | version = "0.1.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | backtrace = "0.3.2" 11 | -------------------------------------------------------------------------------- /util/patricia-trie-ethereum/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "patricia-trie-ethereum" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Merkle-Patricia Trie (Ethereum Style)" 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | trie-db = "0.18.0" 10 | keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } 11 | hash-db = "0.15.0" 12 | rlp = "0.4.4" 13 | parity-bytes = "0.1" 14 | ethereum-types = "0.8.0" 15 | elastic-array = "0.10" 16 | 17 | [dev-dependencies] 18 | memory-db = "0.18.0" 19 | keccak-hash = "0.4.0" 20 | journaldb = { path = "../journaldb" } 21 | criterion = "0.3" 22 | 23 | [[bench]] 24 | name = "rlp_node_codec" 25 | harness = false 26 | -------------------------------------------------------------------------------- /util/registrar/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Registar for Parity" 3 | name = "registrar" 4 | version = "0.0.1" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | call-contract = { package = "ethcore-call-contract", path = "../../ethcore/call-contract" } 10 | ethabi = "9.0.1" 11 | ethabi-derive = "9.0.1" 12 | ethabi-contract = "9.0.0" 13 | keccak-hash = "0.4.0" 14 | types = { path = "../../ethcore/types", package = "common-types" } 15 | -------------------------------------------------------------------------------- /util/registrar/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of Parity Ethereum. 3 | 4 | // Parity Ethereum is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | 9 | // Parity Ethereum is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | 14 | // You should have received a copy of the GNU General Public License 15 | // along with Parity Ethereum. If not, see . 16 | 17 | extern crate call_contract; 18 | extern crate ethabi; 19 | extern crate ethabi_derive; 20 | extern crate keccak_hash; 21 | extern crate types; 22 | 23 | #[macro_use] 24 | extern crate ethabi_contract; 25 | 26 | mod registrar; 27 | pub use registrar::RegistrarClient; 28 | -------------------------------------------------------------------------------- /util/rlp-compress/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rlp_compress" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | 6 | [dependencies] 7 | rlp = "0.4.0" 8 | elastic-array = "0.10" 9 | lazy_static = "1.0" 10 | -------------------------------------------------------------------------------- /util/rlp-derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rlp_derive" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | edition = "2018" 6 | 7 | [lib] 8 | name = "rlp_derive" 9 | proc-macro = true 10 | 11 | [dependencies] 12 | syn = "1.0.14" 13 | quote = "1.0.2" 14 | proc-macro2 = "1.0.8" 15 | 16 | [dev-dependencies] 17 | rlp = "0.4.0" 18 | -------------------------------------------------------------------------------- /util/runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Runtime" 3 | homepage = "http://parity.io" 4 | license = "GPL-3.0" 5 | name = "parity-runtime" 6 | version = "0.1.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | futures = "0.1" 11 | tokio = "0.1.22" 12 | -------------------------------------------------------------------------------- /util/stats/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "stats" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | 6 | [dependencies] 7 | log = "0.4" 8 | -------------------------------------------------------------------------------- /util/time-utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "time-utils" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Time utilities for checked arithmetic" 6 | license = "GPL3" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /util/triehash-ethereum/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "triehash-ethereum" 3 | version = "0.2.0" 4 | authors = ["Parity Technologies "] 5 | description = "Trie-root helpers, ethereum style" 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | triehash = "0.8.2" 10 | ethereum-types = "0.8.0" 11 | keccak-hasher = { path = "../keccak-hasher" } 12 | -------------------------------------------------------------------------------- /util/unexpected/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "unexpected" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /util/version/Cargo.toml: -------------------------------------------------------------------------------- 1 | # NOTE This file is used by the auto-updater service. 2 | # Make sure to update the service if it's moved or the structure is changed. 3 | [package] 4 | name = "parity-version" 5 | # NOTE: this value is used for Parity Ethereum version string (via env CARGO_PKG_VERSION) 6 | version = "2.7.2" 7 | authors = ["Parity Technologies "] 8 | build = "build.rs" 9 | 10 | [package.metadata] 11 | # This versions track. Should be changed to `stable` when on respective branches. 12 | # Used by auto-updater and for Parity version string. 13 | track = "stable" 14 | 15 | # Network specific settings, used ONLY by auto-updater. 16 | # Latest supported fork blocks. 17 | # Indicates a critical release in this track (i.e. consensus issue). 18 | [package.metadata.networks] 19 | foundation = { forkBlock = 9069000, critical = false } 20 | ropsten = { forkBlock = 6485846, critical = false } 21 | kovan = { forkBlock = 14111141, critical = false } 22 | goerli = { forkBlock = 1561651, critical = false } 23 | 24 | [dependencies] 25 | parity-bytes = "0.1" 26 | rlp = "0.4.0" 27 | target_info = "0.1" 28 | 29 | [build-dependencies] 30 | vergen = "3.0.4" 31 | rustc_version = "0.2" 32 | toml = "0.4" 33 | 34 | [features] 35 | final = [] 36 | --------------------------------------------------------------------------------