Compare commits

..

84 Commits

Author SHA1 Message Date
Wei Tang
a716eb3871 EIP-2929: only add params.address to access list 2021-04-15 18:15:40 +02:00
Wei Tang
0fd7c59724 EIP-2929: add tx sender and address into the access list 2021-04-15 18:02:24 +02:00
rakita
aa41520dd1 Bump to v3.2.3 2021-04-15 18:02:24 +02:00
Wei Tang
4bffab6715 Fix compile 2021-04-15 18:02:24 +02:00
Wei Tang
5709dbc3e0 EIP2929: only add builtin to warm address if they are active 2021-04-15 18:02:24 +02:00
rakita
5fdedf0858 Bump to v3.2.1. Changelog 2021-03-17 09:46:36 +01:00
rakita
3317797285 Initial sync block stuck. Block import logs (#318) 2021-03-16 12:08:22 +01:00
Karim Agha
327c4bcb14 Fixing outdated readme links (#322) 2021-03-14 10:25:45 +01:00
rakita
f143ddb75a [devops] Upgrade docker alpine to v1.13.2 2021-03-11 08:42:23 +01:00
rakita
187c81b3f1 Upgrade ethereum/tests to v8.0.1 (#301) 2021-03-10 17:18:17 +01:00
rakita
458d55559e Bump to v3.2.0 2021-03-08 17:49:59 +01:00
rakita
0cf0cdbb86 Disable CI on tag for windows2019 machine"
This reverts commit efb80e1032.
2021-03-05 19:27:01 +01:00
rakita
91e57c803d Disable EIP-2315 2021-03-05 18:01:27 +01:00
Dusan Stanivukovic
973a5a594b Sunce86/add support eip2930 ethereum tests runner (#288)
* added support for eip2930 tests

Co-authored-by: sunce86 <dusan.stanivukovic@gmail.pm>
2021-03-03 15:57:25 +01:00
Anonymous
63fdad8d86 ethcore/snapshot: fix double-lock in Service::feed_chunk (#289) 2021-03-02 14:27:28 +01:00
Giacomo
efb80e1032 Enable CI on windows2019 machine (#283)
Enable CI on windows2019 machine

* Add -y for choco install
2021-02-26 10:35:17 +01:00
draganrakita
f0fd88aa12 Github action path for folder structure 2021-02-25 17:21:02 +01:00
draganrakita
142b63a4f9 Backport github actions from old main 2021-02-25 17:05:24 +01:00
rakita
1d2b640834 chocolate -y confirmation steps 2021-02-25 11:11:31 +01:00
draganrakita
f1dc682168 Bump to 3.2.0-rc.1 2021-02-24 13:00:50 +01:00
draganrakita
0bb2f8f6b8 Berlin hardfork blocks 2021-02-24 13:00:50 +01:00
rakita
d5c2a0fbe2 Fix for TypedTx enabling and hash generation. Tweak sig V in RPC. (#272)
* Fix for TypedTx hash generation from RlpView
* Tweaks on sig V field in RPC
* Fix for eip2930 incomming tx
2021-02-23 13:46:08 +01:00
rakita
98563b0a45 Change ProtocolId to U64. yolo3x spec (#271)
* Change ProtocolId to U64 and make it support variable subprotocol names* 
* Add yolo3x testnet
2021-02-19 12:52:24 +01:00
adria0.eth
d8ce175846 Fix modexp, update tests, update berlin chainspec (#267) 2021-02-17 19:43:09 +01:00
rakita
fb9699d8e1 EIP-2930 remove type from legacy JSONRPC (#265)
* EIP-2930 remove type from legacy JSONRPC
* fmt
2021-02-17 16:52:51 +01:00
rakita
dbf9a1cd98 EIP-2930 spec change for signature hash (#261)
* EIP-2930 spec change for signature hash
* Removing eip2930 test blocks
2021-02-10 15:58:35 +01:00
rakita
6b4e56b214 AccessList in JSONRPC. And enabling github action tests (#255)
* Enabling github action tests
* Fix failing tests
* AccessList to Option in json
* failing rust example removed
* AccessList for jsonrpc
* Tx type as sequence, AccessList as type
2021-02-08 14:55:03 +01:00
Jochen Müller
f40e198eb7 Give IoService a consistent interface (#257)
The start() method had two different signatures depending on configuration. Since ethcore is built with either config depending on the build target, this resulted in compiler errors for either evmbin or oe.
2021-02-05 13:33:39 +01:00
rakita
bbecb0415e Remove eth/63 protocol version (#252)
* Remove eth/63 protocol
2021-02-04 14:10:48 +01:00
rakita
6d81fce451 Update EWF's chains with Istanbul transition block numbers (#11482) (#254)
Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2021-02-04 11:39:10 +01:00
rakita
65c5e6dfd3 EIP-2930 RPC and TypedTransactionView support (#245)
* TypedTransactionView for EIP-2930
* Enable EIP-2930 in RPC calls
* type field added to TypedTransactionView
2021-02-02 16:26:55 +01:00
adria0.eth
2e23ca353f Use berlin chainspec for unit test, yolo3 for testnet (#244)
* Fix yolo+berlin specs
* fix yolo3 maximumExtraDataSize
* fmt
2021-02-01 16:40:00 +01:00
rakita
a831379ad8 Yolo3 spec (#241)
Update Yolo3
2021-02-01 08:34:44 +01:00
rakita
cfc6439f2e Local EIP2930 and EN/DE block tests (#237) 2021-01-28 17:23:01 +01:00
François Garillot
52d966ccaa Cleans up a number of Option / Result patterns and warts (#226) 2021-01-21 18:27:35 +01:00
rakita
59d891edf4 Snapshot manifest block added to prometheus (#232)
Co-authored-by: adria0.eth <5526331+adria0@users.noreply.github.com>
2021-01-21 17:23:15 +01:00
draganrakita
f3bdc0da3c Bump to 3.1.1 2021-01-19 14:49:25 +01:00
Denis Granha
a55799d523 Set alpine version to 3.12.3
Alpine version is changed in order to prevent Cmake errors. Reference: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12321.

Intends to solve https://github.com/openethereum/openethereum/issues/230
2021-01-19 10:59:40 +01:00
draganrakita
1d07c4c06b fix Supplied instant is later than self 2021-01-18 09:34:48 +01:00
rakita
ea25ffd79d Added additional Sg-1,Ca-2,Ca-3 OE bootnodes (#222) 2021-01-17 23:15:33 +01:00
Adria Massanet
eb876cb2d7 CI fix 2021-01-14 15:30:57 +01:00
Adria Massanet
814526a248 Fix CI 2021-01-14 15:30:57 +01:00
Adria Massanet
d3ba83405c fmt 2021-01-14 15:30:57 +01:00
Adria Massanet
c46fe330dc Big folder refactor 2021-01-14 15:30:57 +01:00
draganrakita
0e5d6944b7 Add eip2929,eip2930 to ForkId list 2021-01-11 15:21:16 +01:00
adria0.eth
b0a1e3da03 Update ethereum/tests to f55f344 (#220) 2021-01-11 14:14:41 +01:00
rakita
0706e5468d EIP-1898: Allow default block parameter to be blockHash (#203)
* Allow default block parameter to be blockHash

Backport to 3.1 of https://github.com/openethereum/openethereum/pull/10932

Co-authored-by: Richard Patel <me@terorie.dev>

* Request canonical with BlockHash

Co-authored-by: Seun LanLege <seunlanlege@gmail.com>
Co-authored-by: Richard Patel <me@terorie.dev>
2021-01-11 11:00:27 +01:00
rakita
f286597d10 Update link to issue (#202) 2021-01-08 15:56:53 +01:00
Giacomo
e2f665e9cf Enable Windows2019 CI on main/dev (#213)
* Revert "Disable windows2019, remove tagged windows artifact"

This reverts commit 08e6cca3e5.

* Allow running CI on windows only when pushing to main/dev

* Remove unneeded block code
2020-12-30 15:07:20 +01:00
draganrakita
eab41b49cf test cfg 2020-12-23 15:31:13 +01:00
draganrakita
8d3e0582a8 fmt 2020-12-23 15:31:13 +01:00
draganrakita
705bc71593 Payload limit for test 2020-12-23 15:31:13 +01:00
draganrakita
f723e288c3 Cleanup devp2p unused interface fn 2020-12-23 15:31:13 +01:00
Justin Beaurone
a6bd3516e0 OpenEthereum rebranding 2020-12-21 13:34:05 +01:00
draganrakita
08e6cca3e5 Disable windows2019, remove tagged windows artifact 2020-12-21 11:54:53 +01:00
draganrakita
8a9d14141a Revert "Fix CI problems (#127)" and Remove sscache
This reverts commit 12afb13e9b.
2020-12-21 11:45:52 +01:00
draganrakita
832fc444b6 Tweaks in informer log 2020-12-15 17:07:49 +01:00
adria0.eth
612a71ecb2 Update ISSUE_TEMPLATE.md (#124)
Tell users to ask questions in discord instead of opening an issue.
2020-12-15 11:39:34 +01:00
Giacomo
06fc61d7c5 Add custom windows runner (#162) 2020-12-11 11:18:18 +01:00
rakita
837e8b8725 Ancient target set. InvalidStateRoot bug (#69) (#149) 2020-12-10 17:57:26 +01:00
rakita
ea3efd926e TypedTransaction (EIP-2718) and Optional access list (EIP-2930) (#135) 2020-12-10 16:42:05 +01:00
rakita
3f01b69084 Fix broken doc comments (#151) 2020-12-09 12:43:32 +01:00
rakita
647ff31942 Add ws-max-paxload (#155) 2020-12-09 11:48:27 +01:00
rakita
56131b6d92 Trace comment on new block inclusion (#100) 2020-12-02 11:31:11 +01:00
rakita
51d824fbdc Remove sscache (#138) 2020-12-01 16:40:06 +01:00
rakita
1225ff2c5a Add flag to disable storage output in openethereum-evm tool #97 (#115) 2020-11-26 08:31:44 +01:00
adria0.eth
cb91b7e828 Fix CI problems (#127)
* Temporally Fix CI compilation
2020-11-25 18:28:17 +01:00
Adria Massanet
233bab2ee7 Update linked-hash-map to 0.5.3 2020-11-24 18:11:29 +00:00
Lachezar Lechev
fed80cc075 ethstore - remove unnecessary dir & tiny-keccak dependencies from the lib (#107)
* ethstore - remove unnecessary dir & tiny-keccak dependencies
2020-11-23 13:49:32 +01:00
Giacomo
26ab00b6c7 Fix deprecated set-env declaration (#106)
* Fix deprecated set-env declaration

* Fix add-path and set-env in install-sscache.ps1
2020-11-17 11:16:24 +01:00
Giacomo
01e72efb80 Feature/improve dockerhub deployment (#98)
* Add docker deployment for Github actions

* Add docker specs for the release of tagged and latest versions, also add specs for nightly builds

Co-authored-by: Denis Granha <denis@gnosis.pm>
2020-11-16 18:30:13 +01:00
adria0.eth
81ae80b7f1 EIP2565 impl (#82)
EIP2565 implementation
2020-11-12 14:31:24 +01:00
adria0.eth
910bb78f0d Downgrade sccache to 1.1.2 (#93) 2020-11-12 12:57:35 +01:00
adria0.eth
6078eeaed7 EIP2929 with journaling + Yolov3 (#79) 2020-11-04 19:11:05 +01:00
rakita
50a4d5fa57 Sync block verification (#74)
* Synchronize block verification
* max_round_blocks_to_import set to 1
* Fixed test that rely on 12block batches

Co-authored-by: adria0.eth <5526331+adria0@users.noreply.github.com>
2020-10-27 10:45:48 +01:00
Adria Massanet
410853e280 Update gitactions for dev branch, deprecate stable branch 2020-10-26 09:27:44 +00:00
Denis Granha
bf5830f766 revert actions/cache to version 1.1.2 (#80) 2020-10-23 22:59:18 +02:00
rakita
d811f6e3ce Use ubuntu-16.04 for glibc compatibility (#11888) (#73) 2020-10-23 10:43:18 +02:00
adria0.eth
9110b1d9e4 Update gitactions master->main (#72) 2020-10-12 10:55:21 +02:00
varasev
cb0513a8b1 Add wasmDisableTransition spec option (#60)
* Add wasmDisableTransition spec option
2020-10-08 22:37:48 +02:00
adria0.eth
84f675021c Fix warnings (#64) 2020-09-30 13:10:54 +02:00
rakita
03bfb012a1 Change wiki links (#68) 2020-09-30 13:10:18 +02:00
Denis Granha
16542bd355 fix CD env param 2020-09-29 13:04:59 +02:00
Giacomo
24cff45334 Set AWS_REGION as a global env variable (#67) 2020-09-28 17:07:36 +02:00
879 changed files with 9415 additions and 41580 deletions

View File

@@ -1,3 +1,3 @@
[target.x86_64-pc-windows-msvc]
# Link the C runtime statically ; https://github.com/openethereum/openethereum/issues/6643
# Link the C runtime statically ; https://github.com/openethereum/parity-ethereum/issues/6643
rustflags = ["-Ctarget-feature=+crt-static"]

View File

@@ -2,7 +2,7 @@
## Do you have a question?
Check out our [Basic Usage](https://openethereum.github.io/wiki/Basic-Usage), [Configuration](https://openethereum.github.io/wiki/Configuring-OpenEthereum), and [FAQ](https://openethereum.github.io/wiki/FAQ) articles on our [wiki](https://openethereum.github.io/wiki)!
Check out our [Beginner Introduction](https://openethereum.github.io/Beginner-Introduction), [Configuration](https://openethereum.github.io//Configuring-OpenEthereum), and [FAQ](https://openethereum.github.io/FAQ) articles on our [wiki](https://openethereum.github.io/)!
See also frequently asked questions [tagged with `parity`](https://ethereum.stackexchange.com/questions/tagged/parity?sort=votes&pageSize=50) on Stack Exchange.
@@ -35,7 +35,7 @@ There are a few basic ground-rules for contributors (including the maintainer(s)
* **No pushing directly to the master branch**.
* **All modifications** must be made in a **pull-request** to solicit feedback from other contributors.
* Pull-requests cannot be merged before CI runs green and two reviewers have given their approval.
* Contributors should adhere to the [Parity Ethereum Style Guide](https://openethereum.github.io/wiki/Parity-Ethereum-Style-Guide).
* All code changed should be formated by running `cargo fmt -- --config=merge_imports=true`
### Recommendations

View File

@@ -1,6 +1,8 @@
For questions please use https://discord.io/openethereum, issues are for bugs and feature requests.
_Before filing a new issue, please **provide the following information**._
- **OpenEthereum version**: 0.0.0
- **OpenEthereum version (>=3.1.0)**: 0.0.0
- **Operating system**: Windows / MacOS / Linux
- **Installation**: homebrew / one-line installer / built from source
- **Fully synchronized**: no / yes

View File

@@ -0,0 +1,33 @@
name: Build and Test Suite on Windows
on:
push:
branches:
- main
- dev
jobs:
build-tests:
name: Test and Build
strategy:
matrix:
platform:
- windows2019 # custom runner
toolchain:
- stable
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@main
with:
submodules: true
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Build tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose --no-run

View File

@@ -5,19 +5,15 @@ on:
push:
branches:
- main
- stable
- dev
jobs:
build-tests:
name: Test and Build
env:
SCCACHE_CACHE_SIZE: "1G"
SCCACHE_IDLE_TIMEOUT: 0
strategy:
matrix:
platform:
- ubuntu-16.04
- macos-latest
- windows-latest
toolchain:
- stable
runs-on: ${{ matrix.platform }}
@@ -32,68 +28,13 @@ jobs:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Cache cargo registry
uses: actions/cache@v1.1.2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-build-tests-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1.1.2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-build-tests-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1.1.2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-build-tests-${{ hashFiles('**/Cargo.lock') }}
- name: Cache sccache linux
if: matrix.platform == 'ubuntu-16.04'
uses: actions/cache@v1.1.2
with:
path: "/home/runner/.cache/sccache"
key: ${{ runner.os }}-sccache-build-tests-${{ hashFiles('**/Cargo.lock') }}
- name: Cache sccache MacOS
if: matrix.platform == 'macos-latest'
uses: actions/cache@v1.1.2
with:
path: "/Users/runner/Library/Caches/Mozilla.sccache"
key: ${{ runner.os }}-sccache-build-tests-${{ hashFiles('**/Cargo.lock') }}
- name: Cache sccache Windows
if: matrix.platform == 'windows-latest'
uses: actions/cache@v1.1.2
with:
path: "C:\\Users\\runneradmin\\AppData\\Local\\Mozilla\\sccache\\cache"
key: ${{ runner.os }}-sccache-build-tests-${{ hashFiles('**/Cargo.lock') }}
- name: Install sccache for ${{ matrix.platform }}
shell: pwsh
run: pwsh scripts/actions/install-sccache.ps1 ${{ runner.os}}
- name: Install LLVM for Windows
if: matrix.platform == 'windows-latest'
run: choco install llvm
- name: Sccache statistics
run: sccache --show-stats
- name: Build tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose --no-run
- name: Run tests for ${{ matrix.platform }}
if: matrix.platform == 'windows-latest'
continue-on-error: true #Skip step if Windows tests failure
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose
- name: Run tests for ${{ matrix.platform }}
if: matrix.platform != 'windows-latest'
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose
- name: Stop sccache
if: always()
run: sccache --stop-server
- name: Prepare build directory for cache
shell: bash
run: bash scripts/actions/clean-target.sh

View File

@@ -2,8 +2,6 @@ name: Build Release Suite
on:
push:
branches:
- stable
tags:
- v*
@@ -11,19 +9,16 @@ on:
env:
AWS_REGION: "us-east-1"
AWS_S3_ARTIFACTS_BUCKET: "openethereum-releases"
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build:
name: Build Release
env:
SCCACHE_CACHE_SIZE: "1G"
SCCACHE_IDLE_TIMEOUT: 0
strategy:
matrix:
platform:
- ubuntu-16.04
- macos-latest
- windows-latest
toolchain:
- stable
runs-on: ${{ matrix.platform }}
@@ -36,71 +31,32 @@ jobs:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-build-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-build-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-build-${{ hashFiles('**/Cargo.lock') }}
- name: Cache sccache linux
if: matrix.platform == 'ubuntu-16.04'
uses: actions/cache@v2
with:
path: "/home/runner/.cache/sccache"
key: ${{ runner.os }}-sccache-build-${{ hashFiles('**/Cargo.lock') }}
- name: Cache sccache MacOS
if: matrix.platform == 'macos-latest'
uses: actions/cache@v2
with:
path: "/Users/runner/Library/Caches/Mozilla.sccache"
key: ${{ runner.os }}-sccache-build-${{ hashFiles('**/Cargo.lock') }}
- name: Cache sccache Windows
if: matrix.platform == 'windows-latest'
uses: actions/cache@v2
with:
path: "C:\\Users\\runneradmin\\AppData\\Local\\Mozilla\\sccache\\cache"
key: ${{ runner.os }}-sccache-build-${{ hashFiles('**/Cargo.lock') }}
- name: Install sccache for ${{ matrix.platform }}
shell: pwsh
run: pwsh scripts/actions/install-sccache.ps1 ${{ runner.os}}
# ==============================
# Windows Build
# ==============================
- name: Install LLVM for Windows
if: matrix.platform == 'windows-latest'
run: choco install llvm
# - name: Install LLVM for Windows
# if: matrix.platform == 'windows2019'
# run: choco install llvm
- name: Sccache statistics
run: sccache --show-stats
# - name: Build OpenEthereum for Windows
# if: matrix.platform == 'windows2019'
# run: sh scripts/actions/build-windows.sh ${{matrix.platform}}
- name: Build OpenEthereum for Windows
if: matrix.platform == 'windows-latest'
run: sh scripts/actions/build-windows.sh ${{matrix.platform}}
- name: Upload Windows build
uses: actions/upload-artifact@v2
if: matrix.platform == 'windows-latest'
with:
name: windows-artifacts
path: artifacts
# - name: Upload Windows build
# uses: actions/upload-artifact@v2
# if: matrix.platform == 'windows2019'
# with:
# name: windows-artifacts
# path: artifacts
# ==============================
# Linux/Macos Build
# ==============================
- name: Build OpenEthereum for ${{matrix.platform}}
if: matrix.platform != 'windows-latest'
if: matrix.platform != 'windows2019'
run: sh scripts/actions/build-linux.sh ${{matrix.platform}}
- name: Upload Linux build
@@ -117,35 +73,23 @@ jobs:
name: macos-artifacts
path: artifacts
# ==============================
# End builds
# ==============================
- name: Stop sccache
if: always()
run: sccache --stop-server
- name: Prepare build directory for cache
shell: bash
run: bash scripts/actions/clean-target.sh
zip-artifacts-creator:
name: Create zip artifacts
needs: build
runs-on: ubuntu-16.04
steps:
- name: Set env
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
# ==============================
# Create ZIP files
# ==============================
- name: Download Windows artifacts
uses: actions/download-artifact@v2
with:
name: windows-artifacts
path: windows-artifacts
# - name: Download Windows artifacts
# uses: actions/download-artifact@v2
# with:
# name: windows-artifacts
# path: windows-artifacts
- name: Download Linux artifacts
uses: actions/download-artifact@v2
@@ -188,18 +132,18 @@ jobs:
echo ::set-output name=MACOS_ARTIFACT::openethereum-macos-${{ env.RELEASE_VERSION }}.zip
echo ::set-output name=MACOS_SHASUM::$(shasum -a 256 openethereum-macos-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
- name: Create zip Windows
id: create_zip_windows
run: |
cd windows-artifacts/
zip -rT openethereum-windows-${{ env.RELEASE_VERSION }}.zip *
ls openethereum-windows-${{ env.RELEASE_VERSION }}.zip
cd ..
mv windows-artifacts/openethereum-windows-${{ env.RELEASE_VERSION }}.zip .
# - name: Create zip Windows
# id: create_zip_windows
# run: |
# cd windows-artifacts/
# zip -rT openethereum-windows-${{ env.RELEASE_VERSION }}.zip *
# ls openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# cd ..
# mv windows-artifacts/openethereum-windows-${{ env.RELEASE_VERSION }}.zip .
echo "Setting outputs..."
echo ::set-output name=WINDOWS_ARTIFACT::openethereum-windows-${{ env.RELEASE_VERSION }}.zip
echo ::set-output name=WINDOWS_SHASUM::$(shasum -a 256 openethereum-windows-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
# echo "Setting outputs..."
# echo ::set-output name=WINDOWS_ARTIFACT::openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# echo ::set-output name=WINDOWS_SHASUM::$(shasum -a 256 openethereum-windows-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
# =======================================================================
# Upload artifacts
@@ -218,11 +162,11 @@ jobs:
name: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
path: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
path: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# path: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# =======================================================================
# Upload artifacts to S3
@@ -247,8 +191,8 @@ jobs:
linux-shasum: ${{ steps.create_zip_linux.outputs.LINUX_SHASUM }}
macos-artifact: ${{ steps.create_zip_macos.outputs.MACOS_ARTIFACT }}
macos-shasum: ${{ steps.create_zip_macos.outputs.MACOS_SHASUM }}
windows-artifact: ${{ steps.create_zip_windows.outputs.WINDOWS_ARTIFACT }}
windows-shasum: ${{ steps.create_zip_windows.outputs.WINDOWS_SHASUM }}
# windows-artifact: ${{ steps.create_zip_windows.outputs.WINDOWS_ARTIFACT }}
# windows-shasum: ${{ steps.create_zip_windows.outputs.WINDOWS_SHASUM }}
draft-release:
name: Draft Release
@@ -256,7 +200,7 @@ jobs:
runs-on: ubuntu-16.04
steps:
- name: Set env
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
# ==============================
# Download artifacts
@@ -272,10 +216,10 @@ jobs:
with:
name: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
- name: Display structure of downloaded files
run: ls
@@ -329,13 +273,13 @@ jobs:
asset_name: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
- name: Upload Release Asset - Windows
id: upload_release_asset_windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./openethereum-windows-${{ env.RELEASE_VERSION }}.zip
asset_name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
# - name: Upload Release Asset - Windows
# id: upload_release_asset_windows
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# asset_name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# asset_content_type: application/zip

View File

@@ -5,14 +5,11 @@ on:
push:
branches:
- main
- stable
- dev
jobs:
check:
name: Check
runs-on: ubuntu-16.04
env:
SCCACHE_CACHE_SIZE: "1G"
SCCACHE_IDLE_TIMEOUT: 0
steps:
- name: Checkout sources
uses: actions/checkout@main
@@ -24,32 +21,6 @@ jobs:
toolchain: stable
profile: minimal
override: true
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
# Install sccache based on https://github.com/denoland/rusty_v8/blob/master/.github/workflows/ci.yml#L69
- name: Cache sccache
uses: actions/cache@v2
with:
path: "/home/runner/.cache/sccache"
key: ${{ runner.os }}-sccache-check-${{ hashFiles('**/Cargo.lock') }}
- name: Install sccache for Linux
shell: pwsh
run: pwsh scripts/actions/install-sccache.ps1 ${{ runner.os}}
- name: Sccache statistics
run: sccache --show-stats
- name: Run cargo check 1/3
uses: actions-rs/cargo@v1
with:
@@ -59,12 +30,12 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose
args: --locked --manifest-path crates/runtime/io/Cargo.toml --no-default-features --verbose
- name: Run cargo check 3/3
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose
args: --locked --manifest-path crates/runtime/io/Cargo.toml --features "mio" --verbose
- name: Run cargo check evmbin
uses: actions-rs/cargo@v1
with:
@@ -77,10 +48,3 @@ jobs:
args: --locked --all --benches --verbose
- name: Run validate chainspecs
run: ./scripts/actions/validate-chainspecs.sh
- name: Stop sccache
if: always()
run: sccache --stop-server
continue-on-error: true
- name: Prepare build directory for cache
shell: bash
run: bash scripts/actions/clean-target.sh

View File

@@ -0,0 +1,29 @@
name: Docker Image Nightly Release
# Run "nightly" build on each commit to "dev" branch.
on:
push:
branches:
- dev
jobs:
deploy-docker:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@master
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Deploy to docker hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: openethereum/openethereum
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: scripts/docker/alpine/Dockerfile
tags: "nightly"

30
.github/workflows/deploy-docker-tag.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Docker Image Tag and Latest Release
on:
push:
tags:
- v*
jobs:
deploy-docker:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@master
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Deploy to docker hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: openethereum/openethereum
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: scripts/docker/alpine/Dockerfile
tags: "latest,${{ env.RELEASE_VERSION }}"

8
.gitmodules vendored
View File

@@ -1,7 +1,3 @@
[submodule "ethcore/res/ethereum/tests"]
path = ethcore/res/ethereum/tests
[submodule "crates/ethcore/res/json_tests"]
path = crates/ethcore/res/json_tests
url = https://github.com/ethereum/tests.git
branch = develop
[submodule "ethcore/res/wasm-tests"]
path = ethcore/res/wasm-tests
url = https://github.com/paritytech/wasm-tests

View File

@@ -1,34 +1,24 @@
## OpenEthereum v3.1RC1
## OpenEthereum v3.2.3
OpenEthereum 3.1rc1 is a candidate release based on v2.5.13 which is the last stable version known of the client that does not include any of the issues introduced in v2.7.
It removes non core features like Ethereum Classic, Private Transactions, Light Client, Updater, IPFS and Swarm support, currently deprecated flags such as expanse, kotti, mordor testnets.
* Hotfix for berlin consensus error.
Database migration utility currently in beta: https://github.com/openethereum/3.1-db-upgrade-tool
## OpenEthereum v3.2.1
The full list of included changes from v2.5.13 to v3.1:
Hot fix issue, related to initial sync:
* Initial sync gets stuck. (#318)
## OpenEthereum v3.2.0
- Remove classic, kotti, mordor, expanse (#52)
- Added bad block header hash for ropsten (#49)
- Remove accounts bloom (#33)
- Bump jsonrpc-- to v15
- Implement eth/64, remove eth/62 (#46)
- No snapshotting by default (#11814)
- Update Ellaism chainspec
- Prometheus, heavy memory calls removed (#27)
- Update ethereum/tests
- Implement JSON test suite (#11801)
- Fix issues during block sync (#11265)
- Fix race same block (#11400)
- EIP-2537: Precompile for BLS12-381 curve operations (#11707)
- Remove private transactions
- Remove GetNodeData
- Remove IPFS integration (#11532)
- Remove updater
- Remove light client
- Remove C and Java bindings (#11346)
- Remove whisper (#10855)
- EIP-2315: Simple Subroutines for the EVM (#11629)
- Remove deprecated flags (removal of --geth flag)
- Remove support for hardware wallets (#10678)
- Update bootnodes
Bug fixes:
* Update EWF's chains with Istanbul transition block numbers (#11482) (#254)
* fix Supplied instant is later than self (#169)
* ethcore/snapshot: fix double-lock in Service::feed_chunk (#289)
Enhancements:
* Berlin hardfork blocks: mainnet (12,244,000), goerli (4,460,644), rinkeby (8,290,928) and ropsten (9,812,189)
* yolo3x spec (#241)
* EIP-2930 RPC support
* Remove eth/63 protocol version (#252)
* Snapshot manifest block added to prometheus (#232)
* EIP-1898: Allow default block parameter to be blockHash
* Change ProtocolId to U64
* Update ethereum/tests

105
Cargo.lock generated
View File

@@ -439,7 +439,6 @@ name = "common-types"
version = "0.1.0"
dependencies = [
"ethereum-types 0.4.2",
"ethjson",
"ethkey",
"heapsize",
"keccak-hash",
@@ -447,6 +446,9 @@ dependencies = [
"rlp 0.3.0",
"rlp_derive",
"rustc-hex 1.0.0",
"serde",
"serde_json",
"serde_repr",
"unexpected",
]
@@ -1100,6 +1102,7 @@ dependencies = [
"num",
"parity-bytes",
"parity-crypto 0.4.2",
"rustc-hex 1.0.0",
]
[[package]]
@@ -1245,47 +1248,6 @@ dependencies = [
"tiny-keccak 1.5.0",
]
[[package]]
name = "ethcore-secretstore"
version = "1.0.0"
dependencies = [
"byteorder",
"common-types",
"env_logger",
"ethabi",
"ethabi-contract",
"ethabi-derive",
"ethcore",
"ethcore-accounts",
"ethcore-call-contract",
"ethcore-sync",
"ethereum-types 0.4.2",
"ethkey",
"futures",
"hyper 0.12.35",
"jsonrpc-server-utils",
"keccak-hash",
"kvdb",
"kvdb-rocksdb",
"lazy_static",
"log",
"parity-bytes",
"parity-crypto 0.3.1",
"parity-runtime",
"parking_lot 0.7.1",
"percent-encoding 2.1.0",
"rustc-hex 1.0.0",
"serde",
"serde_derive",
"serde_json",
"tempdir",
"tiny-keccak 1.5.0",
"tokio",
"tokio-io",
"tokio-service",
"url 2.1.0",
]
[[package]]
name = "ethcore-service"
version = "0.1.0"
@@ -1412,7 +1374,9 @@ dependencies = [
name = "ethjson"
version = "0.1.0"
dependencies = [
"common-types",
"ethereum-types 0.4.2",
"ethkey",
"macros",
"maplit",
"rustc-hex 1.0.0",
@@ -1460,7 +1424,6 @@ dependencies = [
name = "ethstore"
version = "0.2.1"
dependencies = [
"dir",
"ethereum-types 0.4.2",
"ethkey",
"itertools 0.5.10",
@@ -1479,7 +1442,6 @@ dependencies = [
"smallvec 0.6.13",
"tempdir",
"time",
"tiny-keccak 1.5.0",
]
[[package]]
@@ -1505,6 +1467,7 @@ version = "0.1.0"
dependencies = [
"bit-set",
"criterion 0.2.11",
"ethcore-builtin",
"ethereum-types 0.4.2",
"heapsize",
"hex-literal",
@@ -2438,9 +2401,9 @@ dependencies = [
[[package]]
name = "linked-hash-map"
version = "0.5.2"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
[[package]]
name = "local-encoding"
@@ -2862,7 +2825,7 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
[[package]]
name = "openethereum"
version = "3.1.0"
version = "3.2.1"
dependencies = [
"ansi_term 0.10.2",
"atty",
@@ -2882,7 +2845,6 @@ dependencies = [
"ethcore-logger",
"ethcore-miner",
"ethcore-network",
"ethcore-secretstore",
"ethcore-service",
"ethcore-sync",
"ethereum-types 0.4.2",
@@ -2917,7 +2879,6 @@ dependencies = [
"pretty_assertions",
"prometheus",
"regex 1.3.9",
"registrar",
"rlp 0.3.0",
"rpassword",
"rustc-hex 1.0.0",
@@ -3003,7 +2964,7 @@ dependencies = [
"rustc-hex 2.0.1",
"scrypt 0.2.0",
"sha2 0.8.0",
"subtle 2.1.0",
"subtle 2.3.0",
"tiny-keccak 1.5.0",
"zeroize",
]
@@ -3227,7 +3188,7 @@ dependencies = [
[[package]]
name = "parity-version"
version = "3.1.0"
version = "3.2.3"
dependencies = [
"parity-bytes",
"rlp 0.3.0",
@@ -3601,22 +3562,6 @@ dependencies = [
"getopts",
]
[[package]]
name = "pwasm-run-test"
version = "0.1.0"
dependencies = [
"clap",
"env_logger",
"ethereum-types 0.4.2",
"ethjson",
"rustc-hex 1.0.0",
"serde",
"serde_derive",
"serde_json",
"vm",
"wasm",
]
[[package]]
name = "pwasm-utils"
version = "0.6.2"
@@ -3958,17 +3903,6 @@ version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
[[package]]
name = "registrar"
version = "0.0.1"
dependencies = [
"ethabi",
"ethabi-contract",
"ethabi-derive",
"futures",
"keccak-hash",
]
[[package]]
name = "relay"
version = "0.1.1"
@@ -4274,6 +4208,17 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_repr"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76"
dependencies = [
"proc-macro2 1.0.20",
"quote 1.0.7",
"syn 1.0.40",
]
[[package]]
name = "sha-1"
version = "0.8.1"
@@ -4456,9 +4401,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
[[package]]
name = "subtle"
version = "2.1.0"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01dca13cf6c3b179864ab3292bd794e757618d35a7766b7c46050c614ba00829"
checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd"
[[package]]
name = "syn"

View File

@@ -2,7 +2,7 @@
description = "OpenEthereum"
name = "openethereum"
# NOTE Make sure to update util/version/Cargo.toml as well
version = "3.1.0"
version = "3.2.1"
license = "GPL-3.0"
authors = [
"OpenEthereum developers",
@@ -10,7 +10,7 @@ authors = [
]
[dependencies]
blooms-db = { path = "util/blooms-db" }
blooms-db = { path = "crates/db/blooms-db" }
log = "0.4"
rustc-hex = "1.0"
docopt = "1.0"
@@ -35,44 +35,42 @@ fdlimit = "0.1"
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
jsonrpc-core = "15.0.0"
parity-bytes = "0.1"
common-types = { path = "ethcore/types" }
ethcore = { path = "ethcore", features = ["parity"] }
ethcore-accounts = { path = "accounts", optional = true }
ethcore-blockchain = { path = "ethcore/blockchain" }
ethcore-call-contract = { path = "ethcore/call-contract"}
ethcore-db = { path = "ethcore/db" }
ethcore-io = { path = "util/io" }
ethcore-logger = { path = "parity/logger" }
ethcore-miner = { path = "miner" }
ethcore-network = { path = "util/network" }
ethcore-service = { path = "ethcore/service" }
ethcore-sync = { path = "ethcore/sync" }
common-types = { path = "crates/ethcore/types" }
ethcore = { path = "crates/ethcore", features = ["parity"] }
ethcore-accounts = { path = "crates/accounts", optional = true }
ethcore-blockchain = { path = "crates/ethcore/blockchain" }
ethcore-call-contract = { path = "crates/vm/call-contract"}
ethcore-db = { path = "crates/db/db" }
ethcore-io = { path = "crates/runtime/io" }
ethcore-logger = { path = "bin/oe/logger" }
ethcore-miner = { path = "crates/concensus/miner" }
ethcore-network = { path = "crates/net/network" }
ethcore-service = { path = "crates/ethcore/service" }
ethcore-sync = { path = "crates/ethcore/sync" }
ethereum-types = "0.4"
ethkey = { path = "accounts/ethkey" }
ethstore = { path = "accounts/ethstore" }
fetch = { path = "util/fetch" }
node-filter = { path = "ethcore/node-filter" }
ethkey = { path = "crates/accounts/ethkey" }
ethstore = { path = "crates/accounts/ethstore" }
fetch = { path = "crates/net/fetch" }
node-filter = { path = "crates/net/node-filter" }
rlp = { version = "0.3.0", features = ["ethereum"] }
cli-signer= { path = "cli-signer" }
cli-signer= { path = "crates/util/cli-signer" }
parity-daemonize = "0.3"
parity-local-store = { path = "miner/local-store" }
parity-runtime = { path = "util/runtime" }
parity-rpc = { path = "rpc" }
parity-version = { path = "util/version" }
parity-local-store = { path = "crates/concensus/miner/local-store" }
parity-runtime = { path = "crates/runtime/runtime" }
parity-rpc = { path = "crates/rpc" }
parity-version = { path = "crates/util/version" }
parity-path = "0.1"
dir = { path = "util/dir" }
panic_hook = { path = "util/panic-hook" }
dir = { path = "crates/util/dir" }
panic_hook = { path = "crates/util/panic-hook" }
keccak-hash = "0.1"
migration-rocksdb = { path = "util/migration-rocksdb" }
migration-rocksdb = { path = "crates/db/migration-rocksdb" }
kvdb = "0.1"
kvdb-rocksdb = "0.1.3"
journaldb = { path = "util/journaldb" }
stats = { path = "util/stats" }
journaldb = { path = "crates/db/journaldb" }
stats = { path = "crates/util/stats" }
prometheus = "0.9.0"
ethcore-secretstore = { path = "secret-store", optional = true }
registrar = { path = "util/registrar" }
# ethcore-secretstore = { path = "crates/util/secret-store", optional = true }
[build-dependencies]
rustc_version = "0.2"
@@ -81,7 +79,7 @@ rustc_version = "0.2"
pretty_assertions = "0.1"
ipnetwork = "0.12.6"
tempdir = "0.3"
fake-fetch = { path = "util/fake-fetch" }
fake-fetch = { path = "crates/net/fake-fetch" }
lazy_static = "1.2.0"
[target.'cfg(windows)'.dependencies]
@@ -97,7 +95,6 @@ test-heavy = ["ethcore/test-heavy"]
evm-debug = ["ethcore/evm-debug"]
evm-debug-tests = ["ethcore/evm-debug-tests"]
slow-blocks = ["ethcore/slow-blocks"]
secretstore = ["ethcore-secretstore", "ethcore-secretstore/accounts"]
final = ["parity-version/final"]
deadlock_detection = ["parking_lot/deadlock_detection"]
# to create a memory profile (requires nightly rust), use e.g.
@@ -109,10 +106,10 @@ deadlock_detection = ["parking_lot/deadlock_detection"]
memory_profiling = []
[lib]
path = "parity/lib.rs"
path = "bin/oe/lib.rs"
[[bin]]
path = "parity/main.rs"
path = "bin/oe/main.rs"
name = "openethereum"
[profile.test]
@@ -128,16 +125,10 @@ lto = true
# in the dependency tree in any other way
# (i.e. pretty much only standalone CLI tools)
members = [
"accounts/ethkey/cli",
"accounts/ethstore/cli",
"chainspec",
"ethcore/wasm/run",
"evmbin",
"util/triehash-ethereum",
"util/keccak-hasher",
"util/patricia-trie-ethereum",
"util/fastmap",
"util/time-utils"
"bin/ethkey",
"bin/ethstore",
"bin/evmbin",
"bin/chainspec"
]
[patch.crates-io]

View File

@@ -46,7 +46,7 @@ OpenEthereum's goal is to be the fastest, lightest, and most secure Ethereum cli
By default, OpenEthereum runs a JSON-RPC HTTP server on port `:8545` and a Web-Sockets server on port `:8546`. This is fully configurable and supports a number of APIs.
If you run into problems while using OpenEthereum, check out the [old wiki for documentation](https://openethereum.github.io/wiki/), feel free to [file an issue in this repository](https://github.com/openethereum/openethereum/issues/new), or hop on our [Discord](https://discord.io/openethereum) chat room to ask a question. We are glad to help!
If you run into problems while using OpenEthereum, check out the [old wiki for documentation](https://openethereum.github.io/), feel free to [file an issue in this repository](https://github.com/openethereum/openethereum/issues/new), or hop on our [Discord](https://discord.io/openethereum) chat room to ask a question. We are glad to help!
You can download OpenEthereum's latest release at [the releases page](https://github.com/openethereum/openethereum/releases) or follow the instructions below to build from source. Read the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
@@ -135,7 +135,7 @@ To start OpenEthereum as a regular user using `systemd` init:
1. Copy `./scripts/openethereum.service` to your
`systemd` user directory (usually `~/.config/systemd/user`).
2. Copy release to bin folder, write `sudo install ./target/release/openethereum /usr/bin/openethereum`
3. To configure OpenEthereum, see [our old wiki](https://openethereum.github.io/wiki/Configuring-OpenEthereum) for details.
3. To configure OpenEthereum, see [our wiki](https://openethereum.github.io/Configuring-OpenEthereum) for details.
## 4. Testing <a id="chapter-004"></a>
@@ -157,7 +157,7 @@ You can show your logs in the test output by passing `--nocapture` (i.e. `cargo
## 5. Documentation <a id="chapter-005"></a>
Be sure to [check out our old wiki](https://openethereum.github.io/wiki/) for more information.
Be sure to [check out our wiki](https://openethereum.github.io/) for more information.
### Viewing documentation for OpenEthereum packages
@@ -297,9 +297,9 @@ Caching, Importing Blocks, and Block Information
In addition to the OpenEthereum client, there are additional tools in this repository available:
- [evmbin](./evmbin) - OpenEthereum EVM Implementation.
- [ethstore](./accounts/ethstore) - OpenEthereum Key Management.
- [ethkey](./accounts/ethkey) - OpenEthereum Keys Generator.
- [evmbin](./bin/evmbin) - OpenEthereum EVM Implementation.
- [ethstore](./crates/accounts/ethstore) - OpenEthereum Key Management.
- [ethkey](./crates/accounts/ethkey) - OpenEthereum Keys Generator.
The following tools are available in a separate repository:
- [ethabi](https://github.com/openethereum/ethabi) - OpenEthereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi)

View File

@@ -5,5 +5,5 @@ version = "0.1.0"
authors = ["Marek Kotewicz <marek@parity.io>"]
[dependencies]
ethjson = { path = "../json" }
ethjson = { path = "../../crates/ethjson" }
serde_json = "1.0"

View File

@@ -7,8 +7,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
docopt = "1.0"
env_logger = "0.5"
ethkey = { path = "../" }
panic_hook = { path = "../../../util/panic-hook" }
ethkey = { path = "../../crates/accounts/ethkey" }
panic_hook = { path = "../../crates/util/panic-hook" }
parity-wordlist="1.3"
rustc-hex = "1.0"
serde = "1.0"

View File

@@ -12,9 +12,9 @@ rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
parking_lot = "0.7"
ethstore = { path = "../" }
dir = { path = '../../../util/dir' }
panic_hook = { path = "../../../util/panic-hook" }
ethstore = { path = "../../crates/accounts/ethstore" }
dir = { path = '../../crates/util/dir' }
panic_hook = { path = "../../crates/util/panic-hook" }
[[bin]]
name = "ethstore"

View File

@@ -9,20 +9,20 @@ name = "openethereum-evm"
path = "./src/main.rs"
[dependencies]
common-types = { path = "../ethcore/types", features = ["test-helpers"] }
common-types = { path = "../../crates/ethcore/types", features = ["test-helpers"] }
docopt = "1.0"
env_logger = "0.5"
ethcore = { path = "../ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] }
ethcore = { path = "../../crates/ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] }
ethereum-types = "0.4"
ethjson = { path = "../json" }
evm = { path = "../ethcore/evm" }
panic_hook = { path = "../util/panic-hook" }
ethjson = { path = "../../crates/ethjson" }
evm = { path = "../../crates/vm/evm" }
panic_hook = { path = "../../crates/util/panic-hook" }
parity-bytes = "0.1"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
vm = { path = "../ethcore/vm" }
vm = { path = "../../crates/vm/vm" }
[dev-dependencies]
criterion = "0.3.0"

View File

@@ -5,11 +5,11 @@ EVM implementation for OpenEthereum.
### Usage
```
EVM implementation for OpenEthereum.
EVM implementation for Parity.
Copyright 2015-2020 Parity Technologies (UK) Ltd.
Usage:
openethereum-evm state-test <file> [--json --std-json --std-dump-json --only NAME --chain CHAIN --std-out-only --std-err-only]
openethereum-evm state-test <file> [--json --std-json --std-dump-json --only NAME --chain CHAIN --std-out-only --std-err-only --omit-storage-output --omit-memory-output]
openethereum-evm stats [options]
openethereum-evm stats-jsontests-vm <file>
openethereum-evm [options]
@@ -30,16 +30,22 @@ Transaction options:
--gas-price WEI Supplied gas price as hex (without 0x).
State test options:
--chain CHAIN Run only from specific chain name (i.e. one of EIP150, EIP158,
Frontier, Homestead, Byzantium, Constantinople,
ConstantinopleFix, Istanbul, EIP158ToByzantiumAt5, FrontierToHomesteadAt5,
HomesteadToDaoAt5, HomesteadToEIP150At5, Berlin, Yolo3).
--only NAME Runs only a single test matching the name.
--chain CHAIN Run only tests from specific chain.
General options:
--json Display verbose results in JSON.
--std-json Display results in standardized JSON format.
--std-err-only With --std-json redirect to err output only.
--std-out-only With --std-json redirect to out output only.
--std-dump-json Display results in standardized JSON format
with additional state dump.
--json Display verbose results in JSON.
--std-json Display results in standardized JSON format.
--std-err-only With --std-json redirect to err output only.
--std-out-only With --std-json redirect to out output only.
--omit-storage-output With --std-json omit storage output.
--omit-memory-output With --std-json omit memory output.
--std-dump-json Display results in standardized JSON format
with additional state dump.
Display result state dump in standardized JSON format.
--chain CHAIN Chain spec file path.
-h, --help Display this message and exit.

View File

@@ -0,0 +1,40 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// OpenEthereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Config used by display informants
#[derive(Default, Copy, Clone)]
pub struct Config {
omit_storage_output: bool,
omit_memory_output: bool,
}
impl Config {
pub fn new(omit_storage_output: bool, omit_memory_output: bool) -> Config {
Config {
omit_storage_output,
omit_memory_output,
}
}
pub fn omit_storage_output(&self) -> bool {
self.omit_storage_output
}
pub fn omit_memory_output(&self) -> bool {
self.omit_memory_output
}
}

View File

@@ -18,11 +18,11 @@
use std::{collections::HashMap, mem};
use super::config::Config;
use bytes::ToPretty;
use display;
use ethcore::trace;
use ethereum_types::{H256, U256};
use display;
use info as vm;
/// JSON formatting informant.
@@ -44,9 +44,16 @@ pub struct Informant {
subinfos: Vec<Informant>,
subdepth: usize,
unmatched: bool,
config: Config,
}
impl Informant {
pub fn new(config: Config) -> Informant {
let mut def = Informant::default();
def.config = config;
def
}
fn with_informant_in_depth<F: Fn(&mut Informant)>(
informant: &mut Informant,
depth: usize,
@@ -67,17 +74,26 @@ impl Informant {
}
fn informant_trace(informant: &Informant, gas_used: U256) -> String {
let memory = if informant.config.omit_memory_output() {
"".to_string()
} else {
format!("0x{}", informant.memory.to_hex())
};
let storage = if informant.config.omit_storage_output() {
None
} else {
Some(&informant.storage)
};
let info = ::evm::Instruction::from_u8(informant.instruction).map(|i| i.info());
json!({
"pc": informant.pc,
"op": informant.instruction,
"opName": info.map(|i| i.name).unwrap_or(""),
"gas": format!("{:#x}", gas_used.saturating_add(informant.gas_cost)),
"gasCost": format!("{:#x}", informant.gas_cost),
"memory": format!("0x{}", informant.memory.to_hex()),
"memory": memory,
"stack": informant.stack,
"storage": informant.storage,
"storage": storage,
"depth": informant.depth,
})
.to_string()
@@ -85,7 +101,7 @@ impl Informant {
}
impl vm::Informant for Informant {
type Sink = ();
type Sink = Config;
fn before_test(&mut self, name: &str, action: &str) {
println!("{}", json!({"action": action, "test": name}));
@@ -96,10 +112,10 @@ impl vm::Informant for Informant {
}
fn clone_sink(&self) -> Self::Sink {
()
self.config
}
fn finish(result: vm::RunResult<Self::Output>, _sink: &mut Self::Sink) {
fn finish(result: vm::RunResult<Self::Output>, config: &mut Self::Sink) {
match result {
Ok(success) => {
for trace in success.traces.unwrap_or_else(Vec::new) {
@@ -115,8 +131,10 @@ impl vm::Informant for Informant {
println!("{}", success_msg)
}
Err(failure) => {
for trace in failure.traces.unwrap_or_else(Vec::new) {
println!("{}", trace);
if !config.omit_storage_output() {
for trace in failure.traces.unwrap_or_else(Vec::new) {
println!("{}", trace);
}
}
let failure_msg = json!({
@@ -205,6 +223,7 @@ impl trace::VMTracer for Informant {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| {
let mut vm = Informant::default();
vm.config = informant.config;
vm.depth = informant.depth + 1;
vm.code = code.to_vec();
vm.gas_used = informant.gas_used;

View File

@@ -18,6 +18,7 @@
use std::time::Duration;
pub mod config;
pub mod json;
pub mod simple;
pub mod std_json;

View File

@@ -16,6 +16,7 @@
//! Simple VM output.
use super::config::Config;
use bytes::ToPretty;
use ethcore::trace;
@@ -24,17 +25,25 @@ use info as vm;
/// Simple formatting informant.
#[derive(Default)]
pub struct Informant;
pub struct Informant {
config: Config,
}
impl Informant {
pub fn new(config: Config) -> Informant {
Informant { config }
}
}
impl vm::Informant for Informant {
type Sink = ();
type Sink = Config;
fn before_test(&mut self, name: &str, action: &str) {
println!("Test: {} ({})", name, action);
}
fn clone_sink(&self) -> Self::Sink {
()
self.config
}
fn finish(result: vm::RunResult<Self::Output>, _sink: &mut Self::Sink) {

View File

@@ -18,11 +18,11 @@
use std::{collections::HashMap, io};
use super::config::Config;
use bytes::ToPretty;
use display;
use ethcore::{pod_state, trace};
use ethereum_types::{H256, U256};
use display;
use info as vm;
pub trait Writer: io::Write + Send + Sized {
@@ -61,30 +61,39 @@ pub struct Informant<Trace, Out> {
subdepth: usize,
trace_sink: Trace,
out_sink: Out,
config: Config,
}
impl Default for Informant<io::Stderr, io::Stdout> {
fn default() -> Self {
Self::new(io::stderr(), io::stdout())
Self::new(io::stderr(), io::stdout(), Config::default())
}
}
impl Informant<io::Stdout, io::Stdout> {
/// std json informant using out only.
pub fn out_only() -> Self {
Self::new(io::stdout(), io::stdout())
pub fn out_only(config: Config) -> Self {
Self::new(io::stdout(), io::stdout(), config)
}
}
impl Informant<io::Stderr, io::Stderr> {
/// std json informant using err only.
pub fn err_only() -> Self {
Self::new(io::stderr(), io::stderr())
pub fn err_only(config: Config) -> Self {
Self::new(io::stderr(), io::stderr(), config)
}
}
impl Informant<io::Stderr, io::Stdout> {
pub fn new_default(config: Config) -> Self {
let mut informant = Self::default();
informant.config = config;
informant
}
}
impl<Trace: Writer, Out: Writer> Informant<Trace, Out> {
pub fn new(trace_sink: Trace, out_sink: Out) -> Self {
pub fn new(trace_sink: Trace, out_sink: Out, config: Config) -> Self {
Informant {
code: Default::default(),
instruction: Default::default(),
@@ -95,6 +104,7 @@ impl<Trace: Writer, Out: Writer> Informant<Trace, Out> {
subdepth: 0,
trace_sink,
out_sink,
config,
}
}
@@ -133,7 +143,7 @@ impl<Trace: Writer, Out: Writer> Informant<Trace, Out> {
}
impl<Trace: Writer, Out: Writer> vm::Informant for Informant<Trace, Out> {
type Sink = (Trace, Out);
type Sink = (Trace, Out, Config);
fn before_test(&mut self, name: &str, action: &str) {
let out_data = json!({
@@ -147,11 +157,15 @@ impl<Trace: Writer, Out: Writer> vm::Informant for Informant<Trace, Out> {
fn set_gas(&mut self, _gas: U256) {}
fn clone_sink(&self) -> Self::Sink {
(self.trace_sink.clone(), self.out_sink.clone())
(
self.trace_sink.clone(),
self.out_sink.clone(),
self.config.clone(),
)
}
fn finish(
result: vm::RunResult<<Self as trace::VMTracer>::Output>,
(ref mut trace_sink, ref mut out_sink): &mut Self::Sink,
(ref mut trace_sink, ref mut out_sink, _): &mut Self::Sink,
) {
match result {
Ok(success) => {
@@ -240,7 +254,11 @@ impl<Trace: Writer, Out: Writer> trace::VMTracer for Informant<Trace, Out> {
fn prepare_subtrace(&mut self, code: &[u8]) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant<Trace, Out>| {
let mut vm = Informant::new(informant.trace_sink.clone(), informant.out_sink.clone());
let mut vm = Informant::new(
informant.trace_sink.clone(),
informant.out_sink.clone(),
informant.config,
);
vm.depth = informant.depth + 1;
vm.code = code.to_vec();
informant.subinfos.push(vm);
@@ -293,7 +311,10 @@ pub mod tests {
let trace_writer: TestWriter = Default::default();
let out_writer: TestWriter = Default::default();
let res = trace_writer.0.clone();
(Informant::new(trace_writer, out_writer), res)
(
Informant::new(trace_writer, out_writer, Config::default()),
res,
)
}
#[test]

View File

@@ -141,7 +141,7 @@ pub fn run_transaction<T: Informant>(
let result = run(
&spec,
trie_spec,
transaction.gas,
transaction.tx().gas,
pre_state,
|mut client| {
let result = client.transact(env_info, transaction, trace::NoopTracer, informant);

View File

@@ -57,10 +57,10 @@ use info::Informant;
const USAGE: &'static str = r#"
EVM implementation for Parity.
Copyright 2015-2019 Parity Technologies (UK) Ltd.
Copyright 2015-2020 Parity Technologies (UK) Ltd.
Usage:
openethereum-evm state-test <file> [--json --std-json --std-dump-json --only NAME --chain CHAIN --std-out-only --std-err-only]
openethereum-evm state-test <file> [--json --std-json --std-dump-json --only NAME --chain CHAIN --std-out-only --std-err-only --omit-storage-output --omit-memory-output]
openethereum-evm stats [options]
openethereum-evm stats-jsontests-vm <file>
openethereum-evm [options]
@@ -84,16 +84,19 @@ State test options:
--chain CHAIN Run only from specific chain name (i.e. one of EIP150, EIP158,
Frontier, Homestead, Byzantium, Constantinople,
ConstantinopleFix, Istanbul, EIP158ToByzantiumAt5, FrontierToHomesteadAt5,
HomesteadToDaoAt5, HomesteadToEIP150At5).
HomesteadToDaoAt5, HomesteadToEIP150At5, Berlin, Yolo3).
--only NAME Runs only a single test matching the name.
General options:
--json Display verbose results in JSON.
--std-json Display results in standardized JSON format.
--std-err-only With --std-json redirect to err output only.
--std-out-only With --std-json redirect to out output only.
--std-dump-json Display results in standardized JSON format
with additional state dump.
--json Display verbose results in JSON.
--std-json Display results in standardized JSON format.
--std-err-only With --std-json redirect to err output only.
--std-out-only With --std-json redirect to out output only.
--omit-storage-output With --std-json omit storage output.
--omit-memory-output With --std-json omit memory output.
--std-dump-json Display results in standardized JSON format
with additional state dump.
Display result state dump in standardized JSON format.
--chain CHAIN Chain spec file path.
-h, --help Display this message and exit.
@@ -107,22 +110,24 @@ fn main() {
.and_then(|d| d.deserialize())
.unwrap_or_else(|e| e.exit());
let config = args.config();
if args.cmd_state_test {
run_state_test(args)
} else if args.cmd_stats_jsontests_vm {
run_stats_jsontests_vm(args)
} else if args.flag_json {
run_call(args, display::json::Informant::default())
run_call(args, display::json::Informant::new(config))
} else if args.flag_std_dump_json || args.flag_std_json {
if args.flag_std_err_only {
run_call(args, display::std_json::Informant::err_only())
run_call(args, display::std_json::Informant::err_only(config))
} else if args.flag_std_out_only {
run_call(args, display::std_json::Informant::out_only())
run_call(args, display::std_json::Informant::out_only(config))
} else {
run_call(args, display::std_json::Informant::default())
run_call(args, display::std_json::Informant::new_default(config))
};
} else {
run_call(args, display::simple::Informant::default())
run_call(args, display::simple::Informant::new(config))
}
}
@@ -165,7 +170,7 @@ fn run_stats_jsontests_vm(args: Args) {
fn run_state_test(args: Args) {
use ethjson::state::test::Test;
let config = args.config();
let file = args.arg_file.expect("FILE is required");
let mut file = match fs::File::open(&file) {
Err(err) => die(format!("Unable to open: {:?}: {}", file, err)),
@@ -197,10 +202,9 @@ fn run_state_test(args: Args) {
{
continue;
}
for (idx, state) in states.into_iter().enumerate() {
let post_root = state.hash.into();
let transaction = multitransaction.select(&state.indexes).into();
let transaction = multitransaction.select(&state.indexes);
let trie_spec = if args.flag_std_dump_json {
TrieSpec::Fat
@@ -216,7 +220,7 @@ fn run_state_test(args: Args) {
post_root,
&env_info,
transaction,
display::json::Informant::default(),
display::json::Informant::new(config),
trie_spec,
)
} else if args.flag_std_dump_json || args.flag_std_json {
@@ -229,7 +233,7 @@ fn run_state_test(args: Args) {
post_root,
&env_info,
transaction,
display::std_json::Informant::err_only(),
display::std_json::Informant::err_only(config),
trie_spec,
)
} else if args.flag_std_out_only {
@@ -241,7 +245,7 @@ fn run_state_test(args: Args) {
post_root,
&env_info,
transaction,
display::std_json::Informant::out_only(),
display::std_json::Informant::out_only(config),
trie_spec,
)
} else {
@@ -253,7 +257,7 @@ fn run_state_test(args: Args) {
post_root,
&env_info,
transaction,
display::std_json::Informant::default(),
display::std_json::Informant::new_default(config),
trie_spec,
)
}
@@ -266,7 +270,7 @@ fn run_state_test(args: Args) {
post_root,
&env_info,
transaction,
display::simple::Informant::default(),
display::simple::Informant::new(config),
trie_spec,
)
}
@@ -287,8 +291,16 @@ fn run_call<T: Informant>(args: Args, informant: T) {
if code.is_none() && to == Address::default() {
die("Either --code or --to is required.");
}
let mut params = ActionParams::default();
if spec.engine.params().eip2929_transition == 0 {
params.access_list.enable();
params.access_list.insert_address(from);
params.access_list.insert_address(to);
for (builtin, _) in spec.engine.builtins() {
params.access_list.insert_address(*builtin);
}
}
params.call_type = if code.is_none() {
CallType::Call
} else {
@@ -331,6 +343,8 @@ struct Args {
flag_std_dump_json: bool,
flag_std_err_only: bool,
flag_std_out_only: bool,
flag_omit_storage_output: bool,
flag_omit_memory_output: bool,
}
impl Args {
@@ -378,13 +392,24 @@ impl Args {
pub fn spec(&self) -> Result<spec::Spec, String> {
Ok(match self.flag_chain {
Some(ref filename) => {
let file = fs::File::open(filename).map_err(|e| format!("{}", e))?;
spec::Spec::load(&::std::env::temp_dir(), file)?
Some(ref spec_name) => {
let fork_spec: Result<ethjson::spec::ForkSpec, _> =
serde_json::from_str(&format!("{:?}", spec_name));
if let Ok(fork_spec) = fork_spec {
ethcore::client::EvmTestClient::spec_from_json(&fork_spec)
.expect("this forkspec is not defined")
} else {
let file = fs::File::open(spec_name).map_err(|e| format!("{}", e))?;
spec::Spec::load(&::std::env::temp_dir(), file)?
}
}
None => ethcore::ethereum::new_foundation(&::std::env::temp_dir()),
})
}
pub fn config(&self) -> display::config::Config {
display::config::Config::new(self.flag_omit_storage_output, self.flag_omit_memory_output)
}
}
fn arg<T>(v: Result<T, String>, param: &str) -> T {

View File

@@ -248,7 +248,7 @@ usage! {
ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
"--chain=[CHAIN]",
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, poasokol, testnet, or dev.",
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, poasokol, testnet, yolo3 or dev.",
ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
"--keys-path=[PATH]",
@@ -466,6 +466,10 @@ usage! {
"--ws-max-connections=[CONN]",
"Maximum number of allowed concurrent WebSockets JSON-RPC connections.",
ARG arg_ws_max_payload: (usize) = 5usize, or |c: &Config| c.websockets.as_ref()?.max_payload,
"--ws-max-payload=[MB]",
"Specify maximum size for WS JSON-RPC requests in megabytes.",
["Metrics"]
FLAG flag_metrics: (bool) = false, or |c: &Config| c.metrics.as_ref()?.enable.clone(),
"--metrics",
@@ -706,7 +710,7 @@ usage! {
"--stratum-secret=[STRING]",
"Secret for authorizing Stratum server for peers.",
ARG arg_max_round_blocks_to_import: (usize) = 12usize, or |c: &Config| c.mining.as_ref()?.max_round_blocks_to_import.clone(),
ARG arg_max_round_blocks_to_import: (usize) = 1usize, or |c: &Config| c.mining.as_ref()?.max_round_blocks_to_import.clone(),
"--max-round-blocks-to-import=[S]",
"Maximal number of blocks to import for each import round.",
@@ -903,6 +907,7 @@ struct Ws {
origins: Option<Vec<String>>,
hosts: Option<Vec<String>>,
max_connections: Option<usize>,
max_payload: Option<usize>,
}
#[derive(Default, Debug, PartialEq, Deserialize)]
@@ -1323,6 +1328,7 @@ mod tests {
arg_ws_origins: "none".into(),
arg_ws_hosts: "none".into(),
arg_ws_max_connections: 100,
arg_ws_max_payload: 5,
// IPC
flag_no_ipc: false,
@@ -1386,7 +1392,7 @@ mod tests {
arg_notify_work: Some("http://localhost:3001".into()),
flag_refuse_service_transactions: false,
flag_infinite_pending_block: false,
arg_max_round_blocks_to_import: 12usize,
arg_max_round_blocks_to_import: 1usize,
flag_stratum: false,
arg_stratum_interface: "local".to_owned(),
@@ -1512,6 +1518,7 @@ mod tests {
origins: Some(vec!["none".into()]),
hosts: None,
max_connections: None,
max_payload: None,
}),
rpc: Some(Rpc {
disable: Some(true),

View File

@@ -518,10 +518,8 @@ impl Configuration {
}
fn ip_filter(&self) -> Result<IpFilter, String> {
match IpFilter::parse(self.args.arg_allow_ips.as_str()) {
Ok(allow_ip) => Ok(allow_ip),
Err(_) => Err("Invalid IP filter value".to_owned()),
}
IpFilter::parse(self.args.arg_allow_ips.as_str())
.map_err(|_| "Invalid IP filter value".to_owned())
}
fn min_peers(&self) -> u32 {
@@ -951,6 +949,7 @@ impl Configuration {
signer_path: self.directories().signer.into(),
support_token_api,
max_connections: self.args.arg_ws_max_connections,
max_payload: self.args.arg_ws_max_payload,
};
Ok(conf)
@@ -1369,7 +1368,7 @@ mod tests {
check_seal: true,
with_color: !cfg!(windows),
verifier_settings: Default::default(),
max_round_blocks_to_import: 12,
max_round_blocks_to_import: 1,
}))
);
}
@@ -1395,7 +1394,7 @@ mod tests {
from_block: BlockId::Number(1),
to_block: BlockId::Latest,
check_seal: true,
max_round_blocks_to_import: 12,
max_round_blocks_to_import: 1,
}))
);
}
@@ -1423,7 +1422,7 @@ mod tests {
code: true,
min_balance: None,
max_balance: None,
max_round_blocks_to_import: 12,
max_round_blocks_to_import: 1,
}))
);
}
@@ -1456,7 +1455,7 @@ mod tests {
from_block: BlockId::Number(1),
to_block: BlockId::Latest,
check_seal: true,
max_round_blocks_to_import: 12,
max_round_blocks_to_import: 1,
}))
);
}
@@ -1483,6 +1482,7 @@ mod tests {
signer_path: expected.into(),
support_token_api: true,
max_connections: 100,
max_payload: 5,
},
LogConfig {
color: !cfg!(windows),
@@ -1550,7 +1550,7 @@ mod tests {
download_old_blocks: true,
verifier_settings: Default::default(),
no_persistent_txqueue: false,
max_round_blocks_to_import: 12,
max_round_blocks_to_import: 1,
metrics_conf: MetricsConfiguration::default(),
};
expected.secretstore_conf.enabled = cfg!(feature = "secretstore");

View File

@@ -105,10 +105,10 @@ pub fn to_block_id(s: &str) -> Result<BlockId, String> {
pub fn to_u256(s: &str) -> Result<U256, String> {
if let Ok(decimal) = U256::from_dec_str(s) {
Ok(decimal)
} else if let Ok(hex) = clean_0x(s).parse() {
Ok(hex)
} else {
Err(format!("Invalid numeric value: {}", s))
clean_0x(s)
.parse()
.map_err(|_| format!("Invalid numeric value: {}", s))
}
}
@@ -171,15 +171,12 @@ pub fn to_price(s: &str) -> Result<f32, String> {
}
pub fn join_set(set: Option<&HashSet<String>>) -> Option<String> {
match set {
Some(s) => Some(
s.iter()
.map(|s| s.as_str())
.collect::<Vec<&str>>()
.join(","),
),
None => None,
}
set.map(|s| {
s.iter()
.map(|s| s.as_str())
.collect::<Vec<&str>>()
.join(",")
})
}
/// Flush output buffer.

View File

@@ -92,7 +92,7 @@ impl CacheSizes {
pub struct SyncInfo {
last_imported_block_number: BlockNumber,
last_imported_old_block_number: Option<BlockNumber>,
last_imported_ancient_number: Option<BlockNumber>,
num_peers: usize,
max_peers: u32,
snapshot_sync: bool,
@@ -160,7 +160,7 @@ impl InformantData for FullNodeInformantData {
last_imported_block_number: status
.last_imported_block_number
.unwrap_or(chain_info.best_block_number),
last_imported_old_block_number: status.last_imported_old_block_number,
last_imported_ancient_number: status.last_imported_old_block_number,
num_peers: status.num_peers,
max_peers: status
.current_max_peers(*num_peers_range.start(), *num_peers_range.end()),
@@ -224,7 +224,14 @@ impl<T: InformantData> Informant<T> {
pub fn tick(&self) {
let now = Instant::now();
let elapsed = now.duration_since(*self.last_tick.read());
let elapsed;
{
let last_tick = self.last_tick.read();
if now < *last_tick + Duration::from_millis(1500) {
return;
}
elapsed = now - *last_tick;
}
let (client_report, full_report) = {
let last_report = self.last_report.lock();
@@ -265,7 +272,7 @@ impl<T: InformantData> Informant<T> {
false => t,
};
info!(target: "import", "{} {} {} {}",
info!(target: "import", "{}{} {} {} {}",
match importing {
true => match snapshot_sync {
false => format!("Syncing {} {} {} {}+{} Qed",
@@ -301,18 +308,22 @@ impl<T: InformantData> Informant<T> {
},
false => String::new(),
},
match chain_info.ancient_block_number {
Some(ancient_number) => format!(" Ancient:#{}", ancient_number),
None => String::new(),
},
match sync_info.as_ref() {
Some(ref sync_info) => format!("{}{}/{} peers",
match importing {
true => format!("{}",
if self.target.executes_transactions() {
paint(Green.bold(), format!("{:>8} ", format!("#{}", sync_info.last_imported_block_number)))
paint(Green.bold(), format!("{:>8} ", format!("LI:#{}", sync_info.last_imported_block_number)))
} else {
String::new()
}
),
false => match sync_info.last_imported_old_block_number {
Some(number) => format!("{} ", paint(Yellow.bold(), format!("{:>8}", format!("#{}", number)))),
false => match sync_info.last_imported_ancient_number {
Some(number) => format!("{} ", paint(Yellow.bold(), format!("{:>8}", format!("AB:#{}", number)))),
None => String::new(),
}
},
@@ -336,6 +347,7 @@ impl<T: InformantData> Informant<T> {
}
impl ChainNotify for Informant<FullNodeInformantData> {
// t_nb 11.2 Informant. Prints new block inclusiong to console/log.
fn new_blocks(&self, new_blocks: NewBlocks) {
if new_blocks.has_more_blocks_to_import {
return;

View File

@@ -67,7 +67,6 @@ extern crate parity_rpc;
extern crate parity_runtime;
extern crate parity_version;
extern crate prometheus;
extern crate registrar;
extern crate stats;
#[macro_use]

View File

@@ -157,10 +157,11 @@ pub fn setup_log(config: &Config) -> Result<Arc<RotatingLogger>, String> {
Ok(logs)
})
// couldn't create new logger - try to fall back on previous logger.
.or_else(|err| match ROTATING_LOGGER.lock().upgrade() {
Some(l) => Ok(l),
// no previous logger. fatal.
None => Err(format!("{:?}", err)),
.or_else(|err| {
ROTATING_LOGGER
.lock()
.upgrade()
.ok_or_else(|| format!("{:?}", err))
})
}

View File

@@ -51,6 +51,7 @@ pub enum SpecType {
Rinkeby,
Goerli,
Sokol,
Yolo3,
Dev,
Custom(String),
}
@@ -81,6 +82,7 @@ impl str::FromStr for SpecType {
"rinkeby" => SpecType::Rinkeby,
"goerli" | "görli" | "testnet" => SpecType::Goerli,
"sokol" | "poasokol" => SpecType::Sokol,
"yolo3" => SpecType::Yolo3,
"dev" => SpecType::Dev,
other => SpecType::Custom(other.into()),
};
@@ -106,6 +108,7 @@ impl fmt::Display for SpecType {
SpecType::Rinkeby => "rinkeby",
SpecType::Goerli => "goerli",
SpecType::Sokol => "sokol",
SpecType::Yolo3 => "yolo3",
SpecType::Dev => "dev",
SpecType::Custom(ref custom) => custom,
})
@@ -131,6 +134,7 @@ impl SpecType {
SpecType::Rinkeby => Ok(ethereum::new_rinkeby(params)),
SpecType::Goerli => Ok(ethereum::new_goerli(params)),
SpecType::Sokol => Ok(ethereum::new_sokol(params)),
SpecType::Yolo3 => Ok(ethereum::new_yolo3(params)),
SpecType::Dev => Ok(Spec::new_instant()),
SpecType::Custom(ref filename) => {
let file = fs::File::open(filename).map_err(|e| {

View File

@@ -97,6 +97,7 @@ pub struct WsConfiguration {
pub hosts: Option<Vec<String>>,
pub signer_path: PathBuf,
pub support_token_api: bool,
pub max_payload: usize,
}
impl Default for WsConfiguration {
@@ -116,6 +117,7 @@ impl Default for WsConfiguration {
hosts: Some(Vec::new()),
signer_path: replace_home(&data_dir, "$BASE/signer").into(),
support_token_api: true,
max_payload: 5,
}
}
}
@@ -194,6 +196,7 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
rpc::WsExtractor::new(path.clone()),
rpc::WsExtractor::new(path.clone()),
rpc::WsStats::new(deps.stats.clone()),
conf.max_payload,
);
// match start_result {

View File

@@ -34,7 +34,7 @@ use ethcore::{
};
use ethcore_logger::{Config as LogConfig, RotatingLogger};
use ethcore_service::ClientService;
use ethereum_types::H256;
use ethereum_types::{H256, U64};
use helpers::{execute_upgrades, passwords_from_files, to_client_config};
use informant::{FullNodeInformantData, Informant};
use journaldb::Algorithm;
@@ -227,12 +227,10 @@ pub fn execute(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<RunningClient
Some(id) => id,
None => spec.network_id(),
};
if spec.subprotocol_name().len() != 3 {
warn!("Your chain specification's subprotocol length is not 3. Ignoring.");
if spec.subprotocol_name().len() > 8 {
warn!("Your chain specification's subprotocol length is more then 8. Ignoring.");
} else {
sync_config
.subprotocol_name
.clone_from_slice(spec.subprotocol_name().as_bytes());
sync_config.subprotocol_name = U64::from(spec.subprotocol_name().as_bytes())
}
sync_config.fork_block = spec.fork_block();

View File

@@ -11,7 +11,7 @@ eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", rev = "c
ethereum-types = "0.4"
lazy_static = "1.0"
log = "0.4"
memzero = { path = "../../util/memzero" }
memzero = { path = "../../../crates/util/memzero" }
parity-wordlist = "1.3"
quick-error = "1.2.2"
rand = "0.4"

View File

@@ -25,10 +25,7 @@ impl Generator for Random {
fn generate(&mut self) -> Result<KeyPair, Self::Error> {
let mut rng = OsRng::new()?;
match rng.generate() {
Ok(pair) => Ok(pair),
Err(void) => match void {}, // LLVM unreachable
}
rng.generate().or_else(|void| match void {})
}
}

Some files were not shown because too many files have changed in this diff Show More