Skip to content

Commit 2286dc1

Browse files
author
winsvega
authored
Merge pull request #157 from ethereum/develop
version 0.2.2 develop
2 parents 1ee8186 + 766b462 commit 2286dc1

File tree

134 files changed

+4124
-1958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4124
-1958
lines changed

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ set(HUNTER_JOBS_NUMBER 4 CACHE STRING "Hunter jobs number")
99
set(HUNTER_CACHE_SERVERS "https://github.com/ethereum/hunter-cache" CACHE STRING "Hunter cache servers")
1010

1111
HunterGate(
12-
URL "https://github.com/ruslo/hunter/archive/v0.23.44.tar.gz"
13-
SHA1 "c4cfcc0cd39fdae8de08f6205b7f34cab4a7ba79"
14-
LOCAL
12+
URL "https://github.com/ruslo/hunter/archive/v0.23.44.tar.gz"
13+
SHA1 "c4cfcc0cd39fdae8de08f6205b7f34cab4a7ba79"
14+
LOCAL
1515
)
1616

17-
project(retesteth VERSION 0.2.1)
18-
set(VERSION_SUFFIX "difficulty")
17+
project(retesteth VERSION 0.2.2)
18+
set(VERSION_SUFFIX "testinfo")
1919

2020
set(Boost_USE_STATIC_LIBS ON)
2121
set(Boost_USE_MULTITHREADED ON)
22-
hunter_add_package(Boost COMPONENTS filesystem program_options system)
23-
find_package(Boost CONFIG REQUIRED filesystem program_options system)
22+
#hunter_add_package(Boost COMPONENTS filesystem program_options system)
23+
24+
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cmake/scripts/boost.sh filesystem program_options system)
25+
set(BOOST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/dependecies/boost/boost_1_79_0/)
26+
find_package(Boost 1.79 REQUIRED COMPONENTS filesystem program_options system)
2427

2528
hunter_add_package(yaml-cpp)
2629
find_package(yaml-cpp CONFIG REQUIRED)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV TZ=Etc/UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
55

66
RUN apt-get update \
7-
&& apt-get install --yes git cmake g++ make perl psmisc \
7+
&& apt-get install --yes git cmake g++ make perl psmisc curl \
88
&& rm -rf /var/lib/apt/lists/*
99

1010
# Retesteth
@@ -40,8 +40,8 @@ RUN apt-get install wget && wget https://github.com/ethereum/solidity/releases/d
4040
# Geth
4141
RUN git clone --depth 1 -b master https://github.com/ethereum/go-ethereum.git /geth
4242
RUN cd /geth && apt-get install wget \
43-
&& wget https://dl.google.com/go/go1.15.7.linux-amd64.tar.gz \
44-
&& tar -xvf go1.15.7.linux-amd64.tar.gz \
43+
&& wget https://dl.google.com/go/go1.18.linux-amd64.tar.gz \
44+
&& tar -xvf go1.18.linux-amd64.tar.gz \
4545
&& mv go /usr/local && ln -s /usr/local/go/bin/go /bin/go \
4646
&& make all && cp /geth/build/bin/evm /bin/evm \
4747
&& cp /geth/build/bin/geth /bin/geth \

README.md

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,72 @@
11
# retesteth
2-
testeth via RPC (wiki: https://github.com/ethereum/retesteth/wiki)
2+
testeth via RPC (wiki: https://github.com/ethereum/retesteth/wiki)
3+
tests execution/generation via transition tool (https://ethereum-tests.readthedocs.io/en/latest/t8ntool-ref.html)
34
(Execution stats: http://retesteth.ethdevops.io/)
45

5-
* A test generaion tool for the test fillers https://github.com/ethereum/tests/tree/develop/src
6+
* A test generation tool for the test fillers https://github.com/ethereum/tests/tree/develop/src
67
* Building instruction for beginners: [retesteth + solidity build](https://github.com/ethereum/retesteth#building-instructions-for-beginners)
78
* [Usage tutorial](https://ethereum-tests.readthedocs.io/en/latest/retesteth-tutorial.html)
89

910
# The Goal
1011

11-
* A test tool that would be capable of running current Blockchain tests against any client by sending rpc request to the client instatnce on either local or remote host. (using unix or TCP sockets)
12-
* Filling existing tests (generating post state from *Filler.json instruction files) using rpc and any exisiting client
13-
* Running rpc request - response tests with a provided client on localhost
12+
* A test tool that would be capable of running current Blockchain/State tests against any client
13+
* On client side use test RPC or transition tool executable which exports client core logic of transaction execution on given state
14+
* Filling existing tests (generating post state from *Filler.json instruction files) using the above and any existing client
15+
* Running request - response tests with a provided client on localhost
1416
* Bunch tests execution with many clients with many threads
15-
* A minimum set of additional rpc methods for client to negotiate with the tool: https://github.com/ethereum/retesteth/wiki/RPC-Methods
17+
* A minimum set of additional RPC methods for client to negotiate with the tool: https://github.com/ethereum/retesteth/wiki/RPC-Methods
18+
* Or a simple transition tool that is also usefull for transaction debugging: https://ethereum-tests.readthedocs.io/en/latest/t8ntool-ref.html
1619

1720
# Current progress
1821

19-
* done: State tests execution and filling was done as PoC on ethereum cpp client (aleth)
20-
* done: Tests execution using threads on localhost with multimple instances of a client (geth + aleth)
21-
* done: Develop minimum set of rpc methods that are to be implemented on other clients and could be used to run tests via rpc
22+
* done: State tests execution and filling was done as PoC on Ethereum cpp client (aleth)
23+
* done: Tests execution using threads on localhost with multiple instances of a client (geth + aleth)
24+
* done: Develop minimum set of RPC methods that are to be implemented on other clients and could be used to run tests via RPC
2225
* done: PoC Running Blockchain tests using geth client
2326
* done: Implement a set of PoC methods in other client then aleth
2427
* done: Refactoring and stability when generating GeneralStateTests
2528
* done: Blockchain test generation support
26-
* now: Use retesteth to produce fork tests with geth/besu/aleth
27-
* now: Refactor the code, impove stability
29+
* done: Use retesteth to produce fork tests with geth/besu
30+
* done: Refactor the code, improve stability
31+
* now: Support and development, support teams
2832

2933
# Building instructions
34+
Ubuntu (retesteth):
3035
```
3136
git clone git@github.com:ethereum/retesteth.git
3237
cd retesteth
3338
mkdir build
3439
cd build
35-
cmake ..
40+
cmake .. -DCMAKE_BUILD_TYPE=Release
3641
make -j4
3742
```
38-
Or try building instruction for begginers: [retesteth + solidity build](https://github.com/ethereum/retesteth#building-instructions-for-beginners)
43+
44+
MacOS (retesteth + tests + geth):
45+
```
46+
HOMEBREW_NO_AUTO_UPDATE=1 brew install -q cmake ninja git go@1.16
47+
git clone --depth 1 https://github.com/ethereum/go-ethereum.git
48+
git clone --depth 1 https://github.com/ethereum/tests.git
49+
cd go-ethereum
50+
make all
51+
ln -s ./build/bin/evm /usr/local/bin/evm
52+
cd ..
53+
git clone https://github.com/ethereum/retesteth.git
54+
cd retesteth
55+
mkdir build
56+
cd build
57+
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake
58+
cmake --build .
59+
60+
```
61+
Or try building instruction for beginners: [retesteth + solidity build](https://github.com/ethereum/retesteth#building-instructions-for-beginners)
3962

4063

4164
# Usage
42-
WIKI: https://github.com/ethereum/retesteth/wiki
43-
Requres to have a client installed on your system. Read the wiki page on detailed instruction on how to configure your client to work with `retesteth`
65+
Wiki: https://github.com/ethereum/retesteth/wiki
66+
Requires to have a client installed on your system. Read the wiki page on detailed instruction on how to configure your client to work with `retesteth`
4467
https://github.com/ethereum/retesteth/wiki/Add-client-configuration-to-Retesteth
45-
```
46-
./retesteth -t GeneralStateTests
68+
```bash
69+
./retesteth -t GeneralStateTests -- --testpath "your path to ethereum/tests repo"
4770
```
4871

4972
# Docker instructions
@@ -82,11 +105,11 @@ cd build
82105
cmake ..
83106
```
84107

85-
Now you should see the successful build files generation result:
108+
Now you should see the successful build files generation result:
86109
```
87110
Configuring done
88111
-- Generating done
89-
-- Build files have been written
112+
-- Build files have been written
90113
```
91114

92115
Run the build command to compile:
@@ -97,10 +120,10 @@ make -j4
97120

98121
#### Solidity
99122

100-
check the available boost version by
123+
check the available boost version by
101124
`sudo apt-cache policy libboost-all-dev`
102125

103-
install boost dependency boost if version >=1.65
126+
install boost dependency boost if version >=1.65
104127
`sudo apt-get install libboost-all-dev`
105128

106129
Solidity building instructions:
@@ -118,5 +141,3 @@ make lllc -j4
118141
```
119142

120143
### DONE!
121-
122-

circle.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,24 @@ defaults:
3131
name: "ConfigureMac"
3232
working_directory: ~/build
3333
command: |
34-
cmake ../project -G "$GENERATOR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOVERAGE=ON $CMAKE_OPTIONS -DCMAKE_TOOLCHAIN_FILE=~/project/toolchain.cmake
34+
cmake ../project -G "$GENERATOR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_OPTIONS -DCMAKE_TOOLCHAIN_FILE=~/project/toolchain.cmake
3535
3636
build: &build
3737
run:
3838
name: "Build"
3939
working_directory: ~/build
4040
command: cmake --build . -- -j $BUILD_PARALLEL_JOBS
4141

42+
test-retesteth: &test-retesteth
43+
run:
44+
name: "Test-retesteth"
45+
working_directory: ~/build/retesteth
46+
command: |
47+
./retesteth -t GeneralStateTests/stExample -- --testpath ~/project/tests
48+
./retesteth -t BlockchainTests/ValidBlocks/bcExample -- --testpath ~/project/tests
49+
./retesteth -t GeneralStateTests -- --checkhash --testpath ~/project/tests
50+
./retesteth -t BlockchainTests -- --checkhash --testpath ~/project/tests
51+
4252
test: &test
4353
run:
4454
name: "Test"
@@ -51,7 +61,11 @@ defaults:
5161
./retesteth -t EthObjectsSuite
5262
./retesteth -t DataObjectTestSuite
5363
./retesteth -t OptionsSuite
64+
./retesteth -t ExpectSectionSuite
65+
./retesteth -t StructTest
66+
./retesteth -t MemoryLeak
5467
# ./retesteth -t LLLCSuite
68+
# ./retesteth -t trDataCompileSuite
5569
# git clone --depth 1 https://github.com/ethereum/tests.git
5670
# export ETHEREUM_TEST_PATH=~/build/testeth/tests
5771
# ctest --output-on-failure -j $TEST_PARALLEL_JOBS
@@ -149,29 +163,35 @@ jobs:
149163
- image: ethereum/cpp-build-env:7
150164
steps: *linux-steps
151165

152-
macOS-XCode11:
166+
macOS-XCode12:
153167
environment:
168+
- BUILD_TYPE: Release
154169
- CXX: clang++
155-
- GCOV: gcov
156170
- GENERATOR: Ninja
157171
- BUILD_PARALLEL_JOBS: 8
158172
- TEST_PARALLEL_JOBS: 8
159173
macos:
160-
xcode: "11.3.1"
174+
xcode: "12.5.1"
161175
steps:
162176
- checkout
163-
- *environment-info
164177
- run:
165178
name: "Install macOS dependencies"
166179
# Python3 and requests are needed for Hunter upload.
167180
command: |
168-
HOMEBREW_NO_AUTO_UPDATE=1 brew install -q cmake ninja
181+
HOMEBREW_NO_AUTO_UPDATE=1 brew install -q cmake ninja git go@1.16
182+
git clone --depth 1 https://github.com/ethereum/go-ethereum.git
183+
git clone --depth 1 https://github.com/ethereum/tests.git
184+
cd go-ethereum
185+
make all
186+
ln -s ~/project/go-ethereum/build/bin/evm /usr/local/bin/evm
187+
188+
- *environment-info
169189
- *configureMac
170-
# - *upload-hunter-cache
171190
# - *install-solidity-mac
172191
- *build
173192
- *store-retesteth
174193
- *test
194+
- *test-retesteth
175195
# - *upload-coverage-data
176196

177197
# TODO: Run GCC6 build only in develop branch.
@@ -181,6 +201,6 @@ workflows:
181201
version: 2
182202
cpp-ethereum:
183203
jobs:
184-
- macOS-XCode11
204+
- macOS-XCode12
185205
- Linux-Clang6
186206
- Linux-GCC6-Debug

cmake/Hunter/config.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ hunter_config(
1717
HTTP_CLIENT=NO
1818
)
1919

20-
hunter_config(Boost VERSION 1.65.2
21-
URL http://retesteth.ethdevops.io/dependencies/boost_1_65_1.tar.bz2
22-
SHA1 4a5b0c3c1b1b9a4d6cb6a6cc395e903e76f76720
23-
)
24-
2520
hunter_config(ethash VERSION 0.4.0
2621
URL https://github.com/chfast/ethash/archive/v0.4.0.tar.gz
2722
SHA1 fd92ffadff2931877a3b68685dd8c53f0bdec539

cmake/scripts/boost.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
echo "Build dependencies: "
3+
echo "BOOST 1.79"
4+
5+
echo "working dir: "$(pwd)
6+
if [ ! -d "dependecies" ]; then
7+
mkdir dependecies
8+
cd dependecies
9+
mkdir boost
10+
cd boost
11+
else
12+
cd "dependecies/boost"
13+
fi
14+
15+
16+
FILE=boost_1_79_0.tar.gz
17+
if test -f "$FILE"; then
18+
echo "$FILE exists, use downloaded version..."
19+
else
20+
curl -L --output boost_1_79_0.tar.gz "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz"
21+
fi
22+
23+
if [ ! -d "boost_1_79_0" ]; then
24+
echo "unpack $FILE..."
25+
tar -xf $FILE
26+
cd boost_1_79_0
27+
mkdir build
28+
echo "configure boost: "
29+
echo "bootstrap.sh --prefix=$(pwd)/build"
30+
./bootstrap.sh --prefix=$(pwd)/build
31+
libs=""
32+
for var in "$@"
33+
do
34+
libs=$libs" --with-$var"
35+
done
36+
./b2 $libs link=static
37+
else
38+
echo "found boost previous build in $(pwd)/boost_1_79_0"
39+
fi
40+
41+
42+
43+

dretesteth.sh

100644100755
File mode changed.

libdevcore/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ add_library(devcore ${sources} ${headers})
88
# Needed to prevent including system-level boost headers:
99
target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIR})
1010

11-
target_link_libraries(devcore Boost::filesystem Boost::system)
11+
target_link_libraries(devcore ${Boost_LIBRARIES})
1212

1313
#find_package(LevelDB)
1414
#target_include_directories(devcore SYSTEM PUBLIC ${LEVELDB_INCLUDE_DIRS})

libdevcore/CommonIO.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "Common.h"
3737
#include "CommonData.h"
3838
#include <boost/filesystem.hpp>
39+
#include <boost/filesystem/fstream.hpp>
3940

4041
namespace dev
4142
{

retesteth/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if (JSONCPP)
9696
add_definitions(-DJSONCPP)
9797
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::filesystem Boost::program_options Boost::system jsoncpp_lib_static yaml-cpp::yaml-cpp devcore devcrypto cryptopp-static CURL::libcurl)
9898
else()
99-
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::filesystem Boost::program_options Boost::system yaml-cpp::yaml-cpp devcore devcrypto cryptopp-static CURL::libcurl)
99+
target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES} yaml-cpp::yaml-cpp devcore devcrypto cryptopp-static CURL::libcurl)
100100
endif()
101101
target_include_directories(${PROJECT_NAME} PRIVATE "../")
102102
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_BINARY_DIR})

0 commit comments

Comments
 (0)