Skip to content
Permalink
Browse files

Merge pull request #1504 from nearprotocol/v0.4.0

Release 0.4.0
  • Loading branch information...
bowenwang1996 committed Oct 21, 2019
2 parents 5dab64f + 122dfec commit 8f488f3fd9b96b1a329e6f24b4bff870f446d7df
Showing with 137,886 additions and 116,166 deletions.
  1. +1 −4 .gitattributes
  2. +13 −73 .gitlab-ci.yml
  3. +1 −1 CODEOWNERS
  4. +1,136 −980 Cargo.lock
  5. +15 −2 Cargo.toml
  6. +1 −3 Dockerfile
  7. +10 −0 Dockerfile.prod
  8. +5 −3 Makefile
  9. +5 −0 chain/chain/Cargo.toml
  10. +1,464 −220 chain/chain/src/chain.rs
  11. +65 −3 chain/chain/src/error.rs
  12. +16 −2 chain/chain/src/lib.rs
  13. +936 −101 chain/chain/src/store.rs
  14. +778 −115 chain/chain/src/test_utils.rs
  15. +332 −113 chain/chain/src/types.rs
  16. +83 −0 chain/chain/tests/challenges.rs
  17. +110 −103 chain/chain/tests/simple_chain.rs
  18. +4 −4 chain/chain/tests/sync_chain.rs
  19. +33 −0 chain/chunks/Cargo.toml
  20. +1,076 −0 chain/chunks/src/lib.rs
  21. +38 −0 chain/chunks/src/types.rs
  22. +9 −4 chain/client/Cargo.toml
  23. +773 −992 chain/client/src/client.rs
  24. +1,091 −0 chain/client/src/client_actor.rs
  25. +31 −20 chain/client/src/info.rs
  26. +5 −3 chain/client/src/lib.rs
  27. +371 −179 chain/client/src/sync.rs
  28. +443 −23 chain/client/src/test_utils.rs
  29. +101 −28 chain/client/src/types.rs
  30. +95 −46 chain/client/src/view_client.rs
  31. +122 −0 chain/client/tests/bug_repros.rs
  32. +542 −0 chain/client/tests/catching_up.rs
  33. +155 −0 chain/client/tests/challenges.rs
  34. +144 −0 chain/client/tests/chunks_management.rs
  35. +477 −0 chain/client/tests/cross_shard_tx.rs
  36. +237 −74 chain/client/tests/process_blocks.rs
  37. +20 −0 chain/epoch_manager/Cargo.toml
  38. +1,312 −0 chain/epoch_manager/src/lib.rs
  39. +240 −0 chain/epoch_manager/src/proposals.rs
  40. +53 −0 chain/epoch_manager/src/reward_calculator.rs
  41. +182 −0 chain/epoch_manager/src/test_utils.rs
  42. +182 −0 chain/epoch_manager/src/types.rs
  43. +10 −9 chain/jsonrpc/client/src/lib.rs
  44. +33 −8 chain/jsonrpc/src/lib.rs
  45. +1 −0 chain/jsonrpc/src/metrics.rs
  46. +11 −6 chain/jsonrpc/tests/rpc_query.rs
  47. +34 −28 chain/jsonrpc/tests/rpc_transactions.rs
  48. +8 −0 chain/network/Cargo.toml
  49. +74 −0 chain/network/benches/graph.rs
  50. +51 −3 chain/network/src/codec.rs
  51. +2 −0 chain/network/src/lib.rs
  52. +184 −42 chain/network/src/peer.rs
  53. +493 −138 chain/network/src/peer_manager.rs
  54. +8 −4 chain/network/src/peer_store.rs
  55. +7 −2 chain/network/src/rate_counter.rs
  56. +629 −0 chain/network/src/routing.rs
  57. +47 −3 chain/network/src/test_utils.rs
  58. +378 −87 chain/network/src/types.rs
  59. +21 −0 chain/network/src/utils.rs
  60. +122 −44 chain/network/tests/announce_account.rs
  61. +101 −28 chain/network/tests/peer_handshake.rs
  62. +472 −0 chain/network/tests/routing.rs
  63. +20 −11 chain/pool/src/lib.rs
  64. +6 −2 chain/telemetry/src/lib.rs
  65. +3 −2 core/crypto/Cargo.toml
  66. +6 −1 core/crypto/src/key_file.rs
  67. +2 −2 core/crypto/src/lib.rs
  68. +64 −47 core/crypto/src/signature.rs
  69. +24 −7 core/crypto/src/signer.rs
  70. +1 −1 core/primitives/Cargo.toml
  71. +15 −10 core/primitives/benches/serialization.rs
  72. +4 −4 core/primitives/src/account.rs
  73. +305 −63 core/primitives/src/block.rs
  74. +0 −4 core/primitives/src/crypto/mod.rs
  75. +0 −335 core/primitives/src/crypto/signature.rs
  76. +0 −204 core/primitives/src/crypto/signer.rs
  77. +273 −0 core/primitives/src/errors.rs
  78. +44 −15 core/primitives/src/hash.rs
  79. +1 −1 core/primitives/src/lib.rs
  80. +21 −13 core/primitives/src/merkle.rs
  81. +0 −111 core/primitives/src/network.rs
  82. +1 −8 core/primitives/src/receipt.rs
  83. +2 −2 core/primitives/src/serialize.rs
  84. +299 −28 core/primitives/src/sharding.rs
  85. +134 −3 core/primitives/src/test_utils.rs
  86. +60 −53 core/primitives/src/transaction.rs
  87. +52 −7 core/primitives/src/types.rs
  88. +59 −26 core/primitives/src/utils.rs
  89. +397 −177 core/primitives/src/views.rs
  90. +1 −0 core/store/Cargo.toml
  91. +97 −26 core/store/src/lib.rs
  92. +524 −225 core/store/src/trie/mod.rs
  93. +25 −10 core/store/src/trie/update.rs
  94. +31 −0 genesis-tools/README.md
  95. +25 −0 genesis-tools/genesis-populate/Cargo.toml
  96. +282 −0 genesis-tools/genesis-populate/src/lib.rs
  97. +41 −0 genesis-tools/genesis-populate/src/main.rs
  98. +2 −2 near/Cargo.toml
  99. +104,888 −104,895 near/res/testnet.json
  100. +218 −154 near/src/config.rs
  101. +21 −14 near/src/lib.rs
  102. +39 −14 near/src/main.rs
  103. +1,357 −609 near/src/runtime.rs
  104. +381 −0 near/src/shard_tracker.rs
  105. +0 −41 near/src/test_utils.rs
  106. +0 −1,241 near/src/validator_manager.rs
  107. +49 −41 near/tests/run_nodes.rs
  108. +0 −93 near/tests/runtime_fork.rs
  109. +158 −82 near/tests/stake_nodes.rs
  110. +78 −50 near/tests/sync_nodes.rs
  111. +201 −56 near/tests/sync_state_nodes.rs
  112. +62 −0 near/tests/track_shards.rs
  113. +84 −0 near/tests/tx_propagation.rs
  114. +0 −7 protos/builder/Cargo.toml
  115. +0 −3 protos/builder/src/bin/protos_autogen.rs
  116. +0 −44 protos/builder/src/lib.rs
  117. 0 touch.txt → pytest/__init__.py
  118. 0 pytest/lib/__init__.py
  119. +216 −0 pytest/lib/cluster.py
  120. +14 −0 pytest/lib/retry.py
  121. +63 −0 pytest/lib/serializer.py
  122. +180 −0 pytest/lib/transaction.py
  123. +43 −0 pytest/lib/utils.py
  124. +6 −0 pytest/requirements.txt
  125. 0 pytest/tests/__init__.py
  126. +58 −0 pytest/tests/sanity/block_production.py
  127. +93 −0 pytest/tests/sanity/restart.py
  128. +69 −0 pytest/tests/sanity/staking1.py
  129. +116 −0 pytest/tests/sanity/staking2.py
  130. +41 −0 pytest/tests/sanity/staking_repro1.py
  131. +14 −0 pytest/tests/sanity/staking_repro2.py
  132. +102 −0 pytest/tests/sanity/state_sync.py
  133. +69 −0 pytest/tests/sanity/transactions.py
  134. +390 −0 pytest/tests/stress/stress.py
  135. +1 −1 runtime/near-runtime-fees/Cargo.toml
  136. +297 −16 runtime/near-runtime-fees/src/lib.rs
  137. +12 −0 runtime/near-vm-errors/Cargo.toml
  138. +218 −0 runtime/near-vm-errors/src/lib.rs
  139. +38 −3 runtime/near-vm-logic/Cargo.toml
  140. +20 −3 runtime/near-vm-logic/src/config.rs
  141. +3 −1 runtime/near-vm-logic/src/context.rs
  142. +60 −24 runtime/near-vm-logic/src/dependencies.rs
  143. +0 −54 runtime/near-vm-logic/src/errors.rs
  144. +119 −0 runtime/near-vm-logic/src/gas_counter.rs
  145. +3 −3 runtime/near-vm-logic/src/lib.rs
  146. +1,005 −270 runtime/near-vm-logic/src/logic.rs
  147. +202 −42 runtime/near-vm-logic/src/mocks/mock_external.rs
  148. +1 −6 runtime/near-vm-logic/src/mocks/mock_memory.rs
  149. +48 −0 runtime/near-vm-logic/src/serde_with.rs
  150. +3 −2 runtime/near-vm-logic/tests/fixtures.rs
  151. +67 −0 runtime/near-vm-logic/tests/helpers.rs
  152. +113 −0 runtime/near-vm-logic/tests/test_context.rs
  153. +202 −0 runtime/near-vm-logic/tests/test_iterators.rs
  154. +292 −0 runtime/near-vm-logic/tests/test_miscs.rs
  155. +458 −0 runtime/near-vm-logic/tests/test_promises.rs
  156. +54 −18 runtime/near-vm-logic/tests/test_registers.rs
  157. +91 −0 runtime/near-vm-logic/tests/test_storage_read_write.rs
  158. +58 −0 runtime/near-vm-logic/tests/test_storage_usage.rs
  159. +59 −0 runtime/near-vm-logic/tests/test_view_method.rs
  160. +3 −3 runtime/near-vm-runner-standalone/Cargo.toml
  161. +8 −6 runtime/near-vm-runner/Cargo.toml
  162. +2 −1 runtime/near-vm-runner/benches/bench.rs
  163. +3 −2 runtime/near-vm-runner/src/cache.rs
  164. +66 −78 runtime/near-vm-runner/src/errors.rs
  165. +58 −3 runtime/near-vm-runner/src/imports.rs
  166. +1 −1 runtime/near-vm-runner/src/lib.rs
  167. +9 −6 runtime/near-vm-runner/src/memory.rs
  168. +4 −5 runtime/near-vm-runner/src/prepare.rs
  169. +44 −7 runtime/near-vm-runner/src/runner.rs
  170. BIN runtime/near-vm-runner/tests/res/test_contract_rs.wasm
  171. +0 −2 runtime/near-vm-runner/tests/test-contract-rs/.cargo/config
  172. +52 −22 runtime/near-vm-runner/tests/test-contract-rs/Cargo.lock
  173. +16 −7 runtime/near-vm-runner/tests/test-contract-rs/Cargo.toml
  174. +1 −1 runtime/near-vm-runner/tests/test-contract-rs/build.sh
  175. +487 −206 runtime/near-vm-runner/tests/test-contract-rs/src/lib.rs
  176. +430 −0 runtime/near-vm-runner/tests/test_error_cases.rs
  177. +106 −0 runtime/near-vm-runner/tests/test_invalid_contracts.rs
  178. +109 −24 runtime/near-vm-runner/tests/test_rs_contract.rs
  179. +8 −23 runtime/near-vm-runner/tests/test_ts_contract.rs
  180. +59 −0 runtime/near-vm-runner/tests/utils.rs
  181. +23 −0 runtime/runtime-params-estimator/Cargo.toml
  182. +18 −0 runtime/runtime-params-estimator/README.md
  183. +378 −0 runtime/runtime-params-estimator/src/cases.rs
  184. +9 −0 runtime/runtime-params-estimator/src/lib.rs
  185. +74 −0 runtime/runtime-params-estimator/src/main.rs
  186. +258 −0 runtime/runtime-params-estimator/src/stats.rs
  187. +88 −0 runtime/runtime-params-estimator/src/testbed.rs
  188. +174 −0 runtime/runtime-params-estimator/src/testbed_runners.rs
  189. +5 −0 runtime/runtime-params-estimator/test-contract/Cargo.lock
  190. +24 −0 runtime/runtime-params-estimator/test-contract/Cargo.toml
  191. +24 −0 runtime/runtime-params-estimator/test-contract/build.sh
  192. BIN runtime/runtime-params-estimator/test-contract/res/large_contract.wasm
  193. BIN runtime/runtime-params-estimator/test-contract/res/large_payload
  194. BIN runtime/runtime-params-estimator/test-contract/res/medium_contract.wasm
  195. BIN runtime/runtime-params-estimator/test-contract/res/medium_payload
  196. BIN runtime/runtime-params-estimator/test-contract/res/small_contract.wasm
  197. BIN runtime/runtime-params-estimator/test-contract/res/small_payload
  198. +611 −0 runtime/runtime-params-estimator/test-contract/src/lib.rs
  199. +9 −7 runtime/runtime/Cargo.toml
  200. +115 −97 runtime/runtime/src/actions.rs
  201. +3 −75 runtime/runtime/src/adapter.rs
  202. +8 −4 runtime/runtime/src/cache.rs
  203. +23 −13 runtime/runtime/src/config.rs
  204. +0 −158 runtime/runtime/src/ethereum.rs
  205. +181 −36 runtime/runtime/src/ext.rs
  206. +713 −273 runtime/runtime/src/lib.rs
  207. +63 −62 runtime/runtime/src/state_viewer.rs
  208. +4 −3 runtime/runtime/src/store.rs
  209. +362 −0 runtime/runtime/tests/runtime_group_tools.rs
  210. +941 −0 runtime/runtime/tests/test_async_calls.rs
  211. +88 −37 runtime/runtime/tests/test_evil_contracts.rs
  212. +259 −0 runtime/runtime/tests/test_regression.rs
  213. +6 −0 runtime/runtime/tests/tiny-contract-rs/Cargo.lock
  214. +19 −0 runtime/runtime/tests/tiny-contract-rs/Cargo.toml
  215. +5 −0 runtime/runtime/tests/tiny-contract-rs/build.sh
  216. BIN runtime/runtime/tests/tiny-contract-rs/res/tiny_contract_rs.wasm
  217. +184 −0 runtime/runtime/tests/tiny-contract-rs/src/lib.rs
  218. +0 −11 runtime/verifier/Cargo.toml
  219. +0 −124 runtime/verifier/src/lib.rs
  220. +2 −4 scripts/nodelib.py
  221. +2 −1 scripts/run_clippy.sh
  222. +2 −0 scripts/run_docker.sh
  223. +159 −0 scripts/state/migrate-from-0.3.py
  224. +1 −11 test-utils/loadtester/src/main.rs
  225. +4 −4 test-utils/loadtester/src/transactions_generator.rs
  226. +66 −32 test-utils/state-viewer/src/main.rs
  227. +2 −0 test-utils/testlib/Cargo.toml
  228. +86 −62 test-utils/testlib/src/fees_utils.rs
  229. +99 −10 test-utils/testlib/src/lib.rs
  230. +8 −5 test-utils/testlib/src/node/mod.rs
  231. +10 −7 test-utils/testlib/src/node/process_node.rs
  232. +17 −6 test-utils/testlib/src/node/runtime_node.rs
  233. +10 −7 test-utils/testlib/src/node/thread_node.rs
  234. +10 −16 test-utils/testlib/src/runtime_utils.rs
  235. +431 −296 test-utils/testlib/src/standard_test_cases.rs
  236. +30 −31 test-utils/testlib/src/user/mod.rs
  237. +7 −12 test-utils/testlib/src/user/rpc_user.rs
  238. +74 −84 test-utils/testlib/src/user/runtime_user.rs
  239. +0 −41 test-utils/txflow-test-gen/README.md
  240. +0 −150 test-utils/txflow-test-gen/beacon.js
  241. +0 −130 test-utils/txflow-test-gen/common_rust_code_for_tests.txt
  242. +0 −16 test-utils/txflow-test-gen/gen_tests.js
  243. +0 −325 test-utils/txflow-test-gen/index.html
  244. +0 −53 test-utils/txflow-test-gen/nighty_gen.js
  245. +0 −12 test-utils/txflow-test-gen/tests.jsonl
  246. +0 −571 test-utils/txflow-test-gen/txflow.js
  247. +0 −261 test-utils/txflow-test-gen/utils.js
  248. +28 −6 tests/test_cases_runtime.rs
  249. +9 −9 tests/test_cases_testnet_rpc.rs
  250. +1 −1 tests/test_catchup.rs
  251. +28 −11 tests/test_errors.rs
  252. +8 −3 tests/test_rejoin.rs
  253. +3 −2 tests/test_simple.rs
  254. +6 −5 tests/test_tps_regression.rs
@@ -1,6 +1,3 @@
Cargo.lock linguist-generated=true -diff
core/protos/src/autogenerated/* linguist-generated=true -diff
nearlib/protos.js linguist-generated=true -diff
pynear/**/protos/* linguist-generated=true -diff
**/package-lock.json linguist-generated=true -diff
nearlib/dist/** linguist-generated=true -diff
near/res/testnet.json linguist-generated=true -diff
@@ -1,120 +1,60 @@
image: parity/rust:a811bb14-20190522
stages:
- test

variables:
CI_SERVER_NAME: "GitLab CI"
CACHE_ROOT: "/tmp/cache/nearcore/${CI_JOB_NAME}"
CARGO_HOME: "/tmp/cache/nearcore/${CI_JOB_NAME}/cargo"
BUILD_TARGET: ubuntu
BUILD_ARCH: amd64
CARGO_TARGET: x86_64-unknown-linux-gnu
APT_CACHE_DIR: apt-cache

.setup_rust: &setup_rust
rustup default nightly
CACHE_ROOT: "/opt/nearcore"

.setup_cache: &setup_cache
mkdir -p "${CACHE_ROOT}/target" &&
ln -s "${CACHE_ROOT}/target" "${CI_PROJECT_DIR}/target"

.cleanup_obsolete_cache: &cleanup_obsolete_cache
find "${CACHE_ROOT}/target" -mmin +43200 -exec rm -rf {} \;

.code_coverage: &code_coverage
mkdir -pv $APT_CACHE_DIR && apt-get -qq update &&
apt-get -qq -o dir::cache::archives="$APT_CACHE_DIR" install -y binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc &&
./scripts/coverage.sh

stages:
- test

cache:
paths:
- apt-cache

# Test all but expensive integration tests.
test_cargo:
stage: test
tags:
- gcloud
- shell
before_script:
- *setup_rust
#- rustup component add clippy
- *setup_cache
script:
- rustc --version && cargo --version
- cargo check --all --tests --benches
- cargo check --all --tests --benches --all-features
- cargo test --all --verbose
after_script:
- *cleanup_obsolete_cache

# Regression tests.
test_regression:
stage: test
before_script:
- *setup_rust
- *setup_cache
script:
- rustc --version && cargo --version
- ./scripts/build_wasm.sh
- cargo test --package nearcore --test test_tps_regression test --features "regression_tests"
- cargo test --package nearcore --test test_tps_regression test --features "regression_tests,fake_crypto"
tags:
- regression_tests
after_script:
- *cleanup_obsolete_cache
- shell
- regression_tests
only:
- schedules
- schedules

# A set of expensive tests.
test_cases_testnet_rpc:
stage: test
before_script:
- *setup_rust
- *setup_cache
script:
- rustc --version && cargo --version
- ./scripts/build_wasm.sh
- cargo test --package nearcore --test test_cases_testnet_rpc test --features "expensive_tests"
tags:
- expensive_tests
after_script:
- *cleanup_obsolete_cache
- shell
- expensive_tests
only:
- schedules
- schedules

#
#coverage:
# stage: test
# before_script:
# - *setup_rust
# - *setup_cache
# script:
# - ./scripts/build_wasm.sh
# - cargo test --all --no-run
# - *code_coverage
#
test_nearlib:
stage: test
tags:
- gcloud
- shell
before_script:
- *setup_rust
- *setup_cache
script:
- ./scripts/test_nearlib.sh

after_script:
- *cleanup_obsolete_cache

test_nearlib_release:
stage: test
tags:
- gcloud
before_script:
- *setup_rust
- *setup_cache
script:
- export NEARLIB_RELEASE=true
- ./scripts/test_nearlib.sh

after_script:
- *cleanup_obsolete_cache
@@ -1,5 +1,5 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

/chain/ @ilblackdragon
/chain/ @ilblackdragon @SkidanovAlex

/runtime/ @nearmax @evgenykuzyakov

0 comments on commit 8f488f3

Please sign in to comment.
You can’t perform that action at this time.