├── accounts ├── ethkey │ ├── .gitignore │ ├── cli │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ ├── keccak.rs │ │ └── random.rs │ └── .travis.yml ├── ethstore │ ├── .gitignore │ ├── .editorconfig │ ├── tests │ │ ├── res │ │ │ ├── geth_keystore │ │ │ │ ├── UTC--2016-04-03T08-58-49.834202900Z--63121b431a52f8043c16fcf0d1df9cb7b5f66649 │ │ │ │ ├── UTC--2016-02-17T09-20-45.721400158Z--3f49624084b67849c7b4e805c5988c21a430f9d9 │ │ │ │ └── UTC--2016-02-20T09-33-03.984382741Z--5ba4dcf897e97c2bdf8315b9ef26c13c085988cf │ │ │ ├── pat │ │ │ │ ├── p1.json │ │ │ │ └── p2.json │ │ │ └── ciphertext │ │ │ │ ├── 30.json │ │ │ │ └── 31.json │ │ └── util │ │ │ └── mod.rs │ ├── cli │ │ └── Cargo.toml │ ├── Cargo.toml │ ├── src │ │ ├── account │ │ │ ├── mod.rs │ │ │ └── version.rs │ │ ├── ethkey.rs │ │ ├── json │ │ │ └── mod.rs │ │ └── random.rs │ └── .travis.yml ├── Cargo.toml └── src │ └── error.rs ├── parity ├── cli │ ├── tests │ │ ├── config.invalid4.toml │ │ ├── config.invalid1.toml │ │ ├── config.invalid3.toml │ │ ├── config.invalid2.toml │ │ └── config.toml │ ├── presets │ │ ├── config.insecure.toml │ │ ├── config.dev.toml │ │ ├── config.dev-insecure.toml │ │ ├── config.non-standard-ports.toml │ │ ├── config.mining.toml │ │ └── mod.rs │ ├── usage_header.txt │ └── version.txt ├── logger │ └── Cargo.toml └── db │ └── mod.rs ├── .git-blame-ignore-revs ├── ethcore ├── res │ ├── ethereum │ │ ├── tests-issues │ │ │ └── currents.json │ │ └── runner │ │ │ └── full.json │ ├── contracts │ │ ├── tx_acl_deprecated.json │ │ ├── validator_report.json │ │ ├── validator_set.json │ │ ├── block_reward.json │ │ ├── tx_acl.json │ │ └── test_validator_set.json │ └── null_morden.json ├── wasm │ ├── run │ │ ├── res │ │ │ ├── sample1.wasm │ │ │ ├── sample2.wasm │ │ │ └── sample3.wasm │ │ └── Cargo.toml │ └── Cargo.toml ├── src │ ├── machine │ │ └── mod.rs │ ├── tests │ │ └── mod.rs │ ├── spec │ │ └── mod.rs │ ├── json_tests │ │ ├── mod.rs │ │ └── skip.rs │ ├── ethereum │ │ └── denominations.rs │ ├── snapshot │ │ └── tests │ │ │ └── mod.rs │ ├── engines │ │ └── clique │ │ │ └── params.rs │ └── trace │ │ ├── import.rs │ │ └── config.rs ├── node-filter │ ├── res │ │ └── peer_set.json │ └── Cargo.toml ├── vm │ └── Cargo.toml ├── call-contract │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── call_contract.rs ├── db │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── types │ ├── Cargo.toml │ └── src │ │ ├── transaction │ │ ├── mod.rs │ │ └── transaction_id.rs │ │ ├── engines │ │ └── mod.rs │ │ ├── block_status.rs │ │ ├── creation_status.rs │ │ ├── call_analytics.rs │ │ ├── ancestry_action.rs │ │ ├── trace_filter.rs │ │ ├── basic_account.rs │ │ ├── views │ │ └── mod.rs │ │ ├── tree_route.rs │ │ ├── pruning_info.rs │ │ ├── data_format.rs │ │ └── security_level.rs ├── service │ ├── Cargo.toml │ └── src │ │ ├── error.rs │ │ ├── stop_guard.rs │ │ └── lib.rs ├── evm │ ├── Cargo.toml │ └── src │ │ └── vmtype.rs ├── sync │ └── src │ │ ├── tests │ │ ├── mod.rs │ │ └── rpc.rs │ │ └── res │ │ └── private_spec.json ├── builtin │ └── Cargo.toml └── blockchain │ ├── Cargo.toml │ └── src │ ├── config.rs │ ├── lib.rs │ └── cache.rs ├── scripts ├── snap │ ├── icon.png │ └── parity.desktop ├── remove_duplicate_empty_lines.sh ├── doc.sh ├── actions │ ├── clean-target.sh │ ├── validate-chainspecs.sh │ ├── install-sccache.ps1 │ ├── build-linux.sh │ └── build-windows.sh ├── hook.sh ├── docker │ ├── hub │ │ ├── check_sync.sh │ │ └── Dockerfile │ ├── centos │ │ ├── Dockerfile │ │ ├── Dockerfile.build │ │ └── build.sh │ ├── README.md │ ├── alpine │ │ └── Dockerfile │ └── ubuntu-arm │ │ └── Dockerfile ├── add_license.sh ├── parity.service ├── prometheus │ ├── config │ │ ├── grafana │ │ │ └── provisioning │ │ │ │ ├── dashboards │ │ │ │ └── provider.yaml │ │ │ │ └── datasources │ │ │ │ └── prometheus.yaml │ │ └── prometheus │ │ │ └── prometheus.yml │ └── docker-compose.yaml ├── evm_uint_bench.sh └── evm_jsontests_bench.sh ├── util ├── memory-db │ ├── .cargo_vcs_info.json │ ├── README.md │ ├── Cargo.toml.orig │ └── Cargo.toml ├── macros │ └── Cargo.toml ├── unexpected │ └── Cargo.toml ├── stats │ └── Cargo.toml ├── time-utils │ └── Cargo.toml ├── rlp-compress │ └── Cargo.toml ├── memory-cache │ └── Cargo.toml ├── bloom │ └── Cargo.toml ├── fake-fetch │ └── Cargo.toml ├── migration-rocksdb │ └── Cargo.toml ├── panic-hook │ └── Cargo.toml ├── dir │ └── Cargo.toml ├── fastmap │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── runtime │ └── Cargo.toml ├── registrar │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── blooms-db │ └── Cargo.toml ├── keccak-hasher │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── rlp-derive │ └── Cargo.toml ├── len-caching-lock │ └── Cargo.toml ├── memzero │ └── Cargo.toml ├── triehash-ethereum │ └── Cargo.toml ├── EIP-152 │ └── Cargo.toml ├── fetch │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── io │ └── Cargo.toml ├── version │ └── Cargo.toml ├── patricia-trie-ethereum │ └── Cargo.toml ├── EIP-712 │ └── Cargo.toml ├── journaldb │ └── Cargo.toml ├── network │ ├── Cargo.toml │ └── src │ │ └── connection_filter.rs └── network-devp2p │ └── Cargo.toml ├── miner ├── using-queue │ └── Cargo.toml ├── stratum │ └── Cargo.toml ├── price-info │ └── Cargo.toml ├── local-store │ └── Cargo.toml ├── Cargo.toml ├── src │ └── local_accounts.rs └── res │ └── contracts │ └── service_transaction.json ├── .cargo └── config ├── secret-store ├── res │ └── acl_storage.json ├── src │ ├── types │ │ └── mod.rs │ ├── key_server_cluster │ │ ├── client_sessions │ │ │ └── mod.rs │ │ ├── net │ │ │ ├── mod.rs │ │ │ └── connection.rs │ │ ├── jobs │ │ │ └── mod.rs │ │ └── io │ │ │ └── mod.rs │ └── helpers.rs └── Cargo.toml ├── chainspec └── Cargo.toml ├── .gitmodules ├── .editorconfig ├── .dockerignore ├── json ├── Cargo.toml └── src │ ├── trie │ ├── mod.rs │ ├── trie.rs │ └── test.rs │ ├── transaction │ ├── mod.rs │ └── test.rs │ ├── vm │ ├── mod.rs │ └── test.rs │ ├── state │ └── mod.rs │ ├── blockchain │ ├── mod.rs │ ├── transaction.rs │ └── test.rs │ ├── lib.rs │ └── spec │ └── instant_seal.rs ├── cli-signer ├── Cargo.toml └── rpc-client │ └── Cargo.toml ├── .github ├── workflows │ ├── fmt.yml │ ├── deploy-docker.yml │ ├── deploy-docker-nightly.yml │ ├── deploy-docker-tag.yml │ └── build-test.yml └── ISSUE_TEMPLATE.md ├── .gitignore ├── ethash └── Cargo.toml ├── license_header ├── rpc └── src │ ├── tests │ └── mod.rs │ └── v1 │ ├── tests │ ├── helpers │ │ └── mod.rs │ └── mocked │ │ └── mod.rs │ ├── traits │ ├── debug.rs │ ├── web3.rs │ ├── net.rs │ └── mod.rs │ ├── types │ ├── rpc_settings.rs │ └── histogram.rs │ ├── impls │ └── web3.rs │ └── metadata.rs └── evmbin ├── Cargo.toml ├── res └── testchain.json └── src └── display ├── mod.rs └── config.rs /accounts/ethkey/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | -------------------------------------------------------------------------------- /accounts/ethstore/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid4.toml: -------------------------------------------------------------------------------- 1 | [account] 2 | invalid = 5 3 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid1.toml: -------------------------------------------------------------------------------- 1 | [account 2 | unlock = "0x1" 3 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid3.toml: -------------------------------------------------------------------------------- 1 | [signer] 2 | passwd = [] 3 | 4 | -------------------------------------------------------------------------------- /parity/cli/tests/config.invalid2.toml: -------------------------------------------------------------------------------- 1 | [account] 2 | unlock = "0x1" 3 | passwd = [] 4 | 5 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Reformat the source code 2 | 610d9baba4af83b5767c659ca2ccfed337af1056 3 | -------------------------------------------------------------------------------- /ethcore/res/ethereum/tests-issues/currents.json: -------------------------------------------------------------------------------- 1 | { 2 | "block": [], 3 | "state": [] 4 | } 5 | -------------------------------------------------------------------------------- /scripts/snap/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethernity-cloud/openethereum/HEAD/scripts/snap/icon.png -------------------------------------------------------------------------------- /parity/cli/presets/config.insecure.toml: -------------------------------------------------------------------------------- 1 | [rpc] 2 | interface = "all" 3 | apis = ["all"] 4 | hosts = ["all"] 5 | -------------------------------------------------------------------------------- /ethcore/wasm/run/res/sample1.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethernity-cloud/openethereum/HEAD/ethcore/wasm/run/res/sample1.wasm -------------------------------------------------------------------------------- /ethcore/wasm/run/res/sample2.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethernity-cloud/openethereum/HEAD/ethcore/wasm/run/res/sample2.wasm -------------------------------------------------------------------------------- /ethcore/wasm/run/res/sample3.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethernity-cloud/openethereum/HEAD/ethcore/wasm/run/res/sample3.wasm -------------------------------------------------------------------------------- /parity/cli/presets/config.dev.toml: -------------------------------------------------------------------------------- 1 | [parity] 2 | chain = "dev" 3 | 4 | [mining] 5 | reseal_min_period = 0 6 | min_gas_price = 0 7 | -------------------------------------------------------------------------------- /util/memory-db/.cargo_vcs_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "sha1": "909b921151ebedf34456246dde0c7c4c3d3dcecb" 4 | } 5 | } -------------------------------------------------------------------------------- /util/macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "macros" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /util/unexpected/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "unexpected" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /miner/using-queue/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "using_queue" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | -------------------------------------------------------------------------------- /scripts/remove_duplicate_empty_lines.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | for f in $(find . -name '*.rs'); do 4 | cat -s $f > $f.temp 5 | mv $f.temp $f 6 | done 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /util/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`. -------------------------------------------------------------------------------- /.cargo/config: -------------------------------------------------------------------------------- 1 | [target.x86_64-pc-windows-msvc] 2 | # Link the C runtime statically ; https://github.com/openethereum/openethereum/issues/6643 3 | rustflags = ["-Ctarget-feature=+crt-static"] 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /secret-store/res/acl_storage.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"constant":true,"inputs":[{"name":"user","type":"address"},{"name":"document","type":"bytes32"}],"name":"checkPermissions","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"} 3 | ] 4 | -------------------------------------------------------------------------------- /scripts/doc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # generate documentation only for openethereum and ethcore libraries 3 | 4 | cargo doc --no-deps --verbose --all && 5 | echo '' > target/doc/index.html 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /chainspec/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Chain Specification" 3 | name = "chainspec" 4 | version = "0.1.0" 5 | authors = ["Marek Kotewicz "] 6 | 7 | [dependencies] 8 | ethjson = { path = "../json" } 9 | serde_json = "1.0" 10 | -------------------------------------------------------------------------------- /util/time-utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "time-utils" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Time utilities for checked arithmetic" 6 | license = "GPL3" 7 | edition = "2018" 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /util/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.3.0", features = ["ethereum"] } 8 | elastic-array = "0.10" 9 | lazy_static = "1.0" 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ethcore/res/ethereum/tests"] 2 | path = ethcore/res/ethereum/tests 3 | url = https://github.com/ethereum/tests.git 4 | branch = develop 5 | [submodule "ethcore/res/wasm-tests"] 6 | path = ethcore/res/wasm-tests 7 | url = https://github.com/paritytech/wasm-tests 8 | -------------------------------------------------------------------------------- /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 | heapsize = "0.4" 10 | lru-cache = "0.1" 11 | -------------------------------------------------------------------------------- /util/bloom/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ethcore-bloom-journal" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Journaling bloom filter" 6 | license = "GPL3" 7 | 8 | [lib] 9 | path = "src/lib.rs" 10 | 11 | [dependencies] 12 | siphasher = "0.1.1" 13 | -------------------------------------------------------------------------------- /util/fake-fetch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Mock fetcher for testing" 3 | name = "fake-fetch" 4 | version = "0.0.1" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | fetch = { path = "../fetch" } 10 | futures = "0.1" 11 | hyper = "0.12" 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /util/migration-rocksdb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "migration-rocksdb" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | 6 | [dependencies] 7 | log = "0.4" 8 | macros = { path = "../macros" } 9 | kvdb = "0.1" 10 | kvdb-rocksdb = "0.1.3" 11 | 12 | [dev-dependencies] 13 | tempdir = "0.3" 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.4" 9 | journaldb = { path = "../journaldb" } 10 | app_dirs = { git = "https://github.com/openethereum/app-dirs-rs" } 11 | home = "0.3" 12 | -------------------------------------------------------------------------------- /util/fastmap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fastmap" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Specialized version of `HashMap` with H256 keys and fast hashing function." 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | ethereum-types = "0.4" 10 | plain_hasher = "0.2" 11 | -------------------------------------------------------------------------------- /util/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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /ethcore/node-filter/res/peer_set.json: -------------------------------------------------------------------------------- 1 | [{"constant":true,"inputs":[{"name":"sl","type":"bytes32"},{"name":"sh","type":"bytes32"},{"name":"pl","type":"bytes32"},{"name":"ph","type":"bytes32"}],"name":"connectionAllowed","outputs":[{"name":"res","type":"bool"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}] 2 | -------------------------------------------------------------------------------- /scripts/hook.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | FILE=./.git/hooks/pre-push 3 | 4 | echo "#!/bin/sh\n" > $FILE 5 | # Exit on any error 6 | echo "set -e" >> $FILE 7 | # Run release build 8 | echo "cargo build --features dev" >> $FILE 9 | # Build tests 10 | echo "cargo test --no-run --features dev --all" >> $FILE 11 | echo "" >> $FILE 12 | chmod +x $FILE 13 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /util/registrar/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Registar for Parity" 3 | name = "registrar" 4 | version = "0.0.1" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | futures = "0.1" 10 | ethabi = "6.0" 11 | ethabi-derive = "6.0" 12 | ethabi-contract = "6.0" 13 | keccak-hash = "0.1" 14 | -------------------------------------------------------------------------------- /util/blooms-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "blooms-db" 3 | version = "0.1.0" 4 | license = "GPL-3.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | byteorder = "1.2" 9 | ethbloom = "=0.5.0" 10 | parking_lot = "0.7" 11 | tiny-keccak = "1.4" 12 | 13 | [dev-dependencies] 14 | criterion = "0.3.0" 15 | tempdir = "0.3" 16 | -------------------------------------------------------------------------------- /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.4" 10 | tiny-keccak = "1.4.2" 11 | hash-db = "0.11.0" 12 | plain_hasher = "0.2" 13 | -------------------------------------------------------------------------------- /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.3.0", features = ["ethereum"] } 17 | -------------------------------------------------------------------------------- /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.7" 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.4.0", features = ["ethereum"] } 10 | ethereum-types = "0.4" 11 | keccak-hasher = { path = "../keccak-hasher" } 12 | -------------------------------------------------------------------------------- /json/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum JSON Deserialization" 3 | name = "ethjson" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | ethereum-types = "0.4" 9 | rustc-hex = "1.0" 10 | serde = "1.0" 11 | serde_json = "1.0" 12 | serde_derive = "1.0" 13 | 14 | [dev-dependencies] 15 | macros = { path = "../util/macros" } 16 | maplit = "1.0.2" 17 | -------------------------------------------------------------------------------- /ethcore/wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "WASM Interpreter" 3 | name = "wasm" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | byteorder = "1.0" 9 | ethereum-types = "0.4" 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 | -------------------------------------------------------------------------------- /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.4" 11 | futures = "0.1" 12 | rpassword = "1.0" 13 | parity-rpc = { path = "../rpc" } 14 | parity-rpc-client = { path = "rpc-client" } 15 | -------------------------------------------------------------------------------- /parity/logger/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Logger Implementation" 3 | name = "ethcore-logger" 4 | version = "1.12.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | log = "0.4" 10 | env_logger = "0.5" 11 | atty = "0.2" 12 | lazy_static = "1.0" 13 | regex = "1.0" 14 | time = "0.1" 15 | parking_lot = "0.7" 16 | arrayvec = "0.4" 17 | ansi_term = "0.10" 18 | -------------------------------------------------------------------------------- /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 | ] 5 | -------------------------------------------------------------------------------- /ethcore/vm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Virtual Machines (VM) Support Library" 3 | name = "vm" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | parity-bytes = "0.1" 9 | ethereum-types = "0.4" 10 | patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" } 11 | ethjson = { path = "../../json" } 12 | rlp = { version = "0.3.0", features = ["ethereum"] } 13 | keccak-hash = "0.1" 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ethcore/call-contract/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information" 3 | name = "ethcore-call-contract" 4 | version = "0.1.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | edition = "2018" 8 | 9 | [dependencies] 10 | types = { path = "../types", package = "common-types" } 11 | ethereum-types = "0.4" 12 | bytes = { version = "0.1", package = "parity-bytes" } 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.4" 10 | keccak-hash = "0.1" 11 | jsonrpc-core = "15.0.0" 12 | jsonrpc-tcp-server = "15.0.0" 13 | log = "0.4" 14 | parking_lot = "0.7" 15 | 16 | [dev-dependencies] 17 | env_logger = "0.5" 18 | tokio = "0.1" 19 | tokio-io = "0.1" 20 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /util/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 | -------------------------------------------------------------------------------- /ethcore/wasm/run/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity WASM Test Run" 3 | name = "pwasm-run-test" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | serde = "1" 9 | serde_json = "1" 10 | serde_derive = "1" 11 | ethereum-types = "0.4" 12 | ethjson = { path = "../../../json" } 13 | vm = { path = "../../vm" } 14 | wasm = { path = "../" } 15 | clap = "2.24" 16 | env_logger = "0.5" 17 | rustc-hex = "1" 18 | 19 | [features] 20 | default = ["ethereum-types/std"] 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /util/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.7" 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 | -------------------------------------------------------------------------------- /accounts/ethkey/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Keys Generator CLI" 3 | name = "ethkey-cli" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | docopt = "1.0" 9 | env_logger = "0.5" 10 | ethkey = { path = "../" } 11 | panic_hook = { path = "../../../util/panic-hook" } 12 | parity-wordlist="1.3" 13 | rustc-hex = "1.0" 14 | serde = "1.0" 15 | serde_derive = "1.0" 16 | threadpool = "1.7" 17 | 18 | [[bin]] 19 | name = "ethkey" 20 | path = "src/main.rs" 21 | doc = false 22 | -------------------------------------------------------------------------------- /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.1.1-rc.1" 5 | authors = ["Parity Technologies "] 6 | build = "build.rs" 7 | 8 | [package.metadata] 9 | 10 | [dependencies] 11 | parity-bytes = "0.1" 12 | rlp = { version = "0.3.0", features = ["ethereum"] } 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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /ethcore/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 = "../types" } 12 | ethereum-types = "0.4" 13 | heapsize = "0.4" 14 | kvdb = "0.1" 15 | parking_lot = "0.7" 16 | rlp = { version = "0.3.0", features = ["ethereum"] } 17 | rlp_derive = { path = "../../util/rlp-derive" } 18 | -------------------------------------------------------------------------------- /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 = "../../util/fetch" } 11 | futures = "0.1" 12 | parity-runtime = { path = "../../util/runtime" } 13 | log = "0.4" 14 | serde_json = "1.0" 15 | 16 | [dev-dependencies] 17 | parking_lot = "0.7" 18 | fake-fetch = { path = "../../util/fake-fetch" } 19 | -------------------------------------------------------------------------------- /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.4" 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.1" 22 | -------------------------------------------------------------------------------- /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 = "../../util/io" } 10 | kvdb = "0.1" 11 | log = "0.4" 12 | rlp = { version = "0.3.0", features = ["ethereum"] } 13 | serde = "1.0" 14 | serde_derive = "1.0" 15 | serde_json = "1.0" 16 | 17 | [dev-dependencies] 18 | ethkey = { path = "../../accounts/ethkey" } 19 | kvdb-memorydb = "0.1" 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/add_license.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | PAT_GPL="^// Copyright.*If not, see \.$" 4 | PAT_OTHER="^// Copyright" 5 | 6 | for f in $(find . -type f | egrep '\.(c|cpp|rs)$'); do 7 | HEADER=$(head -16 $f) 8 | if [[ $HEADER =~ $PAT_GPL ]]; then 9 | BODY=$(tail -n +17 $f) 10 | cat license_header > temp 11 | echo "$BODY" >> temp 12 | mv temp $f 13 | elif [[ $HEADER =~ $PAT_OTHER ]]; then 14 | echo "Other license was found do nothing" 15 | else 16 | echo "$f was missing header" 17 | cat license_header $f > temp 18 | mv temp $f 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /util/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 -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | parking_lot = "0.7" 16 | serde = "1.0" 17 | serde_derive = "1.0" 18 | serde_json = "1.0" 19 | 20 | [dev-dependencies] 21 | ethereum-types = "0.4" 22 | tempdir = "0.3" 23 | -------------------------------------------------------------------------------- /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 ethcore/res/*.json; do 12 | if ! ./target/release/chainspec "$spec"; then ERR=1; fi 13 | done 14 | 15 | for spec in ethcore/res/ethereum/*.json; do 16 | if ! ./target/release/chainspec "$spec"; then ERR=1; fi 17 | done 18 | #show sccache statistics 19 | #sccache --stop-server 20 | exit $ERR 21 | -------------------------------------------------------------------------------- /accounts/ethstore/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Key Management CLI" 3 | name = "ethstore-cli" 4 | version = "0.1.1" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | docopt = "1.0" 9 | env_logger = "0.5" 10 | num_cpus = "1.6" 11 | rustc-hex = "1.0" 12 | serde = "1.0" 13 | serde_derive = "1.0" 14 | parking_lot = "0.7" 15 | ethstore = { path = "../" } 16 | dir = { path = '../../../util/dir' } 17 | panic_hook = { path = "../../../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 | -------------------------------------------------------------------------------- /util/patricia-trie-ethereum/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "patricia-trie-ethereum" 3 | version = "0.1.0" 4 | authors = ["Parity Technologies "] 5 | description = "Merkle-Patricia Trie (Ethereum Style)" 6 | license = "GPL-3.0" 7 | 8 | [dependencies] 9 | trie-db = "0.11.0" 10 | keccak-hasher = { version = "0.1.1", path = "../keccak-hasher" } 11 | hash-db = "0.11.0" 12 | rlp = { version = "0.3.0", features = ["ethereum"] } 13 | parity-bytes = "0.1" 14 | ethereum-types = "0.4" 15 | elastic-array = "0.10" 16 | 17 | [dev-dependencies] 18 | memory-db = "0.11.0" 19 | keccak-hash = "0.1.2" 20 | journaldb = { path = "../journaldb" } 21 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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.4" 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.7" 19 | parity-crypto = "0.3.0" 20 | ethereum-types = "0.4" 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 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/pat/p1.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "3f49624084b67849c7b4e805c5988c21a430f9d9", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "9f27e3dd4fc73e7103ed61e5493662189a3eb52223ae49e3d1deacc04c889eae", 6 | "cipherparams": { 7 | "iv": "457494bf05f2618c397dc74dbb5181c0" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "db14edb18c41ee7f5ec4397df89c3a2ae4d0af60884c52bb54ce490574f8df33" 16 | }, 17 | "mac": "572d24532438d31fdf513c744a3ff26c933ffda5744ee42bc71661cbe3f2112e" 18 | }, 19 | "id": "62a0ad73-556d-496a-8e1c-0783d30d3ace", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/pat/p2.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "5ba4dcf897e97c2bdf8315b9ef26c13c085988cf", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "d4a08ec930163778273920f6ad1d49b71836337be6fd9863993ac700a612fddd", 6 | "cipherparams": { 7 | "iv": "89ce5ec129fc27cd5bcbeb8c92bdad50" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "612ab108dc37e69ee8af37a7b24bf7f2234086d7bbf945bacdeccce331f7f84a" 16 | }, 17 | "mac": "4152caa7444e06784223d735cea80cd2690b4c587ad8db3d5529442227b25695" 18 | }, 19 | "id": "35086353-fb12-4029-b56b-033cd61ce35b", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/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 = "0.3.0" 10 | eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", rev = "ccc06e7480148b723eb44ac56cf4d20eec380b6f" } 11 | ethereum-types = "0.4" 12 | lazy_static = "1.0" 13 | log = "0.4" 14 | memzero = { path = "../../util/memzero" } 15 | parity-wordlist = "1.3" 16 | quick-error = "1.2.2" 17 | rand = "0.4" 18 | rustc-hex = "1.0" 19 | serde = "1.0" 20 | serde_derive = "1.0" 21 | tiny-keccak = "1.4" 22 | rust-crypto = "0.2" 23 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/ciphertext/30.json: -------------------------------------------------------------------------------- 1 | { 2 | "address" : "31e9d1e6d844bd3a536800ef8d8be6a9975db509", 3 | "crypto" : { 4 | "cipher" : "aes-128-ctr", 5 | "cipherparams" : { 6 | "iv" : "3ca92af36ad7c2cd92454c59cea5ef00" 7 | }, 8 | "ciphertext" : "108b7d34f3442fc26ab1ab90ca91476ba6bfa8c00975a49ef9051dc675aa", 9 | "kdf" : "scrypt", 10 | "kdfparams" : { 11 | "dklen" : 32, 12 | "n" : 2, 13 | "r" : 8, 14 | "p" : 1, 15 | "salt" : "d0769e608fb86cda848065642a9c6fa046845c928175662b8e356c77f914cd3b" 16 | }, 17 | "mac" : "75d0e6759f7b3cefa319c3be41680ab6beea7d8328653474bd06706d4cc67420" 18 | }, 19 | "id" : "a37e1559-5955-450d-8075-7b8931b392b2", 20 | "version" : 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/ciphertext/31.json: -------------------------------------------------------------------------------- 1 | { 2 | "address" : "d1e64e5480bfaf733ba7d48712decb8227797a4e", 3 | "crypto" : { 4 | "cipher" : "aes-128-ctr", 5 | "cipherparams" : { 6 | "iv" : "e0c41130a323adc1446fc82f724bca2f" 7 | }, 8 | "ciphertext" : "9517cd5bdbe69076f9bf5057248c6c050141e970efa36ce53692d5d59a3984", 9 | "kdf" : "scrypt", 10 | "kdfparams" : { 11 | "dklen" : 32, 12 | "n" : 2, 13 | "r" : 8, 14 | "p" : 1, 15 | "salt" : "711f816911c92d649fb4c84b047915679933555030b3552c1212609b38208c63" 16 | }, 17 | "mac" : "d5e116151c6aa71470e67a7d42c9620c75c4d23229847dcc127794f0732b0db5" 18 | }, 19 | "id" : "fecfc4ce-e956-48fd-953b-30f8b52ed66c", 20 | "version" : 3 21 | } 22 | -------------------------------------------------------------------------------- /ethcore/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Common Types" 3 | name = "common-types" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | ethereum-types = "0.4" 9 | ethjson = { path = "../../json" } 10 | ethkey = { path = "../../accounts/ethkey" } 11 | heapsize = "0.4" 12 | keccak-hash = "0.1" 13 | parity-bytes = "0.1" 14 | rlp = { version = "0.3.0", features = ["ethereum"] } 15 | rlp_derive = { path = "../../util/rlp-derive" } 16 | unexpected = { path = "../../util/unexpected" } 17 | serde = "1.0" 18 | serde_json = "1.0" 19 | serde_repr = "0.1" 20 | 21 | [dev-dependencies] 22 | rustc-hex = "1.0" 23 | 24 | [features] 25 | test-helpers = [] 26 | -------------------------------------------------------------------------------- /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/parity.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/io.parity.ethereum/ 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 | # SIGHUP gives openethereum time to exit cleanly before SIGKILL (default 90s) 17 | KillSignal=SIGHUP 18 | 19 | [Install] 20 | WantedBy=default.target 21 | 22 | 23 | -------------------------------------------------------------------------------- /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.4" 11 | keccak-hash = "0.1" 12 | log = "0.4" 13 | memmap = "0.6" 14 | parking_lot = "0.7" 15 | primal = "0.2.3" 16 | 17 | [dev-dependencies] 18 | criterion = "0.2" 19 | rustc-hex = "1.0" 20 | serde_json = "1.0" 21 | tempdir = "0.3" 22 | 23 | [features] 24 | default = [] 25 | bench = [] 26 | 27 | [[bench]] 28 | name = "basic" 29 | harness = false 30 | required-features = ['bench'] 31 | 32 | [[bench]] 33 | name = "progpow" 34 | harness = false 35 | required-features = ['bench'] 36 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/geth_keystore/UTC--2016-02-17T09-20-45.721400158Z--3f49624084b67849c7b4e805c5988c21a430f9d9: -------------------------------------------------------------------------------- 1 | { 2 | "address": "3f49624084b67849c7b4e805c5988c21a430f9d9", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "9f27e3dd4fc73e7103ed61e5493662189a3eb52223ae49e3d1deacc04c889eae", 6 | "cipherparams": { 7 | "iv": "457494bf05f2618c397dc74dbb5181c0" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "db14edb18c41ee7f5ec4397df89c3a2ae4d0af60884c52bb54ce490574f8df33" 16 | }, 17 | "mac": "572d24532438d31fdf513c744a3ff26c933ffda5744ee42bc71661cbe3f2112e" 18 | }, 19 | "id": "62a0ad73-556d-496a-8e1c-0783d30d3ace", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /accounts/ethstore/tests/res/geth_keystore/UTC--2016-02-20T09-33-03.984382741Z--5ba4dcf897e97c2bdf8315b9ef26c13c085988cf: -------------------------------------------------------------------------------- 1 | { 2 | "address": "5ba4dcf897e97c2bdf8315b9ef26c13c085988cf", 3 | "Crypto": { 4 | "cipher": "aes-128-ctr", 5 | "ciphertext": "d4a08ec930163778273920f6ad1d49b71836337be6fd9863993ac700a612fddd", 6 | "cipherparams": { 7 | "iv": "89ce5ec129fc27cd5bcbeb8c92bdad50" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "dklen": 32, 12 | "n": 262144, 13 | "p": 1, 14 | "r": 8, 15 | "salt": "612ab108dc37e69ee8af37a7b24bf7f2234086d7bbf945bacdeccce331f7f84a" 16 | }, 17 | "mac": "4152caa7444e06784223d735cea80cd2690b4c587ad8db3d5529442227b25695" 18 | }, 19 | "id": "35086353-fb12-4029-b56b-033cd61ce35b", 20 | "version": 3 21 | } 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = "6.0" 18 | keccak-hash = "0.1" 19 | ethereum-types = "0.4" 20 | failure = "0.1.7" 21 | itertools = "0.7" 22 | lazy_static = "1.1" 23 | regex = "1.0" 24 | validator = "0.8" 25 | validator_derive = "0.8" 26 | lunarity-lexer = "0.2" 27 | rustc-hex = "2.0" 28 | indexmap = "1.0.2" 29 | -------------------------------------------------------------------------------- /util/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.4" 11 | hash-db = "0.11.0" 12 | heapsize = "0.4" 13 | keccak-hasher = { path = "../keccak-hasher" } 14 | kvdb = "0.1" 15 | log = "0.4" 16 | memory-db = { path = "../../util/memory-db" } 17 | parking_lot = "0.7" 18 | fastmap = { path = "../../util/fastmap" } 19 | rlp = { version = "0.3.0", features = ["ethereum"] } 20 | 21 | [dev-dependencies] 22 | env_logger = "0.5" 23 | keccak-hash = "0.1" 24 | kvdb-memorydb = "=0.1.0" 25 | -------------------------------------------------------------------------------- /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 = "../../util/io" } 13 | ethcore-sync = { path = "../sync" } 14 | ethereum-types = "0.4" 15 | kvdb = "0.1" 16 | log = "0.4" 17 | trace-time = "0.1" 18 | 19 | [dev-dependencies] 20 | ethcore-db = { path = "../db" } 21 | ethcore = { path = "..", features = ["test-helpers"] } 22 | tempdir = "0.3" 23 | kvdb-rocksdb = "0.1.3" 24 | -------------------------------------------------------------------------------- /util/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 = "0.3.0" 12 | ethcore-io = { path = "../io" } 13 | ethereum-types = "0.4" 14 | ethkey = { path = "../../accounts/ethkey" } 15 | ipnetwork = "0.12.6" 16 | lazy_static = "1.0" 17 | rlp = { version = "0.3.0", features = ["ethereum"] } 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 | -------------------------------------------------------------------------------- /ethcore/evm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum Virtual Machine (EVM) Rust Implementation" 3 | name = "evm" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | 7 | [dependencies] 8 | bit-set = "0.4" 9 | parity-bytes = "0.1" 10 | ethereum-types = "0.4" 11 | heapsize = "0.4" 12 | lazy_static = "1.0" 13 | log = "0.4" 14 | vm = { path = "../vm" } 15 | keccak-hash = "0.1" 16 | parking_lot = "0.7" 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ethcore/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 = ".."} 11 | ethcore-network = { path = "../../util/network" } 12 | ethcore-network-devp2p = { path = "../../util/network-devp2p" } 13 | ethereum-types = "0.4" 14 | log = "0.4" 15 | parking_lot = "0.7" 16 | ethabi = "6.0" 17 | ethabi-derive = "6.0" 18 | ethabi-contract = "6.0" 19 | lru-cache = "0.1" 20 | 21 | [dev-dependencies] 22 | ethcore = { path = "..", features = ["test-helpers"] } 23 | kvdb-memorydb = "0.1" 24 | ethcore-io = { path = "../../util/io" } 25 | tempdir = "0.3" 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /secret-store/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 | //! Types used in the public api 18 | 19 | mod all; 20 | mod error; 21 | 22 | pub use self::{all::*, error::*}; 23 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = "../ethcore/types", features = ["test-helpers"] } 13 | docopt = "1.0" 14 | env_logger = "0.5" 15 | ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] } 16 | ethereum-types = "0.4" 17 | ethjson = { path = "../json" } 18 | evm = { path = "../ethcore/evm" } 19 | panic_hook = { path = "../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 = "../ethcore/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 | -------------------------------------------------------------------------------- /json/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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /ethcore/builtin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "ethereum vm builtin" 3 | name = "ethcore-builtin" 4 | version = "0.1.0" 5 | authors = ["Parity Technologies "] 6 | edition = "2018" 7 | 8 | [dependencies] 9 | bn = { git = "https://github.com/paritytech/bn", default-features = false } 10 | byteorder = "1.3.2" 11 | eip-152 = { path = "../../util/EIP-152" } 12 | ethereum-types = "0.4" 13 | ethjson = { path = "../../json" } 14 | ethkey = { path = "../../accounts/ethkey" } 15 | keccak-hash = "0.1.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 = "0.4.0" 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ethcore/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 | 26 | pub use self::db::*; 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /json/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/client_sessions/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 decryption_session; 18 | pub mod encryption_session; 19 | pub mod generation_session; 20 | pub mod signing_session_ecdsa; 21 | pub mod signing_session_schnorr; 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /json/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 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/net/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 accept_connection; 18 | mod connect; 19 | mod connection; 20 | 21 | pub use self::{ 22 | accept_connection::{accept_connection, AcceptConnection}, 23 | connect::{connect, Connect}, 24 | connection::Connection, 25 | }; 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /json/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 blockchain::State as AccountState; 26 | pub use vm::Env; 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /util/registrar/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 ethabi; 18 | extern crate futures; 19 | extern crate keccak_hash; 20 | 21 | #[macro_use] 22 | extern crate ethabi_derive; 23 | #[macro_use] 24 | extern crate ethabi_contract; 25 | 26 | mod registrar; 27 | pub use registrar::{Asynchronous, Registrar, RegistrarClient, Synchronous}; 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/jobs/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 consensus_session; 18 | pub mod decryption_job; 19 | pub mod dummy_job; 20 | pub mod job_session; 21 | pub mod key_access_job; 22 | pub mod servers_set_change_access_job; 23 | pub mod signing_job_ecdsa; 24 | pub mod signing_job_schnorr; 25 | pub mod unknown_sessions_job; 26 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /json/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 hash::H256; 20 | use trie::Input; 21 | 22 | /// Trie test deserialization. 23 | #[derive(Debug, Deserialize, PartialEq)] 24 | pub struct Trie { 25 | /// Trie test input. 26 | #[serde(rename = "in")] 27 | pub input: Input, 28 | /// Trie root hash. 29 | pub root: H256, 30 | } 31 | -------------------------------------------------------------------------------- /util/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 | [dependencies.hash-db] 25 | version = "0.11.0" 26 | 27 | [dependencies.heapsize] 28 | version = "0.4" 29 | [dev-dependencies.criterion] 30 | version = "0.2.8" 31 | 32 | [dev-dependencies.keccak-hasher] 33 | version = "0.11.0" -------------------------------------------------------------------------------- /ethcore/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = "../../util/blooms-db" } 13 | common-types = { path = "../types" } 14 | ethcore-db = { path = "../db" } 15 | ethereum-types = "0.4" 16 | heapsize = "0.4" 17 | itertools = "0.5" 18 | keccak-hash = "0.1" 19 | kvdb = "0.1" 20 | log = "0.4" 21 | parity-bytes = "0.1" 22 | parking_lot = "0.7" 23 | rand = "0.6" 24 | rayon = "1.1" 25 | rlp = { version = "0.3.0", features = ["ethereum"] } 26 | rlp_compress = { path = "../../util/rlp-compress" } 27 | rlp_derive = { path = "../../util/rlp-derive" } 28 | triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" } 29 | 30 | [dev-dependencies] 31 | env_logger = "0.5" 32 | ethkey = { path = "../../accounts/ethkey" } 33 | rustc-hex = "1.0" 34 | tempdir = "0.3" 35 | kvdb-memorydb = "0.1" 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 state; 23 | mod test_common; 24 | mod transaction; 25 | mod trie; 26 | 27 | /// executor of ethereum/json tests 28 | pub mod runner; 29 | 30 | pub use self::{ 31 | executive::json_executive_test, 32 | test_common::{debug_include_test, find_json_files_recursive, HookType}, 33 | }; 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /json/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /accounts/ethkey/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 | use tiny_keccak::Keccak; 18 | 19 | pub trait Keccak256 { 20 | fn keccak256(&self) -> T 21 | where 22 | T: Sized; 23 | } 24 | 25 | impl Keccak256<[u8; 32]> for [u8] { 26 | fn keccak256(&self) -> [u8; 32] { 27 | let mut keccak = Keccak::new_keccak256(); 28 | let mut result = [0u8; 32]; 29 | keccak.update(self); 30 | keccak.finalize(&mut result); 31 | result 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/net/connection.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 ethkey::KeyPair; 18 | use key_server_cluster::{io::SharedTcpStream, NodeId}; 19 | use std::net; 20 | 21 | /// Established connection data 22 | pub struct Connection { 23 | /// Peer address. 24 | pub address: net::SocketAddr, 25 | /// Connection stream. 26 | pub stream: SharedTcpStream, 27 | /// Peer node id. 28 | pub node_id: NodeId, 29 | /// Encryption key. 30 | pub key: KeyPair, 31 | } 32 | -------------------------------------------------------------------------------- /util/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.4" 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.7" 20 | ansi_term = "0.10" 21 | rustc-hex = "1.0" 22 | ethcore-io = { path = "../io", features = ["mio"] } 23 | parity-bytes = "0.1" 24 | parity-crypto = "0.3.0" 25 | ethcore-network = { path = "../network" } 26 | ethereum-types = "0.4" 27 | ethkey = { path = "../../accounts/ethkey" } 28 | rlp = { version = "0.3.0", features = ["ethereum"] } 29 | parity-path = "0.1" 30 | ipnetwork = "0.12.6" 31 | keccak-hash = "0.1" 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /json/src/blockchain/transaction.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 transaction deserialization. 18 | 19 | use bytes::Bytes; 20 | use uint::Uint; 21 | 22 | /// Blockchain test transaction deserialization. 23 | #[derive(Debug, PartialEq, Deserialize)] 24 | #[serde(rename_all = "camelCase")] 25 | pub struct Transaction { 26 | data: Bytes, 27 | gas_limit: Uint, 28 | gas_price: Uint, 29 | nonce: Uint, 30 | r: Uint, 31 | s: Uint, 32 | v: Uint, 33 | value: Uint, 34 | } 35 | -------------------------------------------------------------------------------- /json/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 ethereum_types; 18 | extern crate rustc_hex; 19 | extern crate serde; 20 | extern crate serde_json; 21 | #[macro_use] 22 | extern crate serde_derive; 23 | 24 | #[cfg(test)] 25 | extern crate macros; 26 | 27 | #[cfg(test)] 28 | #[macro_use] 29 | extern crate maplit; 30 | 31 | pub mod blockchain; 32 | pub mod bytes; 33 | pub mod hash; 34 | pub mod maybe; 35 | pub mod spec; 36 | pub mod state; 37 | pub mod test; 38 | pub mod transaction; 39 | pub mod trie; 40 | pub mod uint; 41 | pub mod vm; 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 ethereum_types::Address; 20 | use ids::BlockId; 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ethcore/sync/src/res/private_spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PrivateTransactions", 3 | "engine": { 4 | "instantSeal": { 5 | "params": {} 6 | } 7 | }, 8 | "params": { 9 | "gasLimitBoundDivisor": "0x0400", 10 | "accountStartNonce": "0x0", 11 | "maximumExtraDataSize": "0x20", 12 | "minGasLimit": "0x1388", 13 | "networkID" : "0x11" 14 | }, 15 | "genesis": { 16 | "seal": { 17 | "generic": "0x0" 18 | }, 19 | "difficulty": "0x20000", 20 | "author": "0x0000000000000000000000000000000000000000", 21 | "timestamp": "0x00", 22 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 23 | "extraData": "0x", 24 | "gasLimit": "0x989680" 25 | }, 26 | "accounts": { 27 | "0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, 28 | "0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, 29 | "0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, 30 | "0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ethcore/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::Relaxed) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /util/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = "../ethash", optional = true } 12 | fetch = { path = "../util/fetch", optional = true } 13 | hyper = { version = "0.12", optional = true } 14 | url = { version = "2", optional = true } 15 | 16 | # Miner 17 | ansi_term = "0.10" 18 | common-types = { path = "../ethcore/types" } 19 | error-chain = "0.12" 20 | ethabi = "6.0" 21 | ethabi-derive = "6.0" 22 | ethabi-contract = "6.0" 23 | ethcore-call-contract = { path = "../ethcore/call-contract" } 24 | ethereum-types = "0.4" 25 | futures = "0.1" 26 | heapsize = "0.4" 27 | keccak-hash = "0.1" 28 | linked-hash-map = "0.5" 29 | log = "0.4" 30 | parity-runtime = { path = "../util/runtime" } 31 | parking_lot = "0.7" 32 | price-info = { path = "./price-info", optional = true } 33 | rlp = { version = "0.3.0", features = ["ethereum"] } 34 | trace-time = "0.1" 35 | transaction-pool = "2.0.1" 36 | 37 | [dev-dependencies] 38 | env_logger = "0.5" 39 | ethkey = { path = "../accounts/ethkey" } 40 | rustc-hex = "1.0" 41 | 42 | [features] 43 | work-notify = ["ethash", "fetch", "hyper", "url"] 44 | -------------------------------------------------------------------------------- /accounts/ethkey/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: rust 3 | branches: 4 | only: 5 | - master 6 | matrix: 7 | fast_finish: false 8 | include: 9 | - rust: stable 10 | - rust: beta 11 | - rust: nightly 12 | after_success: | 13 | [ $TRAVIS_BRANCH = master ] && 14 | [ $TRAVIS_PULL_REQUEST = false ] && 15 | [ $TRAVIS_RUST_VERSION = stable ] && 16 | cargo doc --no-deps --verbose && 17 | echo '' > target/doc/index.html && 18 | pip install --user ghp-import && 19 | /home/travis/.local/bin/ghp-import -n target/doc && 20 | git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages 21 | env: 22 | global: 23 | - secure: LBkFAH5fAhzHRP7kYQZnOCavOuPS2vEDv49KGfTsY/7MmW0De4c0sz0a3/0IdFqqIMLYLV2uMO86S0p6FBaq6/GIdobLsGZZ3cFReYFI+vb8sylYF/+D/aQ/UOjpEOD8HP6G3YmV5buSyL8uiPlmYbqwBAe4z6ELEbh/16gRuIqQLYQtpYPxMCD3tZzSux81b45K2khETZ7E+ap3LUG3rFTXxjEgx9leIZlVY+Qk4U5D9gFnJnjmxDPyIqzn2dORnw5jcpp3eSUEvSvSgjz4TAVg7Gw789jDl2dyr26U1wp1E5bB9AqZVYOb4l8vcQ6QiHrCvu7Wgl32O6XYkwMjDaDUB68bm5MTsUrwDWgKGx4xeurIBil5doHFlCGZ98RrzPxdgoCd6hCI459dA8jEwdXAfOkZ80RycZlryHCwn68x3dlnJoqVyg8viYo6H6G0GdH/dIhuwbnLDdWZsODehN8eJEy9KKQ4tPp+PjBcgKm1Wz5MzKFSIwfFInic7hjTVXGozHSvgvXJE0BI2bPbjVNCdZa5kGAAUAhBNXyTn7PbC7hYbmwAalzaOIjoYcdQLmUEz2J2gSOK8xW2gMU0Z2I+IylA0oh8xB/r2Q5sqLHT3LPLdzoETsyzaQjWFcFdXdsbbcG59DnFC9s2Jq7KqeODp6EJG4cw0ofKpBuDRes= 24 | -------------------------------------------------------------------------------- /accounts/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 transaction; 25 | 26 | pub use self::{ 27 | block::BlockView, body::BodyView, header::HeaderView, transaction::TransactionView, 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 | -------------------------------------------------------------------------------- /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/ethereum/tests/VMTests/vmArithmeticTest 6 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmBitwiseLogicOperation 7 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmBlockInfoTest 8 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmEnvironmentalInfo 9 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmIOandFlowOperations 10 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmLogTest 11 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmPerformance 12 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmPushDupSwapTest 13 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmRandomTest 14 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmSha3Test 15 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmSystemOperations 16 | ./target/release/openethereum-evm stats-jsontests-vm ./ethcore/res/ethereum/tests/VMTests/vmTests 17 | -------------------------------------------------------------------------------- /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 | mod best_block; 22 | mod block_info; 23 | mod blockchain; 24 | mod cache; 25 | mod config; 26 | mod import_route; 27 | mod update; 28 | 29 | pub mod generator; 30 | 31 | pub use self::{ 32 | blockchain::{BlockChain, BlockChainDB, BlockChainDBHandler, BlockProvider}, 33 | cache::CacheSize, 34 | config::Config, 35 | import_route::ImportRoute, 36 | update::ExtrasInsert, 37 | }; 38 | pub use common_types::tree_route::TreeRoute; 39 | pub use ethcore_db::keys::{BlockDetails, BlockNumberKey, BlockReceipts, TransactionAddress}; 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ethcore/res/ethereum/runner/full.json: -------------------------------------------------------------------------------- 1 | { 2 | "chain": [ 3 | { 4 | "path": "res/ethereum/tests/BlockchainTests", 5 | "skip" : [] 6 | }, 7 | { 8 | "path": "res/ethereum/tests/LegacyTests/Constantinople/BlockchainTests", 9 | "skip" : [] 10 | } 11 | ], 12 | "state": [ 13 | { 14 | "path": "res/ethereum/tests/GeneralStateTests", 15 | "skip" : [] 16 | 17 | }, 18 | { 19 | "path": "res/ethereum/tests//LegacyTests/Constantinople/GeneralStateTests", 20 | "skip" : [] 21 | 22 | } 23 | ], 24 | "difficulty": [ 25 | { 26 | "path": [ 27 | "res/ethereum/tests/BasicTests/difficulty.json", 28 | "res/ethereum/tests/BasicTests/difficultyMainNetwork.json" 29 | ], 30 | "chainspec": "Foundation" 31 | } 32 | ], 33 | "executive": [ 34 | { 35 | "path": "res/ethereum/tests/VMTests" 36 | } 37 | ], 38 | "transaction": [ 39 | { 40 | "path": "res/ethereum/tests/TransactionTests" 41 | } 42 | ], 43 | "trie": [ 44 | { 45 | "path": [ 46 | "res/ethereum/tests/TrieTests/trietest.json", 47 | "res/ethereum/tests/TrieTests/trieanyorder.json" 48 | ], 49 | "triespec": "Generic" 50 | }, 51 | { 52 | "path": [ 53 | "res/ethereum/tests/TrieTests/hex_encoded_securetrie_test.json", 54 | "res/ethereum/tests/TrieTests/trietest_secureTrie.json", 55 | "res/ethereum/tests/TrieTests/trieanyorder_secureTrie.json" 56 | ], 57 | "triespec": "Secure" 58 | } 59 | ] 60 | } -------------------------------------------------------------------------------- /util/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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)] 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 | -------------------------------------------------------------------------------- /json/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /secret-store/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Parity Ethereum (EthCore) Secret Store" 3 | name = "ethcore-secretstore" 4 | version = "1.0.0" 5 | license = "GPL-3.0" 6 | authors = ["Parity Technologies "] 7 | 8 | [dependencies] 9 | byteorder = "1.0" 10 | common-types = { path = "../ethcore/types" } 11 | ethabi = "6.0" 12 | ethabi-contract = "6.0" 13 | ethabi-derive = "6.0" 14 | ethcore = { path = "../ethcore" } 15 | ethcore-accounts = { path = "../accounts", optional = true} 16 | ethcore-call-contract = { path = "../ethcore/call-contract" } 17 | ethcore-sync = { path = "../ethcore/sync" } 18 | ethereum-types = "0.4" 19 | ethkey = { path = "../accounts/ethkey" } 20 | futures = "0.1" 21 | hyper = { version = "0.12", default-features = false } 22 | keccak-hash = "0.1" 23 | kvdb = "0.1" 24 | lazy_static = "1.0" 25 | log = "0.4" 26 | parity-bytes = "0.1" 27 | parity-crypto = "0.3" 28 | parity-runtime = { path = "../util/runtime" } 29 | parking_lot = "0.7" 30 | rustc-hex = "1.0" 31 | serde = "1.0" 32 | serde_derive = "1.0" 33 | serde_json = "1.0" 34 | tiny-keccak = "1.4" 35 | tokio = "0.1.22" 36 | tokio-io = "0.1" 37 | tokio-service = "0.1" 38 | url = "2" 39 | percent-encoding = "2" 40 | jsonrpc-server-utils = "15.0.0" 41 | 42 | [dev-dependencies] 43 | env_logger = "0.5" 44 | ethcore = { path = "../ethcore", features = ["test-helpers"] } 45 | tempdir = "0.3" 46 | kvdb-rocksdb = "0.1.3" 47 | 48 | [features] 49 | accounts = ["ethcore-accounts"] 50 | -------------------------------------------------------------------------------- /secret-store/src/helpers.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 ethcore::client::{BlockChainClient, BlockId, Client}; 18 | use ethereum_types::H256; 19 | 20 | // TODO: Instead of a constant, make this based on consensus finality. 21 | /// Number of confirmations required before request can be processed. 22 | pub const REQUEST_CONFIRMATIONS_REQUIRED: u64 = 3; 23 | 24 | /// Get hash of the last block with at least n confirmations. 25 | pub fn get_confirmed_block_hash(client: &Client, confirmations: u64) -> Option { 26 | client 27 | .block_number(BlockId::Latest) 28 | .map(|b| b.saturating_sub(confirmations)) 29 | .and_then(|b| client.block_hash(BlockId::Number(b))) 30 | } 31 | -------------------------------------------------------------------------------- /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 | #[cfg(any(test, feature = "accounts"))] 33 | mod secretstore; 34 | mod signer; 35 | #[cfg(any(test, feature = "accounts"))] 36 | mod signing; 37 | #[cfg(any(test, feature = "accounts"))] 38 | mod signing_unsafe; 39 | mod traces; 40 | mod web3; 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | use json; 20 | 21 | impl Into for Address { 22 | fn into(self) -> json::H160 { 23 | let a: [u8; 20] = self.into(); 24 | From::from(a) 25 | } 26 | } 27 | 28 | impl From for Address { 29 | fn from(json: json::H160) -> Self { 30 | let a: [u8; 20] = json.into(); 31 | From::from(a) 32 | } 33 | } 34 | 35 | impl<'a> From<&'a json::H160> for Address { 36 | fn from(json: &'a json::H160) -> Self { 37 | let mut a = [0u8; 20]; 38 | a.copy_from_slice(json); 39 | From::from(a) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /parity/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 | -------------------------------------------------------------------------------- /ethcore/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ethcore/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 | -------------------------------------------------------------------------------- /json/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 serde_json::{self, Error}; 20 | use std::{collections::BTreeMap, io::Read}; 21 | use vm::Vm; 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 | -------------------------------------------------------------------------------- /parity/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 | 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /json/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 serde_json::{self, Error}; 20 | use std::{collections::BTreeMap, io::Read}; 21 | use trie::Trie; 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 | -------------------------------------------------------------------------------- /.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-16.04 16 | - macos-latest 17 | - windows2019 # custom runner 18 | toolchain: 19 | - stable 20 | runs-on: ${{ matrix.platform }} 21 | steps: 22 | - name: Checkout sources 23 | uses: actions/checkout@main 24 | with: 25 | submodules: true 26 | - name: Install toolchain 27 | uses: actions-rs/toolchain@v1 28 | with: 29 | toolchain: ${{ matrix.toolchain }} 30 | profile: minimal 31 | override: true 32 | - name: Build tests 33 | uses: actions-rs/cargo@v1 34 | with: 35 | command: test 36 | args: --locked --all --release --features "json-tests" --verbose --no-run 37 | - name: Run tests for ${{ matrix.platform }} 38 | if: matrix.platform != 'windows2019' 39 | uses: actions-rs/cargo@v1 40 | with: 41 | command: test 42 | args: --locked --all --release --features "json-tests" --verbose 43 | -------------------------------------------------------------------------------- /json/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 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /json/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 serde_json::{self, Error}; 20 | use std::{collections::BTreeMap, io::Read}; 21 | use transaction::TransactionTest; 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 | -------------------------------------------------------------------------------- /secret-store/src/key_server_cluster/io/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 deadline; 18 | mod handshake; 19 | mod message; 20 | mod read_header; 21 | mod read_message; 22 | mod read_payload; 23 | mod shared_tcp_stream; 24 | mod write_message; 25 | 26 | pub use self::{ 27 | deadline::{deadline, Deadline, DeadlineStatus}, 28 | handshake::{accept_handshake, handshake, Handshake, HandshakeResult}, 29 | message::{ 30 | deserialize_message, encrypt_message, fix_shared_key, serialize_message, MessageHeader, 31 | SerializedMessage, 32 | }, 33 | read_header::{read_header, ReadHeader}, 34 | read_message::{read_encrypted_message, read_message, ReadMessage}, 35 | read_payload::{read_encrypted_payload, read_payload, ReadPayload}, 36 | shared_tcp_stream::SharedTcpStream, 37 | write_message::{write_encrypted_message, write_message, WriteMessage}, 38 | }; 39 | -------------------------------------------------------------------------------- /ethcore/types/src/transaction/transaction_id.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-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 Id. 18 | 19 | use serde_repr::*; 20 | use std::convert::TryFrom; 21 | 22 | #[derive(Serialize_repr, Eq, Hash, Deserialize_repr, Debug, Clone, PartialEq)] 23 | #[repr(u8)] 24 | pub enum TypedTxId { 25 | AccessList = 0x01, 26 | Legacy = 0x80, // With 0x80 we are sure that all other types will not overlap 27 | } 28 | 29 | impl Default for TypedTxId { 30 | fn default() -> TypedTxId { 31 | TypedTxId::Legacy 32 | } 33 | } 34 | 35 | impl TryFrom for TypedTxId { 36 | type Error = (); 37 | 38 | fn try_from(v: u8) -> Result { 39 | match v { 40 | x if x == TypedTxId::AccessList as u8 => Ok(TypedTxId::AccessList), 41 | x if (x & 0x80) != 0x00 => Ok(TypedTxId::Legacy), 42 | _ => Err(()), 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 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 | -------------------------------------------------------------------------------- /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(123), "abc"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /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::{OsRng, Rng}; 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::new().unwrap(); 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::new().unwrap(); 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 mut rng = OsRng::new().expect("Not able to operate without random source."); 46 | rng.gen_ascii_chars().take(length).collect() 47 | } 48 | -------------------------------------------------------------------------------- /ethcore/res/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 | -------------------------------------------------------------------------------- /rpc/src/v1/traits/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 rpc interfaces. 18 | 19 | pub mod debug; 20 | pub mod eth; 21 | pub mod eth_pubsub; 22 | pub mod eth_signing; 23 | pub mod net; 24 | pub mod parity; 25 | pub mod parity_accounts; 26 | pub mod parity_set; 27 | pub mod parity_signing; 28 | pub mod personal; 29 | pub mod pubsub; 30 | pub mod secretstore; 31 | pub mod signer; 32 | pub mod traces; 33 | pub mod web3; 34 | 35 | pub use self::{ 36 | debug::Debug, 37 | eth::{Eth, EthFilter}, 38 | eth_pubsub::EthPubSub, 39 | eth_signing::EthSigning, 40 | net::Net, 41 | parity::Parity, 42 | parity_accounts::{ParityAccounts, ParityAccountsInfo}, 43 | parity_set::{ParitySet, ParitySetAccounts}, 44 | parity_signing::ParitySigning, 45 | personal::Personal, 46 | pubsub::PubSub, 47 | secretstore::SecretStore, 48 | signer::Signer, 49 | traces::Traces, 50 | web3::Web3, 51 | }; 52 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /accounts/ethkey/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 super::{Generator, KeyPair, SECP256K1}; 18 | use rand::os::OsRng; 19 | 20 | /// Randomly generates new keypair, instantiating the RNG each time. 21 | pub struct Random; 22 | 23 | impl Generator for Random { 24 | type Error = ::std::io::Error; 25 | 26 | fn generate(&mut self) -> Result { 27 | let mut rng = OsRng::new()?; 28 | match rng.generate() { 29 | Ok(pair) => Ok(pair), 30 | Err(void) => match void {}, // LLVM unreachable 31 | } 32 | } 33 | } 34 | 35 | impl Generator for OsRng { 36 | type Error = ::Void; 37 | 38 | fn generate(&mut self) -> Result { 39 | let (sec, publ) = SECP256K1 40 | .generate_keypair(self) 41 | .expect("context always created with full capabilities; qed"); 42 | 43 | Ok(KeyPair::from_keypair(sec, publ)) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /scripts/prometheus/config/grafana/provisioning/datasources/prometheus.yaml: -------------------------------------------------------------------------------- 1 | # config file version 2 | apiVersion: 1 3 | 4 | # list of datasources that should be deleted from the database 5 | deleteDatasources: 6 | - name: Prometheus 7 | orgId: 1 8 | 9 | # list of datasources to insert/update depending 10 | # whats available in the database 11 | datasources: 12 | # name of the datasource. Required 13 | - name: Prometheus 14 | # datasource type. Required 15 | type: prometheus 16 | # access mode. direct or proxy. Required 17 | access: proxy 18 | # org id. will default to orgId 1 if not specified 19 | orgId: 1 20 | # url 21 | url: http://prometheus:9090 22 | # database password, if used 23 | password: 24 | # database user, if used 25 | user: 26 | # database name, if used 27 | database: 28 | # enable/disable basic auth 29 | basicAuth: false 30 | # basic auth username, if used 31 | basicAuthUser: 32 | # basic auth password, if used 33 | basicAuthPassword: 34 | # enable/disable with credentials headers 35 | withCredentials: 36 | # mark as default datasource. Max one per org 37 | isDefault: true 38 | # fields that will be converted to json and stored in json_data 39 | jsonData: 40 | graphiteVersion: "1.1" 41 | tlsAuth: false 42 | tlsAuthWithCACert: false 43 | # json object of data that will be encrypted. 44 | secureJsonData: 45 | tlsCACert: "..." 46 | tlsClientCert: "..." 47 | tlsClientKey: "..." 48 | version: 1 49 | # allow users to edit datasources from the UI. 50 | editable: true 51 | --------------------------------------------------------------------------------