├── .cargo └── config ├── .dockerignore ├── .editorconfig ├── .git-blame-ignore-revs ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── workflows │ ├── build-test-windows.yml │ ├── build-test.yml │ ├── build.yml │ ├── check.yml │ ├── deploy-docker-nightly.yml │ ├── deploy-docker-tag.yml │ ├── deploy-docker.yml │ └── fmt.yml ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── bin ├── chainspec │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── ethkey │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── ethstore │ ├── Cargo.toml │ └── src │ │ ├── crack.rs │ │ └── main.rs ├── evmbin │ ├── Cargo.toml │ ├── README.md │ ├── benches │ │ └── mod.rs │ ├── res │ │ └── testchain.json │ └── src │ │ ├── display │ │ ├── config.rs │ │ ├── json.rs │ │ ├── mod.rs │ │ ├── simple.rs │ │ └── std_json.rs │ │ ├── info.rs │ │ └── main.rs └── oe │ ├── 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.toml │ ├── usage.rs │ ├── usage_header.txt │ └── version.txt │ ├── configuration.rs │ ├── db │ ├── mod.rs │ └── rocksdb │ │ ├── blooms.rs │ │ ├── helpers.rs │ │ ├── migration.rs │ │ └── mod.rs │ ├── helpers.rs │ ├── informant.rs │ ├── lib.rs │ ├── logger │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── rotating.rs │ ├── main.rs │ ├── metrics.rs │ ├── modules.rs │ ├── params.rs │ ├── presale.rs │ ├── rpc.rs │ ├── rpc_apis.rs │ ├── run.rs │ ├── secretstore.rs │ ├── signer.rs │ ├── snapshot.rs │ ├── stratum.rs │ ├── upgrade.rs │ └── user_defaults.rs ├── crates ├── accounts │ ├── Cargo.toml │ ├── ethkey │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── brain.rs │ │ │ ├── brain_prefix.rs │ │ │ ├── brain_recover.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── password.rs │ │ │ └── prefix.rs │ ├── ethstore │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── 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 │ │ │ ├── ethkey.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 ├── concensus │ ├── 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 │ └── 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 │ │ │ ├── transaction_filter.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 ├── db │ ├── bloom │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── blooms-db │ │ ├── Cargo.toml │ │ ├── benches │ │ │ └── blooms.rs │ │ └── src │ │ │ ├── db.rs │ │ │ ├── file.rs │ │ │ └── lib.rs │ ├── db │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── cache_manager.rs │ │ │ ├── db.rs │ │ │ ├── keys.rs │ │ │ └── lib.rs │ ├── journaldb │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── archivedb.rs │ │ │ ├── as_hash_db_impls.rs │ │ │ ├── earlymergedb.rs │ │ │ ├── lib.rs │ │ │ ├── overlaydb.rs │ │ │ ├── overlayrecentdb.rs │ │ │ ├── refcounteddb.rs │ │ │ ├── traits.rs │ │ │ └── util.rs │ ├── memory-db │ │ ├── .cargo_vcs_info.json │ │ ├── Cargo.toml │ │ ├── Cargo.toml.orig │ │ ├── README.md │ │ ├── benches │ │ │ └── bench.rs │ │ └── src │ │ │ └── lib.rs │ ├── migration-rocksdb │ │ ├── Cargo.toml │ │ ├── src │ │ │ └── lib.rs │ │ └── tests │ │ │ └── tests.rs │ └── patricia-trie-ethereum │ │ ├── Cargo.toml │ │ └── src │ │ ├── lib.rs │ │ └── rlp_node_codec.rs ├── ethcore │ ├── Cargo.toml │ ├── benches │ │ └── builtin.rs │ ├── blockchain │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── best_block.rs │ │ │ ├── block_info.rs │ │ │ ├── blockchain.rs │ │ │ ├── cache.rs │ │ │ ├── config.rs │ │ │ ├── generator.rs │ │ │ ├── import_route.rs │ │ │ ├── lib.rs │ │ │ └── update.rs │ ├── res │ │ ├── chainspec │ │ │ ├── aleut.json │ │ │ ├── baikal.json │ │ │ ├── callisto.json │ │ │ ├── ellaism.json │ │ │ ├── ewc.json │ │ │ ├── foundation.json │ │ │ ├── goerli.json │ │ │ ├── instant_seal.json │ │ │ ├── kovan.json │ │ │ ├── mix.json │ │ │ ├── morden.json │ │ │ ├── musicoin.json │ │ │ ├── poacore.json │ │ │ ├── poasokol.json │ │ │ ├── rinkeby.json │ │ │ ├── ropsten.json │ │ │ ├── test │ │ │ │ ├── authority_round.json │ │ │ │ ├── authority_round_block_reward_contract.json │ │ │ │ ├── authority_round_empty_steps.json │ │ │ │ ├── authority_round_randomness_contract.json │ │ │ │ ├── authority_round_rewrite_bytecode_transitions.json │ │ │ │ ├── basic_authority.json │ │ │ │ ├── berlin_test.json │ │ │ │ ├── berlin_to_londonat5_test.json │ │ │ │ ├── builtin_multi_bench.json │ │ │ │ ├── builtin_one_activation_bench.json │ │ │ │ ├── byzantium_test.json │ │ │ │ ├── byzantium_to_constantinoplefixat5_test.json │ │ │ │ ├── constantinople_test.json │ │ │ │ ├── constructor.json │ │ │ │ ├── contract_ver_2_genesis.json │ │ │ │ ├── contract_ver_3.sol │ │ │ │ ├── contract_ver_3_genesis.json │ │ │ │ ├── contract_ver_4.sol │ │ │ │ ├── contract_ver_4_genesis.json │ │ │ │ ├── deprecated_contract_genesis.json │ │ │ │ ├── eip150_test.json │ │ │ │ ├── eip161_test.json │ │ │ │ ├── eip210_test.json │ │ │ │ ├── eip3607_test.json │ │ │ │ ├── frontier_like_test.json │ │ │ │ ├── frontier_test.json │ │ │ │ ├── homestead_test.json │ │ │ │ ├── istanbul_test.json │ │ │ │ ├── kovan_wasm_test.json │ │ │ │ ├── london_test.json │ │ │ │ ├── mcip3_test.json │ │ │ │ ├── null.json │ │ │ │ ├── null_morden.json │ │ │ │ ├── null_morden_with_finality.json │ │ │ │ ├── null_morden_with_reward.json │ │ │ │ ├── spec_backward_compability.json │ │ │ │ ├── st_peters_test.json │ │ │ │ ├── transition_test.json │ │ │ │ ├── validator_contract.json │ │ │ │ ├── validator_contract.sol │ │ │ │ ├── validator_multi.json │ │ │ │ └── validator_safe_contract.json │ │ │ ├── volta.json │ │ │ ├── xdai.json │ │ │ └── yolo3.json │ │ ├── contracts │ │ │ ├── authority_round_random.json │ │ │ ├── block_gas_limit.json │ │ │ ├── block_reward.json │ │ │ ├── registrar.json │ │ │ ├── test_authority_round_random.json │ │ │ ├── test_authority_round_random.sol │ │ │ ├── test_validator_set.json │ │ │ ├── tx_acl.json │ │ │ ├── tx_acl_1559.json │ │ │ ├── tx_acl_deprecated.json │ │ │ ├── tx_acl_gas_price.json │ │ │ ├── validator_report.json │ │ │ └── validator_set.json │ │ ├── json_tests.json │ │ └── local_tests │ │ │ └── block_en_de │ │ │ ├── acl_block_0.json │ │ │ ├── acl_block_1.json │ │ │ ├── acl_block_2.json │ │ │ ├── acl_block_3.json │ │ │ ├── acl_block_4.json │ │ │ ├── acl_block_5.json │ │ │ ├── acl_block_6.json │ │ │ ├── acl_block_7.json │ │ │ ├── acl_block_8.json │ │ │ ├── acl_block_9.json │ │ │ └── simple.json │ ├── service │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── service.rs │ │ │ └── stop_guard.rs │ ├── src │ │ ├── account_db.rs │ │ ├── block.rs │ │ ├── client │ │ │ ├── ancient_import.rs │ │ │ ├── bad_blocks.rs │ │ │ ├── chain_notify.rs │ │ │ ├── client.rs │ │ │ ├── config.rs │ │ │ ├── evm_test_client.rs │ │ │ ├── io_message.rs │ │ │ ├── mod.rs │ │ │ ├── test_client.rs │ │ │ ├── trace.rs │ │ │ └── traits.rs │ │ ├── engines │ │ │ ├── authority_round │ │ │ │ ├── block_gas_limit.rs │ │ │ │ ├── finality.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── randomness.rs │ │ │ │ └── util.rs │ │ │ ├── basic_authority.rs │ │ │ ├── block_reward.rs │ │ │ ├── clique │ │ │ │ ├── block_state.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── params.rs │ │ │ │ ├── tests.rs │ │ │ │ └── util.rs │ │ │ ├── instant_seal.rs │ │ │ ├── mod.rs │ │ │ ├── null_engine.rs │ │ │ ├── signer.rs │ │ │ └── validator_set │ │ │ │ ├── contract.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── multi.rs │ │ │ │ ├── safe_contract.rs │ │ │ │ ├── simple_list.rs │ │ │ │ └── test.rs │ │ ├── error.rs │ │ ├── ethereum │ │ │ ├── denominations.rs │ │ │ ├── ethash.rs │ │ │ └── mod.rs │ │ ├── executed.rs │ │ ├── executive.rs │ │ ├── externalities.rs │ │ ├── factory.rs │ │ ├── json_tests │ │ │ ├── chain.rs │ │ │ ├── difficulty.rs │ │ │ ├── executive.rs │ │ │ ├── local.rs │ │ │ ├── mod.rs │ │ │ ├── runner.rs │ │ │ ├── skip.rs │ │ │ ├── state.rs │ │ │ ├── test_common.rs │ │ │ ├── transaction.rs │ │ │ └── trie.rs │ │ ├── lib.rs │ │ ├── machine │ │ │ ├── impls.rs │ │ │ ├── mod.rs │ │ │ └── traits.rs │ │ ├── miner │ │ │ ├── cache.rs │ │ │ ├── miner.rs │ │ │ ├── mod.rs │ │ │ ├── pool_client.rs │ │ │ └── stratum.rs │ │ ├── pod_account.rs │ │ ├── pod_state.rs │ │ ├── snapshot │ │ │ ├── account.rs │ │ │ ├── block.rs │ │ │ ├── consensus │ │ │ │ ├── authority.rs │ │ │ │ ├── mod.rs │ │ │ │ └── work.rs │ │ │ ├── error.rs │ │ │ ├── io.rs │ │ │ ├── mod.rs │ │ │ ├── service.rs │ │ │ ├── tests │ │ │ │ ├── helpers.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── proof_of_authority.rs │ │ │ │ ├── proof_of_work.rs │ │ │ │ ├── service.rs │ │ │ │ ├── state.rs │ │ │ │ └── test_validator_contract.json │ │ │ ├── traits.rs │ │ │ └── watcher.rs │ │ ├── spec │ │ │ ├── genesis.rs │ │ │ ├── mod.rs │ │ │ ├── seal.rs │ │ │ └── spec.rs │ │ ├── state │ │ │ ├── account.rs │ │ │ ├── backend.rs │ │ │ ├── mod.rs │ │ │ └── substate.rs │ │ ├── state_db.rs │ │ ├── test_helpers.rs │ │ ├── tests │ │ │ ├── blockchain.rs │ │ │ ├── client.rs │ │ │ ├── evm.rs │ │ │ ├── mod.rs │ │ │ └── trace.rs │ │ ├── trace │ │ │ ├── config.rs │ │ │ ├── db.rs │ │ │ ├── executive_tracer.rs │ │ │ ├── import.rs │ │ │ ├── mod.rs │ │ │ ├── noop_tracer.rs │ │ │ └── types │ │ │ │ ├── error.rs │ │ │ │ ├── filter.rs │ │ │ │ ├── flat.rs │ │ │ │ ├── localized.rs │ │ │ │ ├── mod.rs │ │ │ │ └── trace.rs │ │ ├── transaction_ext.rs │ │ ├── tx_filter.rs │ │ └── verification │ │ │ ├── canon_verifier.rs │ │ │ ├── mod.rs │ │ │ ├── noop_verifier.rs │ │ │ ├── queue │ │ │ ├── kind.rs │ │ │ └── mod.rs │ │ │ ├── verification.rs │ │ │ └── verifier.rs │ ├── sync │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── api.rs │ │ │ ├── block_sync.rs │ │ │ ├── blocks.rs │ │ │ ├── chain │ │ │ ├── fork_filter.rs │ │ │ ├── handler.rs │ │ │ ├── mod.rs │ │ │ ├── propagator.rs │ │ │ ├── request_id.rs │ │ │ ├── requester.rs │ │ │ ├── supplier.rs │ │ │ └── sync_packet.rs │ │ │ ├── lib.rs │ │ │ ├── res │ │ │ └── private_spec.json │ │ │ ├── snapshot.rs │ │ │ ├── sync_io.rs │ │ │ ├── tests │ │ │ ├── chain.rs │ │ │ ├── consensus.rs │ │ │ ├── helpers.rs │ │ │ ├── mod.rs │ │ │ ├── rpc.rs │ │ │ └── snapshot.rs │ │ │ └── transactions_stats.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 │ │ ├── creation_status.rs │ │ ├── data_format.rs │ │ ├── encoded.rs │ │ ├── engines │ │ ├── epoch.rs │ │ └── mod.rs │ │ ├── filter.rs │ │ ├── header.rs │ │ ├── ids.rs │ │ ├── lib.rs │ │ ├── log_entry.rs │ │ ├── pruning_info.rs │ │ ├── receipt.rs │ │ ├── restoration_status.rs │ │ ├── security_level.rs │ │ ├── snapshot_manifest.rs │ │ ├── state_diff.rs │ │ ├── trace_filter.rs │ │ ├── transaction │ │ ├── error.rs │ │ ├── mod.rs │ │ ├── transaction.rs │ │ └── transaction_id.rs │ │ ├── tree_route.rs │ │ ├── verification_queue_info.rs │ │ └── views │ │ ├── block.rs │ │ ├── body.rs │ │ ├── header.rs │ │ ├── mod.rs │ │ ├── typed_transaction.rs │ │ └── view_rlp.rs ├── ethjson │ ├── Cargo.toml │ └── src │ │ ├── blockchain │ │ ├── account.rs │ │ ├── block.rs │ │ ├── blockchain.rs │ │ ├── header.rs │ │ ├── mod.rs │ │ ├── state.rs │ │ ├── test.rs │ │ └── transaction.rs │ │ ├── bytes.rs │ │ ├── hash.rs │ │ ├── lib.rs │ │ ├── local_tests │ │ └── mod.rs │ │ ├── maybe.rs │ │ ├── spec │ │ ├── account.rs │ │ ├── authority_round.rs │ │ ├── basic_authority.rs │ │ ├── builtin.rs │ │ ├── clique.rs │ │ ├── engine.rs │ │ ├── ethash.rs │ │ ├── genesis.rs │ │ ├── instant_seal.rs │ │ ├── mod.rs │ │ ├── null_engine.rs │ │ ├── params.rs │ │ ├── seal.rs │ │ ├── spec.rs │ │ ├── state.rs │ │ ├── step_duration.rs │ │ └── validator_set.rs │ │ ├── state │ │ ├── log.rs │ │ ├── mod.rs │ │ ├── state.rs │ │ ├── test.rs │ │ └── transaction.rs │ │ ├── test │ │ └── mod.rs │ │ ├── transaction │ │ ├── mod.rs │ │ ├── test.rs │ │ ├── transaction.rs │ │ └── txtest.rs │ │ ├── trie │ │ ├── input.rs │ │ ├── mod.rs │ │ ├── test.rs │ │ └── trie.rs │ │ ├── uint.rs │ │ └── vm │ │ ├── call.rs │ │ ├── env.rs │ │ ├── mod.rs │ │ ├── test.rs │ │ ├── transaction.rs │ │ └── vm.rs ├── net │ ├── fake-fetch │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── fetch │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── client.rs │ │ │ └── lib.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 │ └── node-filter │ │ ├── Cargo.toml │ │ ├── res │ │ ├── node_filter.json │ │ └── peer_set.json │ │ └── src │ │ └── lib.rs ├── rpc-common │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── types │ │ ├── bytes.rs │ │ └── mod.rs ├── rpc-servers │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rpc │ ├── Cargo.toml │ └── src │ │ ├── authcodes.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 │ │ │ ├── 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 │ │ ├── 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 │ │ ├── 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 │ │ ├── informant.rs │ │ ├── metadata.rs │ │ ├── mod.rs │ │ ├── tests │ │ ├── eth.rs │ │ ├── helpers │ │ │ ├── miner_service.rs │ │ │ ├── mod.rs │ │ │ ├── snapshot_service.rs │ │ │ └── sync_provider.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 │ │ ├── pubsub.rs │ │ ├── rpc.rs │ │ ├── secretstore.rs │ │ ├── signer.rs │ │ ├── traces.rs │ │ └── web3.rs │ │ └── types │ │ ├── account_info.rs │ │ ├── block.rs │ │ ├── block_number.rs │ │ ├── call_request.rs │ │ ├── confirmations.rs │ │ ├── derivation.rs │ │ ├── eip191.rs │ │ ├── eth_types.rs │ │ ├── fee_history.rs │ │ ├── filter.rs │ │ ├── histogram.rs │ │ ├── index.rs │ │ ├── log.rs │ │ ├── mod.rs │ │ ├── node_kind.rs │ │ ├── provenance.rs │ │ ├── pubsub.rs │ │ ├── receipt.rs │ │ ├── rpc_settings.rs │ │ ├── secretstore.rs │ │ ├── sync.rs │ │ ├── trace.rs │ │ ├── trace_filter.rs │ │ ├── transaction.rs │ │ ├── transaction_access_list.rs │ │ ├── transaction_condition.rs │ │ ├── transaction_request.rs │ │ └── work.rs ├── runtime │ ├── io │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── service_mio.rs │ │ │ ├── service_non_mio.rs │ │ │ └── worker.rs │ └── runtime │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── transaction-pool │ ├── Cargo.toml │ └── src │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── listener.rs │ │ ├── options.rs │ │ ├── pool.rs │ │ ├── ready.rs │ │ ├── replace.rs │ │ ├── scoring.rs │ │ ├── status.rs │ │ ├── tests │ │ ├── helpers.rs │ │ ├── mod.rs │ │ └── tx_builder.rs │ │ ├── transactions.rs │ │ └── verifier.rs ├── util │ ├── EIP-152 │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── EIP-712 │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── eip712.rs │ │ │ ├── encode.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ └── parser.rs │ ├── cli-signer │ │ ├── Cargo.toml │ │ ├── rpc-client │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── client.rs │ │ │ │ ├── lib.rs │ │ │ │ └── signer_client.rs │ │ └── src │ │ │ └── lib.rs │ ├── dir │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── helpers.rs │ │ │ └── lib.rs │ ├── fastmap │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.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 │ ├── memzero │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── panic-hook │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.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 │ ├── 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 └── vm │ ├── builtin │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── call-contract │ ├── Cargo.toml │ └── src │ │ ├── call_contract.rs │ │ └── lib.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 │ │ └── vmtype.rs │ ├── vm │ ├── Cargo.toml │ └── src │ │ ├── access_list.rs │ │ ├── action_params.rs │ │ ├── call_type.rs │ │ ├── env_info.rs │ │ ├── error.rs │ │ ├── ext.rs │ │ ├── lib.rs │ │ ├── return_data.rs │ │ ├── schedule.rs │ │ └── tests.rs │ └── wasm │ ├── Cargo.toml │ └── src │ ├── env.rs │ ├── lib.rs │ ├── panic_payload.rs │ ├── parser.rs │ └── runtime.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 ├── CHANGELOG-2.7.md ├── CHANGELOG-3.0.md ├── CHANGELOG-3.1.md └── logo-parity-ethereum.svg ├── license_header └── scripts ├── actions ├── build-linux.sh ├── build-windows.sh ├── clean-target.sh ├── install-sccache.ps1 └── validate-chainspecs.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 ├── openethereum.service ├── prometheus ├── config │ ├── grafana │ │ ├── dashboards │ │ │ └── oe.json │ │ ├── grafana.ini │ │ └── provisioning │ │ │ ├── dashboards │ │ │ └── provider.yaml │ │ │ └── datasources │ │ │ └── prometheus.yaml │ └── prometheus │ │ └── prometheus.yml └── docker-compose.yaml └── snap ├── icon.png ├── parity.desktop └── snapcraft.template.yaml /.cargo/config: -------------------------------------------------------------------------------- 1 | [target.x86_64-pc-windows-msvc] 2 | # Link the C runtime statically ; https://github.com/openethereum/parity-ethereum/issues/6643 3 | rustflags = ["-Ctarget-feature=+crt-static"] 4 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Reformat the source code 2 | 610d9baba4af83b5767c659ca2ccfed337af1056 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | For questions please use https://discord.io/openethereum, issues are for bugs and feature requests. 2 | 3 | _Before filing a new issue, please **provide the following information**._ 4 | 5 | - **OpenEthereum version (>=3.1.0)**: 0.0.0 6 | - **Operating system**: Windows / MacOS / Linux 7 | - **Installation**: homebrew / one-line installer / built from source 8 | - **Fully synchronized**: no / yes 9 | - **Network**: ethereum / ropsten / kovan / ... 10 | - **Restarted**: no / yes 11 | 12 | _Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._ 13 | 14 | -------------------------------------------------------------------------------- /.github/workflows/build-test-windows.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test Suite on Windows 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - dev 8 | jobs: 9 | build-tests: 10 | name: Test and Build 11 | strategy: 12 | matrix: 13 | platform: 14 | - windows2019 # custom runner 15 | toolchain: 16 | - stable 17 | runs-on: ${{ matrix.platform }} 18 | steps: 19 | - name: Checkout sources 20 | uses: actions/checkout@main 21 | with: 22 | submodules: true 23 | - name: Install toolchain 24 | uses: actions-rs/toolchain@v1 25 | with: 26 | toolchain: ${{ matrix.toolchain }} 27 | profile: minimal 28 | override: true 29 | - name: Build tests 30 | uses: actions-rs/cargo@v1 31 | with: 32 | command: test 33 | args: --locked --all --release --features "json-tests" --verbose --no-run 34 | -------------------------------------------------------------------------------- /.github/workflows/build-test.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test Suite 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | - dev 9 | jobs: 10 | build-tests: 11 | name: Test and Build 12 | strategy: 13 | matrix: 14 | platform: 15 | - ubuntu-latest 16 | - macos-latest 17 | toolchain: 18 | - stable 19 | runs-on: ${{ matrix.platform }} 20 | steps: 21 | - name: Checkout sources 22 | uses: actions/checkout@main 23 | with: 24 | submodules: true 25 | - name: Install toolchain 26 | uses: actions-rs/toolchain@v1 27 | with: 28 | toolchain: ${{ matrix.toolchain }} 29 | profile: minimal 30 | override: true 31 | - name: Build tests 32 | uses: actions-rs/cargo@v1 33 | with: 34 | command: test 35 | args: --locked --all --release --features "json-tests" --verbose --no-run 36 | - name: Run tests for ${{ matrix.platform }} 37 | uses: actions-rs/cargo@v1 38 | with: 39 | command: test 40 | args: --locked --all --release --features "json-tests" --verbose 41 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docker-nightly.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Nightly Release 2 | 3 | # Run "nightly" build on each commit to "dev" branch. 4 | on: 5 | push: 6 | branches: 7 | - dev 8 | 9 | jobs: 10 | deploy-docker: 11 | name: Build Release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout sources 15 | uses: actions/checkout@master 16 | - name: Install toolchain 17 | uses: actions-rs/toolchain@v1 18 | with: 19 | toolchain: stable 20 | profile: minimal 21 | override: true 22 | - name: Deploy to docker hub 23 | uses: elgohr/Publish-Docker-Github-Action@master 24 | with: 25 | name: openethereum/openethereum 26 | username: ${{ secrets.DOCKER_USERNAME }} 27 | password: ${{ secrets.DOCKER_PASSWORD }} 28 | dockerfile: scripts/docker/alpine/Dockerfile 29 | tags: "nightly" 30 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docker-tag.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Tag and Latest Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | jobs: 9 | deploy-docker: 10 | name: Build Release 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout sources 14 | uses: actions/checkout@master 15 | - name: Set env 16 | run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 17 | - name: Install toolchain 18 | uses: actions-rs/toolchain@v1 19 | with: 20 | toolchain: stable 21 | profile: minimal 22 | override: true 23 | - name: Deploy to docker hub 24 | uses: elgohr/Publish-Docker-Github-Action@master 25 | with: 26 | name: openethereum/openethereum 27 | username: ${{ secrets.DOCKER_USERNAME }} 28 | password: ${{ secrets.DOCKER_PASSWORD }} 29 | dockerfile: scripts/docker/alpine/Dockerfile 30 | tags: "latest,${{ env.RELEASE_VERSION }}" 31 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docker.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | tags: 8 | - v* 9 | 10 | jobs: 11 | deploy-docker: 12 | name: Build Release 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout sources 16 | uses: actions/checkout@master 17 | - name: Install toolchain 18 | uses: actions-rs/toolchain@v1 19 | with: 20 | toolchain: stable 21 | profile: minimal 22 | override: true 23 | - name: Deploy to docker hub 24 | uses: elgohr/Publish-Docker-Github-Action@master 25 | with: 26 | name: openethereum/openethereum 27 | username: ${{ secrets.DOCKER_USERNAME }} 28 | password: ${{ secrets.DOCKER_PASSWORD }} 29 | dockerfile: scripts/docker/alpine/Dockerfile 30 | tag_names: true 31 | -------------------------------------------------------------------------------- /.github/workflows/fmt.yml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | 3 | name: rustfmt 4 | 5 | jobs: 6 | fmt: 7 | name: Rustfmt 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions-rs/toolchain@v1 12 | with: 13 | profile: minimal 14 | toolchain: stable 15 | override: true 16 | - run: rustup component add rustfmt 17 | - uses: actions-rs/cargo@v1 18 | with: 19 | command: fmt 20 | args: --all -- --check --config merge_imports=true 21 | -------------------------------------------------------------------------------- /.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 | 42 | .vscode 43 | rls/ 44 | /parity.* 45 | 46 | # cargo remote artifacts 47 | remote-target 48 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "crates/ethcore/res/json_tests"] 2 | path = crates/ethcore/res/json_tests 3 | url = https://github.com/ethereum/tests.git 4 | -------------------------------------------------------------------------------- /bin/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 = "../../crates/ethjson" } 9 | serde_json = "1.0" 10 | -------------------------------------------------------------------------------- /bin/ethkey/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 = "../../crates/accounts/ethkey" } 11 | panic_hook = { path = "../../crates/util/panic-hook" } 12 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 13 | parity-wordlist="1.3" 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 | -------------------------------------------------------------------------------- /bin/ethstore/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.11.1" 15 | ethstore = { path = "../../crates/accounts/ethstore" } 16 | dir = { path = '../../crates/util/dir' } 17 | panic_hook = { path = "../../crates/util/panic-hook" } 18 | 19 | [[bin]] 20 | name = "ethstore" 21 | path = "src/main.rs" 22 | doc = false 23 | 24 | [dev-dependencies] 25 | tempdir = "0.3.5" 26 | -------------------------------------------------------------------------------- /bin/evmbin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity EVM Implementation" 3 | name = "evmbin" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [[bin]] 8 | name = "openethereum-evm" 9 | path = "./src/main.rs" 10 | 11 | [dependencies] 12 | common-types = { path = "../../crates/ethcore/types", features = ["test-helpers"] } 13 | docopt = "1.0" 14 | env_logger = "0.5" 15 | ethcore = { path = "../../crates/ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } 16 | ethereum-types = "0.9.2" 17 | ethjson = { path = "../../crates/ethjson" } 18 | evm = { path = "../../crates/vm/evm" } 19 | panic_hook = { path = "../../crates/util/panic-hook" } 20 | parity-bytes = "0.1" 21 | rustc-hex = "1.0" 22 | serde = "1.0" 23 | serde_derive = "1.0" 24 | serde_json = "1.0" 25 | vm = { path = "../../crates/vm/vm" } 26 | 27 | [dev-dependencies] 28 | criterion = "0.3.0" 29 | pretty_assertions = "0.1" 30 | tempdir = "0.3" 31 | 32 | [features] 33 | evm-debug = ["ethcore/evm-debug-tests"] 34 | -------------------------------------------------------------------------------- /bin/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 | -------------------------------------------------------------------------------- /bin/evmbin/src/display/config.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Config used by display informants 18 | 19 | #[derive(Default, Copy, Clone, Debug)] 20 | pub struct Config { 21 | omit_storage_output: bool, 22 | omit_memory_output: bool, 23 | } 24 | 25 | impl Config { 26 | pub fn new(omit_storage_output: bool, omit_memory_output: bool) -> Config { 27 | Config { 28 | omit_storage_output, 29 | omit_memory_output, 30 | } 31 | } 32 | 33 | pub fn omit_storage_output(&self) -> bool { 34 | self.omit_storage_output 35 | } 36 | 37 | pub fn omit_memory_output(&self) -> bool { 38 | self.omit_memory_output 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bin/evmbin/src/display/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! VM Output display utils. 18 | 19 | use std::time::Duration; 20 | 21 | pub mod config; 22 | pub mod json; 23 | pub mod simple; 24 | pub mod std_json; 25 | 26 | /// Formats duration into human readable format. 27 | pub fn format_time(time: &Duration) -> String { 28 | format!("{}.{:.9}s", time.as_secs(), time.subsec_nanos()) 29 | } 30 | 31 | /// Formats the time as microseconds. 32 | pub fn as_micros(time: &Duration) -> u64 { 33 | time.as_secs() * 1_000_000 + time.subsec_nanos() as u64 / 1_000 34 | } 35 | -------------------------------------------------------------------------------- /bin/oe/cli/presets/config.dev-insecure.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | chain = "dev" 3 | 4 | [mining] 5 | reseal_min_period = 0 6 | min_gas_price = 0 7 | 8 | [rpc] 9 | interface = "all" 10 | apis = ["all"] 11 | hosts = ["all"] 12 | -------------------------------------------------------------------------------- /bin/oe/cli/presets/config.dev.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | chain = "dev" 3 | 4 | [mining] 5 | reseal_min_period = 0 6 | min_gas_price = 0 7 | -------------------------------------------------------------------------------- /bin/oe/cli/presets/config.insecure.toml: -------------------------------------------------------------------------------- 1 | [rpc] 2 | interface = "all" 3 | apis = ["all"] 4 | hosts = ["all"] 5 | -------------------------------------------------------------------------------- /bin/oe/cli/presets/config.mining.toml: -------------------------------------------------------------------------------- 1 | [network] 2 | # OpenEthereum will try to maintain connection to at least 50 peers. 3 | min_peers = 50 4 | # OpenEthereum 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 OpenEthereum. 9 | disable = true 10 | 11 | [mining] 12 | # Prepare a block to seal even when there are no miners connected. 13 | force_sealing = true 14 | # New pending block will be created for all transactions (both local and external). 15 | reseal_on_txs = "all" 16 | # New pending block will be created only once per 4000 milliseconds. 17 | reseal_min_period = 4000 18 | # OpenEthereum will keep/relay at most 8192 transactions in queue. 19 | tx_queue_size = 8192 20 | tx_queue_per_sender = 128 21 | 22 | [footprint] 23 | # If defined will never use more then 1024MB for all caches. (Overrides other cache settings). 24 | cache_size = 1024 25 | 26 | [misc] 27 | # Logging pattern (`=`, e.g. `own_tx=trace`). 28 | logging = "miner=trace,own_tx=trace" 29 | -------------------------------------------------------------------------------- /bin/oe/cli/presets/config.non-standard-ports.toml: -------------------------------------------------------------------------------- 1 | [network] 2 | # OpenEthereum 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 | -------------------------------------------------------------------------------- /bin/oe/cli/presets/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /bin/oe/cli/tests/config.invalid1.toml: -------------------------------------------------------------------------------- 1 | [account 2 | unlock = "0x1" 3 | -------------------------------------------------------------------------------- /bin/oe/cli/tests/config.invalid2.toml: -------------------------------------------------------------------------------- 1 | [account] 2 | unlock = "0x1" 3 | passwd = [] 4 | 5 | -------------------------------------------------------------------------------- /bin/oe/cli/tests/config.invalid3.toml: -------------------------------------------------------------------------------- 1 | [signer] 2 | passwd = [] 3 | 4 | -------------------------------------------------------------------------------- /bin/oe/cli/tests/config.invalid4.toml: -------------------------------------------------------------------------------- 1 | [account] 2 | invalid = 5 3 | -------------------------------------------------------------------------------- /bin/oe/cli/tests/config.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | mode = "dark" 3 | mode_timeout = 15 4 | mode_alarm = 10 5 | chain = "./chain.json" 6 | 7 | [account] 8 | unlock = ["0x1", "0x2", "0x3"] 9 | password = ["passwdfile path"] 10 | 11 | [network] 12 | warp = false 13 | discovery = true 14 | nat = "any" 15 | min_peers = 10 16 | max_peers = 20 17 | max_pending_peers = 30 18 | snapshot_peers = 40 19 | allow_ips = "public" 20 | 21 | reserved_only = true 22 | reserved_peers = "./path/to/reserved_peers" 23 | 24 | [websockets] 25 | disable = true 26 | origins = ["none"] 27 | 28 | [rpc] 29 | disable = true 30 | port = 8180 31 | 32 | [ipc] 33 | apis = ["rpc", "eth"] 34 | 35 | [metrics] 36 | enable = true 37 | interface = "local" 38 | port = 4000 39 | prefix = "oe" 40 | 41 | [secretstore] 42 | http_port = 8082 43 | port = 8083 44 | 45 | [mining] 46 | author = "0xdeadbeefcafe0000000000000000000000000001" 47 | engine_signer = "0xdeadbeefcafe0000000000000000000000000001" 48 | force_sealing = true 49 | reseal_on_txs = "all" 50 | reseal_min_period = 4000 51 | reseal_max_period = 60000 52 | price_update_period = "hourly" 53 | tx_queue_size = 8192 54 | 55 | [footprint] 56 | tracing = "on" 57 | pruning = "fast" 58 | pruning_history = 64 59 | cache_size_db = 256 60 | cache_size_blocks = 16 61 | cache_size_queue = 100 62 | cache_size_state = 25 63 | db_compaction = "ssd" 64 | fat_db = "off" 65 | scale_verifiers = false 66 | 67 | [snapshots] 68 | enable = false 69 | 70 | [misc] 71 | logging = "own_tx=trace" 72 | log_file = "/var/log/openethereum.log" 73 | color = true 74 | ports_shift = 0 75 | unsafe_expose = false 76 | -------------------------------------------------------------------------------- /bin/oe/cli/usage_header.txt: -------------------------------------------------------------------------------- 1 | OpenEthereum 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 | -------------------------------------------------------------------------------- /bin/oe/cli/version.txt: -------------------------------------------------------------------------------- 1 | OpenEthereum 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 | -------------------------------------------------------------------------------- /bin/oe/db/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Database-related operations. 18 | 19 | #[path = "rocksdb/mod.rs"] 20 | mod impls; 21 | 22 | pub use self::impls::{migrate, restoration_db_handler}; 23 | 24 | #[cfg(feature = "secretstore")] 25 | pub use self::impls::open_secretstore_db; 26 | -------------------------------------------------------------------------------- /bin/oe/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.11.1" 16 | arrayvec = "0.4" 17 | ansi_term = "0.10" 18 | -------------------------------------------------------------------------------- /crates/accounts/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum Account Management" 3 | homepage = "https://github.com/openethereum/openethereum" 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 | common-types = { path = "../ethcore/types" } 12 | ethkey = { path = "ethkey" } 13 | ethstore = { path = "ethstore" } 14 | log = "0.4" 15 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 16 | parking_lot = "0.11.1" 17 | serde = "1.0" 18 | serde_derive = "1.0" 19 | serde_json = "1.0" 20 | 21 | [dev-dependencies] 22 | ethereum-types = "0.9.2" 23 | tempdir = "0.3" 24 | -------------------------------------------------------------------------------- /crates/accounts/ethkey/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/accounts/ethkey/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Keys Generator" 3 | name = "ethkey" 4 | version = "0.3.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | edit-distance = "2.0" 9 | parity-crypto = { version = "0.6.2", features = ["publickey"] } 10 | eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", rev = "9791e79f21a5309dcb6e0bd254b1ef88fca2f1f4" } 11 | ethereum-types = "0.9.2" 12 | lazy_static = "1.0" 13 | log = "0.4" 14 | memzero = { path = "../../../crates/util/memzero" } 15 | parity-wordlist = "1.3" 16 | quick-error = "1.2.2" 17 | rand = "0.7.3" 18 | rustc-hex = "1.0" 19 | serde = "1.0" 20 | serde_derive = "1.0" 21 | tiny-keccak = "1.4" 22 | -------------------------------------------------------------------------------- /crates/accounts/ethkey/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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::{ 37 | brain::Brain, brain_prefix::BrainPrefix, parity_wordlist::Error as WordlistError, 38 | password::Password, prefix::Prefix, 39 | }; 40 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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.3" 11 | ethkey = { path = "../ethkey" } 12 | serde = "1.0" 13 | serde_json = "1.0" 14 | serde_derive = "1.0" 15 | rustc-hex = "1.0" 16 | time = "0.1.34" 17 | itertools = "0.5" 18 | parking_lot = "0.11.1" 19 | parity-crypto = { version = "0.6.2", features = [ "publickey"] } 20 | ethereum-types = "0.9.2" 21 | smallvec = "0.6" 22 | parity-wordlist = "1.3" 23 | tempdir = "0.3" 24 | lazy_static = "1.2.0" 25 | 26 | [dev-dependencies] 27 | matches = "0.1" 28 | 29 | [lib] 30 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/src/account/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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::{ 24 | cipher::{Aes128Ctr, Cipher}, 25 | crypto::Crypto, 26 | kdf::{Kdf, Pbkdf2, Prf, Scrypt}, 27 | safe_account::SafeAccount, 28 | version::Version, 29 | }; 30 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/src/account/version.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/src/ethkey.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! ethkey reexport to make documentation look pretty. 18 | pub use _ethkey::*; 19 | pub use crypto::publickey::Address; 20 | use json; 21 | 22 | impl Into for Address { 23 | fn into(self) -> json::H160 { 24 | let a: [u8; 20] = self.into(); 25 | From::from(a) 26 | } 27 | } 28 | 29 | impl From for Address { 30 | fn from(json: json::H160) -> Self { 31 | let a: [u8; 20] = json.into(); 32 | From::from(a) 33 | } 34 | } 35 | 36 | impl<'a> From<&'a json::H160> for Address { 37 | fn from(json: &'a json::H160) -> Self { 38 | let mut a = [0u8; 20]; 39 | a.copy_from_slice(json); 40 | From::from(a) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/src/json/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Contract interface specification. 18 | 19 | mod bytes; 20 | mod cipher; 21 | mod crypto; 22 | mod error; 23 | mod hash; 24 | mod id; 25 | mod kdf; 26 | mod key_file; 27 | mod presale; 28 | mod vault_file; 29 | mod vault_key_file; 30 | mod version; 31 | 32 | pub use self::{ 33 | bytes::Bytes, 34 | cipher::{Aes128Ctr, Cipher, CipherSer, CipherSerParams}, 35 | crypto::{CipherText, Crypto}, 36 | error::Error, 37 | hash::{H128, H160, H256}, 38 | id::Uuid, 39 | kdf::{Kdf, KdfSer, KdfSerParams, Pbkdf2, Prf, Scrypt}, 40 | key_file::{KeyFile, OpaqueKeyFile}, 41 | presale::{Encseed, PresaleWallet}, 42 | vault_file::VaultFile, 43 | vault_key_file::{ 44 | insert_vault_name_to_json_meta, remove_vault_name_from_json_meta, VaultKeyFile, 45 | VaultKeyMeta, 46 | }, 47 | version::Version, 48 | }; 49 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/src/random.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | use rand::{distributions::Alphanumeric, rngs::OsRng, Rng, RngCore}; 18 | 19 | pub trait Random { 20 | fn random() -> Self 21 | where 22 | Self: Sized; 23 | } 24 | 25 | impl Random for [u8; 16] { 26 | fn random() -> Self { 27 | let mut result = [0u8; 16]; 28 | let mut rng = OsRng; 29 | rng.fill_bytes(&mut result); 30 | result 31 | } 32 | } 33 | 34 | impl Random for [u8; 32] { 35 | fn random() -> Self { 36 | let mut result = [0u8; 32]; 37 | let mut rng = OsRng; 38 | rng.fill_bytes(&mut result); 39 | result 40 | } 41 | } 42 | 43 | /// Generate a random string of given length. 44 | pub fn random_string(length: usize) -> String { 45 | let rng = OsRng; 46 | rng.sample_iter(&Alphanumeric).take(length).collect() 47 | } 48 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/accounts/ethstore/tests/util/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | mod transient_dir; 18 | 19 | pub use self::transient_dir::TransientDir; 20 | -------------------------------------------------------------------------------- /crates/accounts/src/error.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/concensus/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 | crunchy = "0.1.0" 9 | either = "1.0.0" 10 | ethereum-types = "0.9.2" 11 | keccak-hash = "0.5.0" 12 | tiny-keccak = "2.0.2" 13 | log = "0.4" 14 | memmap = "0.6" 15 | parking_lot = "0.11.1" 16 | primal = "0.2.3" 17 | 18 | [dev-dependencies] 19 | criterion = "0.2" 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 | -------------------------------------------------------------------------------- /crates/concensus/ethash/src/keccak.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | extern crate keccak_hash as hash; 18 | 19 | pub type H256 = [u8; 32]; 20 | 21 | pub mod keccak_512 { 22 | use super::hash; 23 | 24 | pub use self::hash::{ 25 | keccak512 as inplace, keccak512_range as inplace_range, keccak_512 as write, 26 | }; 27 | } 28 | 29 | pub mod keccak_256 { 30 | use super::hash; 31 | 32 | pub use self::hash::{ 33 | keccak256 as inplace, keccak256_range as inplace_range, keccak_256 as write, 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /crates/concensus/miner/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum Miner Interface." 3 | name = "ethcore-miner" 4 | homepage = "https://github.com/openethereum/openethereum" 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 = "../../concensus/ethash", optional = true } 12 | fetch = { path = "../../net/fetch", optional = true } 13 | hyper = { version = "0.12", optional = true } 14 | url = { version = "2", optional = true } 15 | 16 | # Miner 17 | ansi_term = "0.10" 18 | common-types = { path = "../../ethcore/types" } 19 | error-chain = "0.12" 20 | ethabi = "12.0.0" 21 | ethabi-derive = { git = 'https://github.com/rimrakhimov/ethabi', branch = 'rimrakhimov/remove-syn-export-span' } 22 | ethabi-contract = "11.0.0" 23 | ethcore-call-contract = { path = "../../vm/call-contract" } 24 | ethereum-types = "0.9.2" 25 | futures = "0.1" 26 | keccak-hash = "0.5.0" 27 | linked-hash-map = "0.5" 28 | log = "0.4" 29 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 30 | parity-runtime = { path = "../../runtime/runtime" } 31 | parity-util-mem = "0.7" 32 | parking_lot = "0.11.1" 33 | price-info = { path = "./price-info", optional = true } 34 | rlp = { version = "0.4.6" } 35 | serde = { version = "1.0", features = ["derive"] } 36 | serde_derive = "1.0" 37 | serde_json = "1.0" 38 | trace-time = "0.1" 39 | txpool = { path = "../../transaction-pool" } 40 | 41 | [dev-dependencies] 42 | env_logger = "0.5" 43 | ethkey = { path = "../../accounts/ethkey" } 44 | rustc-hex = "1.0" 45 | 46 | [features] 47 | work-notify = ["ethash", "fetch", "hyper", "url"] 48 | -------------------------------------------------------------------------------- /crates/concensus/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 | 7 | [dependencies] 8 | common-types = { path = "../../../ethcore/types" } 9 | ethcore-io = { path = "../../../runtime/io" } 10 | ethcore-db = { path = "../../../db/db"} 11 | kvdb = "0.1" 12 | log = "0.4" 13 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 14 | rlp = { version = "0.4.6" } 15 | serde = "1.0" 16 | serde_derive = "1.0" 17 | serde_json = "1.0" 18 | 19 | [dev-dependencies] 20 | ethkey = { path = "../../../accounts/ethkey" } 21 | kvdb-memorydb = "0.1" 22 | -------------------------------------------------------------------------------- /crates/concensus/miner/price-info/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Fetch current ETH price" 3 | homepage = "https://github.com/openethereum/openethereum" 4 | license = "GPL-3.0" 5 | name = "price-info" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | fetch = { path = "../../../net/fetch" } 11 | futures = "0.1" 12 | parity-runtime = { path = "../../../runtime/runtime" } 13 | log = "0.4" 14 | serde_json = "1.0" 15 | 16 | [dev-dependencies] 17 | parking_lot = "0.11.1" 18 | fake-fetch = { path = "../../../net/fake-fetch" } 19 | -------------------------------------------------------------------------------- /crates/concensus/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 | -------------------------------------------------------------------------------- /crates/concensus/miner/src/local_accounts.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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) 36 | where 37 | A: LocalAccounts, 38 | B: LocalAccounts, 39 | { 40 | fn is_local(&self, address: &Address) -> bool { 41 | self.0.is_local(address) || self.1.is_local(address) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /crates/concensus/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.9.2" 10 | keccak-hash = "0.5.0" 11 | jsonrpc-core = "15.0.0" 12 | jsonrpc-tcp-server = "15.0.0" 13 | log = "0.4" 14 | parking_lot = "0.11.1" 15 | 16 | [dev-dependencies] 17 | env_logger = "0.5" 18 | tokio = "0.1" 19 | tokio-io = "0.1" 20 | -------------------------------------------------------------------------------- /crates/concensus/miner/using-queue/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "using_queue" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /crates/db/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 | 8 | [lib] 9 | path = "src/lib.rs" 10 | 11 | [dependencies] 12 | siphasher = "0.1.1" 13 | -------------------------------------------------------------------------------- /crates/db/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 | 7 | [dependencies] 8 | byteorder = "1.2" 9 | ethbloom = "0.9.1" 10 | parking_lot = "0.11.1" 11 | tiny-keccak = "1.4" 12 | 13 | [dev-dependencies] 14 | criterion = "0.3.0" 15 | tempdir = "0.3" 16 | -------------------------------------------------------------------------------- /crates/db/db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum DB access utilities" 3 | homepage = "https://github.com/openethereum/openethereum" 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 = "../../ethcore/types" } 12 | ethereum-types = "0.9.2" 13 | kvdb = "0.1" 14 | kvdb-rocksdb = "0.1.3" 15 | kvdb-memorydb = "0.1" 16 | parity-util-mem = "0.7" 17 | parking_lot = "0.11.1" 18 | rlp = { version = "0.4.6" } 19 | rlp_derive = { path = "../../util/rlp-derive" } 20 | stats = { path = "../../util/stats" } -------------------------------------------------------------------------------- /crates/db/db/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! OpenEthereum database access utilities. 18 | 19 | #![warn(missing_docs)] 20 | 21 | mod db; 22 | 23 | pub mod cache_manager; 24 | pub mod keys; 25 | pub use kvdb::{DBTransaction, DBValue}; 26 | 27 | pub use self::db::*; 28 | -------------------------------------------------------------------------------- /crates/db/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 | 8 | [dependencies] 9 | parity-bytes = "0.1" 10 | ethereum-types = "0.9.2" 11 | hash-db = "0.11.0" 12 | keccak-hasher = { path = "../../util/keccak-hasher" } 13 | ethcore-db = { path = "../../db/db"} 14 | kvdb = "0.1" 15 | log = "0.4" 16 | memory-db = { path = "../memory-db" } 17 | parity-util-mem = "0.7" 18 | parking_lot = "0.11.1" 19 | fastmap = { path = "../../util/fastmap" } 20 | rlp = { version = "0.4.6" } 21 | 22 | [dev-dependencies] 23 | env_logger = "0.5" 24 | keccak-hash = "0.5.0" 25 | kvdb-memorydb = "=0.1.0" 26 | -------------------------------------------------------------------------------- /crates/db/memory-db/.cargo_vcs_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "sha1": "909b921151ebedf34456246dde0c7c4c3d3dcecb" 4 | } 5 | } -------------------------------------------------------------------------------- /crates/db/memory-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO 2 | # 3 | # When uploading crates to the registry Cargo will automatically 4 | # "normalize" Cargo.toml files for maximal compatibility 5 | # with all versions of Cargo and also rewrite `path` dependencies 6 | # to registry (e.g. crates.io) dependencies 7 | # 8 | # If you believe there's an error in this file please file an 9 | # issue against the rust-lang/cargo repository. If you're 10 | # editing this file be aware that the upstream Cargo.toml 11 | # will likely look very different (and much more reasonable) 12 | 13 | [package] 14 | name = "memory-db" 15 | version = "0.11.0" 16 | authors = ["Parity Technologies "] 17 | description = "In-memory implementation of hash-db, useful for tests" 18 | license = "Apache-2.0" 19 | repository = "https://github.com/paritytech/parity-common" 20 | 21 | [[bench]] 22 | name = "bench" 23 | harness = false 24 | 25 | [dependencies] 26 | hash-db = "0.11.0" 27 | 28 | [dev-dependencies.criterion] 29 | version = "0.2.8" 30 | 31 | [dev-dependencies.keccak-hasher] 32 | version = "0.11.0" 33 | 34 | [dependencies.parity-util-mem] 35 | version = "0.7" 36 | -------------------------------------------------------------------------------- /crates/db/memory-db/Cargo.toml.orig: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "memory-db" 3 | version = "0.11.0" 4 | authors = ["Parity Technologies "] 5 | description = "In-memory implementation of hash-db, useful for tests" 6 | repository = "https://github.com/paritytech/parity-common" 7 | license = "Apache-2.0" 8 | 9 | [dependencies] 10 | heapsize = "0.4" 11 | hash-db = { path = "../hash-db", version = "0.11.0"} 12 | 13 | [dev-dependencies] 14 | keccak-hasher = { path = "../test-support/keccak-hasher", version = "0.11.0"} 15 | criterion = "0.2.8" 16 | 17 | [[bench]] 18 | name = "bench" 19 | harness = false -------------------------------------------------------------------------------- /crates/db/memory-db/README.md: -------------------------------------------------------------------------------- 1 | MemoryDB is a reference counted memory-based [`HashDB`](https://github.com/paritytech/parity-common/tree/master/hash-db) implementation backed by a `HashMap`. -------------------------------------------------------------------------------- /crates/db/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 = "../../util/macros" } 9 | kvdb = "0.1" 10 | kvdb-rocksdb = "0.1.3" 11 | 12 | [dev-dependencies] 13 | tempdir = "0.3" 14 | -------------------------------------------------------------------------------- /crates/db/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.11.0" 10 | keccak-hasher = { version = "0.1.1", path = "../../util/keccak-hasher" } 11 | hash-db = "0.11.0" 12 | rlp = { version = "0.4.6" } 13 | parity-bytes = "0.1" 14 | ethereum-types = "0.9.2" 15 | elastic-array = "0.10" 16 | 17 | [dev-dependencies] 18 | memory-db = "0.11.0" 19 | keccak-hash = "0.5.0" 20 | journaldb = { path = "../journaldb" } 21 | -------------------------------------------------------------------------------- /crates/ethcore/blockchain/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum Blockchain Database, Test Generator, Configuration, Caching, Importing Blocks, and Block Information" 3 | homepage = "https://github.com/openethereum/openethereum" 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 = "../../db/blooms-db" } 13 | common-types = { path = "../types" } 14 | ethcore-db = { path = "../../db/db" } 15 | ethereum-types = "0.9.2" 16 | itertools = "0.5" 17 | keccak-hash = "0.5.0" 18 | kvdb = "0.1" 19 | log = "0.4" 20 | parity-bytes = "0.1" 21 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 22 | parity-util-mem = "0.7" 23 | parking_lot = "0.11.1" 24 | rand = "0.7.3" 25 | rayon = "1.1" 26 | rlp = { version = "0.4.6" } 27 | rlp_compress = { path = "../../util/rlp-compress" } 28 | rlp_derive = { path = "../../util/rlp-derive" } 29 | triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } 30 | stats = { path = "../../util/stats" } 31 | 32 | [dev-dependencies] 33 | env_logger = "0.5" 34 | ethkey = { path = "../../accounts/ethkey" } 35 | rustc-hex = "1.0" 36 | tempdir = "0.3" 37 | kvdb-memorydb = "0.1" 38 | -------------------------------------------------------------------------------- /crates/ethcore/blockchain/src/cache.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/blockchain/src/config.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/blockchain/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Blockchain database. 18 | 19 | #![warn(missing_docs)] 20 | 21 | extern crate parity_crypto as crypto; 22 | 23 | mod best_block; 24 | mod block_info; 25 | mod blockchain; 26 | mod cache; 27 | mod config; 28 | mod import_route; 29 | mod update; 30 | 31 | pub mod generator; 32 | 33 | pub use self::{ 34 | blockchain::{BlockChain, BlockChainDB, BlockChainDBHandler, BlockProvider}, 35 | cache::CacheSize, 36 | config::Config, 37 | import_route::ImportRoute, 38 | update::ExtrasInsert, 39 | }; 40 | pub use common_types::tree_route::TreeRoute; 41 | pub use ethcore_db::keys::{BlockDetails, BlockNumberKey, BlockReceipts, TransactionAddress}; 42 | -------------------------------------------------------------------------------- /crates/ethcore/res/chainspec/test/null_morden.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Morden", 3 | "engine": { 4 | "null": { 5 | "params": {} 6 | } 7 | }, 8 | "params": { 9 | "gasLimitBoundDivisor": "0x0400", 10 | "accountStartNonce": "0x0", 11 | "maximumExtraDataSize": "0x20", 12 | "minGasLimit": "0x1388", 13 | "networkID" : "0x2" 14 | }, 15 | "genesis": { 16 | "seal": { 17 | "ethereum": { 18 | "nonce": "0x00006d6f7264656e", 19 | "mixHash": "0x00000000000000000000000000000000000000647572616c65787365646c6578" 20 | } 21 | }, 22 | "difficulty": "0x20000", 23 | "author": "0x0000000000000000000000000000000000000000", 24 | "timestamp": "0x00", 25 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 26 | "extraData": "0x", 27 | "gasLimit": "0x2fefd8" 28 | }, 29 | "accounts": { 30 | "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, 31 | "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, 32 | "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, 33 | "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, 34 | "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | ] -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | ] -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | {"constant": true, "inputs": [ { "name": "validator", "type": "address" }, { "name": "blockNum", "type": "uint256" } ], "name": "maliceReportedForBlock", "outputs": [ { "name": "", "type": "address[]" } ], "payable": false, "stateMutability": "view", "type": "function" } 5 | ] 6 | -------------------------------------------------------------------------------- /crates/ethcore/res/contracts/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 | "constant": true, 7 | "inputs": [], 8 | "name": "emitInitiateChangeCallable", 9 | "outputs": [ 10 | { 11 | "name": "", 12 | "type": "bool" 13 | } 14 | ], 15 | "payable": false, 16 | "stateMutability": "view", 17 | "type": "function" 18 | }, 19 | { 20 | "constant": false, 21 | "inputs": [], 22 | "name": "emitInitiateChange", 23 | "outputs": [], 24 | "payable": false, 25 | "stateMutability": "nonpayable", 26 | "type": "function" 27 | }, 28 | { 29 | "constant": true, 30 | "inputs": [ 31 | { 32 | "name": "_reportingValidator", 33 | "type": "address" 34 | }, 35 | { 36 | "name": "_maliciousValidator", 37 | "type": "address" 38 | }, 39 | { 40 | "name": "_blockNumber", 41 | "type": "uint256" 42 | } 43 | ], 44 | "name": "shouldValidatorReport", 45 | "outputs": [ 46 | { 47 | "name": "", 48 | "type": "bool" 49 | } 50 | ], 51 | "payable": false, 52 | "stateMutability": "view", 53 | "type": "function" 54 | } 55 | ] -------------------------------------------------------------------------------- /crates/ethcore/res/json_tests.json: -------------------------------------------------------------------------------- 1 | { 2 | "local": [ 3 | { 4 | "path": "res/local_tests/block_en_de", 5 | "test_type": "block_en_de" 6 | } 7 | ], 8 | "chain": [ 9 | { 10 | "path": "res/json_tests/BlockchainTests", 11 | "skip": [] 12 | }, 13 | { 14 | "path": "res/json_tests/LegacyTests/Constantinople/BlockchainTests", 15 | "skip": [] 16 | } 17 | ], 18 | "state": [ 19 | { 20 | "path": "res/json_tests/GeneralStateTests", 21 | "skip": [] 22 | }, 23 | { 24 | "path": "res/json_tests/LegacyTests/Constantinople/GeneralStateTests", 25 | "skip": [] 26 | } 27 | ], 28 | "difficulty": [ 29 | { 30 | "path": [ 31 | "res/json_tests/BasicTests/difficulty.json", 32 | "res/json_tests/BasicTests/difficultyMainNetwork.json" 33 | ], 34 | "chainspec": "Foundation" 35 | } 36 | ], 37 | "executive": [ 38 | { 39 | "path": "res/json_tests/LegacyTests/Constantinople/VMTests" 40 | } 41 | ], 42 | "transaction": [ 43 | { 44 | "path": "res/json_tests/TransactionTests" 45 | } 46 | ], 47 | "trie": [ 48 | { 49 | "path": ["res/json_tests/TrieTests/trietest.json", "res/json_tests/TrieTests/trieanyorder.json"], 50 | "triespec": "Generic" 51 | }, 52 | { 53 | "path": [ 54 | "res/json_tests/TrieTests/hex_encoded_securetrie_test.json", 55 | "res/json_tests/TrieTests/trietest_secureTrie.json", 56 | "res/json_tests/TrieTests/trieanyorder_secureTrie.json" 57 | ], 58 | "triespec": "Secure" 59 | } 60 | ] 61 | } 62 | -------------------------------------------------------------------------------- /crates/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.10" 9 | error-chain = { version = "0.12", default-features = false } 10 | ethcore = { path = ".." } 11 | ethcore-blockchain = { path = "../blockchain" } 12 | ethcore-io = { path = "../../runtime/io" } 13 | ethcore-sync = { path = "../sync" } 14 | ethereum-types = "0.9.2" 15 | kvdb = "0.1" 16 | log = "0.4" 17 | trace-time = "0.1" 18 | 19 | [dev-dependencies] 20 | ethcore-db = { path = "../../db/db" } 21 | ethcore = { path = "..", features = ["test-helpers"] } 22 | tempdir = "0.3" 23 | kvdb-rocksdb = "0.1.3" 24 | -------------------------------------------------------------------------------- /crates/ethcore/service/src/error.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | // Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting` 18 | // https://github.com/openethereum/openethereum/issues/10302 19 | #![allow(deprecated)] 20 | 21 | use ethcore; 22 | use io; 23 | 24 | error_chain! { 25 | foreign_links { 26 | Ethcore(ethcore::error::Error); 27 | IoError(io::IoError); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /crates/ethcore/service/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | extern crate ansi_term; 18 | extern crate ethcore; 19 | extern crate ethcore_blockchain as blockchain; 20 | extern crate ethcore_io as io; 21 | extern crate ethcore_sync as sync; 22 | extern crate ethereum_types; 23 | extern crate kvdb; 24 | 25 | #[macro_use] 26 | extern crate error_chain; 27 | #[macro_use] 28 | extern crate log; 29 | #[macro_use] 30 | extern crate trace_time; 31 | 32 | #[cfg(test)] 33 | extern crate ethcore_db; 34 | #[cfg(test)] 35 | extern crate tempdir; 36 | 37 | mod error; 38 | mod service; 39 | mod stop_guard; 40 | 41 | #[cfg(test)] 42 | extern crate kvdb_rocksdb; 43 | 44 | pub use error::{Error, ErrorKind}; 45 | pub use service::ClientService; 46 | -------------------------------------------------------------------------------- /crates/ethcore/service/src/stop_guard.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Stop guard mod 18 | 19 | use std::sync::{atomic::*, Arc}; 20 | 21 | /// Stop guard that will set a stop flag on drop 22 | pub struct StopGuard { 23 | flag: Arc, 24 | } 25 | 26 | impl StopGuard { 27 | /// Create a stop guard 28 | pub fn new() -> StopGuard { 29 | StopGuard { 30 | flag: Arc::new(AtomicBool::new(false)), 31 | } 32 | } 33 | } 34 | 35 | impl Drop for StopGuard { 36 | fn drop(&mut self) { 37 | self.flag.store(true, Ordering::SeqCst) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /crates/ethcore/src/engines/clique/params.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 { period, epoch } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /crates/ethcore/src/ethereum/denominations.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | use ethereum_types::U256; 18 | 19 | #[inline] 20 | /// 1 Ether in Wei 21 | pub fn ether() -> U256 { 22 | U256::exp10(18) 23 | } 24 | 25 | #[inline] 26 | /// 1 Finney in Wei 27 | pub fn finney() -> U256 { 28 | U256::exp10(15) 29 | } 30 | 31 | #[inline] 32 | /// 1 Szabo in Wei 33 | pub fn szabo() -> U256 { 34 | U256::exp10(12) 35 | } 36 | 37 | #[inline] 38 | /// 1 Shannon in Wei 39 | pub fn shannon() -> U256 { 40 | U256::exp10(9) 41 | } 42 | 43 | #[inline] 44 | /// 1 Wei in Wei 45 | pub fn wei() -> U256 { 46 | U256::exp10(0) 47 | } 48 | -------------------------------------------------------------------------------- /crates/ethcore/src/json_tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Helpers and tests for operating on jsontests. 18 | 19 | mod chain; 20 | mod difficulty; 21 | mod executive; 22 | mod local; 23 | mod state; 24 | mod test_common; 25 | mod transaction; 26 | mod trie; 27 | 28 | /// executor of ethereum/json tests 29 | pub mod runner; 30 | 31 | pub use self::{ 32 | executive::json_executive_test, 33 | test_common::{debug_include_test, find_json_files_recursive, HookType}, 34 | }; 35 | -------------------------------------------------------------------------------- /crates/ethcore/src/json_tests/skip.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! State tests to skip. 18 | 19 | use ethjson; 20 | 21 | #[cfg(feature = "ci-skip-tests")] 22 | lazy_static! { 23 | pub static ref SKIP_TEST_STATE: ethjson::test::SkipStates = { 24 | let skip_data = include_bytes!("../../res/ethereum/tests-issues/currents.json"); 25 | ethjson::test::SkipStates::load(&skip_data[..]).expect("No invalid json allowed") 26 | }; 27 | } 28 | 29 | #[cfg(not(feature = "ci-skip-tests"))] 30 | lazy_static! { 31 | pub static ref SKIP_TEST_STATE: ethjson::test::SkipStates = ethjson::test::SkipStates::empty(); 32 | } 33 | -------------------------------------------------------------------------------- /crates/ethcore/src/machine/mod.rs: -------------------------------------------------------------------------------- 1 | //! Generalization of a state machine for a consensus engine. 2 | 3 | mod impls; 4 | mod traits; 5 | 6 | pub use self::{impls::*, traits::*}; 7 | -------------------------------------------------------------------------------- /crates/ethcore/src/snapshot/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Snapshot tests. 18 | 19 | mod proof_of_authority; 20 | mod proof_of_work; 21 | mod service; 22 | mod state; 23 | 24 | pub mod helpers; 25 | 26 | use super::ManifestData; 27 | 28 | #[test] 29 | fn manifest_rlp() { 30 | let manifest = ManifestData { 31 | version: 2, 32 | block_hashes: Vec::new(), 33 | state_hashes: Vec::new(), 34 | block_number: 1234567, 35 | state_root: Default::default(), 36 | block_hash: Default::default(), 37 | }; 38 | let raw = manifest.clone().into_rlp(); 39 | assert_eq!(ManifestData::from_rlp(&raw).unwrap(), manifest); 40 | } 41 | -------------------------------------------------------------------------------- /crates/ethcore/src/spec/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Blockchain params. 18 | 19 | mod genesis; 20 | mod seal; 21 | mod spec; 22 | 23 | pub use self::{ 24 | genesis::Genesis, 25 | spec::{CommonParams, OptimizeFor, Spec, SpecParams}, 26 | }; 27 | -------------------------------------------------------------------------------- /crates/ethcore/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | mod blockchain; 18 | mod client; 19 | mod evm; 20 | mod trace; 21 | -------------------------------------------------------------------------------- /crates/ethcore/src/trace/config.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | /// Preferef 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 | -------------------------------------------------------------------------------- /crates/ethcore/src/trace/import.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Traces import request. 18 | use ethereum_types::H256; 19 | use types::BlockNumber; 20 | 21 | use trace::FlatBlockTraces; 22 | 23 | /// Traces import request. 24 | pub struct ImportRequest { 25 | /// Traces to import. 26 | pub traces: FlatBlockTraces, 27 | /// Hash of traces block. 28 | pub block_hash: H256, 29 | /// Number of traces block. 30 | pub block_number: BlockNumber, 31 | /// Blocks enacted by this import. 32 | /// 33 | /// They should be ordered from oldest to newest. 34 | pub enacted: Vec, 35 | /// Number of blocks retracted by this import. 36 | pub retracted: usize, 37 | } 38 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/ethcore/sync/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | mod chain; 18 | mod consensus; 19 | pub mod helpers; 20 | pub mod snapshot; 21 | 22 | #[cfg(feature = "ipc")] 23 | mod rpc; 24 | -------------------------------------------------------------------------------- /crates/ethcore/sync/src/tests/rpc.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | use super::super::NetworkConfiguration; 18 | use ipc::binary::{deserialize, serialize}; 19 | use network::NetworkConfiguration as BasicNetworkConfiguration; 20 | use std::convert::From; 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Common Types" 3 | name = "common-types" 4 | version = "0.1.0" 5 | edition = "2018" 6 | authors = [ 7 | "Gnosis Ltd ", 8 | "Parity Technologies ", 9 | ] 10 | 11 | [dependencies] 12 | ethkey = { path = "../../accounts/ethkey" } 13 | ethereum-types = "0.9.2" 14 | keccak-hash = "0.5.0" 15 | parity-bytes = "0.1" 16 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 17 | parity-util-mem = "0.7" 18 | rlp = { version = "0.4.6" } 19 | rlp_derive = { path = "../../util/rlp-derive" } 20 | unexpected = { path = "../../util/unexpected" } 21 | serde = "1.0" 22 | serde_json = "1.0" 23 | serde_repr = "0.1" 24 | hex = "0.4.3" 25 | inflate = "0.4.5" 26 | 27 | [dev-dependencies] 28 | rustc-hex = "1.0" 29 | 30 | [features] 31 | test-helpers = [] 32 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/ancestry_action.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/basic_account.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Basic account type -- the decoded RLP from the state trie. 18 | 19 | use ethereum_types::{H256, U256}; 20 | 21 | /// Basic account type. 22 | #[derive(Debug, Clone, PartialEq, Eq, RlpEncodable, RlpDecodable)] 23 | pub struct BasicAccount { 24 | /// Nonce of the account. 25 | pub nonce: U256, 26 | /// Balance of the account. 27 | pub balance: U256, 28 | /// Storage root of the account. 29 | pub storage_root: H256, 30 | /// Code hash of the account. 31 | pub code_hash: H256, 32 | } 33 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/block_status.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/call_analytics.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/creation_status.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | /// Statuses for snapshot creation. 18 | #[derive(PartialEq, Eq, Clone, Copy, Debug)] 19 | pub enum CreationStatus { 20 | /// No creation activity currently. 21 | Inactive, 22 | /// Snapshot creation is in progress. 23 | Ongoing { 24 | /// Current created snapshot. 25 | block_number: u32, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/data_format.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | Hex, 24 | Binary, 25 | } 26 | 27 | impl Default for DataFormat { 28 | fn default() -> Self { 29 | DataFormat::Binary 30 | } 31 | } 32 | 33 | impl FromStr for DataFormat { 34 | type Err = String; 35 | 36 | fn from_str(s: &str) -> Result { 37 | match s { 38 | "binary" | "bin" => Ok(DataFormat::Binary), 39 | "hex" => Ok(DataFormat::Hex), 40 | x => Err(format!("Invalid format: {}", x)), 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/engines/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Engine-specific types. 18 | 19 | pub mod epoch; 20 | 21 | /// Fork choice. 22 | #[derive(Debug, PartialEq, Eq)] 23 | pub enum ForkChoice { 24 | /// Choose the new block. 25 | New, 26 | /// Choose the current best block. 27 | Old, 28 | } 29 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/pruning_info.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/security_level.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Indication of how secure the chain is. 18 | 19 | use crate::BlockNumber; 20 | 21 | /// Indication of how secure the chain is. 22 | #[derive(Debug, PartialEq, Copy, Clone, Hash, Eq)] 23 | pub enum SecurityLevel { 24 | /// All blocks from genesis to chain head are known to have valid state transitions and PoW. 25 | FullState, 26 | /// All blocks from genesis to chain head are known to have a valid PoW. 27 | FullProofOfWork, 28 | /// Some recent headers (the argument) are known to have a valid PoW. 29 | PartialProofOfWork(BlockNumber), 30 | } 31 | 32 | impl SecurityLevel { 33 | /// `true` for `FullPoW`/`FullState`. 34 | pub fn is_full(&self) -> bool { 35 | match *self { 36 | SecurityLevel::FullState | SecurityLevel::FullProofOfWork => true, 37 | _ => false, 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/trace_filter.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Trace filter related types 18 | 19 | use crate::ids::BlockId; 20 | use ethereum_types::Address; 21 | use std::ops::Range; 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/transaction/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Ethereum Transactions 18 | 19 | mod error; 20 | mod transaction; 21 | mod transaction_id; 22 | 23 | pub use self::{error::Error, transaction::*, transaction_id::*}; 24 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/tree_route.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/ethcore/types/src/views/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 typed_transaction; 25 | 26 | pub use self::{ 27 | block::BlockView, body::BodyView, header::HeaderView, typed_transaction::TypedTransactionView, 28 | view_rlp::ViewRlp, 29 | }; 30 | 31 | #[cfg(test)] 32 | mod tests { 33 | use super::HeaderView; 34 | 35 | #[test] 36 | #[should_panic] 37 | fn should_include_file_line_number_in_panic_for_invalid_rlp() { 38 | let _ = view!(HeaderView, &[]).parent_hash(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /crates/ethjson/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum JSON Deserialization" 3 | name = "ethjson" 4 | version = "0.1.0" 5 | edition = "2018" 6 | authors = [ 7 | "Gnosis Ltd ", 8 | "Parity Technologies " 9 | ] 10 | 11 | [dependencies] 12 | common-types = { path = "../ethcore/types", features = ["test-helpers"] } 13 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 14 | ethereum-types = "0.9.2" 15 | rustc-hex = "1.0" 16 | serde = "1.0" 17 | serde_json = "1.0" 18 | serde_derive = "1.0" 19 | 20 | [dev-dependencies] 21 | macros = { path = "../util/macros" } 22 | maplit = "1.0.2" 23 | -------------------------------------------------------------------------------- /crates/ethjson/src/blockchain/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Blockchain test deserialization. 18 | 19 | pub mod account; 20 | pub mod block; 21 | pub mod blockchain; 22 | pub mod header; 23 | pub mod state; 24 | pub mod test; 25 | pub mod transaction; 26 | 27 | pub use self::{ 28 | account::Account, 29 | block::Block, 30 | blockchain::{BlockChain, Engine}, 31 | header::Header, 32 | state::State, 33 | test::Test, 34 | transaction::Transaction, 35 | }; 36 | -------------------------------------------------------------------------------- /crates/ethjson/src/blockchain/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Blockchain test deserializer. 18 | 19 | use crate::blockchain::blockchain::BlockChain; 20 | use serde_json::{self, Error}; 21 | use std::{collections::BTreeMap, io::Read}; 22 | 23 | /// Blockchain test deserializer. 24 | #[derive(Debug, PartialEq, Deserialize)] 25 | pub struct Test(BTreeMap); 26 | 27 | impl IntoIterator for Test { 28 | type Item = as IntoIterator>::Item; 29 | type IntoIter = as IntoIterator>::IntoIter; 30 | 31 | fn into_iter(self) -> Self::IntoIter { 32 | self.0.into_iter() 33 | } 34 | } 35 | 36 | impl Test { 37 | /// Loads test from json. 38 | pub fn load(reader: R) -> Result 39 | where 40 | R: Read, 41 | { 42 | serde_json::from_reader(reader) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /crates/ethjson/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | pub use common_types as types; 18 | pub use parity_crypto as crypto; 19 | 20 | extern crate rustc_hex; 21 | extern crate serde; 22 | extern crate serde_json; 23 | #[macro_use] 24 | extern crate serde_derive; 25 | 26 | #[cfg(test)] 27 | extern crate macros; 28 | 29 | #[cfg(test)] 30 | #[macro_use] 31 | extern crate maplit; 32 | 33 | pub mod blockchain; 34 | pub mod bytes; 35 | pub mod hash; 36 | pub mod local_tests; 37 | pub mod maybe; 38 | pub mod spec; 39 | pub mod state; 40 | pub mod test; 41 | pub mod transaction; 42 | pub mod trie; 43 | pub mod uint; 44 | pub mod vm; 45 | -------------------------------------------------------------------------------- /crates/ethjson/src/local_tests/mod.rs: -------------------------------------------------------------------------------- 1 | use crate::blockchain::block::Block; 2 | use serde_json::{self, Error}; 3 | use std::{collections::BTreeMap, io::Read}; 4 | 5 | /// Blockchain test deserializer. 6 | #[derive(Debug, PartialEq, Deserialize)] 7 | pub struct BlockEnDeTest(BTreeMap); 8 | 9 | impl IntoIterator for BlockEnDeTest { 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 BlockEnDeTest { 19 | /// Loads test from json. 20 | pub fn load(reader: R) -> Result 21 | where 22 | R: Read, 23 | { 24 | serde_json::from_reader(reader) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /crates/ethjson/src/spec/instant_seal.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Instant seal engine params deserialization. 18 | 19 | /// Instant seal engine params deserialization. 20 | #[derive(Debug, PartialEq, Deserialize)] 21 | #[serde(deny_unknown_fields)] 22 | #[serde(rename_all = "camelCase")] 23 | pub struct InstantSealParams { 24 | /// Whether to enable millisecond timestamp. 25 | #[serde(default)] 26 | pub millisecond_timestamp: bool, 27 | } 28 | 29 | /// Instant seal engine descriptor. 30 | #[derive(Debug, PartialEq, Deserialize)] 31 | #[serde(deny_unknown_fields)] 32 | pub struct InstantSeal { 33 | /// Instant seal parameters. 34 | pub params: InstantSealParams, 35 | } 36 | -------------------------------------------------------------------------------- /crates/ethjson/src/spec/step_duration.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2019 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 | -------------------------------------------------------------------------------- /crates/ethjson/src/state/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! State test deserialization. 18 | 19 | pub mod log; 20 | pub mod state; 21 | pub mod test; 22 | pub mod transaction; 23 | 24 | pub use self::{log::Log, state::State, test::Test, transaction::Transaction}; 25 | pub use crate::{blockchain::State as AccountState, vm::Env}; 26 | -------------------------------------------------------------------------------- /crates/ethjson/src/transaction/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Transaction test deserialization. 18 | 19 | mod test; 20 | mod transaction; 21 | mod txtest; 22 | 23 | pub use self::{test::Test, transaction::Transaction, txtest::TransactionTest}; 24 | -------------------------------------------------------------------------------- /crates/ethjson/src/transaction/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! TransactionTest test deserializer. 18 | 19 | use crate::transaction::TransactionTest; 20 | use serde_json::{self, Error}; 21 | use std::{collections::BTreeMap, io::Read}; 22 | 23 | /// TransactionTest test deserializer. 24 | #[derive(Debug, Deserialize)] 25 | pub struct Test(BTreeMap); 26 | 27 | impl IntoIterator for Test { 28 | type Item = as IntoIterator>::Item; 29 | type IntoIter = as IntoIterator>::IntoIter; 30 | 31 | fn into_iter(self) -> Self::IntoIter { 32 | self.0.into_iter() 33 | } 34 | } 35 | 36 | impl Test { 37 | /// Loads test from json. 38 | pub fn load(reader: R) -> Result 39 | where 40 | R: Read, 41 | { 42 | serde_json::from_reader(reader) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /crates/ethjson/src/trie/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Trie test deserialization. 18 | 19 | mod input; 20 | mod test; 21 | mod trie; 22 | 23 | pub use self::{input::Input, test::Test, trie::Trie}; 24 | -------------------------------------------------------------------------------- /crates/ethjson/src/trie/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! TransactionTest test deserializer. 18 | 19 | use crate::trie::Trie; 20 | use serde_json::{self, Error}; 21 | use std::{collections::BTreeMap, io::Read}; 22 | 23 | /// TransactionTest test deserializer. 24 | #[derive(Debug, PartialEq, Deserialize)] 25 | pub struct Test(BTreeMap); 26 | 27 | impl IntoIterator for Test { 28 | type Item = as IntoIterator>::Item; 29 | type IntoIter = as IntoIterator>::IntoIter; 30 | 31 | fn into_iter(self) -> Self::IntoIter { 32 | self.0.into_iter() 33 | } 34 | } 35 | 36 | impl Test { 37 | /// Loads test from json. 38 | pub fn load(reader: R) -> Result 39 | where 40 | R: Read, 41 | { 42 | serde_json::from_reader(reader) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /crates/ethjson/src/trie/trie.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Trie test deserialization. 18 | 19 | use crate::{hash::H256, trie::Input}; 20 | 21 | /// Trie test deserialization. 22 | #[derive(Debug, Deserialize, PartialEq)] 23 | pub struct Trie { 24 | /// Trie test input. 25 | #[serde(rename = "in")] 26 | pub input: Input, 27 | /// Trie root hash. 28 | pub root: H256, 29 | } 30 | -------------------------------------------------------------------------------- /crates/ethjson/src/vm/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Vm test loader. 18 | 19 | pub mod call; 20 | pub mod env; 21 | pub mod test; 22 | pub mod transaction; 23 | pub mod vm; 24 | 25 | pub use self::{call::Call, env::Env, test::Test, transaction::Transaction, vm::Vm}; 26 | -------------------------------------------------------------------------------- /crates/ethjson/src/vm/test.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Vm test deserializer. 18 | 19 | use crate::vm::Vm; 20 | use serde_json::{self, Error}; 21 | use std::{collections::BTreeMap, io::Read}; 22 | 23 | /// Vm test deserializer. 24 | #[derive(Debug, PartialEq, Deserialize)] 25 | pub struct Test(BTreeMap); 26 | 27 | impl IntoIterator for Test { 28 | type Item = as IntoIterator>::Item; 29 | type IntoIter = as IntoIterator>::IntoIter; 30 | 31 | fn into_iter(self) -> Self::IntoIter { 32 | self.0.into_iter() 33 | } 34 | } 35 | 36 | impl Test { 37 | /// Loads test from json. 38 | pub fn load(reader: R) -> Result 39 | where 40 | R: Read, 41 | { 42 | serde_json::from_reader(reader) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /crates/net/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 | -------------------------------------------------------------------------------- /crates/net/fetch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "HTTP/HTTPS fetching library" 3 | homepage = "https://github.com/openethereum/openethereum" 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.16.0" 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 | -------------------------------------------------------------------------------- /crates/net/fetch/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 http; 28 | extern crate hyper; 29 | extern crate hyper_rustls; 30 | 31 | extern crate bytes; 32 | extern crate tokio; 33 | extern crate url; 34 | 35 | /// Fetch client implementation. 36 | pub mod client; 37 | 38 | pub use self::client::{Abort, BodyReader, Client, Error, Fetch, Request, Response}; 39 | pub use hyper::Method; 40 | pub use url::Url; 41 | -------------------------------------------------------------------------------- /crates/net/network-devp2p/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "DevP2P implementation of the ethcore network library" 3 | homepage = "https://github.com/openethereum/openethereum" 4 | license = "GPL-3.0" 5 | name = "ethcore-network-devp2p" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | log = "0.4" 11 | mio = "0.6.8" 12 | bytes = "0.4" 13 | rand = "0.7.3" 14 | tiny-keccak = "1.4" 15 | rust-crypto = "0.2.34" 16 | slab = "0.2" 17 | igd = "0.7" 18 | libc = "0.2.7" 19 | parking_lot = "0.11.1" 20 | ansi_term = "0.10" 21 | rustc-hex = "1.0" 22 | ethcore-io = { path = "../../runtime/io", features = ["mio"] } 23 | parity-bytes = "0.1" 24 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 25 | ethcore-network = { path = "../network" } 26 | ethereum-types = "0.9.2" 27 | ethkey = { path = "../../../crates/accounts/ethkey" } 28 | rlp = { version = "0.4.6" } 29 | parity-path = "0.1" 30 | ipnetwork = "0.12.6" 31 | keccak-hash = "0.5.0" 32 | parity-snappy = "0.1" 33 | serde = "1.0" 34 | serde_json = "1.0" 35 | serde_derive = "1.0" 36 | error-chain = { version = "0.12", default-features = false } 37 | lru-cache = "0.1" 38 | 39 | [dev-dependencies] 40 | env_logger = "0.5" 41 | tempdir = "0.3" 42 | assert_matches = "1.2" 43 | 44 | [features] 45 | default = [] 46 | -------------------------------------------------------------------------------- /crates/net/network/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethcore network library" 3 | homepage = "https://github.com/openethereum/openethereum" 4 | license = "GPL-3.0" 5 | name = "ethcore-network" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | error-chain = { version = "0.12", default-features = false } 11 | parity-crypto = { version = "0.6.2", features = [ "publickey"] } 12 | ethcore-io = { path = "../../runtime/io" } 13 | ethereum-types = "0.9.2" 14 | ethkey = { path = "../../../crates/accounts/ethkey" } 15 | ipnetwork = "0.12.6" 16 | lazy_static = "1.0" 17 | rlp = { version = "0.4.6" } 18 | libc = "0.2" 19 | parity-snappy = "0.1" 20 | semver = {version="0.9.0", features=["serde"]} 21 | serde = "1.0" 22 | serde_derive = "1.0" 23 | 24 | [dev-dependencies] 25 | assert_matches = "1.2" 26 | -------------------------------------------------------------------------------- /crates/net/network/src/connection_filter.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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( 31 | &self, 32 | own_id: &NodeId, 33 | connecting_id: &NodeId, 34 | direction: ConnectionDirection, 35 | ) -> bool; 36 | } 37 | -------------------------------------------------------------------------------- /crates/net/node-filter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum Smart Contract based Node Filter, Manage Permissions of Network Connections" 3 | homepage = "https://github.com/openethereum/openethereum" 4 | license = "GPL-3.0" 5 | name = "node-filter" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | ethcore = { path = "../../ethcore"} 11 | ethcore-network = { path = "../network" } 12 | ethcore-network-devp2p = { path = "../network-devp2p" } 13 | ethereum-types = "0.9.2" 14 | log = "0.4" 15 | parking_lot = "0.11.1" 16 | ethabi = "12.0.0" 17 | ethabi-derive = { git = 'https://github.com/rimrakhimov/ethabi', branch = 'rimrakhimov/remove-syn-export-span' } 18 | ethabi-contract = "11.0.0" 19 | lru-cache = "0.1" 20 | 21 | [dev-dependencies] 22 | ethcore = { path = "../../ethcore", features = ["test-helpers"] } 23 | kvdb-memorydb = "0.1" 24 | ethcore-io = { path = "../../runtime/io" } 25 | tempdir = "0.3" 26 | -------------------------------------------------------------------------------- /crates/net/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 | -------------------------------------------------------------------------------- /crates/rpc-common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "oe-rpc-common" 3 | version = "0.0.0" 4 | edition = "2021" 5 | description = "Modules common to RPC APIs" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | serde = "1.0" 11 | rustc-hex = "1.0" 12 | 13 | [dev-dependencies] 14 | serde_json = "1.0" -------------------------------------------------------------------------------- /crates/rpc-common/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | mod types; 18 | 19 | pub use types::bytes::Bytes; 20 | -------------------------------------------------------------------------------- /crates/rpc-common/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | pub mod bytes; 18 | -------------------------------------------------------------------------------- /crates/rpc-servers/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum RPC servers (WS, HTTP, IPC)" 3 | name = "oe-rpc-servers" 4 | version = "0.0.0" 5 | license = "GPL-3.0" 6 | edition = "2021" 7 | 8 | [lib] 9 | 10 | [dependencies] 11 | jsonrpc-core = "15.0.0" 12 | http = { package = "jsonrpc-http-server", version = "15.0.0" } 13 | ipc = { package = "jsonrpc-ipc-server", version = "15.0.0" } 14 | ws = { package = "jsonrpc-ws-server", version = "15.0.0" } -------------------------------------------------------------------------------- /crates/rpc/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! RPC integration tests. 18 | 19 | mod helpers; 20 | mod http_client; 21 | // #[cfg(test)] 22 | mod rpc; 23 | pub mod ws; 24 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/impls/web3.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Web3 rpc implementation. 18 | use ethereum_types::H256; 19 | use hash::keccak; 20 | use jsonrpc_core::Result; 21 | use v1::{traits::Web3, types::Bytes}; 22 | use version::version; 23 | 24 | /// Web3 rpc implementation. 25 | #[derive(Default)] 26 | pub struct Web3Client; 27 | 28 | impl Web3 for Web3Client { 29 | fn client_version(&self) -> Result { 30 | Ok(version().to_owned().replacen("/", "//", 1)) 31 | } 32 | 33 | fn sha3(&self, data: Bytes) -> Result { 34 | Ok(keccak(&data.0)) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/metadata.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! OpenEthereum RPC requests Metadata. 18 | use std::sync::Arc; 19 | 20 | use jsonrpc_core; 21 | use jsonrpc_pubsub::{PubSubMetadata, Session}; 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/tests/helpers/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Test rpc services. 18 | 19 | mod miner_service; 20 | mod snapshot_service; 21 | mod sync_provider; 22 | 23 | pub use self::{ 24 | miner_service::TestMinerService, 25 | snapshot_service::TestSnapshotService, 26 | sync_provider::{Config, TestSyncProvider}, 27 | }; 28 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/tests/mocked/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/traits/debug.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/traits/net.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/traits/rpc.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/traits/web3.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/types/fee_history.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Return types for RPC calls 18 | 19 | use ethereum_types::U256; 20 | use v1::types::BlockNumber; 21 | 22 | /// Account information. 23 | #[derive(Debug, Default, Clone, PartialEq, Serialize)] 24 | #[serde(rename_all = "camelCase")] 25 | pub struct EthFeeHistory { 26 | pub oldest_block: BlockNumber, 27 | pub base_fee_per_gas: Vec, 28 | pub gas_used_ratio: Vec, 29 | pub reward: Option>>, 30 | } 31 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/types/histogram.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Gas prices histogram. 18 | 19 | use ethereum_types::U256; 20 | 21 | /// Values of RPC settings. 22 | #[derive(Serialize, Deserialize)] 23 | #[serde(deny_unknown_fields)] 24 | #[serde(rename_all = "camelCase")] 25 | pub struct Histogram { 26 | /// Gas prices for bucket edges. 27 | pub bucket_bounds: Vec, 28 | /// Transacion counts for each bucket. 29 | pub counts: Vec, 30 | } 31 | 32 | impl From<::stats::Histogram<::ethereum_types::U256>> for Histogram { 33 | fn from(h: ::stats::Histogram<::ethereum_types::U256>) -> Self { 34 | Histogram { 35 | bucket_bounds: h.bucket_bounds.into_iter().map(Into::into).collect(), 36 | counts: h.counts, 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/types/rpc_settings.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/rpc/src/v1/types/transaction_access_list.rs: -------------------------------------------------------------------------------- 1 | use ethereum_types::{H160, H256}; 2 | use serde::Serialize; 3 | use std::vec::Vec; 4 | use types::transaction::AccessListItem as InnerAccessListItem; 5 | 6 | pub type AccessList = Vec; 7 | #[derive(Debug, Clone, Default, Eq, PartialEq, Hash, Serialize, Deserialize)] 8 | #[serde(rename_all = "camelCase")] 9 | pub struct AccessListItem { 10 | address: H160, 11 | storage_keys: Vec, 12 | } 13 | 14 | impl AccessListItem { 15 | pub fn new(address: H160, storage_keys: Vec) -> Self { 16 | Self { 17 | address, 18 | storage_keys, 19 | } 20 | } 21 | } 22 | 23 | impl From for AccessListItem { 24 | fn from(item: InnerAccessListItem) -> Self { 25 | AccessListItem { 26 | address: item.0, 27 | storage_keys: item.1, 28 | } 29 | } 30 | } 31 | 32 | impl From for InnerAccessListItem { 33 | fn from(item: AccessListItem) -> Self { 34 | (item.address, item.storage_keys) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /crates/runtime/io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Ethcore IO library" 3 | homepage = "https://github.com/openethereum/openethereum" 4 | license = "GPL-3.0" 5 | name = "ethcore-io" 6 | version = "1.12.0" 7 | authors = ["Parity Technologies "] 8 | 9 | [dependencies] 10 | fnv = "1.0" 11 | mio = { version = "0.6.8", optional = true } 12 | crossbeam-deque = "0.6" 13 | parking_lot = "0.11.1" 14 | log = "0.4" 15 | slab = "0.4" 16 | num_cpus = "1.8" 17 | timer = "0.2" 18 | time = "0.1" 19 | tokio = "0.1" 20 | futures = "0.1" 21 | -------------------------------------------------------------------------------- /crates/runtime/runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum Runtime" 3 | homepage = "https://github.com/openethereum/openethereum" 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 | -------------------------------------------------------------------------------- /crates/transaction-pool/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Gnosis Ltd. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | [package] 5 | name = "txpool" 6 | version = "1.0.0-alpha" 7 | authors = ["Dragan Rakita "] 8 | edition = "2018" 9 | description = "Generic transaction pool." 10 | 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | [dependencies.log] 13 | version = "0.4" 14 | 15 | [dependencies.smallvec] 16 | version = "0.6" 17 | 18 | [dependencies.trace-time] 19 | version = "0.1" 20 | [dev-dependencies.ethereum-types] 21 | version = "0.7" -------------------------------------------------------------------------------- /crates/transaction-pool/src/options.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2018 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 | /// Transaction Pool options. 18 | #[derive(Clone, Debug, PartialEq)] 19 | pub struct Options { 20 | /// Maximal number of transactions in the pool. 21 | pub max_count: usize, 22 | /// Maximal number of transactions from single sender. 23 | pub max_per_sender: usize, 24 | /// Maximal memory usage. 25 | pub max_mem_usage: usize, 26 | } 27 | 28 | impl Default for Options { 29 | fn default() -> Self { 30 | Options { 31 | max_count: 1024, 32 | max_per_sender: 16, 33 | max_mem_usage: 8 * 1024 * 1024, 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /crates/transaction-pool/src/status.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2018 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 | /// Light pool status. 18 | /// This status is cheap to compute and can be called frequently. 19 | #[derive(Default, Debug, Clone, PartialEq, Eq)] 20 | pub struct LightStatus { 21 | /// Memory usage in bytes. 22 | pub mem_usage: usize, 23 | /// Total number of transactions in the pool. 24 | pub transaction_count: usize, 25 | /// Number of unique senders in the pool. 26 | pub senders: usize, 27 | } 28 | 29 | /// A full queue status. 30 | /// To compute this status it is required to provide `Ready`. 31 | /// NOTE: To compute the status we need to visit each transaction in the pool. 32 | #[derive(Default, Debug, Clone, PartialEq, Eq)] 33 | pub struct Status { 34 | /// Number of stalled transactions. 35 | pub stalled: usize, 36 | /// Number of pending (ready) transactions. 37 | pub pending: usize, 38 | /// Number of future (not ready) transactions. 39 | pub future: usize, 40 | } 41 | -------------------------------------------------------------------------------- /crates/transaction-pool/src/verifier.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2018 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 crate::VerifiedTransaction; 18 | 19 | /// Transaction verification. 20 | /// 21 | /// Verifier is responsible to decide if the transaction should even be considered for pool inclusion. 22 | pub trait Verifier { 23 | /// Verification error. 24 | type Error; 25 | 26 | /// Verified transaction. 27 | type VerifiedTransaction: VerifiedTransaction; 28 | 29 | /// Verifies a `UnverifiedTransaction` and produces `VerifiedTransaction` instance. 30 | fn verify_transaction(&self, tx: U) -> Result; 31 | } 32 | -------------------------------------------------------------------------------- /crates/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/openethereum/openethereum" 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 | rustc-hex = "2.0.1" 15 | -------------------------------------------------------------------------------- /crates/util/EIP-712/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eip-712" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | repository = "https://github.com/openethereum/openethereum" 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 = "12.0.0" 18 | keccak-hash = "0.5.0" 19 | ethereum-types = "0.9.2" 20 | logos = "0.12.0" 21 | failure = "0.1.7" 22 | itertools = "0.7" 23 | lazy_static = "1.1" 24 | regex = "1.0" 25 | validator = "0.8" 26 | validator_derive = "0.8" 27 | rustc-hex = "2.0" 28 | indexmap = "1.0.2" 29 | -------------------------------------------------------------------------------- /crates/util/cli-signer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum CLI Signer Tool" 3 | homepage = "https://github.com/openethereum/openethereum" 4 | license = "GPL-3.0" 5 | name = "cli-signer" 6 | version = "1.4.0" 7 | authors = ["Parity "] 8 | 9 | [dependencies] 10 | ethereum-types = "0.9.2" 11 | futures = "0.1" 12 | rpassword = "1.0" 13 | parity-rpc = { path = "../../rpc" } 14 | parity-rpc-client = { path = "rpc-client" } 15 | -------------------------------------------------------------------------------- /crates/util/cli-signer/rpc-client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum RPC Client" 3 | homepage = "https://github.com/openethereum/openethereum" 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.9.2" 11 | futures = "0.1" 12 | log = "0.4" 13 | serde = "1.0" 14 | serde_json = "1.0" 15 | url = "2" 16 | matches = "0.1" 17 | parking_lot = "0.9" 18 | jsonrpc-core = "15.0.0" 19 | jsonrpc-ws-server = "15.0.0" 20 | parity-rpc = { path = "../../../rpc" } 21 | keccak-hash = "0.5.0" 22 | -------------------------------------------------------------------------------- /crates/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.9.2" 9 | journaldb = { path = "../../db/journaldb" } 10 | app_dirs = { git = "https://github.com/openethereum/app-dirs-rs" } 11 | home = "0.3" 12 | -------------------------------------------------------------------------------- /crates/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.9.2" 10 | plain_hasher = "0.2" 11 | -------------------------------------------------------------------------------- /crates/util/fastmap/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Provides a `H256FastMap` type with H256 keys and fast hashing function. 18 | 19 | extern crate ethereum_types; 20 | extern crate plain_hasher; 21 | 22 | use ethereum_types::H256; 23 | use plain_hasher::PlainHasher; 24 | use std::{ 25 | collections::{HashMap, HashSet}, 26 | hash, 27 | }; 28 | 29 | /// Specialized version of `HashMap` with H256 keys and fast hashing function. 30 | pub type H256FastMap = HashMap>; 31 | /// Specialized version of HashSet with H256 values and fast hashing function. 32 | pub type H256FastSet = HashSet>; 33 | 34 | #[cfg(test)] 35 | mod tests { 36 | use super::*; 37 | 38 | #[test] 39 | fn test_works() { 40 | let mut h = H256FastMap::default(); 41 | h.insert(H256::from_low_u64_be(123), "abc"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /crates/util/keccak-hasher/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "keccak-hasher" 3 | version = "0.1.1" 4 | authors = ["Parity Technologies "] 5 | description = "Keccak-256 implementation of the Hasher trait" 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | ethereum-types = "0.9.2" 10 | tiny-keccak = "1.4.2" 11 | hash-db = "0.11.0" 12 | plain_hasher = "0.2" 13 | -------------------------------------------------------------------------------- /crates/util/keccak-hasher/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Hasher implementation for the Keccak-256 hash 18 | extern crate ethereum_types; 19 | extern crate hash_db; 20 | extern crate plain_hasher; 21 | extern crate tiny_keccak; 22 | 23 | use ethereum_types::H256; 24 | use hash_db::Hasher; 25 | use plain_hasher::PlainHasher; 26 | use tiny_keccak::Keccak; 27 | /// Concrete `Hasher` impl for the Keccak-256 hash 28 | #[derive(Default, Debug, Clone, PartialEq)] 29 | pub struct KeccakHasher; 30 | impl Hasher for KeccakHasher { 31 | type Out = H256; 32 | type StdHasher = PlainHasher; 33 | const LENGTH: usize = 32; 34 | fn hash(x: &[u8]) -> Self::Out { 35 | let mut out = [0; 32]; 36 | Keccak::keccak256(x, &mut out); 37 | out.into() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /crates/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 = "https://github.com/openethereum/openethereum" 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.11.1" 11 | -------------------------------------------------------------------------------- /crates/util/macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "macros" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /crates/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.7" 10 | lru-cache = "0.1" 11 | -------------------------------------------------------------------------------- /crates/util/memzero/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "memzero" 3 | version = "0.1.0" 4 | description = "A wrapper for zero-ing out memory when dropped" 5 | license = "GPL-3.0" 6 | homepage = "https://parity.io" 7 | repository = "https://github.com/openethereum/openethereum" 8 | documentation = "https://docs.rs/crate/memzero" 9 | authors = ["Parity Technologies "] 10 | edition = "2018" 11 | -------------------------------------------------------------------------------- /crates/util/panic-hook/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "OpenEthereum custom panic hook" 3 | homepage = "https://github.com/openethereum/openethereum" 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 | -------------------------------------------------------------------------------- /crates/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 = { version = "0.4.6" } 8 | elastic-array = "0.10" 9 | lazy_static = "1.0" 10 | -------------------------------------------------------------------------------- /crates/util/rlp-derive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rlp_derive" 3 | version = "0.1.0" 4 | authors = ["debris "] 5 | 6 | [lib] 7 | name = "rlp_derive" 8 | proc-macro = true 9 | 10 | [dependencies] 11 | syn = "0.15" 12 | quote = "0.6" 13 | proc-macro2 = "0.4" 14 | 15 | [dev-dependencies] 16 | rlp = { version = "0.4.6" } 17 | -------------------------------------------------------------------------------- /crates/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 | prometheus = "0.9.0" 9 | -------------------------------------------------------------------------------- /crates/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 | -------------------------------------------------------------------------------- /crates/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 = { version = "0.5.0" } 10 | ethereum-types = "0.9.2" 11 | keccak-hasher = { path = "../keccak-hasher" } 12 | -------------------------------------------------------------------------------- /crates/util/unexpected/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "unexpected" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /crates/util/version/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "parity-version" 3 | # NOTE: this value is used for OpenEthereum version string (via env CARGO_PKG_VERSION) 4 | version = "3.3.5" 5 | authors = ["Parity Technologies "] 6 | build = "build.rs" 7 | 8 | [package.metadata] 9 | 10 | [dependencies] 11 | parity-bytes = "0.1" 12 | rlp = { version = "0.4.6" } 13 | target_info = "0.1" 14 | 15 | [build-dependencies] 16 | vergen = "0.1" 17 | rustc_version = "0.2" 18 | toml = "0.4" 19 | 20 | [features] 21 | final = [] 22 | -------------------------------------------------------------------------------- /crates/vm/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 | eip-152 = { path = "../../util/EIP-152" } 12 | ethereum-types = "0.9.2" 13 | ethjson = { path = "../../ethjson" } 14 | ethkey = { path = "../../accounts/ethkey" } 15 | keccak-hash = "0.5.0" 16 | log = "0.4" 17 | macros = { path = "../../util/macros" } 18 | num = { version = "0.1", default-features = false, features = ["bigint"] } 19 | parity-bytes = "0.1" 20 | parity-crypto = { version = "0.6.2", features = [ "publickey" ] } 21 | eth_pairings = { git = "https://github.com/matter-labs/eip1962.git", default-features = false, features = ["eip_2537"], rev = "ece6cbabc41948db4200e41f0bfdab7ab94c7af8" } 22 | 23 | [dev-dependencies] 24 | hex-literal = "0.2.1" 25 | rustc-hex = "1.0" 26 | maplit = "1.0.2" 27 | -------------------------------------------------------------------------------- /crates/vm/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 = "../../ethcore/types", package = "common-types" } 11 | ethereum-types = "0.9.2" 12 | bytes = { version = "0.1", package = "parity-bytes" } 13 | -------------------------------------------------------------------------------- /crates/vm/call-contract/src/call_contract.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | //! Provides CallContract and RegistryInfo traits 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(&self, id: BlockId, address: Address, data: Bytes) -> Result; 27 | } 28 | 29 | /// Provides information on a blockchain service and it's registry 30 | pub trait RegistryInfo { 31 | /// Get the address of a particular blockchain service, if available. 32 | fn registry_address(&self, name: String, block: BlockId) -> Option
; 33 | } 34 | -------------------------------------------------------------------------------- /crates/vm/call-contract/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. 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 | -------------------------------------------------------------------------------- /crates/vm/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.9.2" 11 | lazy_static = "1.0" 12 | log = "0.4" 13 | vm = { path = "../vm" } 14 | keccak-hash = "0.5.0" 15 | parity-util-mem = "0.7" 16 | parking_lot = "0.11.1" 17 | memory-cache = { path = "../../util/memory-cache" } 18 | ethcore-builtin = { path = "../builtin" } 19 | num-bigint = "0.2" 20 | 21 | [dev-dependencies] 22 | rustc-hex = "1.0" 23 | criterion = "0.2" 24 | hex-literal = "0.2.0" 25 | 26 | [features] 27 | evm-debug = [] 28 | evm-debug-tests = ["evm-debug"] 29 | 30 | [[bench]] 31 | name = "basic" 32 | harness = false 33 | -------------------------------------------------------------------------------- /crates/vm/evm/src/vmtype.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | use std::fmt; 18 | 19 | /// Type of EVM to use. 20 | #[derive(Debug, PartialEq, Clone)] 21 | pub enum VMType { 22 | /// RUST EVM 23 | Interpreter, 24 | } 25 | 26 | impl fmt::Display for VMType { 27 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 28 | write!( 29 | f, 30 | "{}", 31 | match *self { 32 | VMType::Interpreter => "INT", 33 | } 34 | ) 35 | } 36 | } 37 | 38 | impl Default for VMType { 39 | fn default() -> Self { 40 | VMType::Interpreter 41 | } 42 | } 43 | 44 | impl VMType { 45 | /// Return all possible VMs (Interpreter) 46 | pub fn all() -> Vec { 47 | vec![VMType::Interpreter] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /crates/vm/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.9.2" 10 | patricia-trie-ethereum = { path = "../../db/patricia-trie-ethereum" } 11 | ethjson = { path = "../../ethjson" } 12 | rlp = { version = "0.4.6" } 13 | keccak-hash = "0.5.0" 14 | -------------------------------------------------------------------------------- /crates/vm/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.9.2" 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 | -------------------------------------------------------------------------------- /license_header: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Parity Technologies (UK) Ltd. 2 | // This file is part of OpenEthereum. 3 | 4 | // OpenEthereum 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 | // OpenEthereum 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 OpenEthereum. If not, see . 16 | 17 | -------------------------------------------------------------------------------- /scripts/actions/build-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e # fail on any error 4 | set -u # treat unset variables as error 5 | #strip ON 6 | export RUSTFLAGS=" -Clink-arg=-s -Ctarget-feature=+aes,+sse2,+ssse3" 7 | 8 | echo "_____ Build OpenEthereum and tools _____" 9 | 10 | time cargo build --verbose --color=always --release --features final 11 | time cargo build --verbose --color=always --release -p evmbin 12 | time cargo build --verbose --color=always --release -p ethstore-cli 13 | time cargo build --verbose --color=always --release -p ethkey-cli 14 | 15 | echo "_____ Post-processing binaries _____" 16 | rm -rf artifacts/* 17 | mkdir -p artifacts/ 18 | 19 | cp -v target/release/openethereum artifacts/openethereum 20 | cp -v target/release/openethereum-evm artifacts/openethereum-evm 21 | cp -v target/release/ethstore artifacts/ethstore 22 | cp -v target/release/ethkey artifacts/ethkey 23 | -------------------------------------------------------------------------------- /scripts/actions/build-windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e # fail on any error 3 | set -u # treat unset variables as error 4 | # NOTE: Enables the aes-ni instructions for RustCrypto dependency. 5 | # If you change this please remember to also update .cargo/config 6 | export RUSTFLAGS=" -Ctarget-feature=+aes,+sse2,+ssse3 -Ctarget-feature=+crt-static -Clink-arg=-s" 7 | 8 | echo "_____ Build Parity and tools _____" 9 | time cargo build --verbose --release --features final 10 | time cargo build --verbose --release -p evmbin 11 | time cargo build --verbose --release -p ethstore-cli 12 | time cargo build --verbose --release -p ethkey-cli 13 | 14 | echo "_____ Post-processing binaries _____" 15 | rm -rf artifacts 16 | mkdir -p artifacts 17 | 18 | cp --verbose target/release/openethereum.exe artifacts/openethereum.exe 19 | cp --verbose target/release/openethereum-evm.exe artifacts/openethereum-evm.exe 20 | cp --verbose target/release/ethstore.exe artifacts/ethstore.exe 21 | cp --verbose target/release/ethkey.exe artifacts/ethkey.exe 22 | -------------------------------------------------------------------------------- /scripts/actions/clean-target.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e # fail on any error 4 | set -u # treat unset variables as error 5 | 6 | find ./target/release -maxdepth 1 -type f -delete; 7 | rm -fr ./target/release/{deps,.fingerprint}/*{openethereum,ethcore,ethkey,ethstore,openethereum-evm}*; 8 | rm -f ./target/.rustc_info.json; 9 | -------------------------------------------------------------------------------- /scripts/actions/install-sccache.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | $os=$args[0] 3 | $version="0.2.12" 4 | echo "Current OS:" $os 5 | switch ($os){ 6 | "macOS" {$platform = "x86_64-apple-darwin"} 7 | "Linux" {$platform = "x86_64-unknown-linux-musl"} 8 | "Windows" {$platform ="x86_64-pc-windows-msvc"} 9 | } 10 | echo "Target arch: " $platform 11 | $basename = "sccache-$version-$platform" 12 | $url = "https://github.com/mozilla/sccache/releases/download/"+"$version/$basename.tar.gz" 13 | echo "Download sccache from "+$url 14 | curl -LO $url 15 | tar -xzvf "$basename.tar.gz" 16 | ls $basename/ 17 | . $basename/sccache --start-server 18 | echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 19 | echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV 20 | -------------------------------------------------------------------------------- /scripts/actions/validate-chainspecs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e # fail on any error 3 | set -u # treat unset variables as error 4 | echo "________Running validate_chainspecs.sh________" 5 | 6 | ERR=0 7 | 8 | echo "________Validate chainspecs________" 9 | time cargo build --release -p chainspec --verbose --color=always 10 | 11 | for spec in crates/ethcore/res/chainspec/*.json; do 12 | if ! ./target/release/chainspec "$spec"; then ERR=1; fi 13 | done 14 | 15 | for spec in crates/ethcore/res/chainspec/test/*.json; do 16 | if ! ./target/release/chainspec "$spec"; then ERR=1; fi 17 | done 18 | 19 | #show sccache statistics 20 | #sccache --stop-server 21 | exit $ERR 22 | -------------------------------------------------------------------------------- /scripts/docker/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | ```docker build -f docker/ubuntu/Dockerfile --tag ethcore/openethereum:branch_or_tag_name .``` 4 | 5 | ## Usage - CentOS 6 | 7 | Builds a lightweight non-root OpenEthereum docker image: 8 | ``` 9 | git clone https://github.com/openethereum/openethereum.git 10 | cd openethereum 11 | ./scripts/docker/centos/build.sh 12 | ``` 13 | 14 | Fully customised build: 15 | ``` 16 | OPENETHEREUM_IMAGE_REPO=my-personal/openethereum \ 17 | OPENETHEREUM_BUILDER_IMAGE_TAG=build-latest \ 18 | OPENETHEREUM_RUNNER_IMAGE_TAG=centos-openethereum-experimental \ 19 | ./scripts/docker/centos/build.sh 20 | ``` 21 | 22 | Default values: 23 | ``` 24 | # The image name 25 | OPENETHEREUM_IMAGE_REPO - openethereum/openethereum 26 | 27 | # The tag to be used for builder image, git commit sha will be appended 28 | OPENETHEREUM_BUILDER_IMAGE_TAG - build 29 | 30 | # The tag to be used for runner image 31 | OPENETHEREUM_RUNNER_IMAGE_TAG - latest 32 | ``` 33 | 34 | All default ports you might use will be exposed: 35 | ``` 36 | # secret 37 | # store ui rpc ws listener discovery 38 | # ↓ ↓ ↓ ↓ ↓ ↓ ↓ 39 | EXPOSE 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 | git 15 | 16 | WORKDIR /openethereum 17 | COPY . /openethereum 18 | RUN cargo build --release --features final --target x86_64-alpine-linux-musl --verbose 19 | RUN strip target/x86_64-alpine-linux-musl/release/openethereum 20 | 21 | FROM alpine:edge 22 | 23 | # show backtraces 24 | ENV RUST_BACKTRACE 1 25 | 26 | # curl and jq are installed to help create health and readiness checks on Kubernetes 27 | RUN apk add --no-cache \ 28 | libstdc++ \ 29 | eudev-libs \ 30 | libgcc \ 31 | curl \ 32 | jq 33 | 34 | RUN addgroup -g 1000 openethereum \ 35 | && adduser -u 1000 -G openethereum -s /bin/sh -D openethereum 36 | 37 | USER openethereum 38 | 39 | EXPOSE 8080 8545 8180 40 | 41 | WORKDIR /home/openethereum 42 | 43 | RUN mkdir -p /home/openethereum/.local/share/io.parity.ethereum/ 44 | COPY --chown=openethereum:openethereum --from=builder /openethereum/target/x86_64-alpine-linux-musl/release/openethereum ./ 45 | 46 | ENTRYPOINT ["/home/openethereum/openethereum"] 47 | -------------------------------------------------------------------------------- /scripts/docker/centos/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:latest 2 | 3 | RUN mkdir -p /opt/openethereum/data && \ 4 | chmod g+rwX /opt/openethereum/data && \ 5 | mkdir -p /opt/openethereum/release 6 | 7 | COPY openethereum/openethereum /opt/openethereum/release 8 | 9 | WORKDIR /opt/openethereum/data 10 | 11 | # exposing default ports 12 | # 13 | # secret 14 | # store ui rpc ws listener discovery 15 | # ↓ ↓ ↓ ↓ ↓ ↓ 16 | EXPOSE 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/openethereum/release/openethereum"] 24 | -------------------------------------------------------------------------------- /scripts/docker/centos/Dockerfile.build: -------------------------------------------------------------------------------- 1 | FROM centos:latest 2 | 3 | WORKDIR /build 4 | 5 | ADD . /build/openethereum 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 openethereum && \ 21 | cargo build --verbose --release --features final && \ 22 | strip /build/openethereum/target/release/openethereum && \ 23 | file /build/openethereum/target/release/openethereum 24 | 25 | 26 | -------------------------------------------------------------------------------- /scripts/docker/centos/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # The image name 4 | OPENETHEREUM_IMAGE_REPO=${OPENETHEREUM_IMAGE_REPO:-openethereum/openethereum} 5 | # The tag to be used for builder image 6 | OPENETHEREUM_BUILDER_IMAGE_TAG=${OPENETHEREUM_BUILDER_IMAGE_TAG:-build} 7 | # The tag to be used for runner image 8 | OPENETHEREUM_RUNNER_IMAGE_TAG=${OPENETHEREUM_RUNNER_IMAGE_TAG:-latest} 9 | 10 | echo Building $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") 11 | docker build --no-cache -t $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") . -f scripts/docker/centos/Dockerfile.build 12 | 13 | echo Creating $OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H"), extracting binary 14 | docker create --name extract $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") 15 | mkdir scripts/docker/centos/openethereum 16 | docker cp extract:/build/openethereum/target/release/openethereum scripts/docker/centos/openethereum 17 | 18 | echo Building $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG 19 | docker build --no-cache -t $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG scripts/docker/centos/ -f scripts/docker/centos/Dockerfile 20 | 21 | echo Cleaning up ... 22 | rm -rf scripts/docker/centos/openethereum 23 | docker rm -f extract 24 | docker rmi -f $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") 25 | 26 | echo Echoing OpenEthereum version: 27 | docker run $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_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 openethereum.image.authors="devops-team@parity.io" \ 8 | openethereum.image.vendor="OpenEthereum project" \ 9 | openethereum.image.title="openethereum/openethereum" \ 10 | openethereum.image.description="Fast and feature-rich multi-network Ethereum client." \ 11 | openethereum.image.source="https://github.com/openethereum/openethereum/blob/${VCS_REF}/\ 12 | scripts/docker/hub/Dockerfile" \ 13 | openethereum.image.documentation="https://wiki.parity.io/Parity-Ethereum" \ 14 | openethereum.image.revision="${VCS_REF}" \ 15 | openethereum.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 ca-certificates; \ 25 | # apt cleanup 26 | apt-get autoremove -y; \ 27 | apt-get clean; \ 28 | update-ca-certificates; \ 29 | rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*; \ 30 | # add user 31 | groupadd -g 1000 openethereum; \ 32 | useradd -m -u 1000 -g openethereum -s /bin/sh openethereum 33 | 34 | WORKDIR /home/openethereum 35 | 36 | # add openethereum binary to docker image 37 | COPY artifacts/x86_64-unknown-linux-gnu/openethereum /bin/openethereum 38 | COPY tools/check_sync.sh /check_sync.sh 39 | 40 | # switch to user openethereum here 41 | USER openethereum 42 | 43 | # check if executable works in this container 44 | RUN openethereum --version 45 | 46 | EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp 47 | 48 | ENTRYPOINT ["/bin/openethereum"] 49 | -------------------------------------------------------------------------------- /scripts/docker/hub/check_sync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # checks if OpenEthereum 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 "OpenEthereum is ready to start accepting traffic" 9 | exit 0 10 | else 11 | echo "OpenEthereum is still syncing the blockchain" 12 | exit 1 13 | fi 14 | -------------------------------------------------------------------------------- /scripts/docker/ubuntu-arm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | WORKDIR /build 3 | 4 | # install tools and dependencies 5 | RUN apt-get -y update && \ 6 | apt-get install -y --force-yes --no-install-recommends \ 7 | curl git make g++ gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \ 8 | libc6-dev-armhf-cross wget file ca-certificates \ 9 | binutils-arm-linux-gnueabihf cmake3 \ 10 | && \ 11 | apt-get clean 12 | 13 | # install rustup 14 | RUN curl https://sh.rustup.rs -sSf | sh -s -- -y 15 | 16 | # rustup directory 17 | ENV PATH /root/.cargo/bin:$PATH 18 | 19 | ENV RUST_TARGETS="arm-unknown-linux-gnueabihf" 20 | 21 | # multirust add arm--linux-gnuabhf toolchain 22 | RUN rustup target add armv7-unknown-linux-gnueabihf 23 | 24 | # show backtraces 25 | ENV RUST_BACKTRACE 1 26 | 27 | # show tools 28 | RUN rustc -vV && cargo -V 29 | 30 | # build OpenEthereum 31 | ADD . /build/openethereum 32 | RUN cd openethereum && \ 33 | mkdir -p .cargo && \ 34 | echo '[target.armv7-unknown-linux-gnueabihf]\n\ 35 | linker = "arm-linux-gnueabihf-gcc"\n'\ 36 | >>.cargo/config && \ 37 | cat .cargo/config && \ 38 | cargo build --target armv7-unknown-linux-gnueabihf --release --verbose && \ 39 | ls /build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum && \ 40 | /usr/bin/arm-linux-gnueabihf-strip /build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum 41 | 42 | RUN file /build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum 43 | 44 | EXPOSE 8080 8545 8180 45 | ENTRYPOINT ["/build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum"] 46 | -------------------------------------------------------------------------------- /scripts/evm_jsontests_bench.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cargo build --release -p evmbin 4 | 5 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmArithmeticTest 6 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmBitwiseLogicOperation 7 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmBlockInfoTest 8 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmEnvironmentalInfo 9 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmIOandFlowOperations 10 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmLogTest 11 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmPerformance 12 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmPushDupSwapTest 13 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmRandomTest 14 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmSha3Test 15 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_tests/VMTests/vmSystemOperations 16 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/json_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/openethereum-evm stats --code $CODE1 --gas 4402000 12 | echo "^^^^ usize" 13 | ./target/release/openethereum-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/openethereum-evm stats --code $CODE2 --gas 143020115 23 | echo "^^^^ usize" 24 | ./target/release/openethereum-evm stats --code $CODE2 25 | echo "^^^^ U256" 26 | -------------------------------------------------------------------------------- /scripts/openethereum.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=OpenEthereum Daemon 3 | After=network.target 4 | 5 | [Service] 6 | # run as root, set base_path in config.toml 7 | ExecStart=/usr/bin/openethereum --config /etc/openethereum/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/openethereum/ 10 | # User=username 11 | # Group=groupname 12 | # ExecStart=/usr/bin/openethereum 13 | Restart=on-failure 14 | 15 | # Specifies which signal to use when killing a service. Defaults to SIGTERM. 16 | # SIGTERM gives openethereum time to exit cleanly before sending SIGKILL 17 | KillSignal=SIGTERM 18 | TimeoutStopSec=300 19 | 20 | [Install] 21 | WantedBy=default.target 22 | 23 | 24 | -------------------------------------------------------------------------------- /scripts/prometheus/config/grafana/provisioning/dashboards/provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | # an unique provider name. Required 5 | - name: 'dashboardprovider' 6 | # Org id. Default to 1 7 | orgId: 1 8 | # name of the dashboard folder. 9 | folder: 'dashboards' 10 | # folder UID. will be automatically generated if not specified 11 | folderUid: '' 12 | # provider type. Default to 'file' 13 | type: file 14 | # disable dashboard deletion 15 | disableDeletion: false 16 | # enable dashboard editing 17 | editable: true 18 | # how often Grafana will scan for changed dashboards 19 | updateIntervalSeconds: 10 20 | # allow updating provisioned dashboards from the UI 21 | allowUiUpdates: false 22 | options: 23 | # path to dashboard files on disk. Required when using the 'file' type 24 | path: /etc/grafana/dashboards -------------------------------------------------------------------------------- /scripts/prometheus/config/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | # my global config 2 | global: 3 | scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. 4 | evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. 5 | # scrape_timeout is set to the global default (10s). 6 | 7 | # Alertmanager configuration 8 | alerting: 9 | alertmanagers: 10 | - static_configs: 11 | - targets: 12 | # - alertmanager:9093 13 | 14 | # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. 15 | rule_files: 16 | # - "first_rules.yml" 17 | # - "second_rules.yml" 18 | 19 | # A scrape configuration containing exactly one endpoint to scrape: 20 | # Here it's Prometheus itself. 21 | scrape_configs: 22 | # The job name is added as a label `job=` to any timeseries scraped from this config. 23 | - job_name: 'prometheus' 24 | # metrics_path defaults to '/metrics' 25 | # scheme defaults to 'http'. 26 | static_configs: 27 | - targets: ['localhost:9090'] 28 | 29 | - job_name: openethereum 30 | scrape_interval: 15s 31 | metric_relabel_configs: 32 | - source_labels: [__name__] 33 | target_label: __name__ 34 | replacement: "oe_${1}" 35 | static_configs: 36 | - targets: 37 | - openethereum:3000 38 | -------------------------------------------------------------------------------- /scripts/prometheus/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | services: 3 | 4 | openethereum: 5 | build: 6 | dockerfile: scripts/docker/alpine/Dockerfile 7 | context: ../.. 8 | ports: 9 | - '30303:30303' 10 | - '30303:30303/udp' 11 | - '8545:8545' 12 | links: 13 | - prometheus 14 | 15 | entrypoint: ["/home/openethereum/openethereum","--metrics","--metrics-interface=all"] 16 | 17 | prometheus: 18 | image: prom/prometheus 19 | container_name: prometheus 20 | restart: always 21 | volumes: 22 | - ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml 23 | ports: 24 | - '9090:9090' 25 | 26 | grafana: 27 | image: grafana/grafana 28 | container_name: grafana 29 | restart: always 30 | volumes: 31 | - ./config/grafana:/etc/grafana 32 | ports: 33 | - '3000:3000' 34 | depends_on: 35 | - prometheus 36 | environment: 37 | - GF_SECURITY_ADMIN_PASSWORD:secret 38 | -------------------------------------------------------------------------------- /scripts/snap/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecroxchain/openethereum/6c2d392d867b058ff867c4373e40850ca3f96969/scripts/snap/icon.png -------------------------------------------------------------------------------- /scripts/snap/parity.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Encoding=UTF-8 4 | Name=OpenEthereum 5 | Comment=Fast and feature-rich multi-network Ethereum client. 6 | Exec=openethereum 7 | Icon=/usr/share/pixmaps/icon.png 8 | Terminal=true 9 | --------------------------------------------------------------------------------