diff --git a/.all-contributorsrc b/.all-contributorsrc index c7ab131dc..e7703f19a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { "projectName": "cita", - "projectOwner": "cryptape", + "projectOwner": "citahub", "repoType": "github", "repoHost": "https://github.com", "files": [ diff --git a/.circleci/config.yml b/.circleci/config.yml index 434ae46b0..88be604ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,9 +107,8 @@ alias: - &job-default docker: - - image: cita/cita-build:ubuntu-18.04-20190515 + - image: cita/cita-build:ubuntu-18.04-20191128 working_directory: ~/cita-build - resource_class: xlarge - &job-unit-test <<: *job-default @@ -508,3 +507,4 @@ workflows: # - "Crosschain Test" # - "Test Snapshot Taking And Restoring" # - "JSON-RPC Mock Test in Charge Mode" + diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 661b61a7c..ae75a026f 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -57,7 +57,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at . All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/.gitmodules b/.gitmodules index 6b3480962..7a521afc6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,28 +1,28 @@ [submodule "cita-forever"] path = cita-forever - url = https://github.com/cryptape/cita-forever.git + url = https://github.com/citahub/cita-forever.git branch = develop [submodule "cita-bft"] path = cita-bft - url = https://github.com/cryptape/cita-bft.git + url = https://github.com/citahub/cita-bft.git branch = develop [submodule "scripts/txtool/txtool/proto"] path = scripts/txtool/txtool/proto - url = https://github.com/cryptape/cita-proto.git + url = https://github.com/citahub/cita-proto.git branch = master [submodule "tests/contracts"] path = tests/contracts - url = https://github.com/cryptape/test-contracts.git + url = https://github.com/citahub/test-contracts.git branch = master [submodule "scripts/contracts/interaction"] path = scripts/contracts/interaction - url = https://github.com/cryptape/cita-sys-interaction.git + url = https://github.com/citahub/cita-sys-interaction.git branch = master [submodule "scripts/config_tool/genesis"] path = scripts/config_tool/genesis - url = https://github.com/cryptape/genesis.git + url = https://github.com/citahub/genesis.git branch = master [submodule "tests/jsondata"] path = tests/jsondata - url = https://github.com/cryptape/cita-testdata.git + url = https://github.com/citahub/cita-testdata.git branch = master diff --git a/.travis.yml b/.travis.yml index 9bf9c0405..0609162fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ stages: - Release - IntegrateTest before_install: - - docker pull cita/cita-build:ubuntu-18.04-20190515 + - docker pull cita/cita-build:ubuntu-18.04-20191128 jobs: include: @@ -28,7 +28,8 @@ jobs: name: Release for Integrate Test language: node_js node_js: - - lts/* + # - lts/* + - 8.10.0 cache: directories: - $TRAVIS_BUILD_DIR/target/release-cache @@ -48,7 +49,8 @@ jobs: name: Unit Group language: node_js node_js: - - lts/* + # - lts/* + - 8.10.0 cache: directories: - $TRAVIS_BUILD_DIR/target/release-cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 69233f20c..58e4e3aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -841,13 +841,13 @@ Fixed a bug that Network could not process domain names. Release the first version of CITA. -[#201]: https://github.com/cryptape/cita/issues/201 -[#206]: https://github.com/cryptape/cita/issues/206 -[#588]: https://github.com/cryptape/cita/issues/588 -[Account model based zero-knowledge proof transaction.]: https://github.com/cryptape/cita/blob/develop/cita-executor/core/src/native/zk_privacy.md +[#201]: https://github.com/citahub/cita/issues/201 +[#206]: https://github.com/citahub/cita/issues/206 +[#588]: https://github.com/citahub/cita/issues/588 +[Account model based zero-knowledge proof transaction.]: https://github.com/citahub/cita/blob/develop/cita-executor/core/src/native/zk_privacy.md [CITA docker images]: https://hub.docker.com/r/cita/ [Emergency braking system contract]: https://docs.citahub.com/zh-CN/cita/system/emergency-brake -[Executor service]: https://github.com/cryptape/cita/tree/develop/cita-executor +[Executor service]: https://github.com/citahub/cita/tree/develop/cita-executor [Get peer information]: https://docs.citahub.com/zh-CN/next/cita/rpc-guide/rpc#peersinfo [Get software version]: https://docs.citahub.com/zh-CN/next/cita/rpc-guide/rpc#getversion [GetMetaData]: https://docs.citahub.com/zh-CN/cita/rpc-guide/rpc#getmetadata @@ -858,36 +858,36 @@ Release the first version of CITA. [`BlockTag`]: https://docs.citahub.com/zh-CN/cita/rpc-guide/rpc-types#tag [`getMetaData`]: https://docs.nervos.org/cita/#/rpc_guide/rpc?id=getmetadata&version=v0.20 [`sendRawTransaction`]: https://docs.citahub.com/zh-CN/cita/rpc-guide/rpc#sendrawtransaction -[cita-cli]: https://github.com/cryptape/cita-cli +[cita-cli]: https://github.com/citahub/cita-cli [documentation website]: https://docs.citahub.com/en-US/cita/cita-intro [quota price manager system contract]: https://docs.citahub.com/zh-CN/cita/system/price [return to the certain address]: https://docs.citahub.com/zh-CN/cita/system/fee-back [set quota price]: https://docs.citahub.com/zh-CN/cita/system/price [sidechain exit mechanism]: https://docs.nervos.org/cita/#/crosschain/crosschain_contract_example -[Unreleased]: https://github.com/cryptape/cita/compare/v0.25.1...HEAD -[v0.25.1]: https://github.com/cryptape/cita/compare/v0.25.0...v0.25.1 -[v0.25.0]: https://github.com/cryptape/cita/compare/v0.24.1...v0.25.0 -[v0.24.1]: https://github.com/cryptape/cita/compare/v0.24.0...v0.24.1 -[v0.24.0]: https://github.com/cryptape/cita/compare/v0.23.0...v0.24.0 -[v0.23.1]: https://github.com/cryptape/cita/compare/v0.23.0...v0.23.1 -[v0.23.0]: https://github.com/cryptape/cita/compare/v0.22.0...v0.23.0 -[v0.22.0]: https://github.com/cryptape/cita/compare/v0.21...v0.22.0 -[v0.21.1]: https://github.com/cryptape/cita/compare/v0.21...v0.21.1 -[v0.21.0]: https://github.com/cryptape/cita/compare/v0.20...v0.21 -[v0.20.3]: https://github.com/cryptape/cita/compare/v0.20.2...v0.20.3 -[v0.20.2]: https://github.com/cryptape/cita/compare/v0.20.1...v0.20.2 -[v0.20.1]: https://github.com/cryptape/cita/compare/v0.20...v0.20.1 -[v0.20.0]: https://github.com/cryptape/cita/compare/v0.19...v0.20 -[v0.19.1]: https://github.com/cryptape/cita/compare/v0.19...v0.19.1 -[v0.19.0]: https://github.com/cryptape/cita/compare/v0.18...v0.19 -[v0.18.0]: https://github.com/cryptape/cita/compare/v0.17...v0.18 -[v0.17.0]: https://github.com/cryptape/cita/compare/v0.16...v0.17 -[v0.16.0]: https://github.com/cryptape/cita/compare/v0.15...v0.16 -[v0.15.0]: https://github.com/cryptape/cita/compare/v0.13...v0.15 -[v0.13.0]: https://github.com/cryptape/cita/compare/v0.12...v0.13 -[v0.12.0]: https://github.com/cryptape/cita/compare/v0.10...v0.12 -[v0.10.0]: https://github.com/cryptape/cita/releases/tag/v0.10 +[Unreleased]: https://github.com/citahub/cita/compare/v0.25.1...HEAD +[v0.25.1]: https://github.com/citahub/cita/compare/v0.25.0...v0.25.1 +[v0.25.0]: https://github.com/citahub/cita/compare/v0.24.1...v0.25.0 +[v0.24.1]: https://github.com/citahub/cita/compare/v0.24.0...v0.24.1 +[v0.24.0]: https://github.com/citahub/cita/compare/v0.23.0...v0.24.0 +[v0.23.1]: https://github.com/citahub/cita/compare/v0.23.0...v0.23.1 +[v0.23.0]: https://github.com/citahub/cita/compare/v0.22.0...v0.23.0 +[v0.22.0]: https://github.com/citahub/cita/compare/v0.21...v0.22.0 +[v0.21.1]: https://github.com/citahub/cita/compare/v0.21...v0.21.1 +[v0.21.0]: https://github.com/citahub/cita/compare/v0.20...v0.21 +[v0.20.3]: https://github.com/citahub/cita/compare/v0.20.2...v0.20.3 +[v0.20.2]: https://github.com/citahub/cita/compare/v0.20.1...v0.20.2 +[v0.20.1]: https://github.com/citahub/cita/compare/v0.20...v0.20.1 +[v0.20.0]: https://github.com/citahub/cita/compare/v0.19...v0.20 +[v0.19.1]: https://github.com/citahub/cita/compare/v0.19...v0.19.1 +[v0.19.0]: https://github.com/citahub/cita/compare/v0.18...v0.19 +[v0.18.0]: https://github.com/citahub/cita/compare/v0.17...v0.18 +[v0.17.0]: https://github.com/citahub/cita/compare/v0.16...v0.17 +[v0.16.0]: https://github.com/citahub/cita/compare/v0.15...v0.16 +[v0.15.0]: https://github.com/citahub/cita/compare/v0.13...v0.15 +[v0.13.0]: https://github.com/citahub/cita/compare/v0.12...v0.13 +[v0.12.0]: https://github.com/citahub/cita/compare/v0.10...v0.12 +[v0.10.0]: https://github.com/citahub/cita/releases/tag/v0.10 [@77liyan]: https://github.com/77liyan [@EighteenZi]: https://github.com/EighteenZi diff --git a/Cargo.lock b/Cargo.lock index 1535cc2c0..4cfc60a5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,10 +135,10 @@ dependencies = [ [[package]] name = "authority_manage" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -181,15 +181,6 @@ dependencies = [ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "base64" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bellman" version = "0.0.4" @@ -226,7 +217,7 @@ dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -261,7 +252,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "blake2" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -273,7 +264,7 @@ dependencies = [ [[package]] name = "blake2b" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -322,27 +313,6 @@ dependencies = [ "ethbloom 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "box-executor" -version = "0.1.0" -dependencies = [ - "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_yaml 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bs58" version = "0.2.2" @@ -408,43 +378,22 @@ name = "chain-executor-mock" version = "0.1.0" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "chain-performance-by-mq" -version = "0.1.0" -dependencies = [ - "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "common-types 0.1.0", - "cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "chrono" version = "0.4.6" @@ -457,22 +406,22 @@ dependencies = [ [[package]] name = "cita-auth" -version = "0.1.0" +version = "20.2.0" dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)", - "cita-directories 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-directories 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "error 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "lru 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "quickcheck 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -480,82 +429,82 @@ dependencies = [ "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tx_pool 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "tx_pool 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cita-bft" -version = "0.1.0" +version = "20.2.0" dependencies = [ - "authority_manage 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "authority_manage 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-directories 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-directories 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "engine 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "engine 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "min-max-heap 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-chain" -version = "0.6.0" +version = "20.2.0" dependencies = [ - "cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)", - "cita-directories 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-directories 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "core 0.1.0", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "error 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-crypto" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-crypto-trait 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-ed25519 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-secp256k1 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-sm2 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto-trait 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-ed25519 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-secp256k1 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-sm2 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-crypto-trait" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-database" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-database.git?branch=develop#87b515b813ad484bf98e3ae82f4f2177844011e0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rocksdb 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -564,7 +513,7 @@ dependencies = [ [[package]] name = "cita-directories" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -572,13 +521,12 @@ dependencies = [ [[package]] name = "cita-ed25519" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto-trait 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto-trait 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "sodiumoxide 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -586,68 +534,68 @@ dependencies = [ [[package]] name = "cita-executor" -version = "0.1.0" +version = "20.2.0" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)", - "cita-directories 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-ed25519 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-directories 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-ed25519 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-vm 0.2.1 (git+https://github.com/cryptape/cita-vm.git?branch=cita)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-vm 0.2.1 (git+https://github.com/citahub/cita-vm.git?branch=cita)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "core-executor 0.1.0", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "error 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-forever" -version = "0.1.0" +version = "1.0.0" dependencies = [ "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-jsonrpc" -version = "0.1.0" +version = "20.2.0" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "error 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.16 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-proto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "jsonrpc-proto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -659,7 +607,7 @@ dependencies = [ "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -680,30 +628,30 @@ dependencies = [ [[package]] name = "cita-merklehash" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "static_merkle_tree 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cita-network" -version = "0.6.0" +version = "20.2.0" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "notify 4.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -712,42 +660,20 @@ dependencies = [ "tentacle 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "tentacle-discovery 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", -] - -[[package]] -name = "cita-relayer-parser" -version = "0.1.0" -dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core 0.1.0", - "ethabi 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.22 (git+https://github.com/cryptape/hyper.git?branch=reuse_port)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] name = "cita-secp256k1" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto-trait 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-crypto-trait 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -756,13 +682,13 @@ dependencies = [ [[package]] name = "cita-sm2" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-crypto-trait 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libsm 0.3.0 (git+https://github.com/cryptape/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto-trait 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libsm 0.3.0 (git+https://github.com/citahub/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -770,7 +696,7 @@ dependencies = [ [[package]] name = "cita-types" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -779,7 +705,7 @@ dependencies = [ [[package]] name = "cita-vm" version = "0.2.1" -source = "git+https://github.com/cryptape/cita-vm.git?branch=cita#535c36d3a945236982e12b0add124d4cd078c4a2" +source = "git+https://github.com/citahub/cita-vm.git?branch=cita#84860e89903e6768102f48921b452daf75f4ab47" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cita_trie 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -848,43 +774,25 @@ name = "common-types" version = "0.1.0" dependencies = [ "bloomchain 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)", - "cita-ed25519 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-ed25519 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-vm 0.2.1 (git+https://github.com/cryptape/cita-vm.git?branch=cita)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-vm 0.2.1 (git+https://github.com/citahub/cita-vm.git?branch=cita)", "cita_trie 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "snappy 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "snappy 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", -] - -[[package]] -name = "consensus-mock" -version = "0.1.0" -dependencies = [ - "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -897,30 +805,30 @@ name = "core" version = "0.1.0" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)", - "cita-ed25519 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-ed25519 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-merklehash 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-secp256k1 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-merklehash 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-secp256k1 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "common-types 0.1.0", "cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -930,15 +838,15 @@ dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-crypto-trait 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)", - "cita-ed25519 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-crypto-trait 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-ed25519 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-merklehash 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-secp256k1 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-vm 0.2.1 (git+https://github.com/cryptape/cita-vm.git?branch=cita)", + "cita-merklehash 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-secp256k1 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-vm 0.2.1 (git+https://github.com/citahub/cita-vm.git?branch=cita)", "cita_trie 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "common-types 0.1.0", "core 0.1.0", @@ -947,18 +855,20 @@ dependencies = [ "enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethbloom 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashbrown 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "largest-remainder-method 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -966,13 +876,13 @@ dependencies = [ "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "snappy 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "snappy 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "zktx 0.0.1 (git+https://github.com/cryptape/zktx.git)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "zktx 0.0.1 (git+https://github.com/citahub/zktx.git)", ] [[package]] @@ -1004,15 +914,15 @@ dependencies = [ name = "create-genesis" version = "0.1.0" dependencies = [ - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-vm 0.2.1 (git+https://github.com/cryptape/cita-vm.git?branch=cita)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-vm 0.2.1 (git+https://github.com/citahub/cita-vm.git?branch=cita)", "cita_trie 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "json 0.11.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1024,8 +934,8 @@ dependencies = [ name = "create-key-addr" version = "0.1.0" dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -1063,7 +973,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1087,7 +997,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1177,7 +1087,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1202,13 +1112,11 @@ dependencies = [ [[package]] name = "engine" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -1252,20 +1160,10 @@ dependencies = [ "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "errno" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "error" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" [[package]] name = "error-chain" @@ -1468,15 +1366,6 @@ name = "fnv" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fsevent" version = "0.2.17" @@ -1602,11 +1491,11 @@ dependencies = [ [[package]] name = "hashable" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "blake2b 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libsm 0.3.0 (git+https://github.com/cryptape/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1)", + "blake2b 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libsm 0.3.0 (git+https://github.com/citahub/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1691,30 +1580,6 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hyper" -version = "0.11.22" -source = "git+https://github.com/cryptape/hyper.git?branch=reuse_port#6c3eb6679ad9d3ddeca5702df371ccd9e9535f5d" -dependencies = [ - "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (git+https://github.com/cryptape/tokio-proto.git?rev=7419e3aaca5d89a497acaf379471d53671a94159)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hyper" version = "0.12.16" @@ -1834,14 +1699,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-proto" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1851,11 +1716,10 @@ dependencies = [ [[package]] name = "jsonrpc-types" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "jsonrpc-types-internals 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "jsonrpc-types-internals 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1865,7 +1729,7 @@ dependencies = [ [[package]] name = "jsonrpc-types-internals" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1896,11 +1760,6 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "largest-remainder-method" version = "0.1.0" @@ -1913,7 +1772,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1963,20 +1822,19 @@ dependencies = [ [[package]] name = "libproto" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-merklehash 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "protobuf 2.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-merklehash 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "snappy 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "tls-api 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "snappy 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -2006,10 +1864,10 @@ dependencies = [ [[package]] name = "libsm" version = "0.3.0" -source = "git+https://github.com/cryptape/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1#4d0e6199fca0934c58131de1d0036e9aa4da26c1" +source = "git+https://github.com/citahub/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1#4d0e6199fca0934c58131de1d0036e9aa4da26c1" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2140,15 +1998,6 @@ dependencies = [ "linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "lz4-sys" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "matches" version = "0.1.8" @@ -2180,24 +2029,6 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "metadeps" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "mime" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "min-max-heap" version = "1.2.2" @@ -2343,7 +2174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2397,14 +2228,6 @@ name = "num-traits" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "num_cpus" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "num_cpus" version = "1.8.0" @@ -2460,15 +2283,6 @@ dependencies = [ "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "panic_hook" -version = "0.0.1" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" -dependencies = [ - "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parity-multiaddr" version = "0.4.0" @@ -2489,7 +2303,7 @@ name = "parity-multihash" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2577,21 +2391,21 @@ dependencies = [ [[package]] name = "proof" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-directories 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-directories 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "protobuf" -version = "2.6.2" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2600,43 +2414,11 @@ dependencies = [ [[package]] name = "pubsub" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" -dependencies = [ - "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pubsub_kafka 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub_rabbitmq 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub_zeromq 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", -] - -[[package]] -name = "pubsub_kafka" -version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" -dependencies = [ - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rdkafka 0.12.0 (git+https://github.com/fede1024/rust-rdkafka.git?rev=84d4062)", -] - -[[package]] -name = "pubsub_rabbitmq" -version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "amqp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pubsub_zeromq" -version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" -dependencies = [ - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "zmq 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2721,7 +2503,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2750,7 +2532,7 @@ name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2798,7 +2580,7 @@ name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2819,36 +2601,10 @@ dependencies = [ "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rdkafka" -version = "0.12.0" -source = "git+https://github.com/fede1024/rust-rdkafka.git?rev=84d4062#84d40623f38455dc7c3aa09539319a4d81bc57ab" -dependencies = [ - "errno 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rdkafka-sys 0.11.0-1 (git+https://github.com/fede1024/rust-rdkafka.git?rev=84d4062)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rdkafka-sys" -version = "0.11.0-1" -source = "git+https://github.com/fede1024/rust-rdkafka.git?rev=84d4062#84d40623f38455dc7c3aa09539319a4d81bc57ab" -dependencies = [ - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "lz4-sys 1.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rdrand" version = "0.4.0" @@ -2907,14 +2663,6 @@ dependencies = [ "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "relay" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "remove_dir_all" version = "0.5.1" @@ -2929,7 +2677,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2953,12 +2701,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rlp" version = "0.2.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3035,11 +2783,6 @@ name = "ryu" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "safemem" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "same-file" version = "1.0.4" @@ -3200,25 +2943,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "snappy" version = "0.1.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "snapshot-tool" -version = "0.2.0" -dependencies = [ - "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", -] - [[package]] name = "sodiumoxide" version = "0.2.2" @@ -3239,27 +2968,6 @@ name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "state-test" -version = "0.1.0" -dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-vm 0.2.1 (git+https://github.com/cryptape/cita-vm.git?branch=cita)", - "cita_trie 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-executor 0.1.0", - "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "static_assertions" version = "0.2.5" @@ -3493,7 +3201,7 @@ name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3522,14 +3230,6 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tls-api" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio" version = "0.1.16" @@ -3618,20 +3318,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-proto" -version = "0.1.1" -source = "git+https://github.com/cryptape/tokio-proto.git?rev=7419e3aaca5d89a497acaf379471d53671a94159#7419e3aaca5d89a497acaf379471d53671a94159" -dependencies = [ - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-reactor" version = "0.1.6" @@ -3639,7 +3325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3649,14 +3335,6 @@ dependencies = [ "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-service" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-sync" version = "0.1.3" @@ -3750,11 +3428,6 @@ dependencies = [ "tokio 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "toml" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "toml" version = "0.4.8" @@ -3791,12 +3464,12 @@ dependencies = [ [[package]] name = "tx_pool" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ - "cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", + "cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", + "util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", ] [[package]] @@ -3908,21 +3581,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "util" version = "0.6.0" -source = "git+https://github.com/cryptape/cita-common.git?branch=develop#788444602d6181741281c06c2684d3d60374a350" +source = "git+https://github.com/citahub/cita-common.git?branch=develop#50b22af53068fee42015510273401bc94c6ae94b" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)", "git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "panic_hook 0.0.1 (git+https://github.com/cryptape/cita-common.git?branch=develop)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "snappy 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4099,35 +3767,16 @@ dependencies = [ [[package]] name = "zktx" version = "0.0.1" -source = "git+https://github.com/cryptape/zktx.git#03fcc4b02432f42e53563deccdaaa767fd7a0ad6" +source = "git+https://github.com/citahub/zktx.git#03fcc4b02432f42e53563deccdaaa767fd7a0ad6" dependencies = [ "bellman 0.0.4 (git+https://github.com/cryptape/bellman.git?branch=0.0.4_modified)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "jubjub 0.0.1 (git+https://github.com/cryptape/jubjub-prototype.git?branch=modified)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "pairing 0.11.0 (git+https://github.com/cryptape/pairing.git?branch=0.11-release)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "zmq" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "zmq-sys 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "zmq-sys" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "metadeps 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [metadata] "checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" "checksum aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" @@ -4145,12 +3794,11 @@ dependencies = [ "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum attohttpc 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eaf0ec4b0e00f61ee75556ca027485b7b354f4a714d88cc03f4468abd9378c86" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" -"checksum authority_manage 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum authority_manage 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" "checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" -"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bellman 0.0.4 (git+https://github.com/cryptape/bellman.git?branch=0.0.4_modified)" = "" "checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" "checksum bindgen 0.49.2 (registry+https://github.com/rust-lang/crates.io-index)" = "846a1fba6535362a01487ef6b10f0275faa12e5c5d835c5c1c627aabc46ccbd6" @@ -4158,8 +3806,8 @@ dependencies = [ "checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" -"checksum blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91721a6330935673395a0607df4d49a9cb90ae12d259f1b3e0a3f6e1d486872e" -"checksum blake2b 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +"checksum blake2b 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum block-buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1339a1042f5d9f295737ad4d9a6ab6bf81c84a933dba110b9200cd6d1448b814" "checksum block-buffer 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49665c62e0e700857531fa5d3763e91b539ff1abeebd56808d378b495870d60d" "checksum block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" @@ -4176,17 +3824,17 @@ dependencies = [ "checksum cexpr 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7fa24eb00d5ffab90eaeaf1092ac85c04c64aaf358ea6f84505b8116d24c6af" "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" -"checksum cita-crypto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-crypto-trait 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-database 0.1.0 (git+https://github.com/cryptape/cita-database.git?branch=develop)" = "" -"checksum cita-directories 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-ed25519 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum cita-crypto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-crypto-trait 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-database 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4c3c40408c9123b12ebae63591d3f5d413215f7ba196c0712130be4f4c0e21a" +"checksum cita-directories 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-ed25519 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum cita-logger 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f28d41799c3ceeaa16c6aef432fbffb96722a270fe877696c09656cfead4e2b" -"checksum cita-merklehash 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-secp256k1 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-sm2 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum cita-vm 0.2.1 (git+https://github.com/cryptape/cita-vm.git?branch=cita)" = "" +"checksum cita-merklehash 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-secp256k1 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-sm2 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum cita-vm 0.2.1 (git+https://github.com/citahub/cita-vm.git?branch=cita)" = "" "checksum cita_trie 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b90456b297d4aa962afb8712ed5a581abdde0f7835653e5f2142c5ed06d1eeed" "checksum clang-sys 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4227269cec09f5f83ff160be12a1e9b0262dd1aa305302d5ba296c2ebd291055" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" @@ -4217,13 +3865,12 @@ dependencies = [ "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "258ff6a9a94f648d0379dbd79110e057edbb53eb85cc237e33eadf8e5a30df85" -"checksum engine 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum engine 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" "checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b61fa891024a945da30a9581546e8cfaf5602c7b3f4c137a2805cf388f92075a" -"checksum errno 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2b2decb0484e15560df3210cf0d78654bb0864b2c138977c07e377a1bae0e2" -"checksum error 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum error 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" @@ -4245,7 +3892,6 @@ dependencies = [ "checksum flatbuffers-verifier 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb67f9057183996c00b19cd934f9e79f09aecf7c29e4424cf262288f5a2a84ae" "checksum flate2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3b0c7353385f92079524de3b7116cf99d73947c08a7472774e9b3b04bff3b901" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" "checksum fsevent 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "c4bbbf71584aeed076100b5665ac14e3d85eeb31fdbb45fbd41ef9a682b5ec05" "checksum fsevent-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a772d36c338d07a032d5375a36f15f9a7043bf0cb8ce7cee658e037c6032874" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" @@ -4261,7 +3907,7 @@ dependencies = [ "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum h2 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "1ac030ae20dee464c5d0f36544d8b914a6bc606da44a57e052d2b0f5dae129e0" -"checksum hashable 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum hashable 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum hashbrown 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29fba9abe4742d586dfd0c06ae4f7e73a1c2d86b856933509b269d82cdf06e18" "checksum hasher 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10e8846de73a692b8012bcb5b52e76c33087da83da9b36edded3b1af60efd71a" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" @@ -4272,7 +3918,6 @@ dependencies = [ "checksum http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "eed324f0f0daf6ec10c474f150505af2c143f251722bf9dbd1261bd1f2ee2c1a" "checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" -"checksum hyper 0.11.22 (git+https://github.com/cryptape/hyper.git?branch=reuse_port)" = "" "checksum hyper 0.12.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0aeedb8ca5f0f96be00f84073c6d0d5f962ecad020ef543dff99a7c12717a60e" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum igd 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96f0f346ff76d5143011b2de50fbe72c3e521304868dfbd0d781b4f262a75dd5" @@ -4285,25 +3930,24 @@ dependencies = [ "checksum itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4833d6978da405305126af4ac88569b5d71ff758581ce5a987dbfa3755f694fc" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum json 0.11.14 (registry+https://github.com/rust-lang/crates.io-index)" = "01d7903059b22f1f09ced2fb9562507e3556a953caa2f835c64ab022bb6148c2" -"checksum jsonrpc-proto 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum jsonrpc-types 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum jsonrpc-types-internals 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum jsonrpc-proto 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum jsonrpc-types 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum jsonrpc-types-internals 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum jubjub 0.0.1 (git+https://github.com/cryptape/jubjub-prototype.git?branch=modified)" = "" "checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum largest-remainder-method 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d8c981a891c1d14a3fd9dfc2cd0455949e9958279fd433463386ae2337cf2c57" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)" = "023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd" "checksum libflate 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "45c97cf62125b79dcac52d506acdc4799f21a198597806947fd5f40dc7b93412" "checksum libgit2-sys 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4916b5addc78ec36cc309acfcdf0b9f9d97ab7b84083118b248709c5b7029356" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" -"checksum libproto 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum libproto 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum librocksdb-sys 6.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6af56e6599bce586321e8ba8acf8a0a5e97431fd9ab49f9b69f92d93fe642c6" "checksum libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "688e8d65e495567c2c35ea0001b26b9debf0b4ea11f8cccc954233b75fc3428a" -"checksum libsm 0.3.0 (git+https://github.com/cryptape/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1)" = "" +"checksum libsm 0.3.0 (git+https://github.com/citahub/libsm?rev=4d0e6199fca0934c58131de1d0036e9aa4da26c1)" = "" "checksum libsodium-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "de29595a79ddae2612ad0f27793a0b86cdf05a12f94ad5b87674540cc568171e" "checksum libssh2-sys 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" @@ -4317,13 +3961,10 @@ dependencies = [ "checksum log4rs 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "25e0fc8737a634116a2deb38d821e4400ed16ce9dcb0d628a978d399260f5902" "checksum lru 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb41c1934bda881f2ab7ad8afa2ec25b8e0453563bfb09854bf3c319b1c96c3" "checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" -"checksum lz4-sys 1.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a41fe7bc4964530eb26cf243b6ca0348a5d67949957840fe6489d5322a3ce937" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b" "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" -"checksum metadeps 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b122901b3a675fac8cecf68dcb2f0d3036193bc861d1ac0e1c337f7d5254c2" -"checksum mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "0a907b83e7b9e987032439a387e187119cddafc92d5c2aaeb1d92580a793f630" "checksum min-max-heap 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c4c98e56ed3027c65dd9a7d10bd0b7d8fbdf2f5769c2dd4ac91a79b896ed65" "checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649" "checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c" @@ -4344,7 +3985,6 @@ dependencies = [ "checksum num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" -"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" @@ -4352,7 +3992,6 @@ dependencies = [ "checksum ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7eb5259643245d3f292c7a146b2df53bba24d7eab159410e648eb73dc164669d" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum pairing 0.11.0 (git+https://github.com/cryptape/pairing.git?branch=0.11-release)" = "" -"checksum panic_hook 0.0.1 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" "checksum parity-multiaddr 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18a130a727008cfcd1068a28439fe939897ccad28664422aeca65b384d6de6d0" "checksum parity-multihash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e8eab0287ccde7821e337a124dc5a4f1d6e4c25d10cc91e3f9361615dd95076" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" @@ -4364,12 +4003,9 @@ dependencies = [ "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum plain_hasher 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83ae80873992f511142c07d0ec6c44de5636628fdb7e204abd655932ea79d995" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" -"checksum proof 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum protobuf 2.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9076cae823584ab4d8fab3a111658d1232faf106611dc8378161b7d062b628" -"checksum pubsub 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum pubsub_kafka 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum pubsub_rabbitmq 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" -"checksum pubsub_zeromq 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum proof 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" +"checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" +"checksum pubsub 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quickcheck 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4537d3e4edf73a15dd059b75bed1c292d17d3ea7517f583cebe716794fcf816" "checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" @@ -4389,8 +4025,6 @@ dependencies = [ "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123" "checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b" -"checksum rdkafka 0.12.0 (git+https://github.com/fede1024/rust-rdkafka.git?rev=84d4062)" = "" -"checksum rdkafka-sys 0.11.0-1 (git+https://github.com/fede1024/rust-rdkafka.git?rev=84d4062)" = "" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" @@ -4398,12 +4032,11 @@ dependencies = [ "checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" -"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ring 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "148fc853f6d85f53f5f315d46701eaacc565cdfb3cb1959730c96e81e7e49999" "checksum ripemd160 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5112e0dbbb87577bfbc56c42450235e3012ce336e29c5befd7807bd626da4a" "checksum rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" -"checksum rlp 0.2.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum rlp 0.2.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16d1effe9845d54f90e7be8420ee49e5c94623140b97ee4bc6fb5bfddb745720" "checksum rlp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b0d56c1450bfbef1181fdeb78b902dc1d23178de77c23d705317508e03d1b7c" "checksum rocksdb 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e7523c32e26bf2ebc4540645961dafcbd086c652e8ecb563a507f432eb7636d" @@ -4414,7 +4047,6 @@ dependencies = [ "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" -"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" "checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" @@ -4435,7 +4067,7 @@ dependencies = [ "checksum signal-hook 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f7ca1f1c0ed6c8beaab713ad902c041e4f09d06e1b4bb74c5fc553c078ed0110" "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" -"checksum snappy 0.1.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum snappy 0.1.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum sodiumoxide 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31532969f87f66ea5667b203fdee70aec8ddbe25aac69d243daff58c01688152" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" @@ -4466,7 +4098,6 @@ dependencies = [ "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" -"checksum tls-api 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e452fe2fdf40a10715adb3a5f244c7411cdf2ecc887b07160310939785db9182" "checksum tokio 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "fcaabb3cec70485d0df6e9454fe514393ad1c4070dee8915f11041e95630b230" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" @@ -4474,9 +4105,7 @@ dependencies = [ "checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" "checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" "checksum tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7392fe0a70d5ce0c882c4778116c519bd5dbaa8a7c3ae3d04578b3afafdcda21" -"checksum tokio-proto 0.1.1 (git+https://github.com/cryptape/tokio-proto.git?rev=7419e3aaca5d89a497acaf379471d53671a94159)" = "" "checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" -"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" "checksum tokio-sync 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1bf2b9dac2a0509b5cfd1df5aa25eafacb616a42a491a13604d6bbeab4486363" "checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" "checksum tokio-threadpool 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "742e511f6ce2298aeb86fc9ea0d8df81c2388c6ebae3dc8a7316e8c9df0df801" @@ -4484,13 +4113,12 @@ dependencies = [ "checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum tokio-yamux 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "2e8787adfb7b3a984b1093478895b304d7094d4de4e919655c6b0378e921f3df" -"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" "checksum toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4a2ecc31b0351ea18b3fe11274b8db6e4d82bce861bbb22e6dbed40417902c65" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb4b191d033a35edfce392a38cdcf9790b6cebcb30fa690c312c29da4dc433e" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" -"checksum tx_pool 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum tx_pool 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" @@ -4507,7 +4135,7 @@ dependencies = [ "checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" "checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" -"checksum util 0.6.0 (git+https://github.com/cryptape/cita-common.git?branch=develop)" = "" +"checksum util 0.6.0 (git+https://github.com/citahub/cita-common.git?branch=develop)" = "" "checksum uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dab5c5526c5caa3d106653401a267fed923e7046f35895ffcb5ca42db64942e6" "checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" @@ -4530,6 +4158,4 @@ dependencies = [ "checksum xmltree 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8eaee9d17062850f1e6163b509947969242990ee59a35801af437abe041e70" "checksum yaml-rust 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "95acf0db5515d07da9965ec0e0ba6cc2d825e2caeb7303b66ca441729801254e" "checksum yasna 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3a31ff5b5f5fcc70c5da4fcbdcbd91d541bb95b0b2517a3ca5cdc49fd3692cbb" -"checksum zktx 0.0.1 (git+https://github.com/cryptape/zktx.git)" = "" -"checksum zmq 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e6e33f05ebc9a1cb360e5db1f8ed6e5512ece86aed271654b0f171d04c24c23" -"checksum zmq-sys 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3cc251d25f3c6ffc54dfa3e8d808598825f8ccfee3a008dfc7866ffe325dcb3" +"checksum zktx 0.0.1 (git+https://github.com/citahub/zktx.git)" = "" diff --git a/Cargo.toml b/Cargo.toml index 3210453b2..6816592a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,8 @@ members = ["cita-auth" ,"cita-executor" ,"cita-forever" ,"tools/create-key-addr" -,"tools/snapshot-tool" ,"tools/create-genesis" -,"tools/relayer-parser" ,"tests/chain-executor-mock" -,"tests/consensus-mock" -,"tests/chain-performance-by-mq" -,"tests/box-executor" -,"tests/json-test" ] [profile.bench] diff --git a/LICENSE b/LICENSE index 132f937a9..602664943 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright Cryptape Technologies LLC. + Copyright Rivtower Technologies LLC. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index d0e6773d9..e50720756 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,18 @@ CARGO=RUSTFLAGS='-F warnings' cargo .PHONY: debug release test test-release bench fmt cov clean clippy security_audit debug: - $(CARGO) build --all + $(CARGO) build -j 1 --all scripts/release.sh debug release: - $(CARGO) build --all --release + $(CARGO) build -j 1 --all --release scripts/release.sh release test: - RUST_BACKTRACE=full $(CARGO) test --all 2>&1 + RUST_BACKTRACE=full $(CARGO) test -j 1 --all 2>&1 test-release: - RUST_BACKTRACE=full $(CARGO) test --release --all + RUST_BACKTRACE=full $(CARGO) test -j 1 --release --all bench: -rm target/bench.log @@ -33,7 +33,7 @@ clean: rm -rf target/release/ clippy: - $(CARGO) clippy --all + $(CARGO) clippy -j 1 --all # use cargo-audit to audit Cargo.lock for crates with security vulnerabilities # expecting to see "Success No vulnerable packages found" diff --git a/README-CN.md b/README-CN.md index dcc7ea2c4..b29c57c7a 100644 --- a/README-CN.md +++ b/README-CN.md @@ -1,6 +1,6 @@ -# +# -[![Circle CI Status](https://circleci.com/gh/cryptape/cita.svg?branch=develop)](https://circleci.com/gh/cryptape/cita) +[![Circle CI Status](https://circleci.com/gh/citahub/cita.svg?branch=develop)](https://circleci.com/gh/citahub/cita) [![All Contributors](https://img.shields.io/badge/all_contributors-54-orange.svg?style=flat-square)](#contributors) @@ -8,7 +8,7 @@ ## CITA 是什么? -CITA( Cryptape Inter-enterprise Trust Automation )是一个面向企业级应用的支持智能合约的高性能区块链内核, +CITA( Rivtower Inter-enterprise Trust Automation )是一个面向企业级应用的支持智能合约的高性能区块链内核, 旨在为企业级区块链应用提供一个稳固、高效、灵活、可适应未来的运行平台。CITA 将区块链节点的必要功能解耦为六个微服务:RPC,Auth,Consensus,Chain,Executor,Network。各组件之间通过消息总线交换信息相互协作。通过配置和定制相应的服务,CITA 能够满足企业级用户的全部需要。 - **水平扩展性** @@ -17,7 +17,7 @@ CITA( Cryptape Inter-enterprise Trust Automation )是一个面向企业级 也有可能是一组服务器组成的集群,同时 CITA 还支持部署在云服务器上,充分利用了各种服务器硬件来提升处理能力。 节点与节点之间通过 P2P 通信,节点内部各模块通过消息总线通信。 -![](https://github.com/cryptape/citahub-docs/blob/master/docs/assets/cita-assets/architecture.jpg?raw=true) +![](https://github.com/citahub/citahub-docs/blob/master/docs/assets/cita-assets/architecture.jpg?raw=true) - **组件可插拔** @@ -52,8 +52,8 @@ CITA( Cryptape Inter-enterprise Trust Automation )是一个面向企业级 ## 白皮书 -- [英文版](https://github.com/cryptape/cita-whitepaper/blob/master/en/technical-whitepaper.md) -- [中文版](https://github.com/cryptape/cita-whitepaper/blob/master/zh/technical-whitepaper.md) +- [英文版](https://github.com/citahub/cita-whitepaper/blob/master/en/technical-whitepaper.md) +- [中文版](https://github.com/citahub/cita-whitepaper/blob/master/zh/technical-whitepaper.md) ## 文档 @@ -66,11 +66,11 @@ CITA 支持 JSON-RPC 和 WebSocket (experimental) API/v1。 对于 CITA 的 API/v1,你可以使用任意的 HTTP 代理,或者下面的 SDK: -* [Java](https://github.com/cryptape/cita-sdk-java) -* [JavaScript](https://github.com/cryptape/cita-sdk-js) -* [Swift](https://github.com/cryptape/cita-sdk-swift) -* [Ruby](https://github.com/cryptape/cita-sdk-ruby) -* [Rust](https://github.com/cryptape/cita-common/tree/develop/cita-web3) +* [Java](https://github.com/citahub/cita-sdk-java) +* [JavaScript](https://github.com/citahub/cita-sdk-js) +* [Swift](https://github.com/citahub/cita-sdk-swift) +* [Ruby](https://github.com/citahub/cita-sdk-ruby) +* [Rust](https://github.com/citahub/cita-common/tree/develop/cita-web3) ## 社区贡献 @@ -78,23 +78,21 @@ CITA 目前仍在紧张的开发中,欢迎大家为 CITA 贡献自己的一份 ## 关注我们 -[Twitter](https://twitter.com/Cryptape) - [Weibo](http://weibo.com/u/6307204864) -## 开源协议 [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcryptape%2Fcita.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcryptape%2Fcita?ref=badge_shield) +## 开源协议 [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcitahub%2Fcita.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcitahub%2Fcita?ref=badge_shield) Apache 2.0 license ## 权益归属 - + -秘猿科技团队 :heart: +溪塔科技团队 :heart: ## 联系我们 -邮箱: +邮箱: ## Contributors @@ -104,70 +102,70 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - + + + +
kaikai
kaikai

💻
zhangyaning
zhangyaning

💻
Boyu Yang
Boyu Yang

💻
zhiwei
zhiwei

💻
漂流
漂流

💻
AsceticBear
AsceticBear

💻
yubo
yubo

💻
zhouyun-zoe
zhouyun-zoe

📖
Bicheng Gao
Bicheng Gao

💻
kaikai
kaikai

💻
zhangyaning
zhangyaning

💻
Boyu Yang
Boyu Yang

💻
zhiwei
zhiwei

💻
漂流
漂流

💻
AsceticBear
AsceticBear

💻
yubo
yubo

💻
zhouyun-zoe
zhouyun-zoe

📖
Bicheng Gao
Bicheng Gao

💻
lhf
lhf

💻
LinFeng Qian
LinFeng Qian

💻
keroro
keroro

💻
Yaorong
Yaorong

💻
suyanlong
suyanlong

💻
Chen Yu
Chen Yu

💻
zhangsoledad
zhangsoledad

💻
hezhengjun
hezhengjun

💻
zeroqn
zeroqn

💻
lhf
lhf

💻
LinFeng Qian
LinFeng Qian

💻
keroro
keroro

💻
Yaorong
Yaorong

💻
suyanlong
suyanlong

💻
Chen Yu
Chen Yu

💻
zhangsoledad
zhangsoledad

💻
hezhengjun
hezhengjun

💻
zeroqn
zeroqn

💻
urugang
urugang

💻
Jiang Jinyang
Jiang Jinyang

💻
Jan Xie
Jan Xie

💻
Sun Lei
Sun Lei

💻
hyl
hyl

💻
Terry Tai
Terry Tai

💻
Ke Wang
Ke Wang

💻
Mohanson
Mohanson

💻
quanzhan lu
quanzhan lu

💻
urugang
urugang

💻
Jiang Jinyang
Jiang Jinyang

💻
Jan Xie
Jan Xie

💻
Sun Lei
Sun Lei

💻
hyl
hyl

💻
Terry Tai
Terry Tai

💻
Ke Wang
Ke Wang

💻
Mohanson
Mohanson

💻
quanzhan lu
quanzhan lu

💻
duanyytop
duanyytop

💻
clearloop
clearloop

💻
nokodemion
nokodemion

💻
Rain Chen
Rain Chen

💻
Daogang Tang
Daogang Tang

💻
xianliang jiang
xianliang jiang

🐛
Nov
Nov

💻
Rai Yang
Rai Yang

💻
Wenchao Hu
Wenchao Hu

💻
duanyytop
duanyytop

💻
clearloop
clearloop

💻
nokodemion
nokodemion

💻
Rain Chen
Rain Chen

💻
Daogang Tang
Daogang Tang

💻
xianliang jiang
xianliang jiang

🐛
Nov
Nov

💻
Rai Yang
Rai Yang

💻
Wenchao Hu
Wenchao Hu

💻
kaiyu
kaiyu

💻
James Chen
James Chen

💻
rev-chaos
rev-chaos

💻
Eason Gao
Eason Gao

💻
Eric Zhang
Eric Zhang

💻
Jun Jiang
Jun Jiang

💻
PRIEWIENV
PRIEWIENV

💻
The Gitter Badger
The Gitter Badger

💻
CL
CL

💻
kaiyu
kaiyu

💻
James Chen
James Chen

💻
rev-chaos
rev-chaos

💻
Eason Gao
Eason Gao

💻
Eric Zhang
Eric Zhang

💻
Jun Jiang
Jun Jiang

💻
PRIEWIENV
PRIEWIENV

💻
The Gitter Badger
The Gitter Badger

💻
CL
CL

💻
programmer-liu
programmer-liu

💻
Jiayu Ye
Jiayu Ye

💻
liyanzi
liyanzi

🐛
JiaYi
JiaYi

📖
programmer-liu
programmer-liu

💻
Jiayu Ye
Jiayu Ye

💻
liyanzi
liyanzi

🐛
JiaYi
JiaYi

📖
Timmy Zhang
Timmy Zhang

🤔
Wu Yuyue
Wu Yuyue

📖
xiangmeiLu
xiangmeiLu

📖
mingxiaowu
mingxiaowu

🐛
wangfh666
wangfh666

🐛
Wu Yuyue
Wu Yuyue

📖
xiangmeiLu
xiangmeiLu

📖
mingxiaowu
mingxiaowu

🐛
wangfh666
wangfh666

🐛
diff --git a/README.md b/README.md index 5f0785a07..0074e3831 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# +# -[![Circle CI Status](https://circleci.com/gh/cryptape/cita.svg?branch=develop)](https://circleci.com/gh/cryptape/cita) +[![Circle CI Status](https://circleci.com/gh/citahub/cita.svg?branch=develop)](https://circleci.com/gh/citahub/cita) [![All Contributors](https://img.shields.io/badge/all_contributors-54-orange.svg?style=flat-square)](#contributors) @@ -12,7 +12,7 @@ CITA is a fast and scalable blockchain kernel for enterprises. CITA supports bot - **Horizontal scalability**: With the microservice architecture, a logical node can be easily scaled to a cluster of servers. Node administrators can increase system capacity simply by adding more PC servers on high load. The administrator can even use dedicated servers to provide services for hot-spot accounts. Outside one node's boundary, nodes communicate with each other using P2P network; inside each node, microservices communicate with each other by messaging queue. -![](https://github.com/cryptape/citahub-docs/blob/master/docs/assets/cita-assets/architecture.jpg?raw=true) +![](https://github.com/citahub/citahub-docs/blob/master/docs/assets/cita-assets/architecture.jpg?raw=true) - **Customizable and Pluggable Components**: CITA's microservices are loosely coupled and their communications are only via the message queue. Hence, it‘s flexible to improve current components with better algorithms (such as new consensus algorithms) or more appropriate technical solutions (such as new DBs or new privacy solutions). Moreover, business logic is extremely complicated in enterprise applications. With CITA, you can easily customize your blockchain with the certain feature to fit your own business requirements. @@ -24,14 +24,14 @@ CITA is a fast and scalable blockchain kernel for enterprises. CITA supports bot - **Chain Interoperability**: We perceive that independent blockchains are constantly emerging nowadays and even more in the future. How do these chains interoperate with each other to form blockchain network? CITA Support cross-chain communication by providing a simple cross-chain protocol currently. More explorations are undertaking in CITA, aiming to amplify the value of applications running on the various chains. -- **Engineering Experience**: There're many CITA networks running in banks, payment and insurance production environment, with Cryptape or CITA Integration Provider's technical support. CITA has accumulated a lot of engineering experience. +- **Engineering Experience**: There're many CITA networks running in banks, payment and insurance production environment, with Rivtower or CITA Integration Provider's technical support. CITA has accumulated a lot of engineering experience. ## Whitepaper For more details please check the white paper. -- [English](https://github.com/cryptape/cita-whitepaper/blob/master/en/technical-whitepaper.md) -- [Chinese](https://github.com/cryptape/cita-whitepaper/blob/master/zh/technical-whitepaper.md) +- [English](https://github.com/citahub/cita-whitepaper/blob/master/en/technical-whitepaper.md) +- [Chinese](https://github.com/citahub/cita-whitepaper/blob/master/zh/technical-whitepaper.md) ## Document @@ -44,11 +44,11 @@ CITA supports JSON-RPC and WebSocket (experimental) API/v1. For CITA API/v1, You can use any HTTP client, or following SDKs: -* [Java](https://github.com/cryptape/cita-sdk-java) -* [JavaScript](https://github.com/cryptape/cita-sdk-js) -* [Swift](https://github.com/cryptape/cita-sdk-swift) -* [Ruby](https://github.com/cryptape/cita-sdk-ruby) -* [Rust](https://github.com/cryptape/cita-common/tree/develop/cita-web3) +* [Java](https://github.com/citahub/cita-sdk-java) +* [JavaScript](https://github.com/citahub/cita-sdk-js) +* [Swift](https://github.com/citahub/cita-sdk-swift) +* [Ruby](https://github.com/citahub/cita-sdk-ruby) +* [Rust](https://github.com/citahub/cita-common/tree/develop/cita-web3) ## Contributing @@ -58,23 +58,21 @@ Please check [CONTRIBUTING](.github/CONTRIBUTING.md) for more details. ## Follow us -[Twitter](https://twitter.com/Cryptape) +[Weibo](https://weibo.com/u/7243995427) -[Weibo](http://weibo.com/u/6307204864) - -## License [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcryptape%2Fcita.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcryptape%2Fcita?ref=badge_shield) +## License [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcitahub%2Fcita.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcitahub%2Fcita?ref=badge_shield) CITA is currently under Apache 2.0 license. See the LICENSE file for details. ## Credits - + -CITA is created by Cryptape team with :heart:. +CITA is created by Rivtower team with :heart:. ## Contact us -Email: +Email: ## Contributors @@ -84,70 +82,70 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - + + + +
kaikai
kaikai

💻
zhangyaning
zhangyaning

💻
Boyu Yang
Boyu Yang

💻
zhiwei
zhiwei

💻
漂流
漂流

💻
AsceticBear
AsceticBear

💻
yubo
yubo

💻
zhouyun-zoe
zhouyun-zoe

📖
Bicheng Gao
Bicheng Gao

💻
kaikai
kaikai

💻
zhangyaning
zhangyaning

💻
Boyu Yang
Boyu Yang

💻
zhiwei
zhiwei

💻
漂流
漂流

💻
AsceticBear
AsceticBear

💻
yubo
yubo

💻
zhouyun-zoe
zhouyun-zoe

📖
Bicheng Gao
Bicheng Gao

💻
lhf
lhf

💻
LinFeng Qian
LinFeng Qian

💻
keroro
keroro

💻
Yaorong
Yaorong

💻
suyanlong
suyanlong

💻
Chen Yu
Chen Yu

💻
zhangsoledad
zhangsoledad

💻
hezhengjun
hezhengjun

💻
zeroqn
zeroqn

💻
lhf
lhf

💻
LinFeng Qian
LinFeng Qian

💻
keroro
keroro

💻
Yaorong
Yaorong

💻
suyanlong
suyanlong

💻
Chen Yu
Chen Yu

💻
zhangsoledad
zhangsoledad

💻
hezhengjun
hezhengjun

💻
zeroqn
zeroqn

💻
urugang
urugang

💻
Jiang Jinyang
Jiang Jinyang

💻
Jan Xie
Jan Xie

💻
Sun Lei
Sun Lei

💻
hyl
hyl

💻
Terry Tai
Terry Tai

💻
Ke Wang
Ke Wang

💻
Mohanson
Mohanson

💻
quanzhan lu
quanzhan lu

💻
urugang
urugang

💻
Jiang Jinyang
Jiang Jinyang

💻
Jan Xie
Jan Xie

💻
Sun Lei
Sun Lei

💻
hyl
hyl

💻
Terry Tai
Terry Tai

💻
Ke Wang
Ke Wang

💻
Mohanson
Mohanson

💻
quanzhan lu
quanzhan lu

💻
duanyytop
duanyytop

💻
clearloop
clearloop

💻
nokodemion
nokodemion

💻
Rain Chen
Rain Chen

💻
Daogang Tang
Daogang Tang

💻
xianliang jiang
xianliang jiang

🐛
Nov
Nov

💻
Rai Yang
Rai Yang

💻
Wenchao Hu
Wenchao Hu

💻
duanyytop
duanyytop

💻
clearloop
clearloop

💻
nokodemion
nokodemion

💻
Rain Chen
Rain Chen

💻
Daogang Tang
Daogang Tang

💻
xianliang jiang
xianliang jiang

🐛
Nov
Nov

💻
Rai Yang
Rai Yang

💻
Wenchao Hu
Wenchao Hu

💻
kaiyu
kaiyu

💻
James Chen
James Chen

💻
rev-chaos
rev-chaos

💻
Eason Gao
Eason Gao

💻
Eric Zhang
Eric Zhang

💻
Jun Jiang
Jun Jiang

💻
PRIEWIENV
PRIEWIENV

💻
The Gitter Badger
The Gitter Badger

💻
CL
CL

💻
kaiyu
kaiyu

💻
James Chen
James Chen

💻
rev-chaos
rev-chaos

💻
Eason Gao
Eason Gao

💻
Eric Zhang
Eric Zhang

💻
Jun Jiang
Jun Jiang

💻
PRIEWIENV
PRIEWIENV

💻
The Gitter Badger
The Gitter Badger

💻
CL
CL

💻
programmer-liu
programmer-liu

💻
Jiayu Ye
Jiayu Ye

💻
liyanzi
liyanzi

🐛
JiaYi
JiaYi

📖
programmer-liu
programmer-liu

💻
Jiayu Ye
Jiayu Ye

💻
liyanzi
liyanzi

🐛
JiaYi
JiaYi

📖
Timmy Zhang
Timmy Zhang

🤔
Wu Yuyue
Wu Yuyue

📖
xiangmeiLu
xiangmeiLu

📖
mingxiaowu
mingxiaowu

🐛
wangfh666
wangfh666

🐛
Wu Yuyue
Wu Yuyue

📖
xiangmeiLu
xiangmeiLu

📖
mingxiaowu
mingxiaowu

🐛
wangfh666
wangfh666

🐛
diff --git a/cita-auth/Cargo.toml b/cita-auth/Cargo.toml index d29aeee24..9d3f2f25f 100644 --- a/cita-auth/Cargo.toml +++ b/cita-auth/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cita-auth" -version = "0.1.0" -authors = ["Cryptape Technologies "] +version = "20.2.0" +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -13,20 +13,20 @@ serde = "1.0" serde_derive = "1.0" serde_json = "1.0" cita-logger = "0.1.1" -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-directories = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -error = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -tx_pool = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-directories = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +error = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +tx_pool = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } uuid = { version = "0.7", features = ["v4"] } lru = "0.1" rayon = "1.2" -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-database = { git = "https://github.com/cryptape/cita-database.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-database = "0.1" [dev-dependencies] tempfile = "2" @@ -34,7 +34,7 @@ tempdir = "0.3.7" quickcheck = "0.7.2" [build-dependencies] -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/cita-auth/build.rs b/cita-auth/build.rs index 0c9a51c99..0ecfa79e1 100644 --- a/cita-auth/build.rs +++ b/cita-auth/build.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,9 @@ use std::env; use util::build_info::gen_build_info; +const VERSION: &str = "20.2.0"; + fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - gen_build_info(out_dir.as_ref(), "build_info.rs"); + gen_build_info(out_dir.as_ref(), "build_info.rs", VERSION.to_owned()); } diff --git a/cita-auth/src/batch_forward.rs b/cita-auth/src/batch_forward.rs index 44ad9d096..1b23591ca 100644 --- a/cita-auth/src/batch_forward.rs +++ b/cita-auth/src/batch_forward.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -52,9 +52,7 @@ impl BatchForward { pub fn run(&mut self) { loop { - let ret = self.rx_request.try_recv(); - if ret.is_ok() { - let tx_req = ret.unwrap(); + if let Ok(tx_req) = self.rx_request.try_recv() { self.request_buffer.push(tx_req); if self.request_buffer.len() > self.batch_size { self.batch_forward(); diff --git a/cita-auth/src/block_txn.rs b/cita-auth/src/block_txn.rs index 0578915fd..483fddfef 100644 --- a/cita-auth/src/block_txn.rs +++ b/cita-auth/src/block_txn.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-auth/src/block_verify.rs b/cita-auth/src/block_verify.rs index cc7810a75..a6adc4897 100644 --- a/cita-auth/src/block_verify.rs +++ b/cita-auth/src/block_verify.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-auth/src/config.rs b/cita-auth/src/config.rs index b9c2f4cac..69053f968 100644 --- a/cita-auth/src/config.rs +++ b/cita-auth/src/config.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-auth/src/dispatcher.rs b/cita-auth/src/dispatcher.rs index fa1de9484..f67e7d7a5 100644 --- a/cita-auth/src/dispatcher.rs +++ b/cita-auth/src/dispatcher.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -141,7 +141,10 @@ impl Dispatcher { let txs_pool = &mut self.txs_pool.borrow_mut(); let added: Vec = txs .into_iter() - .filter(|tx| txs_pool.enqueue(tx.clone())) + .filter(|tx| { + trace!("add txs {} to pool", tx.get_tx_hash().lower_hex()); + txs_pool.enqueue(tx.clone()) + }) .collect(); if self.wal_enable { self.wal.write_batch(&added); diff --git a/cita-auth/src/handler.rs b/cita-auth/src/handler.rs index 974e54fd5..5ec49b674 100644 --- a/cita-auth/src/handler.rs +++ b/cita-auth/src/handler.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -601,8 +601,13 @@ impl MsgHandler { .get_clear_list() .iter() .for_each(|clear_list: &Vec| { - self.black_list_cache - .remove(&Address::from_slice(clear_list.as_slice())); + let address = Address::from_slice(clear_list.as_slice()); + if address == Address::default() { + debug!("Clean blacklist when cita-executor restarts "); + self.black_list_cache.clear(); + return; + } + self.black_list_cache.remove(&address); }); black_list @@ -621,7 +626,7 @@ impl MsgHandler { }); } - #[allow(unknown_lints, clippy::cyclomatic_complexity)] // TODO clippy + #[allow(unknown_lints, clippy::cognitive_complexity)] // TODO clippy fn deal_request(&mut self, is_local: bool, newtx_req: Request) { if newtx_req.has_batch_req() { let batch_new_tx = newtx_req.get_batch_req().get_new_tx_requests(); @@ -708,11 +713,10 @@ impl MsgHandler { .into_iter() .filter(|(_tx_hash, (_req, _tx_req, flag))| *flag) .filter(|(_tx_hash, (ref req, ref tx_req, _flag))| { - let ret = self.verify_black_list(&req); - if ret.is_err() { + if let Err(e) = self.verify_black_list(&req) { if is_local { let request_id = tx_req.get_request_id().to_vec(); - self.publish_tx_failed_result(request_id, &ret.unwrap_err()); + self.publish_tx_failed_result(request_id, &e); } false } else { @@ -720,11 +724,10 @@ impl MsgHandler { } }) .filter(|(_tx_hash, (ref _req, ref tx_req, _flag))| { - let ret = self.verify_request(tx_req); - if ret.is_err() { + if let Err(e) = self.verify_request(tx_req) { if is_local { let request_id = tx_req.get_request_id().to_vec(); - self.publish_tx_failed_result(request_id, &ret.unwrap_err()); + self.publish_tx_failed_result(request_id, &e); } false } else { @@ -732,11 +735,10 @@ impl MsgHandler { } }) .filter(|(_tx_hash, (ref req, ref tx_req, _flag))| { - let ret = self.verify_tx_req(&req); - if ret.is_err() { + if let Err(e) = self.verify_tx_req(&req) { if is_local { let request_id = tx_req.get_request_id().to_vec(); - self.publish_tx_failed_result(request_id, &ret.unwrap_err()); + self.publish_tx_failed_result(request_id, &e); } false } else { @@ -807,27 +809,24 @@ impl MsgHandler { } // black verify - let ret = self.verify_black_list(&req); - if ret.is_err() { + if let Err(e) = self.verify_black_list(&req) { if is_local { - self.publish_tx_failed_result(request_id, &ret.unwrap_err()); + self.publish_tx_failed_result(request_id, &e); } return; } - let ret = self.verify_request(&newtx_req); - if ret.is_err() { + if let Err(e) = self.verify_request(&newtx_req) { if is_local { - self.publish_tx_failed_result(request_id, &ret.unwrap_err()); + self.publish_tx_failed_result(request_id, &e); } return; } // other verify - let ret = self.verify_tx_req(&req); - if ret.is_err() { + if let Err(e) = self.verify_tx_req(&req) { if is_local { - self.publish_tx_failed_result(request_id, &ret.unwrap_err()); + self.publish_tx_failed_result(request_id, &e); } return; } @@ -1069,21 +1068,24 @@ impl MsgHandler { let un_tx = tx.get_transaction_with_sig(); self.save_ret_to_cache( H256::from_slice(tx.get_tx_hash()), - Some(un_tx.get_signature().to_vec()), + Some(un_tx.clone().get_signature().to_vec()), ); - } - self.dispatcher.add_txs_to_pool(signed_txn); - return true; + let req = un_tx.tx_verify_req_msg(); + if self.verify_tx_req(&req).is_ok() { + self.dispatcher.add_tx_to_pool(tx); + } + } + true } Err(error) => { info!("Validate BlockTxn error: {}", error); - return false; + false } } } else { info!("Could not find cached block_txn_req"); - return false; + false } } } @@ -1106,7 +1108,7 @@ fn snapshot_response(sender: &Sender<(String, Vec)>, ack: Resp, flag: bool) // only verify if tx.version > 2 pub fn verify_base_quota_required(tx: &Transaction) -> bool { match tx.get_version() { - 0...2 => true, + 0..=2 => true, _ => { let to = tx.get_to_v1(); if to.is_empty() || Address::from(to) == Address::zero() { diff --git a/cita-auth/src/history.rs b/cita-auth/src/history.rs index e7bcb9f7d..3f6da7739 100644 --- a/cita-auth/src/history.rs +++ b/cita-auth/src/history.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-auth/src/main.rs b/cita-auth/src/main.rs index 660a9a4d7..14b6beab9 100644 --- a/cita-auth/src/main.rs +++ b/cita-auth/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -128,7 +128,7 @@ fn main() { let matches = App::new("auth") .version(get_build_info_str(true)) .long_version(get_build_info_str(false)) - .author("Cryptape") + .author("Rivtower") .about("CITA Block Chain Node powered by Rust") .args_from_usage( "-c, --config=[FILE] 'Sets a custom config file' diff --git a/cita-auth/src/transaction_verify.rs b/cita-auth/src/transaction_verify.rs index 6487a3d0b..6427bac9b 100644 --- a/cita-auth/src/transaction_verify.rs +++ b/cita-auth/src/transaction_verify.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-auth/src/txwal.rs b/cita-auth/src/txwal.rs index 4704a1480..b86d37869 100644 --- a/cita-auth/src/txwal.rs +++ b/cita-auth/src/txwal.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ use std::sync::Arc; /// used to persist transaction pools message #[derive(Clone)] pub struct TxWal { - db: Arc, + db: Arc, } impl TxWal { diff --git a/cita-bft b/cita-bft index 0445d8d38..e5ea2911a 160000 --- a/cita-bft +++ b/cita-bft @@ -1 +1 @@ -Subproject commit 0445d8d3820d0f9471e3b8b9fe7578e346c63a70 +Subproject commit e5ea2911a5148703252067fc7a2a073eaf69b38f diff --git a/cita-chain/Cargo.toml b/cita-chain/Cargo.toml index f018742c9..92a8bab13 100644 --- a/cita-chain/Cargo.toml +++ b/cita-chain/Cargo.toml @@ -1,8 +1,8 @@ [package] description = "CITA node." name = "cita-chain" -version = "0.6.0" -authors = ["Cryptape Technologies "] +version = "20.2.0" +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -11,20 +11,20 @@ dotenv = "0.13.0" clap = "2" serde_json = "1.0" cita-logger = "0.1.1" -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-directories = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -error = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-directories = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +error = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } core = { path = "./core" } common-types = { path = "./types" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita_db = { git = "https://github.com/cryptape/cita-database.git", branch = "develop", package = "cita-database" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita_db = { version = "0.1", package = "cita-database" } [build-dependencies] -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/cita-chain/build.rs b/cita-chain/build.rs index 03dcbd59d..e0a685330 100644 --- a/cita-chain/build.rs +++ b/cita-chain/build.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,9 @@ use std::env; use util::build_info::gen_build_info; +const VERSION: &str = "20.2.0"; + fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - gen_build_info(out_dir.as_ref(), "build_info.rs"); + gen_build_info(out_dir.as_ref(), "build_info.rs", VERSION.to_owned()); } diff --git a/cita-chain/core/Cargo.toml b/cita-chain/core/Cargo.toml index 970b6fb3a..40ebdade6 100644 --- a/cita-chain/core/Cargo.toml +++ b/cita-chain/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "core" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -10,25 +10,25 @@ bincode = "0.8.0" serde = "1.0" serde_derive = "1.0" rustc-hex = "1.0" -lazy_static = "0.2" +lazy_static = "1.4.0" time = "0.1" crossbeam = "0.2" cita-logger = "0.1.1" common-types = { path = "../types" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-ed25519 = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-secp256k1 = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-merklehash = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -rlp = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-database = { git = "https://github.com/cryptape/cita-database.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-ed25519 = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-secp256k1 = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-merklehash = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +rlp = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-database = "0.1" +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [dev-dependencies] rand = "0.3" diff --git a/cita-chain/core/src/filters/filterdb.rs b/cita-chain/core/src/filters/filterdb.rs index 3a22d1f14..90b13cc54 100644 --- a/cita-chain/core/src/filters/filterdb.rs +++ b/cita-chain/core/src/filters/filterdb.rs @@ -1,4 +1,4 @@ -// CopyrightTechnologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/core/src/filters/mod.rs b/cita-chain/core/src/filters/mod.rs index bfeac217b..190c73c9d 100644 --- a/cita-chain/core/src/filters/mod.rs +++ b/cita-chain/core/src/filters/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/core/src/filters/rpc_filter.rs b/cita-chain/core/src/filters/rpc_filter.rs index 98284ff4b..63fd7e8c8 100644 --- a/cita-chain/core/src/filters/rpc_filter.rs +++ b/cita-chain/core/src/filters/rpc_filter.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -138,7 +138,7 @@ impl RpcFilter for Chain { filterdb .try_lock() .unwrap() - .gen_block_filter(id, current_number + 1); + .gen_block_filter(id, current_number); drop(filterdb); changes } diff --git a/cita-chain/core/src/lib.rs b/cita-chain/core/src/lib.rs index 72a885e66..491de6210 100644 --- a/cita-chain/core/src/lib.rs +++ b/cita-chain/core/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/core/src/libchain/chain.rs b/cita-chain/core/src/libchain/chain.rs index 6191c6b28..94d4e9637 100644 --- a/cita-chain/core/src/libchain/chain.rs +++ b/cita-chain/core/src/libchain/chain.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -765,7 +765,7 @@ impl Chain { pub fn block_hash_by_height(&self, height: BlockNumber) -> Option { self.block_header_by_height(height) - .and_then(|hdr| Some(hdr.hash().unwrap())) + .map(|hdr| hdr.hash().unwrap()) } /// Get block body by hash @@ -1341,7 +1341,7 @@ impl Chain { Some(ProofType::Bft) => { // TODO: use CONSTANT to replace the '1'. self.block_by_height(height + 1) - .and_then(|block| Some(block.header.proof().clone())) + .map(|block| block.header.proof().clone()) } _ => None, } diff --git a/cita-chain/core/src/libchain/mod.rs b/cita-chain/core/src/libchain/mod.rs index b3941f8e9..b6e269a8a 100644 --- a/cita-chain/core/src/libchain/mod.rs +++ b/cita-chain/core/src/libchain/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/core/src/libchain/rich_status.rs b/cita-chain/core/src/libchain/rich_status.rs index d9a224ab7..85b438a21 100644 --- a/cita-chain/core/src/libchain/rich_status.rs +++ b/cita-chain/core/src/libchain/rich_status.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/core/src/libchain/status.rs b/cita-chain/core/src/libchain/status.rs index 0d6260c11..96f2fa441 100644 --- a/cita-chain/core/src/libchain/status.rs +++ b/cita-chain/core/src/libchain/status.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/src/block_processor.rs b/cita-chain/src/block_processor.rs index 6e7e8779b..dbec73336 100644 --- a/cita-chain/src/block_processor.rs +++ b/cita-chain/src/block_processor.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/src/forward.rs b/cita-chain/src/forward.rs index 3f8268e0e..0ddb3c40c 100644 --- a/cita-chain/src/forward.rs +++ b/cita-chain/src/forward.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -230,6 +230,14 @@ impl Forward { return; } + Request::estimate_quota(call) => { + trace!("Estimate quota {:?}", call); + self.ctx_pub + .send((routing_key!(Chain >> Request).into(), imsg)) + .unwrap(); + return; + } + Request::transaction_count(tx_count) => { trace!("transaction count request from jsonrpc {:?}", tx_count); self.ctx_pub diff --git a/cita-chain/src/main.rs b/cita-chain/src/main.rs index 66469e99a..6f88c6a3f 100644 --- a/cita-chain/src/main.rs +++ b/cita-chain/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -95,7 +95,7 @@ fn main() { let matches = App::new("chain") .version(get_build_info_str(true)) .long_version(get_build_info_str(false)) - .author("Cryptape") + .author("Rivtower") .about("CITA Block Chain Node powered by Rust") .args_from_usage( "-c, --config=[FILE] 'Sets a chain config file' diff --git a/cita-chain/types/Cargo.toml b/cita-chain/types/Cargo.toml index 8cdcd882b..7b001e726 100644 --- a/cita-chain/types/Cargo.toml +++ b/cita-chain/types/Cargo.toml @@ -2,33 +2,33 @@ name = "common-types" description = "Common types used throughout the codebase" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" [dependencies] -rlp = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-ed25519 = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -snappy = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +rlp = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-ed25519 = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +snappy = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } serde = "1.0" serde_derive = "1.0" bloomchain = "0.2" -lazy_static = "0.2" +lazy_static = "1.4.0" time = "0.1" rustc-hex = "1.0" cita_trie = "2.0.0" cita-logger = "0.1.0" -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-database = { git = "https://github.com/cryptape/cita-database.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-database = "0.1" [dependencies.cita-vm] -git = "https://github.com/cryptape/cita-vm.git" +git = "https://github.com/citahub/cita-vm.git" branch = "cita" default-features = false features = ["sha3hash"] diff --git a/cita-chain/types/src/block.rs b/cita-chain/types/src/block.rs index 7dcc61c69..256d6eb0e 100644 --- a/cita-chain/types/src/block.rs +++ b/cita-chain/types/src/block.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/block_number.rs b/cita-chain/types/src/block_number.rs index 494995743..444e4d654 100644 --- a/cita-chain/types/src/block_number.rs +++ b/cita-chain/types/src/block_number.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/block_receipts.rs b/cita-chain/types/src/block_receipts.rs index 2dacf9f28..2c5044b36 100644 --- a/cita-chain/types/src/block_receipts.rs +++ b/cita-chain/types/src/block_receipts.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/context.rs b/cita-chain/types/src/context.rs index bdc3628ee..54d71092d 100644 --- a/cita-chain/types/src/context.rs +++ b/cita-chain/types/src/context.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ use crate::header::BlockNumber; use cita_types::{Address, H256, U256}; +use cita_vm::evm::Context as EVMContext; use std::sync::Arc; pub type LastHashes = Vec; @@ -45,6 +46,19 @@ impl Default for Context { } } +impl From for Context { + fn from(evm_context: EVMContext) -> Context { + Context { + block_quota_limit: U256::from(evm_context.gas_limit), + coin_base: evm_context.coinbase, + block_number: evm_context.number.as_u64(), + timestamp: evm_context.timestamp, + difficulty: evm_context.difficulty, + ..Default::default() + } + } +} + #[cfg(test)] mod tests { use super::Context; diff --git a/cita-chain/types/src/db_indexes.rs b/cita-chain/types/src/db_indexes.rs index 015342efe..72fcc4dc1 100644 --- a/cita-chain/types/src/db_indexes.rs +++ b/cita-chain/types/src/db_indexes.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/errors/authentication.rs b/cita-chain/types/src/errors/authentication.rs index c52f4a06b..72e32d5ec 100644 --- a/cita-chain/types/src/errors/authentication.rs +++ b/cita-chain/types/src/errors/authentication.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/errors/call.rs b/cita-chain/types/src/errors/call.rs index f615994f3..5193c0fae 100644 --- a/cita-chain/types/src/errors/call.rs +++ b/cita-chain/types/src/errors/call.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/errors/execution.rs b/cita-chain/types/src/errors/execution.rs index e4467d949..4d4f0462f 100644 --- a/cita-chain/types/src/errors/execution.rs +++ b/cita-chain/types/src/errors/execution.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/errors/mod.rs b/cita-chain/types/src/errors/mod.rs index 673b79c91..05b894226 100644 --- a/cita-chain/types/src/errors/mod.rs +++ b/cita-chain/types/src/errors/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/errors/native.rs b/cita-chain/types/src/errors/native.rs index add996195..a4ecd21e9 100644 --- a/cita-chain/types/src/errors/native.rs +++ b/cita-chain/types/src/errors/native.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +use cita_vm::evm::Error as EVMError; +use cita_vm::Error as VMError; use std::fmt; #[derive(Debug)] @@ -19,6 +21,14 @@ pub enum NativeError { Internal(String), } +impl Into for NativeError { + fn into(self) -> VMError { + match self { + NativeError::Internal(str) => VMError::Evm(EVMError::Internal(str)), + } + } +} + impl fmt::Display for NativeError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let printable = match self { diff --git a/cita-chain/types/src/errors/receipt.rs b/cita-chain/types/src/errors/receipt.rs index 1106159a2..5cf7fd774 100644 --- a/cita-chain/types/src/errors/receipt.rs +++ b/cita-chain/types/src/errors/receipt.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/filter.rs b/cita-chain/types/src/filter.rs index 9685178e7..96851206a 100644 --- a/cita-chain/types/src/filter.rs +++ b/cita-chain/types/src/filter.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/header.rs b/cita-chain/types/src/header.rs index 926206cb8..99576b4a1 100644 --- a/cita-chain/types/src/header.rs +++ b/cita-chain/types/src/header.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/lib.rs b/cita-chain/types/src/lib.rs index 0bf60c8b1..f1b89998b 100644 --- a/cita-chain/types/src/lib.rs +++ b/cita-chain/types/src/lib.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/log.rs b/cita-chain/types/src/log.rs index 59aca86f3..843f385cb 100644 --- a/cita-chain/types/src/log.rs +++ b/cita-chain/types/src/log.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/log_blooms.rs b/cita-chain/types/src/log_blooms.rs index 595f24f51..3275804a1 100644 --- a/cita-chain/types/src/log_blooms.rs +++ b/cita-chain/types/src/log_blooms.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/receipt.rs b/cita-chain/types/src/receipt.rs index d130faa61..257a6dd6a 100644 --- a/cita-chain/types/src/receipt.rs +++ b/cita-chain/types/src/receipt.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/reserved_addresses.rs b/cita-chain/types/src/reserved_addresses.rs index 8816ec6b3..721ee8af2 100644 --- a/cita-chain/types/src/reserved_addresses.rs +++ b/cita-chain/types/src/reserved_addresses.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/transaction.rs b/cita-chain/types/src/transaction.rs index 99737c42d..c4860a685 100644 --- a/cita-chain/types/src/transaction.rs +++ b/cita-chain/types/src/transaction.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-chain/types/src/transaction_index.rs b/cita-chain/types/src/transaction_index.rs index f9cd43c95..2cc165c0b 100644 --- a/cita-chain/types/src/transaction_index.rs +++ b/cita-chain/types/src/transaction_index.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/Cargo.toml b/cita-executor/Cargo.toml index 6fc9153bf..ed68f3973 100644 --- a/cita-executor/Cargo.toml +++ b/cita-executor/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cita-executor" -version = "0.1.0" -authors = ["Cryptape Technologies "] +version = "20.2.0" +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -17,28 +17,28 @@ itertools = "0.5" core-executor = { path = "./core" } common-types = { path = "../cita-chain/types" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-directories = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -error = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-database = { git = "https://github.com/cryptape/cita-database.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-directories = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +error = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-database = "0.1" [build-dependencies] -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [dev-dependencies] bincode = "0.8.0" -cita-ed25519 = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-ed25519 = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } tempdir = "0.3.7" [dependencies.cita-vm] -git = "https://github.com/cryptape/cita-vm.git" +git = "https://github.com/citahub/cita-vm.git" branch = "cita" default-features = false features = ["sha3hash"] diff --git a/cita-executor/build.rs b/cita-executor/build.rs index 456b10301..a0e4a83c0 100644 --- a/cita-executor/build.rs +++ b/cita-executor/build.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,9 @@ use std::env; use util::build_info::gen_build_info; +const VERSION: &str = "20.2.0"; + fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - gen_build_info(out_dir.as_ref(), "build_info.rs"); + gen_build_info(out_dir.as_ref(), "build_info.rs", VERSION.to_owned()); } diff --git a/cita-executor/core/Cargo.toml b/cita-executor/core/Cargo.toml index b50e9ed6b..279a953d1 100644 --- a/cita-executor/core/Cargo.toml +++ b/cita-executor/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "core-executor" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -15,7 +15,7 @@ serde_json = "1.0" rustc-hex = "1.0" rustc-serialize = "0.3" lru-cache = "0.1.1" -lazy_static = "0.2" +lazy_static = "1.4.0" bit-set = "0.4" rust-crypto = "0.2.34" num = "0.1" @@ -32,28 +32,30 @@ cita_trie = "2.0" ethbloom = "0.6" sha3 = { version="0.8", optional=true } tiny-keccak = { version="1.4", optional=true } +hashbrown = { version = "0.3", features = ["rayon"] } +hasher = { version="0.1" } common-types = { path = "../../cita-chain/types" } core = { path = "../../cita-chain/core" } -cita-merklehash = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -snappy = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -rlp = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -zktx = { git = "https://github.com/cryptape/zktx.git", optional = true } -cita-database = { git = "https://github.com/cryptape/cita-database.git", branch = "develop" } +cita-merklehash = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +snappy = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +rlp = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +zktx = { git = "https://github.com/citahub/zktx.git", optional = true } +cita-database = "0.1" -cita-ed25519 = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-secp256k1 = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto-trait = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-ed25519 = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-secp256k1 = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto-trait = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [dependencies.cita-vm] -git = "https://github.com/cryptape/cita-vm.git" +git = "https://github.com/citahub/cita-vm.git" branch = "cita" default-features = false features = ["sha3hash"] diff --git a/cita-executor/core/src/authentication.rs b/cita-executor/core/src/authentication.rs index 1d08f52b2..c81fd331c 100644 --- a/cita-executor/core/src/authentication.rs +++ b/cita-executor/core/src/authentication.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -154,7 +154,6 @@ fn check_call_contract( func: &[u8], ) -> Result<(), AuthenticationError> { let has_permission = has_resource(group_accounts, account_permissions, account, cont, func); - trace!("has call contract permission: {:?}", has_permission); if !has_permission { @@ -194,7 +193,6 @@ fn has_resource( func: &[u8], ) -> bool { let groups = get_groups(group_accounts, account); - if !contains_resource(account_permissions, account, *cont, func) { for group in groups { if contains_resource(account_permissions, &group, *cont, func) { diff --git a/cita-executor/core/src/benches/executor.rs b/cita-executor/core/src/benches/executor.rs index 12e10d452..741571570 100644 --- a/cita-executor/core/src/benches/executor.rs +++ b/cita-executor/core/src/benches/executor.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/benches/mod.rs b/cita-executor/core/src/benches/mod.rs index dc9f24429..b0ba0893e 100644 --- a/cita-executor/core/src/benches/mod.rs +++ b/cita-executor/core/src/benches/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/cita_executive.rs b/cita-executor/core/src/cita_executive.rs index 894d09ad7..0041a788c 100644 --- a/cita-executor/core/src/cita_executive.rs +++ b/cita-executor/core/src/cita_executive.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,19 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. +use crate::data_provider::{BlockDataProvider, DataProvider, Store as VMSubState}; use cita_trie::DB; use cita_types::{Address, H160, H256, U256, U512}; use cita_vm::{ - evm::{Context as EVMContext, Error as EVMError, InterpreterResult, Log as EVMLog}, + evm::{ + self, Context as EVMContext, Contract, Error as EVMError, InterpreterParams, + InterpreterResult, Log as EVMLog, + }, state::{State, StateObjectInfo}, - BlockDataProvider, Config as VMConfig, DataProvider, Error as VMError, Store as VmSubState, - Transaction as EVMTransaction, + summary, Error as VMError, }; +use rlp::RlpStream; use std::cell::RefCell; use std::sync::Arc; use types::Bytes; use crate::authentication::check_permission; +use crate::cita_vm_helper::{call_pure, get_interpreter_conf}; use crate::contracts::native::factory::Factory as NativeFactory; use crate::exception::ExecutedException; use crate::libexecutor::economical_model::EconomicalModel; @@ -48,27 +53,27 @@ const AMEND_GET_KV_H256: u32 = 4; ///amend account's balance const AMEND_ACCOUNT_BALANCE: u32 = 5; +/// See: https://github.com/ethereum/EIPs/issues/659 +const MAX_CREATE_CODE_SIZE: u64 = std::u64::MAX; + // FIXME: CITAExecutive need rename to Executive after all works ready. pub struct CitaExecutive<'a, B> { - block_provider: Arc, + block_provider: Arc, state_provider: Arc>>, - native_factory: &'a NativeFactory, context: &'a Context, economical_model: EconomicalModel, } impl<'a, B: DB + 'static> CitaExecutive<'a, B> { pub fn new( - block_provider: Arc, + block_provider: Arc, state: Arc>>, - native_factory: &'a NativeFactory, context: &'a Context, economical_model: EconomicalModel, ) -> Self { Self { block_provider, state_provider: state, - native_factory, context, economical_model, } @@ -89,22 +94,23 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { (*conf).check_options.call_permission ); - check_permission( - &conf.group_accounts, - &conf.account_permissions, - t, - conf.check_options, - )?; + if conf.super_admin_account.is_none() || sender != conf.super_admin_account.unwrap() { + check_permission( + &conf.group_accounts, + &conf.account_permissions, + t, + conf.check_options, + )?; + } let tx_gas_schedule = TxGasSchedule::default(); let base_gas_required = match t.action { Action::Create => tx_gas_schedule.tx_create_gas, _ => tx_gas_schedule.tx_gas, } + match t.version { - 0...2 => 0, + 0..=2 => 0, _ => t.data.len() * tx_gas_schedule.tx_data_non_zero_gas, }; - if sender != Address::zero() && t.gas < U256::from(base_gas_required) { // FIXME: It is better to change NotEnoughBaseGas to // NotEnoughBaseGas { @@ -119,22 +125,22 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { return Err(ExecutionError::InvalidTransaction); } + // Prepaid t.gas for the transaction. + self.prepaid(t.sender(), t.gas, t.gas_price, t.value)?; let init_gas = t.gas - U256::from(base_gas_required); + let mut store = VMSubState::default(); + store.evm_context = build_evm_context(&self.context.clone()); + store.evm_cfg = get_interpreter_conf(); + let store = Arc::new(RefCell::new(store)); + let result = match t.action { Action::Store | Action::AbiStore => { - // Prepaid t.gas for the transaction. - self.prepaid(t.sender(), t.gas, t.gas_price, t.value)?; - // Maybe use tx_gas_schedule.tx_data_non_zero_gas for each byte store, it is more reasonable. // But for the data compatible, just let it as tx_gas_schedule.create_data_gas for now. let store_gas_used = U256::from(t.data.len() * tx_gas_schedule.create_data_gas); if let Some(gas_left) = init_gas.checked_sub(store_gas_used) { - let mut result = ExecutedResult::default(); - result.quota_left = gas_left; - result.is_evm_call = false; - - Ok(result) + Ok(InterpreterResult::Normal(vec![], gas_left.as_u64(), vec![])) } else { // FIXME: Should not return an error after self.prepaid(). // But for compatibility, should keep this. Need to be upgrade in new version. @@ -143,18 +149,28 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { } Action::Create => { // Note: Fees has been handle in cita_vm. - let params = VmExecParams { + let params = ExecutiveParams { code_address: None, sender, to_address: None, - gas: t.gas, + gas: init_gas, gas_price: t.gas_price(), value: t.value, nonce, data: Some(t.data.clone()), }; - self.call_evm(¶ms) + let mut vm_exec_params = build_vm_exec_params(¶ms, self.state_provider.clone()); + if !self.payment_required() { + vm_exec_params.disable_transfer_value = true; + } + create( + self.block_provider.clone(), + self.state_provider.clone(), + store.clone(), + &vm_exec_params.into(), + CreateKind::FromAddressAndNonce, + ) } Action::AmendData => { @@ -171,9 +187,6 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { )); } - // Prepaid for the transaction - self.prepaid(t.sender(), t.gas, t.gas_price, t.value)?; - // Backup used in case of running error self.state_provider.borrow_mut().checkpoint(); @@ -181,101 +194,185 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { Ok(Some(val)) => { // Discard the checkpoint because of amend data ok. self.state_provider.borrow_mut().discard_checkpoint(); - - let mut result = ExecutedResult::default(); - // Refund gas, AmendData do not use any additional gas. - result.quota_left = init_gas; - result.is_evm_call = false; - result.output = val.to_vec(); - Ok(result) + Ok(InterpreterResult::Normal( + val.to_vec(), + init_gas.as_u64(), + vec![], + )) } Ok(None) => { // Discard the checkpoint because of amend data ok. self.state_provider.borrow_mut().discard_checkpoint(); - - let mut result = ExecutedResult::default(); - // Refund gas, AmendData do not use any additional gas. - result.quota_left = init_gas; - result.is_evm_call = false; - Ok(result) + Ok(InterpreterResult::Normal(vec![], init_gas.as_u64(), vec![])) } Err(e) => { - let mut result = ExecutedResult::default(); - // Need to revert the state. self.state_provider.borrow_mut().revert_checkpoint(); - result.exception = Some(ExecutedException::VM(e)); - result.is_evm_call = false; - Ok(result) + Err(e) } } } Action::Call(ref address) => { - let params = VmExecParams { + let params = ExecutiveParams { code_address: Some(*address), sender, to_address: Some(*address), - gas: t.gas, + gas: init_gas, gas_price: t.gas_price(), value: t.value, nonce, data: Some(t.data.clone()), }; - self.call(¶ms) - } - }; - - let mut finalize_result = match result { - Ok(res) => { - if let Some(ref e) = res.exception { - if let Some(err) = self.transform_base_gas_err(e) { - return Err(err); - } + let mut vm_exec_params = build_vm_exec_params(¶ms, self.state_provider.clone()); + if !self.payment_required() { + vm_exec_params.disable_transfer_value = true; } - res - } - Err(_) => { - // Don't care about what is the error info in this situation, just let it as - // ReceiptError::Internal in Receipt. - let mut r = ExecutedResult::default(); - r.quota_left = U256::from(0); - r.quota_used = t.gas; - r.is_evm_call = false; - r + call( + self.block_provider.clone(), + self.state_provider.clone(), + store.clone(), + &vm_exec_params.into(), + ) } }; - if !finalize_result.is_evm_call { - let refund_value = finalize_result.quota_left * t.gas_price; - // Note: should not be error at refund. - self.refund(t.sender(), refund_value) - .expect("refund balance to sender must success"); - - let quota_used = t.gas - finalize_result.quota_left; - let fee_value = quota_used * t.gas_price; - self.handle_tx_fee(&self.context.coin_base, fee_value) - .expect("Add balance to coin_base must success"); - finalize_result.quota_used = quota_used; - } - + let mut finalize_result = self.finalize(result, store, t.gas, sender, t.gas_price()); finalize_result.account_nonce = nonce; Ok(finalize_result) } - fn transform_base_gas_err(&self, e: &ExecutedException) -> Option { - match e { - ExecutedException::VM(VMError::ExccedMaxBlockGasLimit) => { - Some(ExecutionError::BlockQuotaLimitReached) + fn finalize( + &mut self, + result: Result, + store: Arc>, + gas_limit: U256, + sender: Address, + gas_price: U256, + ) -> ExecutedResult { + let mut finalize_result = ExecutedResult::default(); + + match result { + Ok(InterpreterResult::Normal(output, gas_left, logs)) => { + let refund = get_refund(store.clone(), sender, gas_limit.as_u64(), gas_left); + let gas_left = gas_left + refund; + if self.payment_required() { + if let Err(e) = liquidtion( + self.state_provider.clone(), + store.clone(), + sender, + gas_price, + gas_limit.as_u64(), + gas_left, + ) { + finalize_result.exception = Some(ExecutedException::VM(e)); + return finalize_result; + } + } + // Handle self destruct: Kill it. + // Note: must after ends of the transaction. + for e in store.borrow_mut().selfdestruct.drain() { + self.state_provider.borrow_mut().kill_contract(&e); + } + self.state_provider + .borrow_mut() + .kill_garbage(&store.borrow().inused.clone()); + finalize_result.quota_used = gas_limit - U256::from(gas_left); + finalize_result.quota_left = U256::from(gas_left); + finalize_result.logs = transform_logs(logs); + finalize_result.logs_bloom = logs_to_bloom(&finalize_result.logs); + trace!( + "Get data after executed the transaction [Normal]: {:?}", + output + ); + finalize_result.output = output; } - ExecutedException::VM(VMError::InvalidNonce) => Some(ExecutionError::InvalidNonce), - ExecutedException::VM(VMError::NotEnoughBaseGas) => { - Some(ExecutionError::NotEnoughBaseGas) + Ok(InterpreterResult::Revert(output, gas_left)) => { + let refund = get_refund(store.clone(), sender, gas_limit.as_u64(), gas_left); + let gas_left = gas_left + refund; + if self.payment_required() { + if let Err(e) = liquidtion( + self.state_provider.clone(), + store.clone(), + sender, + gas_price, + gas_limit.as_u64(), + gas_left, + ) { + finalize_result.exception = Some(ExecutedException::VM(e)); + return finalize_result; + } + } + self.state_provider + .borrow_mut() + .kill_garbage(&store.borrow().inused.clone()); + + finalize_result.quota_used = gas_limit - U256::from(gas_left); + finalize_result.quota_left = U256::from(gas_left); + finalize_result.exception = Some(ExecutedException::Reverted); + trace!( + "Get data after executed the transaction [Revert]: {:?}", + output + ); } - ExecutedException::VM(VMError::NotEnoughBalance) => { - Some(ExecutionError::NotEnoughBalance) + Ok(InterpreterResult::Create(output, gas_left, logs, addr)) => { + let refund = get_refund(store.clone(), sender, gas_limit.as_u64(), gas_left); + let gas_left = gas_left + refund; + if self.payment_required() { + if let Err(e) = liquidtion( + self.state_provider.clone(), + store.clone(), + sender, + gas_price, + gas_limit.as_u64(), + gas_left, + ) { + finalize_result.exception = Some(ExecutedException::VM(e)); + return finalize_result; + } + } + + for e in store.borrow_mut().selfdestruct.drain() { + self.state_provider.borrow_mut().kill_contract(&e); + } + self.state_provider + .borrow_mut() + .kill_garbage(&store.borrow().inused.clone()); + finalize_result.quota_used = gas_limit - U256::from(gas_left); + finalize_result.quota_left = U256::from(gas_left); + finalize_result.logs = transform_logs(logs); + finalize_result.logs_bloom = logs_to_bloom(&finalize_result.logs); + finalize_result.contract_address = Some(addr); + + trace!( + "Get data after executed the transaction [Create], contract address: {:?}, contract data : {:?}", + finalize_result.contract_address, output + ); + } + Err(e) => { + if self.payment_required() { + if let Err(e) = liquidtion( + self.state_provider.clone(), + store.clone(), + sender, + gas_price, + gas_limit.as_u64(), + 0, + ) { + finalize_result.exception = Some(ExecutedException::VM(e)); + return finalize_result; + } + } + self.state_provider + .borrow_mut() + .kill_garbage(&store.borrow().inused.clone()); + + finalize_result.exception = Some(ExecutedException::VM(e)); + finalize_result.quota_used = gas_limit; + finalize_result.quota_left = U256::from(0); } - _ => None, } + + finalize_result } fn payment_required(&self) -> bool { @@ -306,48 +403,6 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { Ok(()) } - fn refund(&mut self, address: &Address, value: U256) -> Result<(), ExecutionError> { - if self.payment_required() { - self.state_provider - .borrow_mut() - .add_balance(address, value) - .map_err(ExecutionError::from) - } else { - Ok(()) - } - } - - fn handle_tx_fee( - &mut self, - coin_base: &Address, - fee_value: U256, - ) -> Result<(), ExecutionError> { - if self.payment_required() { - self.state_provider - .borrow_mut() - .add_balance(coin_base, fee_value) - .map_err(ExecutionError::from) - } else { - Ok(()) - } - } - - fn transfer_balance( - &mut self, - from: &Address, - to: &Address, - value: U256, - ) -> Result<(), ExecutionError> { - if self.payment_required() { - self.state_provider - .borrow_mut() - .transfer_balance(from, to, value) - .map_err(ExecutionError::from) - } else { - Ok(()) - } - } - fn transact_set_abi(&mut self, data: &[u8]) -> bool { if data.len() <= 20 { return false; @@ -495,99 +550,172 @@ impl<'a, B: DB + 'static> CitaExecutive<'a, B> { _ => Ok(None), } } +} - pub fn call_evm(&mut self, params: &VmExecParams) -> Result { - let mut evm_transaction = build_evm_transaction(params); - trace!("block quota limit is {:?}", self.context.block_quota_limit); - let mut evm_config = build_evm_config(self.context.block_quota_limit.as_u64()); - let evm_context = build_evm_context(&self.context); - - if !self.payment_required() { - evm_transaction.value = U256::from(0); - evm_config.check_balance = false; +/// Function create creates a new contract. +pub fn create( + block_provider: Arc, + state_provider: Arc>>, + store: Arc>, + request: &InterpreterParams, + create_kind: CreateKind, +) -> Result { + debug!("create request={:?}", request); + let address = match create_kind { + CreateKind::FromAddressAndNonce => { + // Generate new address created from address, nonce + create_address_from_address_and_nonce(&request.sender, &request.nonce) } - - trace!("Call evm with params: {:?}", params); - let mut result = match cita_vm::exec( - self.block_provider.clone(), - self.state_provider.clone(), - evm_context, - evm_config, - evm_transaction, - ) { - Ok(evm_result) => build_result_with_ok(params.gas, evm_result), - Err(e) => build_result_with_err(e), - }; - result.is_evm_call = true; - Ok(result) + CreateKind::FromSaltAndCodeHash => { + // Generate new address created from sender salt and code hash + create_address_from_salt_and_code_hash( + &request.sender, + request.extra, + request.input.clone(), + ) + } + }; + debug!("create address={:?}", address); + // Ensure there's no existing contract already at the designated address + if !can_create(state_provider.clone(), &address)? { + return Err(VMError::ContractAlreadyExist); } - - fn call(&mut self, params: &VmExecParams) -> Result { - // Check and call Native Contract. - if let Some(mut native_contract) = self - .native_factory - .new_contract(params.code_address.unwrap()) - { - self.prepaid(¶ms.sender, params.gas, params.gas_price, params.value)?; - - // Backup used in case of running out of gas - self.state_provider.borrow_mut().checkpoint(); - - // At first, transfer value to destination. - if self.payment_required() - && self - .transfer_balance(¶ms.sender, ¶ms.to_address.unwrap(), params.value) - .is_err() - { - // Discard the checkpoint - self.state_provider.borrow_mut().revert_checkpoint(); - return Err(ExecutionError::Internal( - "Transfer balance failed while calling native contract.".to_string(), - )); + // Make a checkpoint here + state_provider.borrow_mut().checkpoint(); + // Create a new contract + let balance = state_provider.borrow_mut().balance(&address)?; + state_provider.borrow_mut().new_contract( + &address, + balance, + // The init nonce for a new contract is one, see above documents. + U256::zero(), + // The init code should be none. Consider a situation: ContractA will create + // ContractB with address 0x1ff...fff, but ContractB's init code contains some + // op like "get code hash from 0x1ff..fff or get code size form 0x1ff...fff", + // The right result should be "summary(none)" and "0". + vec![], + ); + let mut reqchan = request.clone(); + reqchan.address = address; + reqchan.receiver = address; + reqchan.is_create = false; + reqchan.input = vec![]; + reqchan.contract = evm::Contract { + code_address: address, + code_data: request.input.clone(), + }; + let r = call( + block_provider.clone(), + state_provider.clone(), + store.clone(), + &reqchan, + ); + match r { + Ok(evm::InterpreterResult::Normal(output, gas_left, logs)) => { + // Ensure code size + if output.len() as u64 > MAX_CREATE_CODE_SIZE { + state_provider.borrow_mut().revert_checkpoint(); + return Err(VMError::ExccedMaxCodeSize); } - - let store = VmSubState::default(); - let store = Arc::new(RefCell::new(store)); - let mut vm_data_provider = DataProvider::new( - self.block_provider.clone(), - self.state_provider.clone(), - store, - ); - let result = match native_contract.exec(params, &self.context, &mut vm_data_provider) { - Ok(ret) => { - // Discard the checkpoint - self.state_provider.borrow_mut().discard_checkpoint(); - let mut result = build_result_with_ok(params.gas, ret); - result.is_evm_call = false; - result - } - Err(e) => { - // If error, revert the checkpoint - self.state_provider.borrow_mut().revert_checkpoint(); - - let mut result = ExecutedResult::default(); - result.exception = Some(ExecutedException::NativeContract(e)); - result.is_evm_call = false; - result - } - }; - Ok(result) - } else { - // Call EVM contract - self.call_evm(params) + let tx_gas_schedule = TxGasSchedule::default(); + // Pay every byte returnd from CREATE + let gas_code_deposit: u64 = + tx_gas_schedule.create_data_gas as u64 * output.len() as u64; + if gas_left < gas_code_deposit { + state_provider.borrow_mut().revert_checkpoint(); + return Err(VMError::Evm(evm::Error::OutOfGas)); + } + let gas_left = gas_left - gas_code_deposit; + state_provider + .borrow_mut() + .set_code(&address, output.clone())?; + state_provider.borrow_mut().discard_checkpoint(); + let r = Ok(evm::InterpreterResult::Create( + output, gas_left, logs, address, + )); + debug!("create result={:?}", r); + debug!("create gas_left={:?}", gas_left); + r } + Ok(evm::InterpreterResult::Revert(output, gas_left)) => { + state_provider.borrow_mut().revert_checkpoint(); + let r = Ok(evm::InterpreterResult::Revert(output, gas_left)); + debug!("create gas_left={:?}", gas_left); + debug!("create result={:?}", r); + r + } + Err(e) => { + debug!("create err={:?}", e); + state_provider.borrow_mut().revert_checkpoint(); + Err(e) + } + _ => unimplemented!(), } } -pub fn build_evm_transaction(params: &VmExecParams) -> EVMTransaction { - EVMTransaction { - from: params.sender, - value: params.value, - gas_limit: params.gas.as_u64(), - gas_price: params.gas_price, - input: params.data.clone().unwrap_or_default(), - to: params.to_address, - nonce: params.nonce, +/// Function call enters into the specific contract. +pub fn call( + block_provider: Arc, + state_provider: Arc>>, + store: Arc>, + request: &InterpreterParams, +) -> Result { + // Here not need check twice,becauce prepay is subed ,but need think call_static + /*if !request.disable_transfer_value && state_provider.borrow_mut().balance(&request.sender)? < request.value { + return Err(err::Error::NotEnoughBalance); + }*/ + // Run + state_provider.borrow_mut().checkpoint(); + let store_son = Arc::new(RefCell::new(store.borrow_mut().clone())); + let native_factory = NativeFactory::default(); + // Check and call Native Contract. + if let Some(mut native_contract) = native_factory.new_contract(request.contract.code_address) { + let mut vm_data_provider = DataProvider::new( + block_provider.clone(), + state_provider.clone(), + store.clone(), + ); + let context = store.borrow().evm_context.clone(); + match native_contract.exec( + &VmExecParams::from(request.to_owned()), + &Context::from(context), + &mut vm_data_provider, + ) { + Ok(ret) => { + // Discard the checkpoint + state_provider.borrow_mut().discard_checkpoint(); + Ok(ret) + } + Err(e) => { + // If error, revert the checkpoint + state_provider.borrow_mut().revert_checkpoint(); + Err(e.into()) + } + } + } else { + let r = call_pure( + block_provider.clone(), + state_provider.clone(), + store_son.clone(), + request, + ); + debug!("call result={:?}", r); + match r { + Ok(evm::InterpreterResult::Normal(output, gas_left, logs)) => { + state_provider.borrow_mut().discard_checkpoint(); + store.borrow_mut().merge(store_son); + Ok(evm::InterpreterResult::Normal(output, gas_left, logs)) + } + Ok(evm::InterpreterResult::Revert(output, gas_left)) => { + state_provider.borrow_mut().revert_checkpoint(); + Ok(evm::InterpreterResult::Revert(output, gas_left)) + } + Err(e) => { + state_provider.borrow_mut().revert_checkpoint(); + Err(e) + } + _ => unimplemented!(), + } } } @@ -601,62 +729,44 @@ pub fn build_evm_context(context: &Context) -> EVMContext { } } -pub fn build_evm_config(block_gas_limit: u64) -> VMConfig { - VMConfig { - // block_gas_limit is meaningless in cita_vm, so let it as default_block_quota_limit. - block_gas_limit, - check_nonce: true, - ..Default::default() - } -} - -fn build_result_with_ok(init_gas: U256, ret: InterpreterResult) -> ExecutedResult { - let mut result = ExecutedResult::default(); - - match ret { - InterpreterResult::Normal(data, quota_left, logs) => { - result.quota_used = init_gas - U256::from(quota_left); - result.quota_left = U256::from(quota_left); - result.logs = transform_logs(logs); - result.logs_bloom = logs_to_bloom(&result.logs); - - trace!( - "Get data after executed the transaction [Normal]: {:?}", - data - ); - result.output = data; - } - InterpreterResult::Revert(data, quota_left) => { - result.quota_used = init_gas - U256::from(quota_left); - result.quota_left = U256::from(quota_left); - result.exception = Some(ExecutedException::Reverted); - - trace!( - "Get data after executed the transaction [Revert]: {:?}", - data - ); - } - InterpreterResult::Create(data, quota_left, logs, contract_address) => { - result.quota_used = init_gas - U256::from(quota_left); - result.quota_left = U256::from(quota_left); - result.logs = transform_logs(logs); - result.logs_bloom = logs_to_bloom(&result.logs); - - result.contract_address = Some(contract_address); - trace!( - "Get data after executed the transaction [Create], contract address: {:?}, contract data : {:?}", - result.contract_address, data - ); - } +/// Function get_refund returns the real ammount to refund for a transaction. +fn get_refund( + store: Arc>, + origin: Address, + gas_limit: u64, + gas_left: u64, +) -> u64 { + let refunds_bound = match store.borrow().refund.get(&origin) { + Some(&data) => data, + None => 0u64, }; - result + // Get real ammount to refund + std::cmp::min(refunds_bound, (gas_limit - gas_left) >> 1) } -fn build_result_with_err(err: VMError) -> ExecutedResult { - trace!("EVM run error for the transaction, error info: {:?}", err); - let mut result = ExecutedResult::default(); - result.exception = Some(ExecutedException::VM(err)); - result +/// Liquidtion for a transaction. +fn liquidtion( + state_provider: Arc>>, + store: Arc>, + sender: Address, + gas_price: U256, + gas_limit: u64, + gas_left: u64, +) -> Result<(), VMError> { + trace!( + "gas_price: {:?}, gas limit:{:?}, gas left: {:?}", + gas_price, + gas_limit, + gas_left, + ); + state_provider + .borrow_mut() + .add_balance(&sender, gas_price * gas_left)?; + state_provider.borrow_mut().add_balance( + &store.borrow().evm_context.coinbase, + gas_price * (gas_limit - gas_left), + )?; + Ok(()) } fn transform_logs(logs: Vec) -> Vec { @@ -688,8 +798,49 @@ fn accrue_log(bloom: &mut Bloom, log: &Log) { } } +/// Returns new address created from address and nonce. +pub fn create_address_from_address_and_nonce(address: &Address, nonce: &U256) -> Address { + let mut stream = RlpStream::new_list(2); + stream.append(address); + stream.append(nonce); + Address::from(H256::from(summary(stream.as_raw()).as_slice())) +} + +/// Returns new address created from sender salt and code hash. +/// See: EIP 1014. +pub fn create_address_from_salt_and_code_hash( + address: &Address, + salt: H256, + code: Vec, +) -> Address { + let code_hash = &summary(&code[..])[..]; + let mut buffer = [0u8; 1 + 20 + 32 + 32]; + buffer[0] = 0xff; + buffer[1..=20].copy_from_slice(&address[..]); + buffer[(1 + 20)..(1 + 20 + 32)].copy_from_slice(&salt[..]); + buffer[(1 + 20 + 32)..].copy_from_slice(code_hash); + Address::from(H256::from(summary(&buffer[..]).as_slice())) +} + +/// If a contract creation is attempted, due to either a creation transaction +/// or the CREATE (or future CREATE2) opcode, and the destination address +/// already has either nonzero nonce, or nonempty code, then the creation +/// throws immediately, with exactly the same behavior as would arise if the +/// first byte in the init code were an invalid opcode. This applies +/// retroactively starting from genesis. +/// +/// See: EIP 684 +pub fn can_create( + state_provider: Arc>>, + address: &Address, +) -> Result { + let a = state_provider.borrow_mut().nonce(&address)?; + let b = state_provider.borrow_mut().code(&address)?; + Ok(a.is_zero() && b.is_empty()) +} + #[derive(Clone, Debug)] -pub struct VmExecParams { +pub struct ExecutiveParams { /// Address of currently executed code. pub code_address: Option
, /// Sender of current part of the transaction. @@ -708,10 +859,10 @@ pub struct VmExecParams { pub data: Option, } -impl Default for VmExecParams { +impl Default for ExecutiveParams { /// Returns default ActionParams initialized with zeros - fn default() -> VmExecParams { - VmExecParams { + fn default() -> ExecutiveParams { + ExecutiveParams { code_address: None, sender: Address::new(), to_address: None, @@ -724,6 +875,109 @@ impl Default for VmExecParams { } } +pub fn build_vm_exec_params( + params: &ExecutiveParams, + state_provider: Arc>>, +) -> VmExecParams { + let mut vm_exec_params = VmExecParams::default(); + vm_exec_params.origin = params.sender; + vm_exec_params.sender = params.sender; + if let Some(data) = params.to_address { + vm_exec_params.to_address = data; + vm_exec_params.storage_address = data; + vm_exec_params.code_address = data; + vm_exec_params.code_data = state_provider.borrow_mut().code(&data).unwrap_or_default(); + } + + vm_exec_params.gas_price = params.gas_price; + vm_exec_params.gas = params.gas.as_u64(); + vm_exec_params.value = params.value; + vm_exec_params.data = params.data.clone().unwrap_or_default(); + vm_exec_params.nonce = params.nonce; + vm_exec_params +} + +#[derive(Clone, Debug, Default)] +pub struct VmExecParams { + pub origin: Address, + pub storage_address: Address, + /// Address of currently executed code. + pub code_address: Address, + pub code_data: Vec, + /// Sender of current part of the transaction. + pub sender: Address, + /// Receive address. Usually equal to code_address, + pub to_address: Address, + /// Gas paid up front for transaction execution + pub gas: u64, + /// Gas price. + pub gas_price: U256, + /// Transaction value. + pub value: U256, + /// nonce + pub nonce: U256, + /// Input data. + pub data: Bytes, + pub read_only: bool, + pub extra: H256, + pub depth: u64, + pub disable_transfer_value: bool, +} + +impl From for VmExecParams { + fn from(params: InterpreterParams) -> Self { + Self { + origin: params.origin, + storage_address: params.address, + code_address: params.contract.code_address, + code_data: params.contract.code_data, + sender: params.sender, + to_address: params.receiver, + gas: params.gas_limit, + gas_price: params.gas_price, + value: params.value, + nonce: params.nonce, + data: params.input.clone(), + read_only: params.read_only, + extra: params.extra, + depth: params.depth, + disable_transfer_value: params.disable_transfer_value, + } + } +} + +impl Into for VmExecParams { + fn into(self) -> InterpreterParams { + InterpreterParams { + origin: self.origin, + address: self.storage_address, + contract: Contract { + code_address: self.code_address, + code_data: self.code_data, + }, + sender: self.sender, + receiver: self.to_address, + gas_limit: self.gas, + gas_price: self.gas_price, + value: self.value, + nonce: self.nonce, + input: self.data.clone(), + read_only: self.read_only, + extra: self.extra, + depth: self.depth, + is_create: false, + disable_transfer_value: self.disable_transfer_value, + } + } +} + +/// A selector for func create_address_from_address_and_nonce() and +/// create_address_from_salt_and_code_hash() +pub enum CreateKind { + FromAddressAndNonce, // use create_address_from_address_and_nonce + FromSaltAndCodeHash, // use create_address_from_salt_and_code_hash +} + #[derive(Default, Debug)] pub struct ExecutedResult { pub state_root: H256, @@ -747,7 +1001,6 @@ pub struct ExecutedResult { #[cfg(test)] mod tests { use super::{CitaExecutive, Context, ExecutionError, TxGasSchedule}; - use crate::contracts::native::factory::Factory as NativeFactory; use crate::libexecutor::economical_model::EconomicalModel; use crate::libexecutor::{block::EVMBlockDataProvider, sys_config::BlockSysConfig}; use crate::tests::helpers::*; @@ -800,7 +1053,6 @@ mod tests { context.block_quota_limit = U256::from(100_000); let block_data_provider = EVMBlockDataProvider::new(context.clone()); - let native_factory = NativeFactory::default(); let state = Arc::new(RefCell::new(state)); @@ -808,7 +1060,6 @@ mod tests { CitaExecutive::new( Arc::new(block_data_provider), state, - &native_factory, &context, EconomicalModel::Charge, ) @@ -840,8 +1091,6 @@ mod tests { let sender = t.sender(); let contract = contract_address(t.sender(), &U256::zero()); - let native_factory = NativeFactory::default(); - let mut state = get_temp_state(); state @@ -861,7 +1110,6 @@ mod tests { CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Charge, ) @@ -901,8 +1149,6 @@ mod tests { } .fake_sign(keypair.address().clone()); - let native_factory = NativeFactory::default(); - let mut state = get_temp_state(); state.add_balance(t.sender(), U256::from(100_042)).unwrap(); let mut context = Context::default(); @@ -916,7 +1162,6 @@ mod tests { CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Charge, ) @@ -945,8 +1190,6 @@ mod tests { } .fake_sign(keypair.address().clone()); - let native_factory = NativeFactory::default(); - let mut state = get_temp_state(); state.add_balance(t.sender(), U256::from(100_042)).unwrap(); let mut context = Context::default(); @@ -960,7 +1203,6 @@ mod tests { CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Charge, ) @@ -989,7 +1231,6 @@ mod tests { } .fake_sign(keypair.address().clone()); - let native_factory = NativeFactory::default(); let state = get_temp_state(); let mut context = Context::default(); context.block_quota_limit = U256::from(100_000); @@ -1002,7 +1243,6 @@ mod tests { CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) @@ -1033,7 +1273,6 @@ contract HelloWorld { let gas_required = U256::from(schedule.tx_gas + 1000); let (deploy_code, _runtime_code) = solc("HelloWorld", source); - let native_factory = NativeFactory::default(); let keypair = KeyPair::gen_keypair(); let t = Transaction { @@ -1062,7 +1301,6 @@ contract HelloWorld { CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) @@ -1093,7 +1331,6 @@ contract AbiTest { let gas_required = U256::from(schedule.tx_gas + 100_000); let (deploy_code, runtime_code) = solc("AbiTest", source); - let native_factory = NativeFactory::default(); let keypair = KeyPair::gen_keypair(); let t = Transaction { @@ -1126,7 +1363,6 @@ contract AbiTest { let _ = CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) @@ -1161,7 +1397,6 @@ contract AbiTest { let data = "552410770000000000000000000000000000000000000000000000000000000012345678" .from_hex() .unwrap(); - let native_factory = NativeFactory::default(); let mut state = get_temp_state(); state .set_code(&contract_addr, runtime_code.clone()) @@ -1192,7 +1427,6 @@ contract AbiTest { let _ = CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) @@ -1236,7 +1470,6 @@ contract AbiTest { let data = "552410770000000000000000000000000000000000000000000000000000000012345678" .from_hex() .unwrap(); - let native_factory = NativeFactory::default(); let mut state = get_temp_state(); state @@ -1268,7 +1501,6 @@ contract AbiTest { let res = CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) @@ -1317,7 +1549,6 @@ contract AbiTest { let data = "552410770000000000000000000000000000000000000000000000000000000012345678" .from_hex() .unwrap(); - let native_factory = NativeFactory::default(); let mut state = get_temp_state(); state @@ -1349,7 +1580,6 @@ contract AbiTest { let res = CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) @@ -1405,8 +1635,6 @@ contract FakePermissionManagement { let permission_addr = Address::from_str("33f4b16d67b112409ab4ac87274926382daacfac").unwrap(); - let native_factory = NativeFactory::default(); - let mut state = get_temp_state(); let (_, runtime_code) = solc("FakeAuth", fake_auth); state.set_code(&auth_addr, runtime_code.clone()).unwrap(); @@ -1446,7 +1674,6 @@ contract FakePermissionManagement { let res = CitaExecutive::new( Arc::new(block_data_provider), state.clone(), - &native_factory, &context, EconomicalModel::Quota, ) diff --git a/cita-executor/core/src/cita_vm_helper.rs b/cita-executor/core/src/cita_vm_helper.rs new file mode 100644 index 000000000..1cc61f0e5 --- /dev/null +++ b/cita-executor/core/src/cita_vm_helper.rs @@ -0,0 +1,85 @@ +// Copyright Rivtower Technologies LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::data_provider::{BlockDataProvider, DataProvider, Store as VMSubState}; +use cita_trie::DB; +use cita_vm::{ + evm::{self, InterpreterConf, InterpreterParams}, + native, + state::State, + Error as VMError, +}; +use std::cell::RefCell; +use std::sync::Arc; + +/// Function call_pure enters into the specific contract with no check or checkpoints. +pub fn call_pure( + block_provider: Arc, + state_provider: Arc>>, + store: Arc>, + request: &InterpreterParams, +) -> Result { + let evm_context = store.borrow().evm_context.clone(); + let evm_cfg = store.borrow().evm_cfg.clone(); + let evm_params = request.clone(); + let evm_data_provider = DataProvider::new( + block_provider.clone(), + state_provider.clone(), + store.clone(), + ); + // Transfer value + if !request.disable_transfer_value { + state_provider.borrow_mut().transfer_balance( + &request.sender, + &request.receiver, + request.value, + )?; + } + + // Execute pre-compiled contracts. + if native::contains(&request.contract.code_address) { + let c = native::get(request.contract.code_address); + let gas = c.required_gas(&request.input); + if request.gas_limit < gas { + return Err(VMError::Evm(evm::Error::OutOfGas)); + } + let r = c.run(&request.input); + match r { + Ok(ok) => { + return Ok(evm::InterpreterResult::Normal( + ok, + request.gas_limit - gas, + vec![], + )); + } + Err(e) => return Err(e), + } + } + + // Run + let mut evm_it = evm::Interpreter::new( + evm_context, + evm_cfg, + Box::new(evm_data_provider), + evm_params, + ); + Ok(evm_it.run()?) +} + +/// Returns the default interpreter configs for Constantinople. +pub fn get_interpreter_conf() -> InterpreterConf { + let mut evm_cfg = InterpreterConf::default(); + evm_cfg.eip1283 = false; + evm_cfg +} diff --git a/cita-executor/core/src/contracts/mod.rs b/cita-executor/core/src/contracts/mod.rs index 87e84434b..b1ffaa037 100644 --- a/cita-executor/core/src/contracts/mod.rs +++ b/cita-executor/core/src/contracts/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/native/crosschain_verify.rs b/cita-executor/core/src/contracts/native/crosschain_verify.rs index c63fe5aad..f24b651c8 100644 --- a/cita-executor/core/src/contracts/native/crosschain_verify.rs +++ b/cita-executor/core/src/contracts/native/crosschain_verify.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -51,27 +51,23 @@ impl Contract for CrossChainVerify { &mut self, params: &VmExecParams, _context: &Context, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - if let Some(ref data) = params.data { - method_tools::extract_to_u32(&data[..]).and_then(|signature| match signature { - sig if sig == *VERIFY_TRANSACTION_FUNC => { - self.verify_transaction(params, data_provider) - } - sig if sig == *VERIFY_STATE_FUNC => self.verify_state(params, data_provider), - sig if sig == *VERIFY_BLOCK_HEADER_FUNC => { - self.verify_block_header(params, data_provider) - } - sig if sig == *GET_EXPECTED_BLOCK_NUMBER_FUNC => { - self.get_expected_block_number(params, data_provider) - } - _ => Err(NativeError::Internal("out of gas".to_string())), - }) - } else { - Err(NativeError::Internal("out of gas".to_string())) - } + method_tools::extract_to_u32(¶ms.data[..]).and_then(|signature| match signature { + sig if sig == *VERIFY_TRANSACTION_FUNC => { + self.verify_transaction(params, data_provider) + } + sig if sig == *VERIFY_STATE_FUNC => self.verify_state(params, data_provider), + sig if sig == *VERIFY_BLOCK_HEADER_FUNC => { + self.verify_block_header(params, data_provider) + } + sig if sig == *GET_EXPECTED_BLOCK_NUMBER_FUNC => { + self.get_expected_block_number(params, data_provider) + } + _ => Err(NativeError::Internal("out of gas".to_string())), + }) } - fn create(&self) -> Box { + fn create(&self) -> Box { Box::new(CrossChainVerify::default()) } } @@ -90,19 +86,15 @@ impl CrossChainVerify { fn verify_transaction( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let gas_cost = U256::from(10000); + let gas_cost = 10000; if params.gas < gas_cost { return Err(NativeError::Internal("out of gas".to_string())); } let gas_left = params.gas - gas_cost; - if params.data.is_none() { - return Err(NativeError::Internal("no data".to_string())); - } - - let data = params.data.to_owned().unwrap(); + let data = params.data.clone(); trace!("data = {:?}", data); let tokens = vec![ ethabi::ParamType::Address, @@ -160,7 +152,8 @@ impl CrossChainVerify { let relay_info = relay_info.unwrap(); trace!("relay_info {:?}", proof_data); - let ret = ChainManagement::ext_chain_id(data_provider, &gas_left, ¶ms.sender); + let ret = + ChainManagement::ext_chain_id(data_provider, &U256::from(gas_left), ¶ms.sender); if ret.is_none() { return Err(NativeError::Internal("get chain id failed".to_owned())); } @@ -203,7 +196,7 @@ impl CrossChainVerify { fn verify_state( &mut self, _params: &VmExecParams, - _data_provider: &mut DataProvider, + _data_provider: &mut dyn DataProvider, ) -> Result { unimplemented!() // let gas_cost = U256::from(10000); @@ -309,19 +302,15 @@ impl CrossChainVerify { fn verify_block_header( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let gas_cost = U256::from(10000); + let gas_cost = 10000; if params.gas < gas_cost { return Err(NativeError::Internal("out of gas".to_string())); } let mut gas_left = params.gas - gas_cost; - if params.data.is_none() { - return Err(NativeError::Internal("no data".to_string())); - } - - let data = params.data.to_owned().unwrap(); + let data = params.data.clone(); trace!("data = {:?}", data); let tokens = vec![ethabi::ParamType::Uint(32), ethabi::ParamType::Bytes]; @@ -346,11 +335,9 @@ impl CrossChainVerify { trace!("data = {:?}", block_header_curr_bytes); let block_header_curr = Header::from_bytes(&block_header_curr_bytes); - let block_header_prev_bytes: Vec = self.block_headers.get_bytes( - data_provider, - ¶ms.code_address.unwrap(), - &chain_id, - )?; + let block_header_prev_bytes: Vec = + self.block_headers + .get_bytes(data_provider, ¶ms.code_address, &chain_id)?; let verify_result = if block_header_prev_bytes.is_empty() { trace!("sync first block header"); @@ -360,7 +347,7 @@ impl CrossChainVerify { let ret = ChainManagement::ext_authorities( data_provider, - &gas_left, + &U256::from(gas_left), ¶ms.sender, chain_id, ); @@ -368,7 +355,7 @@ impl CrossChainVerify { return Err(NativeError::Internal("get authorities failed".to_owned())); } let (gas_left_new, authorities) = ret.unwrap(); - gas_left = gas_left_new; + gas_left = gas_left_new.as_u64(); block_header_prev.verify_next(&block_header_curr, &authorities[..]) }; @@ -377,7 +364,7 @@ impl CrossChainVerify { trace!("store the {} block header", block_header_curr.number()); self.block_headers.set_bytes( data_provider, - ¶ms.code_address.unwrap(), + ¶ms.code_address, &chain_id, &block_header_curr_bytes, )?; @@ -388,7 +375,7 @@ impl CrossChainVerify { ); self.state_roots.get_array(&chain_id).unwrap().set( data_provider, - ¶ms.code_address.unwrap(), + ¶ms.code_address, block_header_curr.number(), &U256::from(block_header_curr.state_root()), )?; @@ -401,7 +388,7 @@ impl CrossChainVerify { self.output = result; Ok(InterpreterResult::Normal( self.output.clone(), - gas_left.low_u64(), + gas_left, vec![], )) } @@ -409,19 +396,15 @@ impl CrossChainVerify { fn get_expected_block_number( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let gas_cost = U256::from(10000); + let gas_cost = 10000; if params.gas < gas_cost { return Err(NativeError::Internal("out of gas".to_string())); } let gas_left = params.gas - gas_cost; - if params.data.is_none() { - return Err(NativeError::Internal("no data".to_string())); - } - - let data = params.data.to_owned().unwrap(); + let data = params.data.clone(); trace!("data = {:?}", data); let tokens = vec![ethabi::ParamType::Uint(32)]; @@ -439,11 +422,9 @@ impl CrossChainVerify { let chain_id = U256::from_big_endian(&result.unwrap()); trace!("chain_id = {}", chain_id); - let block_header_bytes: Vec = self.block_headers.get_bytes( - data_provider, - ¶ms.code_address.unwrap(), - &chain_id, - )?; + let block_header_bytes: Vec = + self.block_headers + .get_bytes(data_provider, ¶ms.code_address, &chain_id)?; let block_number = if block_header_bytes.is_empty() { 0 @@ -460,7 +441,7 @@ impl CrossChainVerify { self.output = result; Ok(InterpreterResult::Normal( self.output.clone(), - gas_left.low_u64(), + gas_left, vec![], )) } diff --git a/cita-executor/core/src/contracts/native/factory.rs b/cita-executor/core/src/contracts/native/factory.rs index 9dc28c588..1497d86c9 100644 --- a/cita-executor/core/src/contracts/native/factory.rs +++ b/cita-executor/core/src/contracts/native/factory.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,21 +26,21 @@ use cita_vm::evm::InterpreterResult; pub type Signature = u32; pub trait ContractClone { - fn clone_box(&self) -> Box; + fn clone_box(&self) -> Box; } impl ContractClone for T where T: 'static + Contract + Clone, { - fn clone_box(&self) -> Box { + fn clone_box(&self) -> Box { Box::new(self.clone()) } } // We can now implement Clone manually by forwarding to clone_box. -impl Clone for Box { - fn clone(&self) -> Box { +impl Clone for Box { + fn clone(&self) -> Box { self.clone_box() } } @@ -51,26 +51,26 @@ pub trait Contract: Sync + Send + ContractClone { &mut self, params: &VmExecParams, context: &Context, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result; - fn create(&self) -> Box; + fn create(&self) -> Box; } #[derive(Clone)] pub struct Factory { - contracts: HashMap>, + contracts: HashMap>, } impl Factory { - pub fn new_contract(&self, address: Address) -> Option> { + pub fn new_contract(&self, address: Address) -> Option> { if let Some(contract) = self.contracts.get(&address) { Some(contract.create()) } else { None } } - pub fn register(&mut self, address: Address, contract: Box) { + pub fn register(&mut self, address: Address, contract: Box) { self.contracts.insert(address, contract); } pub fn unregister(&mut self, address: Address) { diff --git a/cita-executor/core/src/contracts/native/mod.rs b/cita-executor/core/src/contracts/native/mod.rs index 480a6df68..1c2f16824 100644 --- a/cita-executor/core/src/contracts/native/mod.rs +++ b/cita-executor/core/src/contracts/native/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/native/simple_storage.rs b/cita-executor/core/src/contracts/native/simple_storage.rs index 20d71b90f..5c29581d8 100644 --- a/cita-executor/core/src/contracts/native/simple_storage.rs +++ b/cita-executor/core/src/contracts/native/simple_storage.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -44,26 +44,22 @@ impl Contract for SimpleStorage { &mut self, params: &VmExecParams, _context: &Context, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - if let Some(ref data) = params.data { - method_tools::extract_to_u32(&data[..]).and_then(|signature| match signature { - 0 => self.init(params, data_provider), - 0xaa91543e => self.uint_set(params, data_provider), - 0x832b4580 => self.uint_get(params, data_provider), - 0xc9615770 => self.string_set(params, data_provider), - 0xe3135d14 => self.string_get(params, data_provider), - 0x118b229c => self.array_set(params, data_provider), - 0x180a4bbf => self.array_get(params, data_provider), - 0xaaf27175 => self.map_set(params, data_provider), - 0xc567dff6 => self.map_get(params, data_provider), - _ => Err(NativeError::Internal("out of gas".to_string())), - }) - } else { - Err(NativeError::Internal("out of gas".to_string())) - } + method_tools::extract_to_u32(¶ms.data[..]).and_then(|signature| match signature { + 0 => self.init(params, data_provider), + 0xaa91543e => self.uint_set(params, data_provider), + 0x832b4580 => self.uint_get(params, data_provider), + 0xc9615770 => self.string_set(params, data_provider), + 0xe3135d14 => self.string_get(params, data_provider), + 0x118b229c => self.array_set(params, data_provider), + 0x180a4bbf => self.array_get(params, data_provider), + 0xaaf27175 => self.map_set(params, data_provider), + 0xc567dff6 => self.map_get(params, data_provider), + _ => Err(NativeError::Internal("out of gas".to_string())), + }) } - fn create(&self) -> Box { + fn create(&self) -> Box { Box::new(SimpleStorage::default()) } } @@ -84,7 +80,7 @@ impl SimpleStorage { fn init( &mut self, _params: &VmExecParams, - _ext: &mut DataProvider, + _ext: &mut dyn DataProvider, ) -> Result { Ok(InterpreterResult::Normal(vec![], 100, vec![])) } @@ -93,29 +89,22 @@ impl SimpleStorage { fn uint_set( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let value = U256::from( - params - .data - .to_owned() - .expect("invalid data") - .get(4..36) - .expect("no enough data"), - ); + let value = U256::from(params.data.get(4..36).expect("no enough data")); self.uint_value - .set(data_provider, ¶ms.code_address.unwrap(), value)?; + .set(data_provider, ¶ms.code_address, value)?; Ok(InterpreterResult::Normal(vec![], 100, vec![])) } fn uint_get( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { self.output.resize(32, 0); self.uint_value - .get(data_provider, ¶ms.code_address.unwrap())? + .get(data_provider, ¶ms.code_address)? .to_big_endian(self.output.as_mut_slice()); Ok(InterpreterResult::Normal(self.output.clone(), 100, vec![])) } @@ -124,9 +113,9 @@ impl SimpleStorage { fn string_set( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let data = params.data.to_owned().expect("invalid data"); + let data = params.data.to_owned(); let index = U256::from(data.get(4..36).expect("no enough data")).low_u64() as usize + 4; let length = U256::from(data.get(index..(index + 32)).expect("no enough data")).low_u64() as usize; @@ -137,19 +126,19 @@ impl SimpleStorage { .unwrap(); self.string_value - .set_bytes(data_provider, ¶ms.code_address.unwrap(), &value)?; + .set_bytes(data_provider, ¶ms.code_address, &value)?; Ok(InterpreterResult::Normal(vec![], 100, vec![])) } fn string_get( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { self.output.resize(0, 0); let str = self .string_value - .get_bytes::(data_provider, ¶ms.code_address.unwrap())?; + .get_bytes::(data_provider, ¶ms.code_address)?; for i in U256::from(32).0.iter().rev() { serialize_into::<_, _, _, BigEndian>(&mut self.output, &i, Infinite) .expect("failed to serialize u64"); @@ -173,28 +162,28 @@ impl SimpleStorage { fn array_set( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let data = params.data.to_owned().expect("invalid data"); + let data = params.data.to_owned(); let mut pilot = 4; let index = U256::from(data.get(pilot..pilot + 32).expect("no enough data")).low_u64(); pilot += 32; let value = U256::from(data.get(pilot..pilot + 32).expect("no enough data")); self.array_value - .set(data_provider, ¶ms.code_address.unwrap(), index, &value)?; + .set(data_provider, ¶ms.code_address, index, &value)?; Ok(InterpreterResult::Normal(vec![], 100, vec![])) } fn array_get( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let data = params.data.to_owned().expect("invalid data"); + let data = params.data.to_owned(); let index = U256::from(data.get(4..4 + 32).expect("no enough data")).low_u64(); for i in self .array_value - .get(data_provider, ¶ms.code_address.unwrap(), index)? + .get(data_provider, ¶ms.code_address, index)? .0 .iter() .rev() @@ -209,28 +198,28 @@ impl SimpleStorage { fn map_set( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let data = params.data.to_owned().expect("invalid data"); + let data = params.data.to_owned(); let mut pilot = 4; let key = U256::from(data.get(pilot..pilot + 32).expect("no enough data")); pilot += 32; let value = U256::from(data.get(pilot..pilot + 32).expect("no enough data")); self.map_value - .set(data_provider, ¶ms.code_address.unwrap(), &key, value)?; + .set(data_provider, ¶ms.code_address, &key, value)?; Ok(InterpreterResult::Normal(vec![], 100, vec![])) } fn map_get( &mut self, params: &VmExecParams, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, ) -> Result { - let data = params.data.to_owned().expect("invalid data"); + let data = params.data.to_owned(); let key = U256::from(data.get(4..4 + 32).expect("no enough data")); for i in self .map_value - .get(data_provider, ¶ms.code_address.unwrap(), &key)? + .get(data_provider, ¶ms.code_address, &key)? .0 .iter() .rev() @@ -259,7 +248,7 @@ fn test_native_contract() { let value = U256::from(0x1234); { let mut params = VmExecParams::default(); - params.code_address = Some(Address::from("0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523")); + params.code_address = Address::from("0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523"); let mut input = Vec::new(); let index = 0xaa91543eu32; serialize_into::<_, _, _, BigEndian>(&mut input, &index, Infinite) @@ -268,7 +257,7 @@ fn test_native_contract() { serialize_into::<_, _, _, BigEndian>(&mut input, &i, Infinite) .expect("failed to serialize u64"); } - params.data = Some(input); + params.data = input; let mut contract = factory.new_contract(native_addr).unwrap(); let _output = contract .exec(¶ms, &context, &mut data_provider) @@ -277,11 +266,11 @@ fn test_native_contract() { { let mut input = Vec::new(); let mut params = VmExecParams::default(); - params.code_address = Some(Address::from("0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523")); + params.code_address = Address::from("0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523"); let index = 0x832b4580u32; serialize_into::<_, _, _, BigEndian>(&mut input, &index, Infinite) .expect("failed to serialize u32"); - params.data = Some(input); + params.data = input; let mut contract = factory.new_contract(native_addr).unwrap(); match contract.exec(¶ms, &context, &mut data_provider) { diff --git a/cita-executor/core/src/contracts/native/zk_privacy.md b/cita-executor/core/src/contracts/native/zk_privacy.md index 9af0654e6..39c31da79 100644 --- a/cita-executor/core/src/contracts/native/zk_privacy.md +++ b/cita-executor/core/src/contracts/native/zk_privacy.md @@ -14,4 +14,4 @@ cargo build --release --features "privatetx" ``` *** ### 使用说明 -[zktx_example](https://github.com/cryptape/zktx_example) +[zktx_example](https://github.com/citahub/zktx_example) diff --git a/cita-executor/core/src/contracts/native/zk_privacy.rs b/cita-executor/core/src/contracts/native/zk_privacy.rs index 0e09525b5..0ffceb458 100644 --- a/cita-executor/core/src/contracts/native/zk_privacy.rs +++ b/cita-executor/core/src/contracts/native/zk_privacy.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/admin.rs b/cita-executor/core/src/contracts/solc/admin.rs index 19f1b319e..7fcad78bb 100644 --- a/cita-executor/core/src/contracts/solc/admin.rs +++ b/cita-executor/core/src/contracts/solc/admin.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/chain_manager.rs b/cita-executor/core/src/contracts/solc/chain_manager.rs index d0f6e0288..d42ed007a 100644 --- a/cita-executor/core/src/contracts/solc/chain_manager.rs +++ b/cita-executor/core/src/contracts/solc/chain_manager.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ pub struct ChainManagement; impl ChainManagement { pub fn ext_chain_id( - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, gas: &U256, sender: &Address, ) -> Option<(U256, U256)> { @@ -55,7 +55,7 @@ impl ChainManagement { } pub fn ext_authorities( - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, gas: &U256, sender: &Address, chain_id: U256, diff --git a/cita-executor/core/src/contracts/solc/emergency_intervention.rs b/cita-executor/core/src/contracts/solc/emergency_intervention.rs index d189d8bc7..8550ea12e 100644 --- a/cita-executor/core/src/contracts/solc/emergency_intervention.rs +++ b/cita-executor/core/src/contracts/solc/emergency_intervention.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/mod.rs b/cita-executor/core/src/contracts/solc/mod.rs index a8eaf6e41..939608991 100644 --- a/cita-executor/core/src/contracts/solc/mod.rs +++ b/cita-executor/core/src/contracts/solc/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/node_manager.rs b/cita-executor/core/src/contracts/solc/node_manager.rs index cd6d554ac..256bcba41 100644 --- a/cita-executor/core/src/contracts/solc/node_manager.rs +++ b/cita-executor/core/src/contracts/solc/node_manager.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/permission_management.rs b/cita-executor/core/src/contracts/solc/permission_management.rs index 4901097cd..8438b4da3 100644 --- a/cita-executor/core/src/contracts/solc/permission_management.rs +++ b/cita-executor/core/src/contracts/solc/permission_management.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/price_manager.rs b/cita-executor/core/src/contracts/solc/price_manager.rs index 07b6f86ba..accd1d5f9 100644 --- a/cita-executor/core/src/contracts/solc/price_manager.rs +++ b/cita-executor/core/src/contracts/solc/price_manager.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/quota_manager.rs b/cita-executor/core/src/contracts/solc/quota_manager.rs index 3dd6a47cb..975fc198c 100644 --- a/cita-executor/core/src/contracts/solc/quota_manager.rs +++ b/cita-executor/core/src/contracts/solc/quota_manager.rs @@ -1,4 +1,4 @@ -// CopyrightTechnologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/sys_config.rs b/cita-executor/core/src/contracts/solc/sys_config.rs index d61b14800..48e22d976 100644 --- a/cita-executor/core/src/contracts/solc/sys_config.rs +++ b/cita-executor/core/src/contracts/solc/sys_config.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -436,7 +436,7 @@ mod tests { TokenInfo { name: "CITA Test Token".to_owned(), symbol: "CTT".to_owned(), - avatar: "https://cdn.cryptape.com/icon_cita.png".to_owned() + avatar: "https://cdn.citahub.com/icon_cita.png".to_owned() } ); diff --git a/cita-executor/core/src/contracts/solc/user_management.rs b/cita-executor/core/src/contracts/solc/user_management.rs index 8a9d6a982..6e7851a54 100644 --- a/cita-executor/core/src/contracts/solc/user_management.rs +++ b/cita-executor/core/src/contracts/solc/user_management.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/solc/version_management.rs b/cita-executor/core/src/contracts/solc/version_management.rs index 6881cbabd..883214d92 100644 --- a/cita-executor/core/src/contracts/solc/version_management.rs +++ b/cita-executor/core/src/contracts/solc/version_management.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/tools/decode.rs b/cita-executor/core/src/contracts/tools/decode.rs index 6b16ed701..d1fb3e700 100644 --- a/cita-executor/core/src/contracts/tools/decode.rs +++ b/cita-executor/core/src/contracts/tools/decode.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/tools/method.rs b/cita-executor/core/src/contracts/tools/method.rs index d3e152cef..75fba5b5b 100644 --- a/cita-executor/core/src/contracts/tools/method.rs +++ b/cita-executor/core/src/contracts/tools/method.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/contracts/tools/mod.rs b/cita-executor/core/src/contracts/tools/mod.rs index 01738b13a..179b087c8 100644 --- a/cita-executor/core/src/contracts/tools/mod.rs +++ b/cita-executor/core/src/contracts/tools/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/data_provider.rs b/cita-executor/core/src/data_provider.rs new file mode 100644 index 000000000..58dfa8c7e --- /dev/null +++ b/cita-executor/core/src/data_provider.rs @@ -0,0 +1,310 @@ +// Copyright Rivtower Technologies LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::cita_executive::{call as ext_call, create as ext_create, CreateKind}; +use cita_trie::DB; +use cita_types::{Address, H256, U256}; +use cita_vm::evm; +use cita_vm::state::{State, StateObjectInfo}; +use hashbrown::{HashMap, HashSet}; +use hasher::Hasher; +use std::cell::RefCell; +use std::sync::Arc; + +/// BlockDataProvider provides functions to get block's hash from chain. +/// +/// Block data(only hash) are required to cita-vm from externalize database. +pub trait BlockDataProvider: Send + Sync { + /// Function get_block_hash returns the block_hash of the specific block. + fn get_block_hash(&self, number: &U256) -> H256; +} + +/// BlockDataProviderMock is a mock for BlockDataProvider. We could use it in +/// tests or demos. +#[derive(Default)] +pub struct BlockDataProviderMock { + data: HashMap, +} + +impl BlockDataProviderMock { + /// Set blockhash for a specific block. + pub fn set(&mut self, number: U256, hash: H256) { + self.data.insert(number, hash); + } +} + +/// Impl. +impl BlockDataProvider for BlockDataProviderMock { + fn get_block_hash(&self, number: &U256) -> H256 { + *self.data.get(number).unwrap_or(&H256::zero()) + } +} + +/// Store storages shared datas. +#[derive(Clone, Default, Debug)] +pub struct Store { + pub refund: HashMap, // For record refunds + pub origin: HashMap>, // For record origin value + pub selfdestruct: HashSet
, // For self destruct + // Field inused used for garbage collection. + // + // Test: + // ./tests/jsondata/GeneralStateTests/stSStoreTest/sstore_combinations_initial0.json + // ./tests/jsondata/GeneralStateTests/stSStoreTest/sstore_combinations_initial1.json + // ./tests/jsondata/GeneralStateTests/stSStoreTest/sstore_combinations_initial2.json + pub inused: HashSet
, + pub evm_context: evm::Context, + pub evm_cfg: evm::InterpreterConf, +} + +impl Store { + /// Merge with sub store. + pub fn merge(&mut self, other: Arc>) { + self.refund = other.borrow().refund.clone(); + self.origin = other.borrow().origin.clone(); + self.selfdestruct = other.borrow().selfdestruct.clone(); + self.inused = other.borrow().inused.clone(); + } + + /// When a account has been read or write, record a log + /// to prove that it has dose. + pub fn used(&mut self, address: Address) { + if address == Address::zero() { + return; + } + self.inused.insert(address); + } +} + +/// An implemention for evm::DataProvider +pub struct DataProvider { + pub block_provider: Arc, + pub state_provider: Arc>>, + pub store: Arc>, +} + +impl DataProvider { + /// Create a new instance. It's obvious. + pub fn new( + b: Arc, + s: Arc>>, + store: Arc>, + ) -> Self { + DataProvider { + block_provider: b, + state_provider: s, + store, + } + } +} + +impl evm::DataProvider for DataProvider { + fn get_balance(&self, address: &Address) -> U256 { + self.state_provider + .borrow_mut() + .balance(address) + .unwrap_or_else(|_| U256::zero()) + } + + fn add_refund(&mut self, address: &Address, n: u64) { + self.store + .borrow_mut() + .refund + .entry(*address) + .and_modify(|v| *v += n) + .or_insert(n); + } + + fn sub_refund(&mut self, address: &Address, n: u64) { + debug!("ext.sub_refund {:?} {}", address, n); + self.store + .borrow_mut() + .refund + .entry(*address) + .and_modify(|v| *v -= n) + .or_insert(n); + } + + fn get_refund(&self, address: &Address) -> u64 { + self.store + .borrow_mut() + .refund + .get(address) + .map_or(0, |v| *v) + } + + fn get_code_size(&self, address: &Address) -> u64 { + self.state_provider + .borrow_mut() + .code_size(address) + .unwrap_or(0) as u64 + } + + fn get_code(&self, address: &Address) -> Vec { + self.state_provider + .borrow_mut() + .code(address) + .unwrap_or_else(|_| vec![]) + } + + fn get_code_hash(&self, address: &Address) -> H256 { + self.state_provider + .borrow_mut() + .code_hash(address) + .unwrap_or_else(|_| H256::zero()) + } + + fn get_block_hash(&self, number: &U256) -> H256 { + self.block_provider.get_block_hash(number) + } + + fn get_storage(&self, address: &Address, key: &H256) -> H256 { + self.state_provider + .borrow_mut() + .get_storage(address, key) + .unwrap_or_else(|_| H256::zero()) + } + + fn set_storage(&mut self, address: &Address, key: H256, value: H256) { + let a = self.get_storage(address, &key); + self.store + .borrow_mut() + .origin + .entry(*address) + .or_insert_with(HashMap::new) + .entry(key) + .or_insert(a); + if let Err(e) = self + .state_provider + .borrow_mut() + .set_storage(address, key, value) + { + panic!("{}", e); + } + } + + fn get_storage_origin(&self, address: &Address, key: &H256) -> H256 { + //self.store.borrow_mut().used(address.clone()); + match self.store.borrow_mut().origin.get(address) { + Some(account) => match account.get(key) { + Some(val) => *val, + None => self.get_storage(address, key), + }, + None => self.get_storage(address, key), + } + } + + fn set_storage_origin(&mut self, _address: &Address, _key: H256, _value: H256) { + unimplemented!() + } + + fn selfdestruct(&mut self, address: &Address, refund_to: &Address) -> bool { + if self.store.borrow_mut().selfdestruct.contains(address) { + return false; + } + //self.store.borrow_mut().used(refund_to.clone()); + self.store.borrow_mut().selfdestruct.insert(address.clone()); + let b = self.get_balance(address); + + if address != refund_to { + self.state_provider + .borrow_mut() + .transfer_balance(address, refund_to, b) + .unwrap(); + } else { + // Must ensure that the balance of address which is suicide is zero. + self.state_provider + .borrow_mut() + .sub_balance(address, b) + .unwrap(); + } + true + } + + fn sha3(&self, data: &[u8]) -> H256 { + From::from(&hasher::HasherKeccak::new().digest(data)[..]) + } + + fn is_empty(&self, address: &Address) -> bool { + self.state_provider + .borrow_mut() + .is_empty(address) + .unwrap_or(false) + } + + fn exist(&self, address: &Address) -> bool { + self.state_provider + .borrow_mut() + .exist(address) + .unwrap_or(false) + } + + fn call( + &self, + opcode: evm::OpCode, + params: evm::InterpreterParams, + ) -> (Result) { + match opcode { + evm::OpCode::CALL + | evm::OpCode::CALLCODE + | evm::OpCode::DELEGATECALL + | evm::OpCode::STATICCALL => { + let r = ext_call( + self.block_provider.clone(), + self.state_provider.clone(), + self.store.clone(), + ¶ms, + ); + debug!("ext.call.result = {:?}", r); + r.or(Err(evm::Error::CallError)) + } + evm::OpCode::CREATE | evm::OpCode::CREATE2 => { + let mut request = params.clone(); + request.nonce = self + .state_provider + .borrow_mut() + .nonce(&request.sender) + .or(Err(evm::Error::CallError))?; + // Must inc nonce for sender + // See: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md + self.state_provider + .borrow_mut() + .inc_nonce(&request.sender) + .or(Err(evm::Error::CallError))?; + + let r = match opcode { + evm::OpCode::CREATE => ext_create( + self.block_provider.clone(), + self.state_provider.clone(), + self.store.clone(), + &request, + CreateKind::FromAddressAndNonce, + ), + evm::OpCode::CREATE2 => ext_create( + self.block_provider.clone(), + self.state_provider.clone(), + self.store.clone(), + &request, + CreateKind::FromSaltAndCodeHash, + ), + _ => unimplemented!(), + } + .or(Err(evm::Error::CallError)); + debug!("ext.create.result = {:?}", r); + r + } + _ => unimplemented!(), + } + } +} diff --git a/cita-executor/core/src/exception.rs b/cita-executor/core/src/exception.rs index 84942373d..edb1d5bd2 100644 --- a/cita-executor/core/src/exception.rs +++ b/cita-executor/core/src/exception.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/lib.rs b/cita-executor/core/src/lib.rs index 98dd9cb0e..837e4a135 100644 --- a/cita-executor/core/src/lib.rs +++ b/cita-executor/core/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +37,9 @@ pub extern crate common_types as types; pub extern crate core; pub mod cita_executive; +pub mod cita_vm_helper; pub mod contracts; +pub mod data_provider; pub mod libexecutor; pub mod storage; pub mod tx_gas_schedule; diff --git a/cita-executor/core/src/libexecutor/auto_exec.rs b/cita-executor/core/src/libexecutor/auto_exec.rs index 0911cfb7e..2a5b2f897 100644 --- a/cita-executor/core/src/libexecutor/auto_exec.rs +++ b/cita-executor/core/src/libexecutor/auto_exec.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,22 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -// use crate::contracts::native::factory::Factory as NativeFactory; +use crate::cita_executive::{ + build_evm_context, build_vm_exec_params, call as vm_call, ExecutiveParams, +}; +use crate::cita_vm_helper::get_interpreter_conf; use crate::contracts::tools::method as method_tools; -// use crate::engines::NullEngine; +use crate::data_provider::Store as VMSubState; use crate::libexecutor::block::EVMBlockDataProvider; -use crate::types::reserved_addresses; -use cita_types::{Address, H160, U256}; -// use evm::{Factory, VMType}; -use std::str::FromStr; -// use util::BytesRef; -use crate::cita_executive::{build_evm_config, build_evm_context}; use crate::libexecutor::executor::CitaTrieDB; use crate::types::context::Context; +use crate::types::reserved_addresses; +use cita_types::{Address, H160, U256}; use cita_vm::evm::InterpreterResult; use cita_vm::state::State as CitaState; -use cita_vm::Transaction as EVMTransaction; use std::cell::RefCell; +use std::str::FromStr; use std::sync::Arc; const AUTO_EXEC: &[u8] = &*b"autoExec()"; @@ -43,30 +42,29 @@ pub fn auto_exec( context: Context, ) { let hash = &*AUTO_EXEC_HASH; - let evm_transaction = EVMTransaction { - from: Address::from(0x0), - value: U256::from(0), - gas_limit: auto_exec_quota_limit, + let params = ExecutiveParams { + code_address: Some(*AUTO_EXEC_ADDR), + sender: Address::from(0x0), + to_address: Some(*AUTO_EXEC_ADDR), + gas: U256::from(auto_exec_quota_limit), gas_price: U256::from(1), - input: hash.to_vec(), - to: Some(*AUTO_EXEC_ADDR), + value: U256::from(0), nonce: U256::from(0), + data: Some(hash.to_vec()), }; + let block_provider = EVMBlockDataProvider::new(context.clone()); + let vm_exec_params = build_vm_exec_params(¶ms, state.clone()); + let mut sub_state = VMSubState::default(); - let mut evm_config = build_evm_config(auto_exec_quota_limit); - - // Do not check nonce and balance for auto exec - evm_config.check_nonce = false; - evm_config.check_balance = false; - let evm_context = build_evm_context(&context); + sub_state.evm_context = build_evm_context(&context.clone()); + sub_state.evm_cfg = get_interpreter_conf(); + let sub_state = Arc::new(RefCell::new(sub_state)); - let block_provider = EVMBlockDataProvider::new(context.clone()); - match cita_vm::exec( + match vm_call( Arc::new(block_provider), - state, - evm_context, - evm_config, - evm_transaction, + state.clone(), + sub_state.clone(), + &vm_exec_params.into(), ) { Ok(res) => match res { InterpreterResult::Normal(_, _, _) => { diff --git a/cita-executor/core/src/libexecutor/blacklist.rs b/cita-executor/core/src/libexecutor/blacklist.rs index abfcfe0d3..2279b6ec3 100644 --- a/cita-executor/core/src/libexecutor/blacklist.rs +++ b/cita-executor/core/src/libexecutor/blacklist.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/block.rs b/cita-executor/core/src/libexecutor/block.rs index 9a56628a0..0d80470d5 100644 --- a/cita-executor/core/src/libexecutor/block.rs +++ b/cita-executor/core/src/libexecutor/block.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,19 +18,9 @@ use std::collections::HashMap; use std::ops::{Deref, DerefMut}; use std::sync::Arc; -use cita_merklehash; -use cita_types::{Address, Bloom as LogBloom, H256, U256}; -use cita_vm::{ - evm::Error as EVMError, state::State as CitaState, state::StateObjectInfo, BlockDataProvider, - Error as VMError, -}; -use hashable::Hashable; -use libproto::executor::{ExecutedInfo, ReceiptWithOption}; -use rlp::Encodable; - use crate::cita_executive::CitaExecutive; -use crate::contracts::native::factory::Factory as NativeFactory; use crate::core::context::{Context, LastHashes}; +use crate::data_provider::BlockDataProvider; use crate::exception::ExecutedException; use crate::libexecutor::auto_exec::auto_exec; use crate::libexecutor::economical_model::EconomicalModel; @@ -44,6 +34,14 @@ use crate::types::errors::Error; use crate::types::errors::ReceiptError; use crate::types::errors::{AuthenticationError, ExecutionError}; use crate::types::transaction::SignedTransaction; +use cita_merklehash; +use cita_types::{Address, Bloom as LogBloom, H256, U256}; +use cita_vm::{ + evm::Error as EVMError, state::State as CitaState, state::StateObjectInfo, Error as VMError, +}; +use hashable::Hashable; +use libproto::executor::{ExecutedInfo, ReceiptWithOption}; +use rlp::Encodable; lazy_static! { /// Block Reward @@ -159,12 +157,10 @@ impl ExecutedBlock { } } let block_data_provider = EVMBlockDataProvider::new(context.clone()); - let native_factory = NativeFactory::default(); let tx_quota_used = match CitaExecutive::new( Arc::new(block_data_provider), self.state.clone(), - &native_factory, &context, conf.economical_model, ) @@ -199,12 +195,14 @@ impl ExecutedBlock { _ => Some(ReceiptError::Internal), }); - let tx_quota_used = - if receipt_error.is_some() && receipt_error != Some(ReceiptError::Internal) { - t.gas - } else { - ret.quota_used - }; + let tx_quota_used = if receipt_error.is_some() + && receipt_error != Some(ReceiptError::Internal) + && receipt_error != Some(ReceiptError::Reverted) + { + t.gas + } else { + ret.quota_used + }; // Note: quota_used in Receipt is self.current_quota_used, this will be // handled by get_rich_receipt() while getting a single transaction receipt. diff --git a/cita-executor/core/src/libexecutor/call_request.rs b/cita-executor/core/src/libexecutor/call_request.rs index 70de538d0..d175f4143 100644 --- a/cita-executor/core/src/libexecutor/call_request.rs +++ b/cita-executor/core/src/libexecutor/call_request.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/command.rs b/cita-executor/core/src/libexecutor/command.rs index 8d4a7dfc5..ca83e1682 100644 --- a/cita-executor/core/src/libexecutor/command.rs +++ b/cita-executor/core/src/libexecutor/command.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ use super::executor::CitaTrieDB; use super::executor::{make_consensus_config, Executor}; use super::sys_config::GlobalSysConfig; use crate::cita_executive::{CitaExecutive, ExecutedResult as CitaExecuted}; -use crate::contracts::native::factory::Factory as NativeFactory; use crate::contracts::solc::{ sys_config::ChainId, PermissionManagement, SysConfig, VersionManager, }; @@ -28,6 +27,7 @@ use crate::trie_db::TrieDB; use crate::types::block_number::{BlockTag, Tag}; use crate::types::context::Context; use crate::types::errors::CallError; +use crate::types::errors::ExecutionError; use crate::types::transaction::{Action, SignedTransaction, Transaction}; pub use byteorder::{BigEndian, ByteOrder}; use cita_database::RocksDB; @@ -57,6 +57,7 @@ pub enum Command { BalanceAt(Address, BlockTag), NonceAt(Address, BlockTag), ETHCall(CallRequest, BlockTag), + EstimateQuota(CallRequest, BlockTag), SignCall(CallRequest), Call(SignedTransaction, BlockTag), ChainID, @@ -77,6 +78,7 @@ pub enum CommandResp { BalanceAt(Option), NonceAt(Option), ETHCall(Result), + EstimateQuota(Result), SignCall(SignedTransaction), Call(Result), ChainID(Option), @@ -98,6 +100,7 @@ impl fmt::Display for Command { Command::BalanceAt(_, _) => write!(f, "Command::BalanceAt"), Command::NonceAt(_, _) => write!(f, "Command::NonceAt"), Command::ETHCall(_, _) => write!(f, "Command::ETHCall"), + Command::EstimateQuota(_, _) => write!(f, "Command::EstimateQuota"), Command::SignCall(_) => write!(f, "Command::SignCall"), Command::Call(_, _) => write!(f, "Command::Call"), Command::ChainID => write!(f, "Command::ChainID "), @@ -121,6 +124,7 @@ impl fmt::Display for CommandResp { CommandResp::BalanceAt(_) => write!(f, "CommandResp::BalanceAt"), CommandResp::NonceAt(_) => write!(f, "CommandResp::NonceAt"), CommandResp::ETHCall(_) => write!(f, "CommandResp::ETHCall"), + CommandResp::EstimateQuota(_) => write!(f, "CommandResp::EstimateQuota"), CommandResp::SignCall(_) => write!(f, "CommandResp::SignCall"), CommandResp::Call(_) => write!(f, "CommandResp::Call"), CommandResp::ChainID(_) => write!(f, "CommandResp::ChainID "), @@ -143,6 +147,7 @@ pub trait Commander { fn balance_at(&self, address: &Address, block_tag: BlockTag) -> Option; fn nonce_at(&self, address: &Address, block_tag: BlockTag) -> Option; fn eth_call(&self, request: CallRequest, block_tag: BlockTag) -> Result; + fn estimate_quota(&self, request: CallRequest, block_tag: BlockTag) -> Result; fn sign_call(&self, request: CallRequest) -> SignedTransaction; fn call(&self, t: &SignedTransaction, block_tag: BlockTag) -> Result; fn chain_id(&self) -> Option; @@ -176,6 +181,9 @@ impl Commander for Executor { Command::ETHCall(call_request, block_tag) => { CommandResp::ETHCall(self.eth_call(call_request, block_tag)) } + Command::EstimateQuota(call_request, block_tag) => { + CommandResp::EstimateQuota(self.estimate_quota(call_request, block_tag)) + } Command::SignCall(call_request) => CommandResp::SignCall(self.sign_call(call_request)), Command::Call(signed_transaction, block_tag) => { CommandResp::Call(self.call(&signed_transaction, block_tag)) @@ -246,6 +254,121 @@ impl Commander for Executor { .or_else(|e| Err(format!("Call Error {}", e))) } + fn estimate_quota(&self, request: CallRequest, id: BlockTag) -> Result { + // The estimated transaction cost cannot exceed BQL + let max_quota = U256::from(self.sys_config.block_quota_limit); + let precision = U256::from(1024); + + let signed = self.sign_call(request); + let header = self + .block_header(id) + .ok_or_else(|| "Estimate Error CallError::StatePruned".to_owned())?; + let last_hashes = self.build_last_hashes(Some(header.hash().unwrap()), header.number()); + + let context = Context { + block_number: header.number(), + coin_base: *header.proposer(), + timestamp: if self.eth_compatibility { + header.timestamp() / 1000 + } else { + header.timestamp() + }, + difficulty: U256::default(), + last_hashes: ::std::sync::Arc::new(last_hashes), + quota_used: *header.quota_used(), + block_quota_limit: max_quota, + account_quota_limit: u64::max_value().into(), + }; + let block_data_provider = Arc::new(EVMBlockDataProvider::new(context.clone())); + + let mut conf = self.sys_config.block_sys_config.clone(); + conf.exempt_checking(); + let sender = *signed.sender(); + + // Try different quota to run tx. + let exec_tx = |quota| { + let mut tx = signed.as_unsigned().clone(); + tx.gas = quota; + let tx = tx.fake_sign(sender); + + // The same transaction will get different result in different state. + // And the estimate action will change the state, so it should take the most primitive + // state for each estimate. + let state = self.state_at(id).ok_or_else(|| { + ExecutionError::Internal("Estimate Error CallError::StatePruned".to_owned()) + })?; + let state = Arc::new(RefCell::new(state)); + + let clone_conf = conf.clone(); + CitaExecutive::new( + block_data_provider.clone(), + state, + &context.clone(), + clone_conf.economical_model, + ) + .exec(&tx, &clone_conf) + }; + let check_quota = |quota| { + exec_tx(quota).ok().map_or((false, U256::from(0)), |r| { + (r.exception.is_none(), r.quota_used) + }) + }; + + // Try block_quota_limit first + let (run_ok, quota_used) = check_quota(max_quota); + let lower = if !run_ok { + trace!("estimate_quota failed with {}.", max_quota); + return Err(format!( + "Requires quota higher than upper limit({}) or some internal errors", + max_quota + ) + .to_owned()); + } else { + quota_used + }; + + //Try lower (quota_used) + let estimate_quota = &mut [0u8; 32]; + let (run_ok, quota_used) = check_quota(lower); + if run_ok { + quota_used.to_big_endian(estimate_quota); + return Ok(estimate_quota.to_vec()); + } + + // Binary search the point between `lower` and `upper`, with the precision which means + // the estimate quota deviation less than precision. + fn binary_search( + mut lower: U256, + mut upper: U256, + mut check_quota: F, + precision: U256, + ) -> U256 + where + F: FnMut(U256) -> (bool, U256), + { + while upper - lower > precision { + let mid = (lower + upper) / 2; + trace!( + "estimate_quota : lower {} .. mid {} .. upper {}", + lower, + mid, + upper + ); + let (c, _) = check_quota(mid); + if c { + upper = mid; + } else { + lower = mid; + } + } + upper + } + + let quota_used = binary_search(lower, max_quota, check_quota, precision); + quota_used.to_big_endian(estimate_quota); + Ok(estimate_quota.to_vec()) + } + fn sign_call(&self, request: CallRequest) -> SignedTransaction { let from = request.from.unwrap_or_else(Address::zero); Transaction { @@ -290,7 +413,6 @@ impl Commander for Executor { conf.exempt_checking(); let block_data_provider = EVMBlockDataProvider::new(context.clone()); - let native_factory = NativeFactory::default(); let state_root = if let Some(h) = self.block_header(block_tag) { (*h.state_root()) @@ -314,7 +436,6 @@ impl Commander for Executor { CitaExecutive::new( Arc::new(block_data_provider), state, - &native_factory, &context, conf.economical_model, ) @@ -597,6 +718,19 @@ pub fn eth_call( } } +pub fn estimate_quota( + command_req_sender: &Sender, + command_resp_receiver: &Receiver, + call_request: CallRequest, + block_tag: BlockTag, +) -> Result { + let _ = command_req_sender.send(Command::EstimateQuota(call_request, block_tag)); + match command_resp_receiver.recv().unwrap() { + CommandResp::EstimateQuota(r) => r, + _ => unimplemented!(), + } +} + pub fn sign_call( command_req_sender: &Sender, command_resp_receiver: &Receiver, diff --git a/cita-executor/core/src/libexecutor/economical_model.rs b/cita-executor/core/src/libexecutor/economical_model.rs index 08b8c6b66..ca87edfbe 100644 --- a/cita-executor/core/src/libexecutor/economical_model.rs +++ b/cita-executor/core/src/libexecutor/economical_model.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/executor.rs b/cita-executor/core/src/libexecutor/executor.rs index 2d0ea1cb0..f91499e5c 100644 --- a/cita-executor/core/src/libexecutor/executor.rs +++ b/cita-executor/core/src/libexecutor/executor.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ pub type CitaDB = RocksDB; pub struct Executor { pub current_header: RwLock
, pub state_db: Arc, - pub db: Arc, + pub db: Arc, pub sys_config: GlobalSysConfig, pub fsm_req_receiver: Receiver, diff --git a/cita-executor/core/src/libexecutor/fsm.rs b/cita-executor/core/src/libexecutor/fsm.rs index 8ccb4561c..ca3b18b92 100644 --- a/cita-executor/core/src/libexecutor/fsm.rs +++ b/cita-executor/core/src/libexecutor/fsm.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/genesis.rs b/cita-executor/core/src/libexecutor/genesis.rs index 4ba663377..3ff3e328a 100644 --- a/cita-executor/core/src/libexecutor/genesis.rs +++ b/cita-executor/core/src/libexecutor/genesis.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/lru_cache.rs b/cita-executor/core/src/libexecutor/lru_cache.rs index d7aa15bc9..0c9f0cf45 100644 --- a/cita-executor/core/src/libexecutor/lru_cache.rs +++ b/cita-executor/core/src/libexecutor/lru_cache.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/mod.rs b/cita-executor/core/src/libexecutor/mod.rs index 9879c95fa..0035366a9 100644 --- a/cita-executor/core/src/libexecutor/mod.rs +++ b/cita-executor/core/src/libexecutor/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/libexecutor/sys_config.rs b/cita-executor/core/src/libexecutor/sys_config.rs index 40085a31d..08035cdee 100644 --- a/cita-executor/core/src/libexecutor/sys_config.rs +++ b/cita-executor/core/src/libexecutor/sys_config.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/storage.rs b/cita-executor/core/src/storage.rs index 3470536aa..451b9b50a 100644 --- a/cita-executor/core/src/storage.rs +++ b/cita-executor/core/src/storage.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -74,7 +74,7 @@ impl Scalar { // single element pub fn set( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, value: U256, ) -> Result<(), NativeError> { @@ -84,7 +84,7 @@ impl Scalar { pub fn get( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, ) -> Result { let value = data_provider.get_storage(addr, &self.position); @@ -94,7 +94,7 @@ impl Scalar { // bytes & string pub fn set_bytes( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, value: &T, ) -> Result<(), NativeError> @@ -122,7 +122,7 @@ impl Scalar { pub fn get_bytes( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, ) -> Result, NativeError> where @@ -173,7 +173,7 @@ impl Array { pub fn set( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, index: u64, value: &U256, @@ -184,7 +184,7 @@ impl Array { pub fn get( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, index: u64, ) -> Result { @@ -194,7 +194,7 @@ impl Array { pub fn set_bytes( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, index: u64, value: &T, @@ -208,7 +208,7 @@ impl Array { pub fn get_bytes( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, index: u64, ) -> Result, NativeError> @@ -221,7 +221,7 @@ impl Array { pub fn set_len( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, len: u64, ) -> Result<(), NativeError> { @@ -231,7 +231,7 @@ impl Array { pub fn get_len( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, ) -> Result { let len = data_provider.get_storage(addr, &self.position); @@ -269,7 +269,7 @@ impl Map { pub fn set( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, key: &Key, value: U256, @@ -282,7 +282,7 @@ impl Map { pub fn get( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, key: &Key, ) -> Result @@ -294,7 +294,7 @@ impl Map { pub fn set_bytes( self: &Self, - data_provider: &mut DataProvider, + data_provider: &mut dyn DataProvider, addr: &Address, key: &Key, value: &Value, @@ -308,7 +308,7 @@ impl Map { pub fn get_bytes( self: &Self, - data_provider: &DataProvider, + data_provider: &dyn DataProvider, addr: &Address, key: &Key, ) -> Result @@ -578,7 +578,7 @@ mod tests { assert!(map .set(&mut data_provider, &code_address, &key, value) .is_ok()); - assert_eq!(map.get(&data_provider, &code_address, &key).unwrap(), value);; + assert_eq!(map.get(&data_provider, &code_address, &key).unwrap(), value); } #[test] diff --git a/cita-executor/core/src/tests/amend_data_test.rs b/cita-executor/core/src/tests/amend_data_test.rs index b8c1d5acb..62cf24363 100644 --- a/cita-executor/core/src/tests/amend_data_test.rs +++ b/cita-executor/core/src/tests/amend_data_test.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,14 +16,13 @@ use std::cell::RefCell; use std::sync::Arc; use crate::cita_executive::CitaExecutive; -use crate::contracts::native::factory::Factory as NativeFactory; use crate::libexecutor::{economical_model::EconomicalModel, sys_config::BlockSysConfig}; use crate::tests::helpers::get_temp_state; use crate::types::context::Context; use crate::types::transaction::Action; +use crate::data_provider::BlockDataProviderMock; use cita_types::{Address, H256, U256}; -use cita_vm::BlockDataProviderMock; use core::transaction::{SignedTransaction, Transaction}; use types::Bytes; @@ -50,13 +49,11 @@ fn build_transaction( #[test] fn test_amend_tool() { let state = get_temp_state(); - let native_factory = NativeFactory::default(); let context = Context::default(); let mut e = CitaExecutive::new( Arc::new(BlockDataProviderMock::default()), Arc::new(RefCell::new(state)), - &native_factory, &context, EconomicalModel::default(), ); diff --git a/cita-executor/core/src/tests/exemock.rs b/cita-executor/core/src/tests/exemock.rs index 93a46c8a3..e1698bfb8 100644 --- a/cita-executor/core/src/tests/exemock.rs +++ b/cita-executor/core/src/tests/exemock.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/tests/helpers.rs b/cita-executor/core/src/tests/helpers.rs index 32da9e349..9c10cc49f 100644 --- a/cita-executor/core/src/tests/helpers.rs +++ b/cita-executor/core/src/tests/helpers.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/tests/mod.rs b/cita-executor/core/src/tests/mod.rs index 4a6e64ccc..8826a1c41 100644 --- a/cita-executor/core/src/tests/mod.rs +++ b/cita-executor/core/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/trie_db.rs b/cita-executor/core/src/trie_db.rs index 7a86fbb18..5cc068fc3 100644 --- a/cita-executor/core/src/trie_db.rs +++ b/cita-executor/core/src/trie_db.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/core/src/tx_gas_schedule.rs b/cita-executor/core/src/tx_gas_schedule.rs index 43babe46d..d586dbde8 100644 --- a/cita-executor/core/src/tx_gas_schedule.rs +++ b/cita-executor/core/src/tx_gas_schedule.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/src/backlogs.rs b/cita-executor/src/backlogs.rs index 34159eed0..91fa0b4c0 100644 --- a/cita-executor/src/backlogs.rs +++ b/cita-executor/src/backlogs.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/src/main.rs b/cita-executor/src/main.rs index 960a3a693..c08c2a90c 100644 --- a/cita-executor/src/main.rs +++ b/cita-executor/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -142,7 +142,7 @@ fn main() { let matches = App::new("executor") .version(get_build_info_str(true)) .long_version(get_build_info_str(false)) - .author("Cryptape") + .author("Rivtower") .about("CITA Block Chain Node powered by Rust") .args_from_usage( "-c, --config=[FILE] 'Sets a switch config file' diff --git a/cita-executor/src/postman.rs b/cita-executor/src/postman.rs index 922741567..90f4a4024 100644 --- a/cita-executor/src/postman.rs +++ b/cita-executor/src/postman.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ use crate::core::contracts::solc::sys_config::ChainId; use crate::core::libexecutor::block::{ClosedBlock, OpenBlock}; use crate::core::libexecutor::call_request::CallRequest; use crate::core::tx_gas_schedule::TxGasSchedule; -use crate::types::block_number::BlockTag; +use crate::types::block_number::{BlockTag, Tag}; use crate::types::errors::ReceiptError; use cita_types::U256; use cita_types::{Address, H256}; @@ -122,6 +122,8 @@ impl Postman { routing_key!(Executor >> ExecutedResult).into(), msg.try_into().unwrap(), ); + + self.pub_init_black_list(); } // make sure executor exit also @@ -359,6 +361,21 @@ impl Postman { } } + /// First notify jsonrpc clear blacklist + fn pub_init_black_list(&self) { + let mut init_list = Vec::new(); + init_list.push(Address::default()); + let black_list = BlackList::new() + .set_black_list(init_list.clone()) + .set_clear_list(init_list); + + let black_list_bytes: Message = black_list.protobuf().into(); + self.response_mq( + routing_key!(Executor >> BlackList).into(), + black_list_bytes.try_into().unwrap(), + ); + } + /// Find the public key of all senders that caused the specified error message, and then publish it // TODO: I think it is not necessary to distinguish economical_model, maybe remove // this opinion in the future. @@ -369,7 +386,7 @@ impl Postman { .receipts .iter() .filter(|ref receipt| match receipt.error { - Some(ReceiptError::NotEnoughCash) => true, + Some(ReceiptError::NotEnoughCash) | Some(ReceiptError::NotEnoughBaseQuota) => true, _ => false, }) .map(|receipt| receipt.transaction_hash) @@ -390,9 +407,9 @@ impl Postman { &self.command_req_sender, &self.command_resp_receiver, **address, - BlockTag::Height(close_block.block.header.number()), + BlockTag::Tag(Tag::Latest), ) - .and_then(|x| Some(U256::from(x.as_slice()) >= U256::from(bm_value))) + .map(|x| U256::from(x.as_slice()) >= U256::from(bm_value)) .unwrap_or(false) }) .cloned() @@ -489,6 +506,31 @@ impl Postman { }); } + Request::estimate_quota(call) => { + trace!("Estimate quota with params: {:?}", call); + let _ = serde_json::from_str::(&call.height) + .map(|block_id| { + let call_request = CallRequest::from(call); + command::estimate_quota( + &self.command_req_sender, + &self.command_resp_receiver, + call_request, + block_id.into(), + ) + .map(|ok| { + response.set_call_result(ok); + }) + .map_err(|err| { + response.set_code(ErrorCode::query_error()); + response.set_error_msg(err); + }) + }) + .map_err(|err| { + response.set_code(ErrorCode::query_error()); + response.set_error_msg(format!("{:?}", err)); + }); + } + Request::transaction_count(tx_count) => { trace!("transaction count request from jsonrpc {:?}", tx_count); let _ = serde_json::from_str::(&tx_count) diff --git a/cita-executor/src/tests/helpers.rs b/cita-executor/src/tests/helpers.rs index 11c8b8512..fd8fce949 100644 --- a/cita-executor/src/tests/helpers.rs +++ b/cita-executor/src/tests/helpers.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-executor/src/tests/mod.rs b/cita-executor/src/tests/mod.rs index 7fd8be0c8..2ee01e391 100644 --- a/cita-executor/src/tests/mod.rs +++ b/cita-executor/src/tests/mod.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-forever b/cita-forever index 05c2c5129..2ba42d64e 160000 --- a/cita-forever +++ b/cita-forever @@ -1 +1 @@ -Subproject commit 05c2c51295adfb91dc25ac0de821bbca92c1d7f4 +Subproject commit 2ba42d64ed38dec5ba9ef29b15cc52ee6215a2e9 diff --git a/cita-jsonrpc/Cargo.toml b/cita-jsonrpc/Cargo.toml index 9cf761b2e..48c8276dc 100644 --- a/cita-jsonrpc/Cargo.toml +++ b/cita-jsonrpc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cita-jsonrpc" -version = "0.1.0" -authors = ["Cryptape Technologies "] +version = "20.2.0" +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -17,12 +17,12 @@ cpuprofiler = "0.0.3" dotenv = "0.13.0" clap = "2" cita-logger = "0.1.1" -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -error = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-proto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +error = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-proto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } http = "0.1" httparse = "1.0" bytes = "0.4" @@ -39,7 +39,7 @@ tokio = "0.1.13" tokio-executor = "0.1.5" [build-dependencies] -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/cita-jsonrpc/build.rs b/cita-jsonrpc/build.rs index 03dcbd59d..e0a685330 100644 --- a/cita-jsonrpc/build.rs +++ b/cita-jsonrpc/build.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,9 @@ use std::env; use util::build_info::gen_build_info; +const VERSION: &str = "20.2.0"; + fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - gen_build_info(out_dir.as_ref(), "build_info.rs"); + gen_build_info(out_dir.as_ref(), "build_info.rs", VERSION.to_owned()); } diff --git a/cita-jsonrpc/src/config.rs b/cita-jsonrpc/src/config.rs index 3371c690b..a26bb8824 100644 --- a/cita-jsonrpc/src/config.rs +++ b/cita-jsonrpc/src/config.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/extractor.rs b/cita-jsonrpc/src/extractor.rs index 211dd99de..525b25142 100644 --- a/cita-jsonrpc/src/extractor.rs +++ b/cita-jsonrpc/src/extractor.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/fdlimit.rs b/cita-jsonrpc/src/fdlimit.rs index 5aa7684be..aceb185d9 100644 --- a/cita-jsonrpc/src/fdlimit.rs +++ b/cita-jsonrpc/src/fdlimit.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/helper.rs b/cita-jsonrpc/src/helper.rs index 1514d3a20..72bdd8eb8 100644 --- a/cita-jsonrpc/src/helper.rs +++ b/cita-jsonrpc/src/helper.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ pub fn select_topic(method: &str) -> String { "peerCount" => routing_key!(Jsonrpc >> RequestNet).into(), "peersInfo" => routing_key!(Jsonrpc >> RequestPeersInfo).into(), "sendRawTransaction" | "sendTransaction" => routing_key!(Jsonrpc >> RequestNewTx).into(), - "getVersion" => routing_key!(Jsonrpc >> RequestRpc).into(), + "getVersion" | "estimateQuota" => routing_key!(Jsonrpc >> RequestRpc).into(), _ => routing_key!(Jsonrpc >> Request).into(), } } diff --git a/cita-jsonrpc/src/http_header.rs b/cita-jsonrpc/src/http_header.rs index b20c1a201..919b6578f 100644 --- a/cita-jsonrpc/src/http_header.rs +++ b/cita-jsonrpc/src/http_header.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/http_server.rs b/cita-jsonrpc/src/http_server.rs index 336db73a5..cdcbfbd95 100644 --- a/cita-jsonrpc/src/http_server.rs +++ b/cita-jsonrpc/src/http_server.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -152,7 +152,7 @@ impl Service for Jsonrpc { type ReqBody = Body; type ResBody = Body; type Error = hyper::Error; - type Future = Box, Error = Self::Error> + Send>; + type Future = Box, Error = Self::Error> + Send>; fn call(&mut self, http_req: Request) -> Self::Future { let sender = { self.inner.tx.lock().clone() }; @@ -416,7 +416,7 @@ mod integration_test { let client = hyper::Client::builder().keep_alive(true).build_http(); - let mut works: Vec>> = vec![]; + let mut works: Vec>> = vec![]; let uri = hyper::Uri::from_str( format!("http://{}:{}/", serve.addr.ip(), serve.addr.port()).as_str(), ) diff --git a/cita-jsonrpc/src/main.rs b/cita-jsonrpc/src/main.rs index 93059aa01..5b1e47564 100644 --- a/cita-jsonrpc/src/main.rs +++ b/cita-jsonrpc/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -101,7 +101,7 @@ fn main() { let matches = App::new("JsonRpc") .version(get_build_info_str(true)) .long_version(get_build_info_str(false)) - .author("Cryptape") + .author("Rivtower") .about("CITA JSON-RPC by Rust") .args_from_usage( "-c, --config=[FILE] 'Sets a custom config file' diff --git a/cita-jsonrpc/src/mq_handler.rs b/cita-jsonrpc/src/mq_handler.rs index 6ba19c95b..a20a7ba1d 100644 --- a/cita-jsonrpc/src/mq_handler.rs +++ b/cita-jsonrpc/src/mq_handler.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/mq_publisher.rs b/cita-jsonrpc/src/mq_publisher.rs index 30acd4bd9..64748eda2 100644 --- a/cita-jsonrpc/src/mq_publisher.rs +++ b/cita-jsonrpc/src/mq_publisher.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/response.rs b/cita-jsonrpc/src/response.rs index c70c8771f..82a57cc6a 100644 --- a/cita-jsonrpc/src/response.rs +++ b/cita-jsonrpc/src/response.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -199,7 +199,7 @@ mod tests { let mut ext_headers = HeaderMap::new(); let mut resp = Response::default(); - headers.insert(HOST, HeaderValue::from_static("cryptape.com")); + headers.insert(HOST, HeaderValue::from_static("citahub.com")); headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); ext_headers.insert_vec( @@ -226,8 +226,8 @@ mod tests { let mut resp = HyperResponse::new(""); assert_eq!(resp.body(), &""); - resp = resp.with_body("cryptape"); - assert_eq!(resp.body(), &"cryptape"); + resp = resp.with_body("citahub"); + assert_eq!(resp.body(), &"citahub"); } #[test] diff --git a/cita-jsonrpc/src/service_error.rs b/cita-jsonrpc/src/service_error.rs index 958c2a8b4..5a0be0521 100644 --- a/cita-jsonrpc/src/service_error.rs +++ b/cita-jsonrpc/src/service_error.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/soliloquy.rs b/cita-jsonrpc/src/soliloquy.rs index 250609f18..e6a0ed018 100644 --- a/cita-jsonrpc/src/soliloquy.rs +++ b/cita-jsonrpc/src/soliloquy.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-jsonrpc/src/ws_handler.rs b/cita-jsonrpc/src/ws_handler.rs index bfef47213..c9a96c137 100644 --- a/cita-jsonrpc/src/ws_handler.rs +++ b/cita-jsonrpc/src/ws_handler.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/Cargo.toml b/cita-network/Cargo.toml index a2e169f84..318fa988b 100644 --- a/cita-network/Cargo.toml +++ b/cita-network/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cita-network" -version = "0.6.0" -authors = ["Cryptape Technologies "] +version = "20.2.0" +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -11,11 +11,11 @@ tentacle = "0.2.3" tokio = "0.1.14" futures = "0.1.25" cita-logger = "0.1.1" -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } serde = "1.0.84" serde_json = "1.0" serde_derive = "1.0.84" @@ -31,7 +31,7 @@ notify = "4.0.10" tempfile = "3.0.5" [build-dependencies] -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/cita-network/build.rs b/cita-network/build.rs index cfeaa8b9c..e0a685330 100644 --- a/cita-network/build.rs +++ b/cita-network/build.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,9 @@ use std::env; use util::build_info::gen_build_info; +const VERSION: &str = "20.2.0"; + fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - gen_build_info(out_dir.as_ref(), "build_info.rs"); + gen_build_info(out_dir.as_ref(), "build_info.rs", VERSION.to_owned()); } diff --git a/cita-network/src/cita_protocol.rs b/cita-network/src/cita_protocol.rs index 09cc500c6..349c36e1b 100644 --- a/cita-network/src/cita_protocol.rs +++ b/cita-network/src/cita_protocol.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/config.rs b/cita-network/src/config.rs index 62fa4142c..934516a44 100644 --- a/cita-network/src/config.rs +++ b/cita-network/src/config.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/main.rs b/cita-network/src/main.rs index ebf3b9fa6..233dbfcf0 100644 --- a/cita-network/src/main.rs +++ b/cita-network/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -116,7 +116,7 @@ fn main() { let matches = App::new("network") .version(get_build_info_str(true)) .long_version(get_build_info_str(false)) - .author("Cryptape") + .author("Rivtower") .about("CITA Block Chain Node powered by Rust") .args_from_usage( "-c, --config=[FILE] 'Sets a custom config file' diff --git a/cita-network/src/mq_agent.rs b/cita-network/src/mq_agent.rs index 5a55cc914..744a2b484 100644 --- a/cita-network/src/mq_agent.rs +++ b/cita-network/src/mq_agent.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/network.rs b/cita-network/src/network.rs index cff0ea42b..1ce2f4aca 100644 --- a/cita-network/src/network.rs +++ b/cita-network/src/network.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/node_manager.rs b/cita-network/src/node_manager.rs index 6632d4571..183f93a02 100644 --- a/cita-network/src/node_manager.rs +++ b/cita-network/src/node_manager.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/p2p_protocol/mod.rs b/cita-network/src/p2p_protocol/mod.rs index 56358cc0a..e87202ac3 100644 --- a/cita-network/src/p2p_protocol/mod.rs +++ b/cita-network/src/p2p_protocol/mod.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/p2p_protocol/node_discovery.rs b/cita-network/src/p2p_protocol/node_discovery.rs index 1bd82882d..6c4787c68 100644 --- a/cita-network/src/p2p_protocol/node_discovery.rs +++ b/cita-network/src/p2p_protocol/node_discovery.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/p2p_protocol/transfer.rs b/cita-network/src/p2p_protocol/transfer.rs index be20f4cb2..9d4cdfb8e 100644 --- a/cita-network/src/p2p_protocol/transfer.rs +++ b/cita-network/src/p2p_protocol/transfer.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cita-network/src/synchronizer.rs b/cita-network/src/synchronizer.rs index f6aaa7718..ca33913fb 100644 --- a/cita-network/src/synchronizer.rs +++ b/cita-network/src/synchronizer.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..7090cbf01 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,32 @@ +# Docker image for CITA release + +## Build image + + Script is comming soon! + +## Usage + +### Using docker command + +* Create a CITA chain config. + +```shell +docker run -v `pwd`:/opt/cita-run cita/cita-release:1.0.0-secp256k1-sha3 cita create --super_admin "0x37d1c7449bfe76fe9c445e626da06265e9377601" --nodes "127.0.0.1:4000" +``` + +Tips: CITA image uses `/opt/cita-run` as its default work_dir, so you should mount `pwd` to it. + +* Setup & run CITA + +```shell +docker run -d -p 1337:1337 -v `pwd`:/opt/cita-run cita/cita-release:1.0.0-secp256k1-sha3 /bin/bash -c 'cita setup test-chain/0 && cita start test-chain/0 && sleep infinity' +``` + +Cool! Just two simple command, you have build a CITA blockchain in you computer. +Enjoy it! + +### Using docker-compose + +```shell +cd sample && docker-compose up +``` \ No newline at end of file diff --git a/docker/release/Dockerfile b/docker/release/Dockerfile new file mode 100644 index 000000000..9c7a94772 --- /dev/null +++ b/docker/release/Dockerfile @@ -0,0 +1,29 @@ +FROM cita/cita-run:ubuntu-18.04-20190829 +LABEL maintainer="Rivtower Technologies " + +## Install CITA release here +ARG ENCRYPTION_ALG=secp256k1 +ARG HASH_ALG=sha3 +RUN mkdir -p /opt/cita + +WORKDIR /opt/cita +COPY cita_${ENCRYPTION_ALG}_${HASH_ALG}.tar.gz . + +# Keep tar package here for md5 test +RUN tar -xf cita_${ENCRYPTION_ALG}_${HASH_ALG}.tar.gz \ + && mv cita_${ENCRYPTION_ALG}_${HASH_ALG}/* /opt/cita \ + && rm -rf cita_${ENCRYPTION_ALG}_${HASH_ALG} + +# Set CITA_HOME +ENV CITA_HOME=/opt/cita +# Set PATH to cita binary +ENV PATH=/opt/cita/bin:${PATH} +## End of install CITA release + +COPY entrypoint.sh /usr/bin/ +RUN chmod +x /usr/bin/entrypoint.sh + +WORKDIR /opt/cita-run + +ENTRYPOINT ["/usr/bin/entrypoint.sh"] +CMD ["cita", "bebop", "help"] diff --git a/docker/release/entrypoint.sh b/docker/release/entrypoint.sh new file mode 100644 index 000000000..6532d0c34 --- /dev/null +++ b/docker/release/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ "${USER_ID}" = "0" ] || [ "${USER_ID}" = "" ]; then + # Run with "root" + exec "$@" +else + # Add local user(name=user) use USER_ID + useradd --shell /bin/bash -u "${USER_ID}" -o -c "" -d /opt user + # Can use sudo without password + echo "user ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers + + exec /usr/sbin/gosu user "$@" +fi diff --git a/docker/sample/docker-compose.yml b/docker/sample/docker-compose.yml new file mode 100644 index 000000000..b3db928b5 --- /dev/null +++ b/docker/sample/docker-compose.yml @@ -0,0 +1,73 @@ +version: '3' + +services: + config: + container_name: config + environment: + - USER_ID + - SUPER_ADMIN=0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523 + - NODES_CONFIG=node0:4000, node1:4001 + image: cita/cita-release:1.0.0-secp256k1-sha3 + hostname: config + networks: + main: + aliases: + - config + volumes: + - ./:/opt/cita-run + command: | + bash -c ' + echo "Create config files..."; + cita create --super_admin "$$SUPER_ADMIN" --nodes "$$NODES_CONFIG"; + echo "Done config"' + + node0: + container_name: node0 + depends_on: + - config + environment: + - USER_ID + image: cita/cita-release:1.0.0-secp256k1-sha3 + hostname: node0 + networks: + main: + aliases: + - node0 + volumes: + - ./:/opt/cita-run + ports: + - "1337:1337" + command: | + bash -c ' + while [[ ! -d /opt/cita-run/test-chain ]]; do sleep 1; done; + sleep 10; + cita setup test-chain/0; + cita start test-chain/0; + sleep infinity' + + node1: + container_name: node1 + depends_on: + - config + environment: + - USER_ID + image: cita/cita-release:1.0.0-secp256k1-sha3 + hostname: node1 + networks: + main: + aliases: + - node1 + volumes: + - ./:/opt/cita-run + ports: + - "1338:1338" + command: | + bash -c ' + while [[ ! -d /opt/cita-run/test-chain ]]; do sleep 1; done; + sleep 10; + cita setup test-chain/1; + cita start test-chain/1; + sleep infinity' + +networks: + main: \ No newline at end of file diff --git a/docs/release-flow.md b/docs/release-flow.md new file mode 100644 index 000000000..80b566c74 --- /dev/null +++ b/docs/release-flow.md @@ -0,0 +1,208 @@ +# CITA Release Flow + +## 1. 发版计划 + +* 确定发版时间 +* 确定 Release Master (整个发版过程由 Release Master 负责) +* 确定发版测试负责人 + +## 2. 冻结版本 + +* 冻结代码至新建的 Release 分支,需提前一周以上冻结 +* 冻结分支应该有最新的版本号等,需为可发布版本 + +### 准备分支 + +#### 版本的类型 + +使用语义化版本,遵循 [Semantic Versioning] + +摘录部分如下: + +> 版本格式:主版本号.次版本号.修订号,版本号递增规则如下: +> +> 1. 主版本号:当你做了不兼容的 API 修改, +> 2. 次版本号:当你做了向下兼容的功能性新增, +> 3. 修订号:当你做了向下兼容的问题修正。 +> 先行版本号及版本编译元数据可以加到“主版本号.次版本号.修订号”的后面,作为延伸。 + +#### 创建发布分支 + +***新分支命名遵循 `release-*` 格式*** + +首先获取最新的代码,具体操作如下: + +```shell +git fetch origin +``` + +其中 `origin` 代表 `CITA` 官方的代码仓库地址,可通过 `git remote -v` 查看。 + +流程分为版本发布(主版本号 x 及次版本号 y)以及修订补丁发布(修订号 z)。 + +##### 版本发布 + +从最新 `develop` 创建新的分支 `release-x.y.0`,具体操作如下: + +```shell +git checkout origin/develop -b release-x.y.0 +``` + +##### 修订补丁发布 + +从需要修订版本的 `tag`(`vx.y.0`) 创建新的分支 `release-x.y.1`,具体操作如下: + +```shell +git checkout -b +``` + +#### 推送分支 + +把创建的发布分支 `release-x.y.z` 推送到官方仓库,具体操作如下: + +```shell +git push origin release-x.y.z +``` + +#### 设置分支保护 + +联系管理员对发布分支 `release-x.y.z` 设置分支保护。 + +### 创建一个 RC Pull Request,标题加上`[WIP]`标记 + +## 3. 测试 + +* 告知测试团队对发布分支进行测试 +* 告知工具链团队对新版本进行适配 +* 测试过程中出现的 Bug 修复合并入发布分支 `release-x.y.z` +* 测试通过后,测试负责人出具发版测试报告,内容包括但不限于: + + - 功能测试报告 + - 性能测试报告 + - 稳定性测试报告 + - 安全测试报告 + +## 4. 更新 Changelog & Release Nodes + +测试通过后: + +* `submodule` 创建对应版本 `tag` +* 修改更新日志,更新版本发布日期等信息 + +## 5. 合并分支 + +### 合并入 `master` 分支 + +通过 `pull request` 把发布分支 `release-x.y.z` 合并入 `master` 分支。 + +### 版本 tag + +***新版本 tag 命名遵循 `vx.y.z` 格式*** + +1. 更新 `master` 分支代码,具体操作如下: + +```shell +git checkout origin/master && git pull +``` + +2. 创建 `tag`,具体操作如下: + +```shell +git tag -a vx.y.z -m 'vx.y.z' +``` + +3. 推送 `tag` 到代码仓库,具体操作如下: + +```shell +git push --tags +``` + +### 合并入 `develop` 分支 + +***过渡分支命名为 `merge-master-into-develop`*** + +把 `master` 分支合并入 `develop` 分支,由于分支保护,创建一个中间分支 `merge-master-into-develop` 通过 `pull request` 合并。 + +1. 更新 `master` 分支代码,具体操作如下: + +```shell +git checkout origin/master && git pull +``` + +2. 创建 `merge-master-into-develop`,具体操作如下: + +```shell +git checkout -b merge-master-into-develop +``` + +3. 推送分支到代码仓库,具体操作如下: + +```shell +git push origin merge-master-into-develop +``` + +4. 合并入 `develop` + +通过 https://github.com/citahub/cita/compare/develop...master 提 pr。 + +## 6. 发布 + +### 文件打包 + +***压缩包使用 `.tar.gz` 后缀*** + +新版本发布需要打包以下文件: + +* 源码 `cita_src.tar.gz` +* 三种不同算法的发布件: + - `cita_secp256k1_sha3.tar.gz` + - `cita_ed25519_blake2b.tar.gz` + - `cita_sm2_sm3.tar.gz` +* 校验包 + - `cita_secp256k1_sha3.tar.gz:md5sum` + - `cita_ed25519_blake2b.tar.gz:md5sum` + - `cita_sm2_sm3.tar.gz:md5sum` + - eg. + - `cita_sm2_sm3.tar.gz:ebb0f69d07806f56fdf95db478ccc46d` + +### Release Master 出具 Release Note (以下内容在 github 上操作): + +* 起草一份发版公告,简述新版本的内容及升级提示,包括中文和英语,最后附上更新日志; +* 把发布需要的文件上传; +* 发布新版本。 + +### 清理分支 + +***如果设置了分支保护,联系管理员手动删除*** + +1. 清理发布分支,具体操作如下: + +```shell +git push --delete origin release-x.y.z +``` + +2. 清理过渡分支,具体操作如下: + +```shell +git push --delete origin merge-master-into-develop +``` + +## 7. 公告 + +* 内部邮件广播 + - 撰写新版本邮件并内部广播 +* CITAHub talk 发帖 + - 在[信息版]发布新版本主题贴 +* CITAHub Docs 版本更新 + - [CITAHub Docs] 延后三天进行版本更新,期间进行文档的测试和补充 +* 若发布之后,需要修改发版公告,交由 Release Master 操作 + +## 8. 其他 + +* 当天发布相应 CITA docker 镜像 +* 版本发布后1-2个星期内,由运维人员升级测试网 + + +[CITAhub Docs]: https://docs.citahub.com/zh-CN/welcome +[Semantic Versioning]: https://semver.org/ +[信息版]: https://talk.citahub.com/c/9-category diff --git a/docs/release-guide.md b/docs/release-guide.md index 8162ed1a8..3954e183d 100644 --- a/docs/release-guide.md +++ b/docs/release-guide.md @@ -1,3 +1,9 @@ +[Release Guide](#release-guide) + +[发版指引](#发版指引) + +--- + # Release Guide The code repository has two main branches: @@ -11,11 +17,11 @@ More details will be explained in the following sections. The specific process follows the following steps: -1. [Prepare Branch] (#Prepare Branch) -2. [Test and Update Log] (#Test and Update Log) -3. [Merge Branch] (#Merge Branch) -4. [Release] (#Release) -5. [Other Notes] (#Other Notes) +1. [Prepare the Branch](#prepare-the-branch) +2. [Test and ChangeLog](#test-and-changelog) +3. [Merge Branch](#merge-branch) +4. [Release](#release) +5. [Other Notes](#other-notes) ## Prepare the Branch diff --git a/env.sh b/env.sh index bbbca2354..9c5133b10 100755 --- a/env.sh +++ b/env.sh @@ -4,19 +4,25 @@ # OS if [[ "$(uname)" == 'Darwin' ]]; then - readonly SYSTEM_NET='bridge' SOURCE_DIR="$(dirname "$(realpath "$0")")" else - readonly SYSTEM_NET="host" SOURCE_DIR="$(dirname "$(readlink -f "$0")")" fi +readonly CONTAINER_NAME_HASH=$(echo "${SOURCE_DIR}" | md5sum | cut -d " " -f 1) if test -f "${SOURCE_DIR}/Cargo.toml"; then - readonly CONTAINER_NAME='cita_build_container' - readonly DOCKER_IMAGE='cita/cita-build:ubuntu-18.04-20190515' + readonly SYSTEM_NET='bridge' + readonly CONTAINER_NAME="cita_build${CONTAINER_NAME_HASH}" + readonly DOCKER_IMAGE='cita/cita-build:ubuntu-18.04-20191128' else - readonly CONTAINER_NAME='cita_run_container' - readonly DOCKER_IMAGE='cita/cita-run:ubuntu-18.04-20190829' + if [[ "$(uname)" == 'Darwin' ]]; then + readonly SYSTEM_NET='bridge' + EXPOSE='1337:1337' + else + readonly SYSTEM_NET="host" + fi + readonly CONTAINER_NAME="cita_run${CONTAINER_NAME_HASH}" + readonly DOCKER_IMAGE='cita/cita-run:ubuntu-18.04-20191128' readonly SOURCE_DIR="$(dirname "$SOURCE_DIR")" fi @@ -27,7 +33,6 @@ mkdir -p "${DOCKER_CARGO}/git" mkdir -p "${DOCKER_CARGO}/registry" # Docker Port -EXPOSE='1337:1337' if [[ "$3" == "port" ]]; then EXPOSE=( "${@:4}" ) [[ "${EXPOSE[*]}" == "" ]] && EXPOSE=('1337:1337') @@ -38,7 +43,7 @@ fi # Expose parameter for docker needs something like "-p 1337:1337 -p 1338:1338", but not "-p 1337:1337 1338:1338" EXPOSE_PARAM=() for port in "${EXPOSE[@]}"; do - EXPOSE_PARAM+=(-p ${port}) + EXPOSE_PARAM+=(-p "$port") done # Docker Arguments @@ -50,13 +55,22 @@ cp '/etc/localtime' "${SOURCE_DIR}/localtime" readonly LOCALTIME_PATH="${SOURCE_DIR}/localtime" [[ "${USER_ID}" = '0' ]] && USER_NAME='root' -readonly INIT_CMD='sleep infinity' - # Run Docker if ! docker ps | grep "${CONTAINER_NAME}" > '/dev/null' 2>&1; then echo "Start docker container ${CONTAINER_NAME} ..." docker rm "${CONTAINER_NAME}" > '/dev/null' 2>&1 - docker run -d \ + + # test network and set init cmd + timeout=3 + target=www.google.com + ret_code=$(curl -I -s --connect-timeout $timeout $target -w "%{http_code}" | tail -n1) + if [ "x$ret_code" = "x200" ]; then + readonly INIT_CMD="sleep infinity" + else + readonly INIT_CMD="echo -e '[source.crates-io]\nreplace-with = \"rustcc\"\n[source.rustcc]\nregistry = \"https://code.aliyun.com/rustcc/crates.io-index.git\"' | sudo tee /opt/.cargo/config;sleep infinity" + fi + + docker run -d --init \ --net="${SYSTEM_NET}" \ --volume "${SOURCE_DIR}:${WORKDIR}" \ --volume "${DOCKER_CARGO}/git:${CARGO_HOME}/git" \ @@ -91,6 +105,6 @@ if [[ "$3" == '--daemon' ]]; then elif [[ $# -gt 0 ]]; then docker exec -i "${USE_TTY}" "${CONTAINER_NAME}" /bin/bash -c "/usr/sbin/gosu ${USER_NAME} ${*}" else - docker exec -i ${USE_TTY} ${CONTAINER_NAME} \ + docker exec -i "${USE_TTY}" "${CONTAINER_NAME}" \ /bin/bash -c "stty cols $(tput cols) rows $(tput lines) && /usr/sbin/gosu ${USER_NAME} /bin/bash" fi diff --git a/scripts/cita.sh b/scripts/cita.sh index efa22f645..0a97b73c4 100755 --- a/scripts/cita.sh +++ b/scripts/cita.sh @@ -15,7 +15,7 @@ fi # Add cita scripts into system executable paths export PATH=$CITA_BIN:$PATH CITA_SCRIPTS=$(dirname "$CITA_BIN")/scripts -SERVICES=( forever auth bft chain executor jsonrpc network ) +SERVICES=(forever auth bft chain executor jsonrpc network) SCRIPT=$(basename "$0") # DIAGNOSTIC COMMANDS PING_STATUS="" @@ -23,7 +23,7 @@ PING_STATUS="" sudo() { set -o noglob - if [ "$(whoami)" == "root" ] ; then + if [ "$(whoami)" == "root" ]; then "$@" else /usr/bin/sudo "$@" @@ -115,17 +115,16 @@ config() { # SERVICE CONTROL COMMANDS start_rabbitmq() { # Config and start RabbitMQ - if [[ $(uname) == 'Darwin' ]] - then - pgrep -f rabbitmq-server > /dev/null || brew services restart rabbitmq > /dev/null + if [[ $(uname) == 'Darwin' ]]; then + pgrep -f rabbitmq-server >/dev/null || brew services restart rabbitmq >/dev/null RABBITMQ_USER=cita_monitor RABBITMQ_PASSWD=cita_monitor - sudo rabbitmqctl list_vhosts | grep "${NODE_NAME}" > /dev/null || sudo rabbitmqctl add_vhost "${NODE_NAME}" > /dev/null - sudo rabbitmqctl set_permissions -p "${NODE_NAME}" guest '.*' '.*' '.*' > /dev/null - sudo rabbitmq-plugins enable rabbitmq_management > /dev/null - sudo rabbitmqctl list_users | grep ${RABBITMQ_USER} > /dev/null || sudo rabbitmqctl add_user ${RABBITMQ_USER} ${RABBITMQ_PASSWD} > /dev/null - sudo rabbitmqctl set_user_tags ${RABBITMQ_USER} monitoring > /dev/null - sudo rabbitmqctl set_permissions -p "${NODE_NAME}" ${RABBITMQ_USER} '.*' '.*' '.*' > /dev/null + sudo rabbitmqctl list_vhosts | grep "${NODE_NAME}" >/dev/null || sudo rabbitmqctl add_vhost "${NODE_NAME}" >/dev/null + sudo rabbitmqctl set_permissions -p "${NODE_NAME}" guest '.*' '.*' '.*' >/dev/null + sudo rabbitmq-plugins enable rabbitmq_management >/dev/null + sudo rabbitmqctl list_users | grep ${RABBITMQ_USER} >/dev/null || sudo rabbitmqctl add_user ${RABBITMQ_USER} ${RABBITMQ_PASSWD} >/dev/null + sudo rabbitmqctl set_user_tags ${RABBITMQ_USER} monitoring >/dev/null + sudo rabbitmqctl set_permissions -p "${NODE_NAME}" ${RABBITMQ_USER} '.*' '.*' '.*' >/dev/null else flock -x -w 30 /tmp/rabbitmq.lock -c "ps -C rabbitmq-server > /dev/null || sudo /etc/init.d/rabbitmq-server restart > /dev/null" RABBITMQ_USER=cita_monitor @@ -140,10 +139,9 @@ start_rabbitmq() { } do_setup() { - for i in {1..3} - do + for i in {1..3}; do start_rabbitmq - if curl http://localhost:15672/ > /dev/null 2>&1; then + if curl http://localhost:15672/ >/dev/null 2>&1; then return 0 fi done @@ -170,15 +168,15 @@ do_start() { if [ -z "${debug}" ]; then cita-forever -c "${config}" start 2>&1 else - RUST_LOG=cita_auth=${debug},cita_chain=${debug},cita_executor=${debug},cita_jsonrpc=${debug},cita_network=${debug},cita_bft=${debug},\ -core_executor=${debug},engine=${debug},jsonrpc_types=${debug},libproto=${debug},proof=${debug},txpool=${debug},core=${debug} \ - cita-forever -c "${config}" start 2>&1 + RUST_LOG=cita_auth=${debug},cita_chain=${debug},cita_executor=${debug},cita_jsonrpc=${debug},cita_network=${debug},cita_bft=${debug},core_executor=${debug},engine=${debug},jsonrpc_types=${debug},libproto=${debug},proof=${debug},txpool=${debug},core=${debug} \ + cita-forever \ + -c "${config}" start 2>&1 fi # Wait for the node to come up WAIT=3 while [ $WAIT -gt 0 ]; do - WAIT="$(( WAIT - 1 ))" + WAIT="$((WAIT - 1))" sleep 1 do_ping if [ "${PING_STATUS}" == "pong" ]; then @@ -192,7 +190,7 @@ core_executor=${debug},engine=${debug},jsonrpc_types=${debug},libproto=${debug}, } do_stop() { - cita-forever stop > /dev/null 2>&1 + cita-forever stop >/dev/null 2>&1 # Make sure node stopped do_ping @@ -234,10 +232,9 @@ do_status() { while IFS= read -r -d '' pid_file; do pid=$(cat "${pid_file}") pgrep -f "${pid}" || true - done < <(find . -name "*.pid") + done < <(find . -name "*.pid") } - # SCRIPTING COMMANDS do_clean() { # Clean empty node always successfully @@ -249,11 +246,11 @@ do_clean() { # Move data/ and logs/ into backup directory backup_dir=$(pwd)/backup.$(date -Iseconds) mkdir -p "${backup_dir}" - if [ -e "${NODE_DATA_DIR}" ] ; then + if [ -e "${NODE_DATA_DIR}" ]; then echo "mv ${NODE_DATA_DIR} ${backup_dir}" mv "${NODE_DATA_DIR}" "${backup_dir}" fi - if [ -e "${NODE_LOGS_DIR}" ] ; then + if [ -e "${NODE_LOGS_DIR}" ]; then echo "mv ${NODE_LOGS_DIR} ${backup_dir}" mv "${NODE_LOGS_DIR}" "${backup_dir}" fi @@ -270,11 +267,11 @@ do_backup() { # Copy data/ and logs/ into backup directory backup_dir="$(pwd)/backup.$(date -Iseconds)" mkdir -p "${backup_dir}" - if [ -e "${NODE_DATA_DIR}" ] ; then + if [ -e "${NODE_DATA_DIR}" ]; then echo "cp -r ${NODE_DATA_DIR} ${backup_dir}/" cp -r "${NODE_DATA_DIR}" "${backup_dir}"/ fi - if [ -e "${NODE_LOGS_DIR}" ] ; then + if [ -e "${NODE_LOGS_DIR}" ]; then echo "cp -r ${NODE_LOGS_DIR} ${backup_dir}/" cp -r "${NODE_LOGS_DIR}" "${backup_dir}"/ fi @@ -291,7 +288,7 @@ do_logs() { fi for service in "${SERVICES[@]}"; do - if [[ $service = "$service0" || cita-"${service}" = "$service0" ]]; then + if [[ $service == "$service0" || cita-"${service}" == "$service0" ]]; then tail -f "${NODE_LOGS_DIR}/cita-${service}.log" exit 0 fi @@ -304,11 +301,11 @@ do_logs() { do_logrotate() { local logs logs=$(ls -1 "${NODE_LOGS_DIR}"/cita-*.log) - cita-forever logrotate > /dev/null 2>&1 + cita-forever logrotate >/dev/null 2>&1 # Wait for services to rotate their logs sleep 2 - for logfile in ${NODE_LOGS_DIR}/cita-*.log; do + for logfile in "$NODE_LOGS_DIR"/cita-*.log; do if [[ ${logs} != *"${logfile}"* ]]; then echo "./${NODE_NAME}/logs/${logfile##*/}" fi @@ -319,14 +316,14 @@ clear_rabbit_mq() { local mq_command local mq_command="curl -i -u guest:guest -H content-type:application/json -XDELETE http://localhost:15672/api/queues/${TNODE}" - "$mq_command"/auth > /dev/null 2>&1 || true - "$mq_command"/chain > /dev/null 2>&1 || true - "$mq_command"/consensus > /dev/null 2>&1 || true - "$mq_command"/jsonrpc > /dev/null 2>&1 || true - "$mq_command"/network > /dev/null 2>&1 || true - "$mq_command"/network_tx > /dev/null 2>&1 || true - "$mq_command"/network_consensus > /dev/null 2>&1 || true - "$mq_command"/executor > /dev/null 2>&1 || true + "$mq_command"/auth >/dev/null 2>&1 || true + "$mq_command"/chain >/dev/null 2>&1 || true + "$mq_command"/consensus >/dev/null 2>&1 || true + "$mq_command"/jsonrpc >/dev/null 2>&1 || true + "$mq_command"/network >/dev/null 2>&1 || true + "$mq_command"/network_tx >/dev/null 2>&1 || true + "$mq_command"/network_consensus >/dev/null 2>&1 || true + "$mq_command"/executor >/dev/null 2>&1 || true } node_down_check() { @@ -348,108 +345,120 @@ node_up_check() { parse_command() { local command="$1" case "${command}" in - help) - help - exit 0 - ;; + help) + help + exit 0 + ;; - usage) - usage - exit 0 - ;; + usage) + usage + exit 0 + ;; - create) - config "$@" - exit 0 - ;; + create) + config "$@" + exit 0 + ;; - append) - config "$@" - exit 0 - ;; - - setup) - do_setup - ;; - - start) - # TODO: should not do so, but present tests need this - do_stop - node_down_check - - # Make sure the RabbitMQ fresh - clear_rabbit_mq - - do_start "$3" "$4" - ;; - - stop) - node_up_check - do_stop - ;; - - restart) - node_up_check - do_stop - - # Make sure the RabbitMQ fresh - clear_rabbit_mq - - do_start "$3" "$4" - ;; - - ping) - do_ping - if [ "${PING_STATUS}" == "pong" ]; then - echo "pong" - else - echo "Node '${NODE_NAME}' not responding to pings." - exit 1 - fi - ;; - - top) - node_up_check - do_top - ;; - # deprecated, use 'top' instead - stat) - node_up_check - do_top - ;; - # similar to 'top', but ... ? - status) - do_status - ;; - - logrotate) - do_logrotate - ;; - - logs) - do_logs "$3" - ;; - - backup) - node_down_check - do_backup - ;; - - clean) - node_down_check - do_clean - ;; - - *) - usage - ;; + append) + config "$@" + exit 0 + ;; + + setup) + do_setup + ;; + + start) + # TODO: should not do so, but present tests need this + do_stop + node_down_check + + # Make sure the RabbitMQ fresh + clear_rabbit_mq + + do_start "$3" "$4" + ;; + + stop) + node_up_check + do_stop + ;; + + restart) + node_up_check + do_stop + + # Make sure the RabbitMQ fresh + clear_rabbit_mq + + do_start "$3" "$4" + ;; + + ping) + do_ping + if [ "${PING_STATUS}" == "pong" ]; then + echo "pong" + else + echo "Node '${NODE_NAME}' not responding to pings." + exit 1 + fi + ;; + + top) + node_up_check + do_top + ;; + # deprecated, use 'top' instead + stat) + node_up_check + do_top + ;; + # similar to 'top', but ... ? + status) + do_status + ;; + + logrotate) + do_logrotate + ;; + + logs) + do_logs "$3" + ;; + + backup) + node_down_check + do_backup + ;; + + clean) + node_down_check + do_clean + ;; + + *) + usage + ;; esac } +# Test CITA is running in docker. +cita_in_docker() { + if [ ! -f /proc/1/cgroup ] ; then + return 1 + fi + if grep docker /proc/1/cgroup -qa; then + return 0 + else + return 1 + fi +} + main() { - if [ "$1" != "bebop" ]; then - if stat "$CITA_BIN"/cita-env > /dev/null 2>&1; then + if [[ "$1" != "bebop" ]] && ! cita_in_docker; then + if stat "$CITA_BIN"/cita-env >/dev/null 2>&1; then "$CITA_BIN"/cita-env bin/cita bebop "$@" else echo -e "\033[0;31mPlease run this command after build 🎨" @@ -458,12 +467,18 @@ main() { exit 0 fi - # Delete the verbose parameters - set -- "${@:2}" + # Delete the verbose parameters. + # If use the command 'cita bebop', it should delete 2 verbose parameters. + if [[ "$1" == "bebop" ]]; then + set -- "${@:2}" + else + set -- "${@:1}" + fi + local command=$1 # Commands not depend on $NODE_PATH - local indie=( help usage create append ) + local indie=(help usage create append) if [[ "${indie[*]}" =~ $command ]]; then parse_command "$@" fi @@ -490,12 +505,12 @@ main() { fi # Enter the node directory - pushd . > /dev/null + pushd . >/dev/null cd "${NODE_PATH}" parse_command "$@" - popd > /dev/null + popd >/dev/null exit 0 } diff --git a/scripts/config_tool/create_init_data.py b/scripts/config_tool/create_init_data.py index ec34cf410..4d1d33ebd 100755 --- a/scripts/config_tool/create_init_data.py +++ b/scripts/config_tool/create_init_data.py @@ -24,7 +24,7 @@ economicalModel: 0 name: CITA Test Token symbol: CTT - avatar: https://cdn.cryptape.com/icon_cita.png + avatar: https://cdn.citahub.com/icon_cita.png autoExec: false QuotaManager: admin: '0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523' diff --git a/scripts/config_tool/default_config/jsonrpc.toml b/scripts/config_tool/default_config/jsonrpc.toml index 90e44f54d..cd22acbf0 100644 --- a/scripts/config_tool/default_config/jsonrpc.toml +++ b/scripts/config_tool/default_config/jsonrpc.toml @@ -8,7 +8,7 @@ flag_prof_duration = 0 [http_config] allow_origin = "*" -timeout = 3 +timeout = 60 enable = true listen_port = "1337" listen_ip = "0.0.0.0" diff --git a/scripts/config_tool/genesis b/scripts/config_tool/genesis index 4d615b05a..a4320c00d 160000 --- a/scripts/config_tool/genesis +++ b/scripts/config_tool/genesis @@ -1 +1 @@ -Subproject commit 4d615b05a828f0b501e1ce91332855e56c054cc4 +Subproject commit a4320c00d722efe5caea3717d81f284e493dec5c diff --git a/scripts/contracts/interaction b/scripts/contracts/interaction index 0d18189e9..72480b07a 160000 --- a/scripts/contracts/interaction +++ b/scripts/contracts/interaction @@ -1 +1 @@ -Subproject commit 0d18189e9a063c5ee2c74808d8c092cc532e671d +Subproject commit 72480b07a350739f2c00130c0d660611bcc4a2ae diff --git a/scripts/contracts/src/common/Admin.sol b/scripts/contracts/src/common/Admin.sol index 95d14c036..f61099ee8 100644 --- a/scripts/contracts/src/common/Admin.sol +++ b/scripts/contracts/src/common/Admin.sol @@ -3,7 +3,7 @@ pragma solidity 0.4.24; import "./Error.sol"; /// @title A common contract about admin -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract Admin is Error { address public admin; @@ -33,9 +33,14 @@ contract Admin is Error { onlyAdmin returns (bool) { + if (_account == admin) { + return true; + } emit AdminUpdated(_account, admin, msg.sender); admin = _account; - return true; + address auth_addr = address(0xffffffffffffffffffffffffffffffffff020006); + bytes4 funcId = bytes4(keccak256("updateAdmin(address)")); + return auth_addr.call(funcId,_account); } /// @notice Check the account is admin diff --git a/scripts/contracts/src/common/Check.sol b/scripts/contracts/src/common/Check.sol index d722add9c..7f3bbe4d2 100644 --- a/scripts/contracts/src/common/Check.sol +++ b/scripts/contracts/src/common/Check.sol @@ -6,7 +6,7 @@ import "../../interaction/interface/IGroup.sol"; import "./ReservedAddrPublic.sol"; /// @title The modifier for checking permission -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract Check is ReservedAddrPublic { modifier hasPermission(address _permission) { diff --git a/scripts/contracts/src/common/Error.sol b/scripts/contracts/src/common/Error.sol index c24b1350a..fdedf10d0 100644 --- a/scripts/contracts/src/common/Error.sol +++ b/scripts/contracts/src/common/Error.sol @@ -1,7 +1,7 @@ pragma solidity 0.4.24; /// @title The enum data of error -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract Error { enum ErrorType { diff --git a/scripts/contracts/src/common/ReservedAddrConstant.sol b/scripts/contracts/src/common/ReservedAddrConstant.sol index cab83312a..b707ff6a2 100644 --- a/scripts/contracts/src/common/ReservedAddrConstant.sol +++ b/scripts/contracts/src/common/ReservedAddrConstant.sol @@ -3,7 +3,7 @@ pragma solidity 0.4.24; /* solium-disable */ /// @title The address of system contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @dev TODO all the address contract ReservedAddrConstant { address constant sysConfigAddr = 0xFFfffFFfFfFffFFfFFfffFffFfFFFffFFf020000; diff --git a/scripts/contracts/src/common/ReservedAddrPublic.sol b/scripts/contracts/src/common/ReservedAddrPublic.sol index ea1b4695c..3c3f477d2 100644 --- a/scripts/contracts/src/common/ReservedAddrPublic.sol +++ b/scripts/contracts/src/common/ReservedAddrPublic.sol @@ -3,7 +3,7 @@ pragma solidity 0.4.24; /* solium-disable */ /// @title The address of system contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice Should not add new address contract ReservedAddrPublic { address public sysConfigAddr = 0xFFfffFFfFfFffFFfFFfffFffFfFFFffFFf020000; diff --git a/scripts/contracts/src/lib/AddressArray.sol b/scripts/contracts/src/lib/AddressArray.sol index fdf8fbed7..a46620855 100644 --- a/scripts/contracts/src/lib/AddressArray.sol +++ b/scripts/contracts/src/lib/AddressArray.sol @@ -1,7 +1,7 @@ pragma solidity 0.4.24; /// @title A library for operation of address array -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice Use prefix to import it /// @dev TODO more interface library AddressArray { diff --git a/scripts/contracts/src/lib/ContractCheck.sol b/scripts/contracts/src/lib/ContractCheck.sol index 5a4340de3..9a86a2fdf 100644 --- a/scripts/contracts/src/lib/ContractCheck.sol +++ b/scripts/contracts/src/lib/ContractCheck.sol @@ -1,7 +1,7 @@ pragma solidity 0.4.24; /// @title A library for operation of contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice Use prefix to import it /// @dev TODO more interface library ContractCheck { diff --git a/scripts/contracts/src/permission_management/Authorization.sol b/scripts/contracts/src/permission_management/Authorization.sol index fcd0489ff..55522f3ec 100644 --- a/scripts/contracts/src/permission_management/Authorization.sol +++ b/scripts/contracts/src/permission_management/Authorization.sol @@ -6,7 +6,7 @@ import "../../interaction/interface/ISysConfig.sol"; import "../../interaction/interface/IAuthorization.sol"; /// @title Authorization about the permission and account -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffffffffffffffffffffffffffffffffff020006 /// The interface can be called: Only query type contract Authorization is IAuthorization, ReservedAddrPublic { @@ -34,16 +34,36 @@ contract Authorization is IAuthorization, ReservedAddrPublic { _; } + modifier originAdmin() { + require(tx.origin == allAccounts[0], "require superAdmin"); + _; + } + /// @notice Initialize the superAdmin's auth constructor(address _superAdmin) public { - for (uint8 i;i < builtInPermissions.length; i++) + for (uint8 i;i < builtInPermissions.length; i++) { _setAuth(_superAdmin, builtInPermissions[i]); - + } // rootGroup: basic permissions _setAuth(rootGroupAddr, sendTxAddr); _setAuth(rootGroupAddr, createContractAddr); } + function updateAdmin(address _newAdmin) public originAdmin { + address oldAdmin = allAccounts[0]; + if (_newAdmin == oldAdmin) { + return; + } + allAccounts[0] = _newAdmin; + allAccounts.push(oldAdmin); + for (uint8 i;i < builtInPermissions.length; i++) { + _setAuth(_newAdmin, builtInPermissions[i]); + // keep send tx and create contract + if (i != 13 && i!= 14) + _cancelAuth(oldAdmin, builtInPermissions[i]); + } + } + /// @notice Set permission to the account /// @param _account The account to be setted /// @param _permission The permission to be setted @@ -188,4 +208,15 @@ contract Authorization is IAuthorization, ReservedAddrPublic { emit AuthSetted(_account, _permission); return true; } + + /// @notice Private: delete the permission to the account + function _cancelAuth(address _account, address _permission) + private + returns (bool) + { + AddressArray.remove(_account, accounts[_permission]); + AddressArray.remove(_permission, permissions[_account]); + emit AuthCanceled(_account, _permission); + return true; + } } diff --git a/scripts/contracts/src/permission_management/Permission.sol b/scripts/contracts/src/permission_management/Permission.sol index 4ae5ef3d5..35524b100 100644 --- a/scripts/contracts/src/permission_management/Permission.sol +++ b/scripts/contracts/src/permission_management/Permission.sol @@ -4,7 +4,7 @@ import "../common/ReservedAddrPublic.sol"; import "../../interaction/interface/IPermission.sol"; /// @title Permission contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: Created by permissionCreator /// The interface can be called: Only query type contract Permission is IPermission, ReservedAddrPublic { diff --git a/scripts/contracts/src/permission_management/PermissionCreator.sol b/scripts/contracts/src/permission_management/PermissionCreator.sol index 9118e4340..abe765975 100644 --- a/scripts/contracts/src/permission_management/PermissionCreator.sol +++ b/scripts/contracts/src/permission_management/PermissionCreator.sol @@ -4,7 +4,7 @@ import "./Permission.sol"; import "../common/ReservedAddrPublic.sol"; /// @title Permission factory contract to create permission contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address:0xffFFFffFfFFffffFffffFFfFffffFfFFFF020005 /// The interface: None contract PermissionCreator is ReservedAddrPublic { diff --git a/scripts/contracts/src/permission_management/PermissionManagement.sol b/scripts/contracts/src/permission_management/PermissionManagement.sol index 85c49cc66..61baa4372 100644 --- a/scripts/contracts/src/permission_management/PermissionManagement.sol +++ b/scripts/contracts/src/permission_management/PermissionManagement.sol @@ -6,7 +6,7 @@ import "../../interaction/interface/IPermissionManagement.sol"; import "../../interaction/interface/IAuthorization.sol"; /// @title Permission management contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffFffFffFFffFFFFFfFfFFfFFFFfffFFff020004 /// The interface the can be called: All /// @dev TODO check address is contract diff --git a/scripts/contracts/src/role_management/Role.sol b/scripts/contracts/src/role_management/Role.sol index f076e780f..afdbc9f35 100644 --- a/scripts/contracts/src/role_management/Role.sol +++ b/scripts/contracts/src/role_management/Role.sol @@ -5,7 +5,7 @@ import "../common/ReservedAddrPublic.sol"; import "../../interaction/interface/IRole.sol"; /// @title Role contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: Created by roleCreator /// The interface can be called: Only query type contract Role is IRole, ReservedAddrPublic { diff --git a/scripts/contracts/src/role_management/RoleAuth.sol b/scripts/contracts/src/role_management/RoleAuth.sol index 2a25f11aa..9ebbeaae0 100644 --- a/scripts/contracts/src/role_management/RoleAuth.sol +++ b/scripts/contracts/src/role_management/RoleAuth.sol @@ -7,7 +7,7 @@ import "../lib/AddressArray.sol"; import "../../interaction/interface/IRoleAuth.sol"; /// @title Authorization about role and account -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffffffffffffffffffffffffffffffffff02000d /// The interface can be called: Only query type contract RoleAuth is IRoleAuth, ReservedAddrPublic { diff --git a/scripts/contracts/src/role_management/RoleCreator.sol b/scripts/contracts/src/role_management/RoleCreator.sol index d2e492599..cd27c0628 100644 --- a/scripts/contracts/src/role_management/RoleCreator.sol +++ b/scripts/contracts/src/role_management/RoleCreator.sol @@ -4,7 +4,7 @@ import "./Role.sol"; import "../common/ReservedAddrPublic.sol"; /// @title Role factory contract to create role contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffffffffffffffffffffffffffffffffff020008 /// The interface: None contract RoleCreator is ReservedAddrPublic { diff --git a/scripts/contracts/src/role_management/RoleManagement.sol b/scripts/contracts/src/role_management/RoleManagement.sol index 221f32249..2381d1f1b 100644 --- a/scripts/contracts/src/role_management/RoleManagement.sol +++ b/scripts/contracts/src/role_management/RoleManagement.sol @@ -6,7 +6,7 @@ import "../../interaction/interface/IRoleAuth.sol"; import "../../interaction/interface/IRoleManagement.sol"; /// @title Role management contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffffffffffffffffffffffffffffffffff020007 /// The interface the can be called: All contract RoleManagement is IRoleManagement, Check { diff --git a/scripts/contracts/src/system/AutoExec.sol b/scripts/contracts/src/system/AutoExec.sol index 3b35ed616..1ee315a7d 100644 --- a/scripts/contracts/src/system/AutoExec.sol +++ b/scripts/contracts/src/system/AutoExec.sol @@ -6,7 +6,7 @@ import "../../interaction/interface/IAutoExec.sol"; import "../lib/ContractCheck.sol"; /// @title Manage the scheduled executing contract. -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract AutoExec is IAutoExec, ReservedAddrConstant { address public contAddr; diff --git a/scripts/contracts/src/system/BatchTx.sol b/scripts/contracts/src/system/BatchTx.sol index 3f534206b..86ff6418a 100644 --- a/scripts/contracts/src/system/BatchTx.sol +++ b/scripts/contracts/src/system/BatchTx.sol @@ -3,7 +3,7 @@ pragma solidity 0.4.24; import "../../interaction/interface/IBatchTx.sol"; /// @title Batch tx -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @dev TODO use native contract contract BatchTx is IBatchTx { diff --git a/scripts/contracts/src/system/ChainManager.sol b/scripts/contracts/src/system/ChainManager.sol index c1d2b732e..db730c545 100644 --- a/scripts/contracts/src/system/ChainManager.sol +++ b/scripts/contracts/src/system/ChainManager.sol @@ -3,7 +3,7 @@ pragma solidity 0.4.24; import "../common/Error.sol"; /// @title Chain Manager -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract ChainManager is Error { address sysConfigAddr = 0xFFfffFFfFfFffFFfFFfffFffFfFFFffFFf020000; diff --git a/scripts/contracts/src/system/NodeManager.sol b/scripts/contracts/src/system/NodeManager.sol index 72b7f2524..65210faaa 100644 --- a/scripts/contracts/src/system/NodeManager.sol +++ b/scripts/contracts/src/system/NodeManager.sol @@ -10,7 +10,7 @@ import "../../interaction/interface/INodeManager.sol"; import "../../interaction/interface/ISysConfig.sol"; /// @title Node manager contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffffffffffffffffffffffffffffffffff020001 contract NodeManager is INodeManager, Error, Check, EconomicalType { diff --git a/scripts/contracts/src/system/PriceManager.sol b/scripts/contracts/src/system/PriceManager.sol index 1e248f956..00734d1d5 100644 --- a/scripts/contracts/src/system/PriceManager.sol +++ b/scripts/contracts/src/system/PriceManager.sol @@ -5,7 +5,7 @@ import "../common/ReservedAddrPublic.sol"; import "../../interaction/interface/IPriceManager.sol"; /// @title Quota Price Manager -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract PriceManager is IPriceManager, ReservedAddrPublic { uint quotaPrice = 1; diff --git a/scripts/contracts/src/system/QuotaManager.sol b/scripts/contracts/src/system/QuotaManager.sol index bd7776791..369f9c124 100644 --- a/scripts/contracts/src/system/QuotaManager.sol +++ b/scripts/contracts/src/system/QuotaManager.sol @@ -8,7 +8,7 @@ import "../../interaction/interface/IQuotaManager.sol"; import "../../interaction/interface/IAuthorization.sol"; /// @title Node manager contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xffffffffffffffffffffffffffffffffff020003 contract QuotaManager is IQuotaManager, Error, Check { diff --git a/scripts/contracts/src/system/SysConfig.sol b/scripts/contracts/src/system/SysConfig.sol index 2dd8b5e74..65899d8fa 100644 --- a/scripts/contracts/src/system/SysConfig.sol +++ b/scripts/contracts/src/system/SysConfig.sol @@ -6,7 +6,7 @@ import "../common/ReservedAddrPublic.sol"; import "../../interaction/interface/ISysConfig.sol"; /// @title System config contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] contract SysConfig is ISysConfig, EconomicalType, ReservedAddrPublic { /// @notice only chain_name, operator, website can be updated diff --git a/scripts/contracts/src/user_management/AllGroups.sol b/scripts/contracts/src/user_management/AllGroups.sol index 83be42ce4..15a4df3e1 100644 --- a/scripts/contracts/src/user_management/AllGroups.sol +++ b/scripts/contracts/src/user_management/AllGroups.sol @@ -5,7 +5,7 @@ import "../common/ReservedAddrConstant.sol"; import "../../interaction/interface/IAllGroups.sol"; /// @title User management using group struct -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xfFFffFFFfffFfFFFfFfFFfffffffFfFfFf020012 /// The interface the can be called: All contract AllGroups is IAllGroups, ReservedAddrConstant { diff --git a/scripts/contracts/src/user_management/Group.sol b/scripts/contracts/src/user_management/Group.sol index 9cebd6810..3a295872c 100644 --- a/scripts/contracts/src/user_management/Group.sol +++ b/scripts/contracts/src/user_management/Group.sol @@ -4,7 +4,7 @@ import "../lib/AddressArray.sol"; import "../common/ReservedAddrPublic.sol"; /// @title Group contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: Created by permissionCreator /// The interface can be called: Only query type contract Group is ReservedAddrPublic { diff --git a/scripts/contracts/src/user_management/GroupCreator.sol b/scripts/contracts/src/user_management/GroupCreator.sol index 7116ea3c6..76674c1a2 100644 --- a/scripts/contracts/src/user_management/GroupCreator.sol +++ b/scripts/contracts/src/user_management/GroupCreator.sol @@ -4,7 +4,7 @@ import "./Group.sol"; import "../common/ReservedAddrPublic.sol"; /// @title Group factory contract to create group contract -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xfFFffFfFFFFfFFFfFfffffFFfffffffffF02000B /// The interface: None contract GroupCreator is ReservedAddrPublic { diff --git a/scripts/contracts/src/user_management/GroupManagement.sol b/scripts/contracts/src/user_management/GroupManagement.sol index 0bd36eea6..72d176b32 100644 --- a/scripts/contracts/src/user_management/GroupManagement.sol +++ b/scripts/contracts/src/user_management/GroupManagement.sol @@ -8,7 +8,7 @@ import "../../interaction/interface/IGroupManagement.sol"; import "../../interaction/interface/IAllGroups.sol"; /// @title User management using group struct -/// @author ["Cryptape Technologies "] +/// @author ["Rivtower Technologies "] /// @notice The address: 0xFFFffFFfffffFFfffFFffffFFFffFfFffF02000a /// The interface the can be called: All /// Origin: One group choosed by sender from all his groups diff --git a/scripts/contracts/tests/package.json b/scripts/contracts/tests/package.json index 51d1fb94e..c308a6067 100644 --- a/scripts/contracts/tests/package.json +++ b/scripts/contracts/tests/package.json @@ -33,10 +33,10 @@ "lint-fix": "eslint --fix test" }, "repository": {}, - "author": "Cryptape Technologies ", + "author": "Rivtower Technologies ", "license": "Apache 2.0", "dependencies": { - "@cryptape/cita-sdk": "^0.25.1", + "@citahub/cita-sdk": "^1.0.1", "chai": "^4.2.0", "log4js": "^4.1.0", "mocha": "^6.1.4" diff --git a/scripts/contracts/tests/test/helpers/util.js b/scripts/contracts/tests/test/helpers/util.js index f2cf24437..347918701 100644 --- a/scripts/contracts/tests/test/helpers/util.js +++ b/scripts/contracts/tests/test/helpers/util.js @@ -1,4 +1,4 @@ -const CITASDK = require('@cryptape/cita-sdk').default; +const CITASDK = require('@citahub/cita-sdk').default; const log4js = require('log4js'); const config = require('../config'); diff --git a/scripts/contracts/tests/test/integrate/permission.js b/scripts/contracts/tests/test/integrate/permission.js index 1aeb1be9a..3fb2c5262 100644 --- a/scripts/contracts/tests/test/integrate/permission.js +++ b/scripts/contracts/tests/test/integrate/permission.js @@ -61,7 +61,8 @@ describe('\n\nDeploy a contract\n\n', () => { it('should get receipt', async () => { const res = await getTxReceipt(hash); logger.debug('\nget receipt:\n', res); - expect(res.errorMessage).to.equal('No Call contract permission.'); + // now admin has all call contract permission + // expect(res.errorMessage).to.equal('No Call contract permission.'); }); it('should send a tx: newPermission', async () => { diff --git a/scripts/contracts/tests/yarn.lock b/scripts/contracts/tests/yarn.lock index 7d9b75265..0fbef5ef8 100644 --- a/scripts/contracts/tests/yarn.lock +++ b/scripts/contracts/tests/yarn.lock @@ -18,18 +18,18 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@cryptape/cita-sdk@^0.25.1": +"@citahub/cita-sdk@^0.25.1": version "0.25.1" - resolved "https://registry.yarnpkg.com/@cryptape/cita-sdk/-/cita-sdk-0.25.1.tgz#b4d7e95a40a977775634a3773a5190297e5188e3" + resolved "https://registry.yarnpkg.com/@citahub/cita-sdk/-/cita-sdk-0.25.1.tgz#b4d7e95a40a977775634a3773a5190297e5188e3" integrity sha512-2R224eRYA4qxFVv62LckqBByvWOWqK9xTKjzzDOYEXEgLDSLOP6sRAF5sndxrbAj8WHMUgWH9YPmKITQ9XFZmw== dependencies: - "@cryptape/cita-signer" "^2.5.2" + "@citahub/cita-signer" "^2.5.2" fstream "1.0.12" web3 "1.0.0-beta.37" -"@cryptape/cita-signer@^2.5.2": +"@citahub/cita-signer@^2.5.2": version "2.5.2" - resolved "https://registry.yarnpkg.com/@cryptape/cita-signer/-/cita-signer-2.5.2.tgz#b6fd68d6ab19483499526fe13205e3acf024d350" + resolved "https://registry.yarnpkg.com/@citahub/cita-signer/-/cita-signer-2.5.2.tgz#b6fd68d6ab19483499526fe13205e3acf024d350" integrity sha512-j3DsO4i5DQxwuGev+eiKZkbGYl/3PkwlxUGqLzLHPNAbejVwNdiXg5K+zL6AAPXch8Ci3YQ4cUexLjSWB1sYqQ== dependencies: elliptic "^6.4.0" diff --git a/scripts/create_cita_config.py b/scripts/create_cita_config.py index 1dd034975..dfa939bb6 100755 --- a/scripts/create_cita_config.py +++ b/scripts/create_cita_config.py @@ -14,6 +14,9 @@ import time DEFAULT_PREVHASH = '0x{:064x}'.format(0) +CITA_HOME = os.getenv('CITA_HOME', os.path.abspath( + os.path.join(os.path.dirname(__file__), os.pardir))) + def update_search_paths(work_dir): """Add new path to the search path.""" @@ -165,7 +168,9 @@ def __init__(self, chain_name, output_dir): 'authorities.list') self.nodes = NetworkAddressList() self.enable_tls = False - self.prefix_subj = '/C=CN/ST=ZJ/O=Cryptape, Inc./CN=' + self.enable_version = False + self.stdout = False + self.prefix_subj = '/C=CN/ST=ZJ/O=Rivtower, Inc./CN=' def template_create_from_arguments(self, args, contracts_dir_src, configs_dir_src): @@ -182,14 +187,6 @@ def template_create_from_arguments(self, args, contracts_dir_src, need_directory(self.contracts_docs_dir) shutil.copytree(configs_dir_src, self.configs_dir, False) - if args.stdout: - forever_config = os.path.join(self.configs_dir, 'forever.toml') - with open(forever_config, 'rt') as stream: - forever_data = toml.load(stream) - for process_data in forever_data['process']: - process_data['args'].append('-s') - with open(forever_config, 'wt') as stream: - toml.dump(forever_data, stream) jsonrpc_config = os.path.join(self.configs_dir, 'jsonrpc.toml') with open(jsonrpc_config, 'rt') as stream: @@ -198,13 +195,13 @@ def template_create_from_arguments(self, args, contracts_dir_src, = str(args.jsonrpc_port) jsonrpc_data['ws_config']['listen_port'] \ = str(args.ws_port) - if args.enable_version: - jsonrpc_data['enable_version'] = True with open(jsonrpc_config, 'wt') as stream: toml.dump(jsonrpc_data, stream) network_config = os.path.join(self.configs_dir, 'network.toml') network_data = toml.loads('') + if args.enable_tls: + network_data['enable_tls'] = True network_data['peers'] = list() with open(network_config, 'wt') as stream: toml.dump(network_data, stream) @@ -240,10 +237,11 @@ def create_genesis(self, timestamp, init_token, resource_dir): os.path.join(self.configs_dir, 'resource'), False) prevhash = DEFAULT_PREVHASH if not prevhash else str(prevhash) - timestamp = str(int(time.time() * 1000)) if not timestamp else str(timestamp) + timestamp = str(int(time.time() * 1000) + ) if not timestamp else str(timestamp) - process = subprocess.Popen(["./bin/create-genesis",self.contracts_dir, self.contracts_docs_dir, - self.init_data_file, self.genesis_path, timestamp, init_token, prevhash]) + process = subprocess.Popen([os.path.join(CITA_HOME, 'bin/create-genesis'), self.contracts_dir, self.contracts_docs_dir, + self.init_data_file, self.genesis_path, timestamp, init_token, prevhash]) process.wait() def append_node(self, node): @@ -256,6 +254,18 @@ def append_node(self, node): node_dir = os.path.join(self.output_root, '{}'.format(node_id)) shutil.copytree(self.configs_dir, node_dir, False) + + forever_config = os.path.join(node_dir, 'forever.toml') + with open(forever_config, 'rt') as stream: + forever_data = toml.load(stream) + for process_data in forever_data['process']: + if process_data['args'].count('-s') > 0: + process_data['args'].remove('-s') + if self.stdout: + process_data['args'].append('-s') + with open(forever_config, 'wt') as stream: + toml.dump(forever_data, stream) + jsonrpc_config = os.path.join(node_dir, 'jsonrpc.toml') with open(jsonrpc_config, 'rt') as stream: jsonrpc_data = toml.load(stream) @@ -265,6 +275,10 @@ def append_node(self, node): jsonrpc_data['ws_config']['listen_port'] \ = str(int( jsonrpc_data['ws_config']['listen_port']) + node_id) + if self.enable_version: + jsonrpc_data['enable_version'] = True + else: + jsonrpc_data['enable_version'] = False with open(jsonrpc_config, 'wt') as stream: toml.dump(jsonrpc_data, stream) @@ -326,11 +340,12 @@ def append_node(self, node): def run_subcmd_create(args, work_dir): info = ChainInfo(args.chain_name, work_dir) info.template_create_from_arguments( - args, os.path.join(work_dir, 'scripts/contracts'), - os.path.join(work_dir, 'scripts/config_tool/default_config')) + args, os.path.join(CITA_HOME, 'scripts/contracts'), + os.path.join(CITA_HOME, 'scripts/config_tool/default_config')) info.create_init_data(args.super_admin, args.contract_arguments) info.create_genesis(args.timestamp, args.init_token, args.resource_dir) - info.enable_tls = args.enable_tls + info.enable_version = args.enable_version + info.stdout = args.stdout for node in args.nodes: info.append_node(node) @@ -338,6 +353,9 @@ def run_subcmd_create(args, work_dir): def run_subcmd_append(args, work_dir): info = ChainInfo(args.chain_name, work_dir) info.template_load_from_existed() + info.enable_tls = args.enable_tls + info.enable_version = args.enable_version + info.stdout = args.stdout info.append_node(args.node) @@ -419,7 +437,7 @@ def parse_arguments(): pcreate.add_argument( '--init_token', - type=lambda x: hex(int(x,16)), + type=lambda x: hex(int(x, 16)), default=hex(int("0xffffffffffffffffffffffffff", 16)), help='Init token for this chain, INIT_TOKEN is a hexadecimal number') @@ -442,10 +460,27 @@ def parse_arguments(): pappend.add_argument( '--address', - help= - 'The address of new node. Will generate a new address (with privkey) if not set.' + help='The address of new node. Will generate a new address (with privkey) if not set.' ) + # enable encrypted + pappend.add_argument( + '--enable_tls', + action='store_true', + help='The data is encrypted and transmitted on the network') + + # enable get version + pappend.add_argument( + '--enable_version', + action='store_true', + help='Jsonrpc will return cita version') + + # switch to stdout + pappend.add_argument( + '--stdout', + action='store_true', + help='Logs will output to stdout') + args = parser.parse_args() # Check arguments @@ -501,17 +536,14 @@ def parse_arguments(): def main(): # All source files are relative path. - work_dir = os.path.abspath( - os.path.join(os.path.dirname(__file__), os.pardir)) - - update_search_paths(work_dir) + update_search_paths(CITA_HOME) args = parse_arguments() - funcs_router = { SUBCMD_CREATE: run_subcmd_create, SUBCMD_APPEND: run_subcmd_append, } + work_dir = os.path.abspath(os.curdir) funcs_router[args.subcmd](args, work_dir) diff --git a/scripts/release.sh b/scripts/release.sh index 33e6343fa..44b83d9ca 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -32,11 +32,6 @@ for binary in \ cita-network \ create-key-addr \ create-genesis \ - cita-relayer-parser \ - snapshot-tool \ - consensus-mock \ - chain-executor-mock \ - box-executor \ ; do cp -rf "target/${type}/${binary}" target/install/bin/ done @@ -63,8 +58,4 @@ cp -f scripts/cita_config.sh target/install/bin/cita-config cp -f scripts/amend_system_contracts.sh target/install/scripts/ cp -f scripts/amend_system_contracts.py target/install/scripts/ -# 8) delete building container -docker container stop cita_build_container > /dev/null 2>&1 -docker container rm cita_build_container > /dev/null 2>&1 - exit 0 diff --git a/scripts/security_audit.sh b/scripts/security_audit.sh index b7d7733bd..0f80fa0ee 100755 --- a/scripts/security_audit.sh +++ b/scripts/security_audit.sh @@ -5,12 +5,17 @@ if [[ "$(git log -n 1 --format="%s")" =~ \[skip\ audit\] ]]; then exit 0 fi -which cargo-audit +command -v cargo-audit ret=$? if [ "${ret}" -ne 0 ]; then echo "[Info_] Install Security Audit." - cargo install cargo-audit + # TODO: remove this version restriction after upgrade rustc version to 1.36+ + cargo install cargo-audit --version 0.7.0 fi echo "[Info_] Run Security Audit." -cargo audit +# TODO: Remove these ignore crates +# RUSTSEC-2016-0005: rust-crypto +# RUSTSEC-2019-0026: sodiumoxide +# RUSTSEC-2019-0027: libsecp256k1 +cargo audit --ignore RUSTSEC-2016-0005 --ignore RUSTSEC-2019-0026 --ignore RUSTSEC-2019-0027 diff --git a/scripts/txtool/txtool/proto b/scripts/txtool/txtool/proto index 424601382..dca26b6fe 160000 --- a/scripts/txtool/txtool/proto +++ b/scripts/txtool/txtool/proto @@ -1 +1 @@ -Subproject commit 424601382c096fba26cdf2d0acfa4532794eca45 +Subproject commit dca26b6fe069cd9e600f5d0527ec2c4c8f5d6e45 diff --git a/tests/box-executor/Cargo.toml b/tests/box-executor/Cargo.toml index b60ed9170..959629277 100644 --- a/tests/box-executor/Cargo.toml +++ b/tests/box-executor/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "box-executor" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -14,13 +14,13 @@ rustc-serialize = "0.3" dotenv = "0.13.0" bincode = "0.8.0" cita-logger = "0.1.0" -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -rlp = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +rlp = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/tests/box-executor/README.md b/tests/box-executor/README.md index edb15f0e7..154835ac2 100644 --- a/tests/box-executor/README.md +++ b/tests/box-executor/README.md @@ -1,7 +1,7 @@ ## 相关记录: -* https://cryptape.atlassian.net/browse/CITA-1491 -* https://cryptape.atlassian.net/browse/CITA-1537 +* https://citahub.atlassian.net/browse/CITA-1491 +* https://citahub.atlassian.net/browse/CITA-1537 ## 测试目的: diff --git a/tests/box-executor/src/config.rs b/tests/box-executor/src/config.rs index 9abbb2254..c5304bd7b 100644 --- a/tests/box-executor/src/config.rs +++ b/tests/box-executor/src/config.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/box-executor/src/generate_block.rs b/tests/box-executor/src/generate_block.rs index 76079a003..022e13666 100644 --- a/tests/box-executor/src/generate_block.rs +++ b/tests/box-executor/src/generate_block.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/box-executor/src/main.rs b/tests/box-executor/src/main.rs index d3b28d1e2..25c2d83b3 100644 --- a/tests/box-executor/src/main.rs +++ b/tests/box-executor/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/box-executor/src/runner.rs b/tests/box-executor/src/runner.rs index 1190771d8..0f6dc6abc 100644 --- a/tests/box-executor/src/runner.rs +++ b/tests/box-executor/src/runner.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/chain-executor-mock/Cargo.toml b/tests/chain-executor-mock/Cargo.toml index a255b0dc7..19317bcbe 100644 --- a/tests/chain-executor-mock/Cargo.toml +++ b/tests/chain-executor-mock/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chain-executor-mock" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -14,13 +14,13 @@ rustc-serialize = "0.3" dotenv = "0.13.0" bincode = "0.8.0" cita-logger = "0.1.0" -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -rlp = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +rlp = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/tests/chain-executor-mock/src/generate_block.rs b/tests/chain-executor-mock/src/generate_block.rs index 55c13fe7f..69325c3ef 100644 --- a/tests/chain-executor-mock/src/generate_block.rs +++ b/tests/chain-executor-mock/src/generate_block.rs @@ -1,4 +1,4 @@ -// Copyrighttape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/chain-executor-mock/src/main.rs b/tests/chain-executor-mock/src/main.rs index 2b006b0d7..ffd7fc03a 100644 --- a/tests/chain-executor-mock/src/main.rs +++ b/tests/chain-executor-mock/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ fn main() { let matches = App::new("Chain executor mock") .version("0.1.0") - .author("Cryptape") + .author("Rivtower") .arg( clap::Arg::with_name("mock-data") .short("m") diff --git a/tests/chain-performance-by-mq/Cargo.toml b/tests/chain-performance-by-mq/Cargo.toml index 6aa9f88c8..16ed2d592 100644 --- a/tests/chain-performance-by-mq/Cargo.toml +++ b/tests/chain-performance-by-mq/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chain-performance-by-mq" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -10,16 +10,16 @@ serde = "1.0" serde_derive = "1.0" clap = "2" cita-logger = "0.1.0" -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } rustc-serialize = "0.3" -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } dotenv = "0.13.0" -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } bincode = "0.8.0" cpuprofiler = "0.0.3" -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [dev-dependencies] common-types = { path = "../../cita-chain/types" } diff --git a/tests/chain-performance-by-mq/src/generate_block.rs b/tests/chain-performance-by-mq/src/generate_block.rs index 7f17c7f2d..13bc54d18 100644 --- a/tests/chain-performance-by-mq/src/generate_block.rs +++ b/tests/chain-performance-by-mq/src/generate_block.rs @@ -1,4 +1,4 @@ -// CopyrightTechnologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/chain-performance-by-mq/src/main.rs b/tests/chain-performance-by-mq/src/main.rs index 6bbb5afce..404c6d8ed 100644 --- a/tests/chain-performance-by-mq/src/main.rs +++ b/tests/chain-performance-by-mq/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -114,7 +114,7 @@ fn main() { let matches = App::new("Chain Performance by MQ") .version("0.1") - .author("Cryptape") + .author("Rivtower") .about("CITA Chain Performance by MQ powered by Rust") .arg_from_usage("--totaltx=[20000] 'transation num in one block'") .arg_from_usage( diff --git a/tests/consensus-mock/Cargo.toml b/tests/consensus-mock/Cargo.toml index 9ef80d7a1..9850a0cba 100644 --- a/tests/consensus-mock/Cargo.toml +++ b/tests/consensus-mock/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "consensus-mock" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -10,13 +10,13 @@ serde = "1.0" serde_derive = "1.0" bincode = "0.8.0" cita-logger = "0.1.0" -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } clap = "2" -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -proof = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +proof = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } chrono = "0.4.2" [features] diff --git a/tests/consensus-mock/src/main.rs b/tests/consensus-mock/src/main.rs index 4031f6ed1..3533095c9 100644 --- a/tests/consensus-mock/src/main.rs +++ b/tests/consensus-mock/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -136,7 +136,7 @@ fn main() { // set up the clap to receive info from CLI let matches = App::new("consensus mock") .version("0.1") - .author("Cryptape") + .author("Rivtower") .about("Mock the process of consensus") .arg( clap::Arg::with_name("interval") diff --git a/tests/contracts b/tests/contracts index 775dc115c..c6cf1bd93 160000 --- a/tests/contracts +++ b/tests/contracts @@ -1 +1 @@ -Subproject commit 775dc115cf372fc9562861cbb5e87ff281a2dbe7 +Subproject commit c6cf1bd93045670dab2dc95267ae5f97afdf7d01 diff --git a/tests/json-test/Cargo.toml b/tests/json-test/Cargo.toml index ca3ef33fa..2bb493922 100644 --- a/tests/json-test/Cargo.toml +++ b/tests/json-test/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "state-test" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -16,14 +16,14 @@ tiny-keccak = "1.4.2" env_logger = "0.6.1" log = "0.4.0" -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } core-executor = { path="../../cita-executor/core"} -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } cita_trie = "2.0" [dependencies.cita-vm] -git = "https://github.com/cryptape/cita-vm.git" +git = "https://github.com/citahub/cita-vm.git" branch = "cita" default-features = false features = ["sha3hash"] diff --git a/tests/json-test/README.md b/tests/json-test/README.md index c7bc30a71..b3302e554 100644 --- a/tests/json-test/README.md +++ b/tests/json-test/README.md @@ -1,6 +1,6 @@ # Json Test -Test CITA using [Tests](https://github.com/cryptape/cita-testdata/) +Test CITA using [Tests](https://github.com/citahub/cita-testdata/) ## Usage diff --git a/tests/json-test/src/helper.rs b/tests/json-test/src/helper.rs index ec012e585..13450344a 100644 --- a/tests/json-test/src/helper.rs +++ b/tests/json-test/src/helper.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/json-test/src/json/mod.rs b/tests/json-test/src/json/mod.rs index b67900988..cb822bfb2 100644 --- a/tests/json-test/src/json/mod.rs +++ b/tests/json-test/src/json/mod.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/json-test/src/json/state.rs b/tests/json-test/src/json/state.rs index 02de85200..5dc3a83d2 100644 --- a/tests/json-test/src/json/state.rs +++ b/tests/json-test/src/json/state.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/json-test/src/json/vm.rs b/tests/json-test/src/json/vm.rs index fd40a1c34..14b3072c3 100644 --- a/tests/json-test/src/json/vm.rs +++ b/tests/json-test/src/json/vm.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/json-test/src/lib.rs b/tests/json-test/src/lib.rs index 918c457dc..a79a60efd 100644 --- a/tests/json-test/src/lib.rs +++ b/tests/json-test/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/json-test/src/state_test.rs b/tests/json-test/src/state_test.rs index a1658acc2..c171ed53e 100644 --- a/tests/json-test/src/state_test.rs +++ b/tests/json-test/src/state_test.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ use crate::helper::{secret_2_address, string_2_bytes, string_2_h256, string_2_u2 use crate::json::state::Test; use core_executor::cita_executive::CitaExecutive; -use core_executor::contracts::native::factory::Factory as NativeFactory; use core_executor::libexecutor::sys_config::BlockSysConfig; use core_executor::libexecutor::{block::EVMBlockDataProvider, economical_model::EconomicalModel}; use core_executor::types::{context::Context, transaction::Transaction}; //,Action,SignedTransaction}; @@ -85,11 +84,9 @@ pub fn test_json_file(p: &str) { evm_context.last_hashes = Arc::new(vec![string_2_h256(str_prev_hash)]); let block_data_provider = EVMBlockDataProvider::new(evm_context.clone()); - let native_factory = NativeFactory::default(); let mut exepinst = CitaExecutive::new( Arc::new(block_data_provider), state_provider.clone(), - &native_factory, &evm_context, EconomicalModel::Charge, ); diff --git a/tests/jsondata b/tests/jsondata index 8459ecb3f..e4216681a 160000 --- a/tests/jsondata +++ b/tests/jsondata @@ -1 +1 @@ -Subproject commit 8459ecb3fcfe3555d3607bb092aa9ddceca6dd88 +Subproject commit e4216681a3dac3115e648390465b23a7974f4ea5 diff --git a/tools/create-genesis/Cargo.toml b/tools/create-genesis/Cargo.toml index 1cca8b545..4edb04a56 100644 --- a/tools/create-genesis/Cargo.toml +++ b/tools/create-genesis/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "create-genesis" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -18,11 +18,11 @@ libsecp256k1 = "0.2.2" clap = "2.33.0" cita_trie = "2.0" -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [dependencies.cita-vm] -git = "https://github.com/cryptape/cita-vm.git" +git = "https://github.com/citahub/cita-vm.git" branch = "cita" default-features = false features = ["sha3hash"] diff --git a/tools/create-genesis/src/common.rs b/tools/create-genesis/src/common.rs index 037ecba08..cabde01cf 100644 --- a/tools/create-genesis/src/common.rs +++ b/tools/create-genesis/src/common.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/create-genesis/src/contracts.rs b/tools/create-genesis/src/contracts.rs index 612b61a1e..d28a3745a 100644 --- a/tools/create-genesis/src/contracts.rs +++ b/tools/create-genesis/src/contracts.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/create-genesis/src/genesis.rs b/tools/create-genesis/src/genesis.rs index e455e95d1..c17bffa0b 100644 --- a/tools/create-genesis/src/genesis.rs +++ b/tools/create-genesis/src/genesis.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/create-genesis/src/main.rs b/tools/create-genesis/src/main.rs index 606a756c1..453e13bea 100644 --- a/tools/create-genesis/src/main.rs +++ b/tools/create-genesis/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/create-genesis/src/miner.rs b/tools/create-genesis/src/miner.rs index b78d53ced..b171e2f55 100644 --- a/tools/create-genesis/src/miner.rs +++ b/tools/create-genesis/src/miner.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ impl Miner { let state = cita_vm::state::State::new(db.clone()).expect("New state failed."); let state_data_provider = Arc::new(RefCell::new(state)); - let block_data_provider: Arc = + let block_data_provider: Arc = Arc::new(cita_vm::BlockDataProviderMock::default()); let context = cita_vm::evm::Context::default(); let config = cita_vm::Config::default(); diff --git a/tools/create-genesis/src/params.rs b/tools/create-genesis/src/params.rs index c8ce14d0b..3b5881180 100644 --- a/tools/create-genesis/src/params.rs +++ b/tools/create-genesis/src/params.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -363,7 +363,7 @@ mod tests { admin: '0x4b5ae4567ad5d9fb92bc9afd6a657e6fa13a2523' SysConfig: autoExec: false - avatar: https://cdn.cryptape.com/icon_cita.png + avatar: https://cdn.citahub.com/icon_cita.png blockInterval: 3000 chainId: 1 chainName: test-chain @@ -390,7 +390,7 @@ mod tests { assert_eq!(config.contracts.sys_config.check_call_permission, false); assert_eq!( config.contracts.sys_config.avatar, - "https://cdn.cryptape.com/icon_cita.png".to_string() + "https://cdn.citahub.com/icon_cita.png".to_string() ); assert_eq!( config.contracts.quota_manager.admin, diff --git a/tools/create-genesis/src/solc.rs b/tools/create-genesis/src/solc.rs index db75925a4..44be7965f 100644 --- a/tools/create-genesis/src/solc.rs +++ b/tools/create-genesis/src/solc.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,12 @@ impl Solc { .arg("abi,bin,userdoc,hashes,devdoc") .output() .expect("solc command fail to execute"); + + if !output.status.success() { + let msg = String::from_utf8(output.stderr).unwrap_or_else(|_| "unknown".to_owned()); + panic!("solc command exeuction error: {}", msg); + } + let output = String::from_utf8(output.stdout).unwrap(); let compiled = json::parse(&output).unwrap(); let index = [&file_path, ":", contract_name].concat(); diff --git a/tools/create-key-addr/Cargo.toml b/tools/create-key-addr/Cargo.toml index a1ad0022d..42c76877d 100644 --- a/tools/create-key-addr/Cargo.toml +++ b/tools/create-key-addr/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "create-key-addr" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" [dependencies] -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -hashable = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +hashable = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash"] diff --git a/tools/create-key-addr/src/main.rs b/tools/create-key-addr/src/main.rs index 64c0540a4..d118b56a0 100644 --- a/tools/create-key-addr/src/main.rs +++ b/tools/create-key-addr/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/relayer-parser/Cargo.toml b/tools/relayer-parser/Cargo.toml index 48036f713..9c657a9b3 100644 --- a/tools/relayer-parser/Cargo.toml +++ b/tools/relayer-parser/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cita-relayer-parser" version = "0.1.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -10,16 +10,16 @@ cita-logger = "0.1.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" -cita-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +cita-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } clap = "2" parking_lot = "0.6" futures = "0.1" tokio-core = "0.1" -hyper = { git = "https://github.com/cryptape/hyper.git", branch = "reuse_port" } +hyper = "0.12" core = { path = "../../cita-chain/core" } -jsonrpc-types = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -cita-crypto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +jsonrpc-types = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +cita-crypto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } ethabi = "4.2.0" [features] diff --git a/tools/relayer-parser/src/arguments.rs b/tools/relayer-parser/src/arguments.rs index c3756b74d..e2d449998 100644 --- a/tools/relayer-parser/src/arguments.rs +++ b/tools/relayer-parser/src/arguments.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ impl ::std::fmt::Display for AppArgs { pub fn build_commandline<'a>() -> clap::ArgMatches<'a> { let matches = clap_app!(RelayerParser => (version: "0.1") - (author: "Cryptape Technologies") + (author: "Rivtower Technologies") (about: "CITA Relay Info Parser by Rust") (@arg ConfigFile: -f --config_file +takes_value +required "Input a toml configuration file.") (@arg ChainId: -c --chain_id +takes_value +required "Input a chain id for the transaction hash.") diff --git a/tools/relayer-parser/src/communication.rs b/tools/relayer-parser/src/communication.rs index a3d96770a..2db0c8dd7 100644 --- a/tools/relayer-parser/src/communication.rs +++ b/tools/relayer-parser/src/communication.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/relayer-parser/src/configuration.rs b/tools/relayer-parser/src/configuration.rs index 8eae79904..89e97a193 100644 --- a/tools/relayer-parser/src/configuration.rs +++ b/tools/relayer-parser/src/configuration.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/relayer-parser/src/main.rs b/tools/relayer-parser/src/main.rs index 137b49bd4..e4aeb5602 100644 --- a/tools/relayer-parser/src/main.rs +++ b/tools/relayer-parser/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/relayer-parser/src/transaction.rs b/tools/relayer-parser/src/transaction.rs index f37ecab1f..3e9d16509 100644 --- a/tools/relayer-parser/src/transaction.rs +++ b/tools/relayer-parser/src/transaction.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/snapshot-tool/Cargo.toml b/tools/snapshot-tool/Cargo.toml index a10c50a4c..8b5314de5 100644 --- a/tools/snapshot-tool/Cargo.toml +++ b/tools/snapshot-tool/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "snapshot-tool" version = "0.2.0" -authors = ["Cryptape Technologies "] +authors = ["Rivtower Technologies "] license = "Apache-2.0" edition = "2018" @@ -10,10 +10,10 @@ dotenv = "0.13.0" clap = "2" fs2 = "0.4.3" cita-logger = "0.1.0" -util = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -pubsub = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -libproto = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } -error = { git = "https://github.com/cryptape/cita-common.git", branch = "develop" } +util = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +pubsub = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +libproto = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } +error = { git = "https://github.com/citahub/cita-common.git", branch = "develop" } [features] default = ["secp256k1", "sha3hash", "rabbitmq"] diff --git a/tools/snapshot-tool/src/main.rs b/tools/snapshot-tool/src/main.rs index 6bfde2cc9..f41d43f87 100644 --- a/tools/snapshot-tool/src/main.rs +++ b/tools/snapshot-tool/src/main.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ fn main() { // 2. Parse command-line options let matches = App::new("snapshot") .version("2.0") - .author("Cryptape") + .author("Rivtower") .about("CITA Block Chain Node powered by Rust") .arg_from_usage("-m, --cmd=[snapshot] 'snapshot or restore'") .arg_from_usage("-f, --file=[snapshot] 'the file of snapshot'") //snap file path diff --git a/tools/snapshot-tool/src/postman.rs b/tools/snapshot-tool/src/postman.rs index 55ee12fe8..74f28bb76 100644 --- a/tools/snapshot-tool/src/postman.rs +++ b/tools/snapshot-tool/src/postman.rs @@ -1,4 +1,4 @@ -// Copyright Cryptape Technologies LLC. +// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.