Skip to content

Commit 6205647

Browse files
author
winsvega
authored
Merge pull request #210 from ethereum/develop
version 0.3.1 Develop
2 parents 68a2186 + f6fdc42 commit 6205647

File tree

130 files changed

+3074
-883
lines changed

Some content is hidden

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

130 files changed

+3074
-883
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/toolchain.cmake)
44

55
include("./cmake/Hunter/HunterGate.cmake")
66

7+
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
8+
set(CMAKE_BUILD_TYPE "Release")
9+
endif()
710
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
811
add_compile_definitions("__DEBUG__")
912
endif()
@@ -23,7 +26,7 @@ HunterGate(
2326
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
2427

2528
project(retesteth VERSION 0.3.1)
26-
set(VERSION_SUFFIX "shanghai")
29+
set(VERSION_SUFFIX "cancun")
2730

2831
set(Boost_USE_STATIC_LIBS ON)
2932
set(Boost_USE_MULTITHREADED ON)

Dockerfile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ARG RETESTETH_SRC="https://github.com/ethereum/retesteth.git"
77
ARG GETH_SRC="https://github.com/ethereum/go-ethereum.git"
88
ARG NIMBUS_SRC="https://github.com/status-im/nimbus-eth1.git"
99
ARG EVMONE_SRC="https://github.com/ethereum/evmone.git"
10+
ARG PYT8N_SRC="https://github.com/ethereum/execution-specs.git"
1011

1112
# Leave empty to disable the build, can point to commit hash as well
1213
ARG BESU="main"
@@ -16,6 +17,7 @@ ARG ETHEREUMJS="master"
1617
ARG RETESTETH="develop"
1718
ARG PYSPECS="main"
1819
ARG EVMONE="master"
20+
ARG PYT8N="master"
1921

2022
SHELL ["/bin/bash", "-c"]
2123
ENV TZ=Etc/UTC
@@ -27,10 +29,11 @@ RUN apt-get update \
2729
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
2830
&& add-apt-repository -y ppa:deadsnakes/ppa \
2931
&& add-apt-repository ppa:linuxuprising/java \
30-
&& apt-get install --yes git cmake make perl psmisc curl wget gcc-11 g++-11 python3.10 python3.10-venv python3-pip python3-dev \
32+
&& apt-get install --yes jq lsof git cmake make perl psmisc curl wget gcc-11 g++-11 python3.10 python3.10-venv python3-pip python3-dev \
3133
&& apt-get install --yes libboost-filesystem-dev libboost-system-dev libboost-program-options-dev libboost-test-dev \
3234
&& echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | /usr/bin/debconf-set-selections \
3335
&& apt-get install --yes oracle-java17-installer oracle-java17-set-default \
36+
&& apt-get install --yes uuid-runtime \
3437
&& rm -rf /var/lib/apt/lists/*
3538
RUN rm /usr/bin/python3 && ln -s /usr/bin/python3.10 /usr/bin/python3 \
3639
&& rm /usr/bin/gcc && rm /usr/bin/g++ \
@@ -50,7 +53,7 @@ RUN test -n "$RETESTETH" \
5053
|| echo "Retesteth is empty, skip LLLC"
5154

5255
# Solidity solc
53-
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.17/solc-static-linux \
56+
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-static-linux \
5457
&& cp solc-static-linux /bin/solc \
5558
&& chmod +x /bin/solc
5659

@@ -64,16 +67,23 @@ RUN cd /execution-spec-tests && git fetch && git checkout $PYSPECS \
6467
&& cp tfinit.sh /usr/bin/tfinit.sh \
6568
&& chmod +x /usr/bin/tfinit.sh
6669

70+
# PYT8N
71+
RUN test -n "$PYT8N" \
72+
&& git clone $PYT8N_SRC /pyt8n \
73+
&& cd /pyt8n && git fetch && git checkout $PYT8N \
74+
&& python3 -m venv ./venv/ \
75+
&& source ./venv/bin/activate \
76+
&& pip install -e . \
77+
|| echo "Pyt8n is empty"
6778

6879
# Geth
6980
RUN test -n "$GETH" \
7081
&& git clone $GETH_SRC /geth \
7182
&& cd /geth && git fetch && git checkout $GETH \
72-
&& wget https://dl.google.com/go/go1.19.linux-amd64.tar.gz \
73-
&& tar -xvf go1.19.linux-amd64.tar.gz \
83+
&& wget https://dl.google.com/go/go1.20.linux-amd64.tar.gz \
84+
&& tar -xvf go1.20.linux-amd64.tar.gz \
7485
&& mv go /usr/local && ln -s /usr/local/go/bin/go /bin/go \
75-
&& make all && cp /geth/build/bin/evm /bin/evm \
76-
&& cp /geth/build/bin/geth /bin/geth \
86+
&& go build ./cmd/evm && cp evm /bin/evm \
7787
&& rm -rf /geth && rm -rf /usr/local/go \
7888
|| echo "Geth is empty"
7989

circle.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ defaults:
4444
name: "LinuxInstallGO and Tests"
4545
working_directory: ~/project
4646
command: |
47-
curl -L --output go1.19.linux-amd64.tar.gz "https://dl.google.com/go/go1.19.linux-amd64.tar.gz"
48-
tar -xf go1.19.linux-amd64.tar.gz
47+
curl -L --output go1.20.linux-amd64.tar.gz "https://dl.google.com/go/go1.20.linux-amd64.tar.gz"
48+
tar -xf go1.20.linux-amd64.tar.gz
4949
sudo mv go /usr/local
5050
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
5151
git clone --depth 1 https://github.com/ethereum/go-ethereum.git
@@ -165,9 +165,9 @@ defaults:
165165
git clone --depth 1 https://github.com/ethereum/go-ethereum.git
166166
git clone --depth 1 https://github.com/ethereum/tests.git
167167
168-
curl -L https://go.dev/dl/go1.19.1.darwin-amd64.pkg -o go1.19.pkg
169-
chmod +x go1.19.pkg
170-
sudo installer -pkg go1.19.pkg -target /
168+
curl -L https://go.dev/dl/go1.20.1.darwin-amd64.pkg -o go1.20.pkg
169+
chmod +x go1.20.pkg
170+
sudo installer -pkg go1.20.pkg -target /
171171
sudo ln -s /usr/local/go/bin/go /usr/local/bin
172172
173173
cd go-ethereum
@@ -238,7 +238,7 @@ jobs:
238238
- BUILD_PARALLEL_JOBS: 4
239239
- TEST_PARALLEL_JOBS: 4
240240
macos:
241-
xcode: "14.0.1"
241+
xcode: "14.2.0"
242242
steps: *mac-steps
243243

244244
# TODO: Run GCC6 build only in develop branch.

dretesteth.sh

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@ cleanDocker () {
4545
exit 0
4646
}
4747

48+
lllc () {
49+
testpath=""
50+
testpaths=0
51+
argstring=""
52+
for var in "$@"
53+
do
54+
if [ "$var" = "--testpath" ]; then
55+
testpaths=1
56+
continue
57+
fi
58+
if [ "$testpaths" -eq "1" ]; then
59+
testpaths=0
60+
testpath=$var
61+
continue
62+
fi
63+
argstring=$argstring" "$var
64+
done
65+
if [ -z $testpath ]; then
66+
echo "Provide --testpath var'to mount into docker '/test'"
67+
exit 1
68+
fi
69+
docker run --entrypoint /bin/lllc -it -v $testpath:/tests -w /tests retesteth $argstring
70+
exit 0
71+
}
72+
4873

4974
case $1 in
5075
"build")
@@ -59,6 +84,9 @@ case $1 in
5984
"clean")
6085
cleanDocker
6186
;;
87+
"lllc")
88+
lllc $2 $3 $4 $5 $6 $7 $8
89+
;;
6290
esac
6391

6492

@@ -124,7 +152,7 @@ if [ "$SCRIPT_NAME" = "dtf.sh" ]; then
124152
dockerwdir="/"
125153
fi
126154

127-
docker run --entrypoint /usr/bin/tfinit.sh -it -w $dockerwdir -e ETHEREUMJS_PATH=/ethereumjs -e PYSPECS_PATH=/execution-spec-tests -v $testpath:/tests retesteth $argstring
155+
docker run --entrypoint /usr/bin/tfinit.sh -it -w $dockerwdir -e BESU_PATH=/besu -e ETHEREUMJS_PATH=/ethereumjs -e PYSPECS_PATH=/execution-spec-tests -e PYT8N_PATH=/pyt8n -v $testpath:/tests retesteth $argstring
128156
exit 0
129157
fi
130158

@@ -182,5 +210,5 @@ fi
182210
if [ "$helpversion" -eq 1 ]; then
183211
docker run retesteth $argstring
184212
else
185-
docker run -w $dockerwdir -e ETHEREUMJS_PATH=/ethereumjs -e PYSPECS_PATH=/execution-spec-tests -v $testpath:/tests retesteth $argstring --testpath /tests $defaultclient
213+
docker run -w $dockerwdir -e BESU_PATH=/besu -e ETHEREUMJS_PATH=/ethereumjs -e PYSPECS_PATH=/execution-spec-tests -e PYT8N_PATH=/pyt8n -v $testpath:/tests retesteth $argstring --testpath /tests $defaultclient
186214
fi

libdataobj/DataObject.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,11 @@ std::string DataObject::asJson(int level, bool pretty, bool nokey) const
523523
break;
524524
case DataType::String:
525525
printLevel();
526-
if (pretty)
526+
if (!m_strKey.empty() && !nokey)
527527
{
528-
if (!m_strKey.empty() && !nokey)
528+
if(pretty)
529529
out << "\"" << m_strKey << "\" : ";
530-
}
531-
else
532-
{
533-
if (!m_strKey.empty() && !nokey)
530+
else
534531
out << "\"" << m_strKey << "\":";
535532
}
536533

@@ -541,6 +538,11 @@ std::string DataObject::asJson(int level, bool pretty, bool nokey) const
541538
buffer += "\\n";
542539
else if (ch == 9)
543540
buffer += "\\t";
541+
else if (ch == '"')
542+
{
543+
buffer += "\\";
544+
buffer += "\"";
545+
}
544546
else
545547
buffer += ch;
546548
}

libdataobj/JsonParser.cpp

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ JsonParser::JsonParser(std::string const& _input, CJOptions const& _opt)
1313
if (_input.size() < 2 || _input.find("{") == string::npos || _input.rfind("}") == string::npos)
1414
throw DataObjectException() << "ConvertJsoncppStringToData can't read json structure in file: `" + _input.substr(0, 50);
1515

16+
m_applyDepth.clear();
1617
m_root.getContent().setAutosort(_opt.autosort);
1718
m_actualRoot = &m_root.getContent();
1819
}
1920

20-
string JsonParser::printDebug(size_t const& _i)
21+
string JsonParser::printDebug(size_t const& _i) const
2122
{
2223
static const short c_debugSize = 120;
2324
string debug;
@@ -55,13 +56,24 @@ void JsonParser::parse()
5556
}
5657
}
5758

59+
void JsonParser::checkJsonCommaEnding(size_t& _i) const
60+
{
61+
if (m_input.at(_i) == '}' || m_input.at(_i) == ']')
62+
_i--; // because cycle iteration we need to process ending clouse
63+
else if (m_input.at(_i) != ',')
64+
throw DataObjectException() << errorPrefix
65+
+ "Dataobject array/object expected ',' when listing elements, but got `" + m_input.at(_i) + "`"
66+
+ "around: " + printDebug(_i);
67+
}
68+
5869
JsonParser::RET JsonParser::tryParseKeyValue(size_t& _i)
5970
{
6071
const bool escapeChar = (_i > 0 && m_input.at(_i - 1) == '\\');
6172
if (m_input.at(_i) == '"' && !escapeChar)
6273
{
6374
spDataObject obj;
6475
string key = parseKeyValue(_i);
76+
6577
_i = skipSpaces(_i);
6678
if (m_input.at(_i) == ':')
6779
{
@@ -104,14 +116,12 @@ JsonParser::RET JsonParser::tryParseKeyValue(size_t& _i)
104116
if (m_actualRoot->type() == DataType::Array)
105117
{
106118
m_actualRoot->addArrayObject(sDataObject(std::move(key)));
107-
if (m_input.at(_i) != ',')
108-
_i--; // because cycle iteration we need to process ending clouse
119+
checkJsonCommaEnding(_i);
109120
return RET::CONTINUE;
110121
}
111122
else
112123
m_actualRoot->setString(std::move(key));
113-
if (m_input.at(_i) != ',')
114-
_i--; // because cycle iteration we need to process ending clouse
124+
checkJsonCommaEnding(_i);
115125
m_actualRoot = m_applyDepth.at(m_applyDepth.size() - 1);
116126
m_applyDepth.pop_back();
117127
return RET::CONTINUE;
@@ -263,25 +273,25 @@ size_t JsonParser::skipSpaces(size_t const& _i) const
263273
string JsonParser::parseKeyValue(size_t& _i) const
264274
{
265275
if (_i + 1 > m_input.size())
266-
throw DataObjectException() << errorPrefix + "reached EOF before reading char: `\"`";
276+
throw DataObjectException() << errorPrefix + "reached EOF before reading char: `\"` around: " + printDebug(_i);
267277

268278
bool escapeChar = true;
269279
size_t endPos = m_input.find('"', _i + 1);
270-
while (escapeChar)
271-
{
272-
escapeChar = (m_input[endPos - 1] == '\\');
273-
if (escapeChar)
274-
endPos = m_input.find('"', endPos + 1);
275-
}
276-
277280
if (endPos != string::npos)
278281
{
282+
while (escapeChar)
283+
{
284+
escapeChar = (m_input[endPos - 1] == '\\');
285+
if (escapeChar)
286+
endPos = m_input.find('"', endPos + 1);
287+
}
288+
279289
const string key = m_input.substr(_i + 1, endPos - _i - 1);
280290
_i = endPos + 1;
281291
return key;
282292
}
283293
else
284-
throw DataObjectException() << errorPrefix + "not found key ending char: `\"`";
294+
throw DataObjectException() << errorPrefix + "not found key ending char: `\"` around: " + printDebug(_i);
285295
return string();
286296
}
287297

libdataobj/JsonParser.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class JsonParser
2020
};
2121
private:
2222
void keyEncountered() { m_keyEncountered = true; }
23-
std::string printDebug(size_t const& _i);
23+
std::string printDebug(size_t const& _i) const;
2424
bool isEmptyChar(char const& _char) const;
2525
RET tryParseKeyValue(size_t& _i);
2626
RET tryParseArrayBegin(size_t const& _i);
@@ -34,13 +34,14 @@ class JsonParser
3434
std::string parseKeyValue(size_t& _i) const;
3535
bool readBoolOrNull(size_t& _i, bool& _result, bool& _readNull) const;
3636
bool readDigit(size_t& _i, int& _result) const;
37+
void checkJsonCommaEnding(size_t& _i) const;
3738
private:
3839
std::string const& m_input;
3940
CJOptions const m_opt;
4041

4142
std::vector<DataObject*> m_applyDepth; // indexes at root array of objects that we are reading into
4243
spDataObject m_root;
43-
DataObject* m_actualRoot;
44+
DataObject* m_actualRoot = nullptr;
4445
bool m_keyEncountered = false;
4546
std::string const errorPrefix = "Error parsing json: ";
4647
};

retesteth/Constants.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ const string c_transactionsRoot = "transactionsRoot";
4747
const string c_transactionsTrie = "transactionsTrie";
4848
const string c_baseFeePerGas = "baseFeePerGas";
4949
const string c_withdrawalsRoot = "withdrawalsRoot";
50-
const string c_excessDataGas = "excessDataGas";
50+
const string c_parentBeaconBlockRoot = "parentBeaconBlockRoot";
51+
const string c_excessBlobGas = "excessBlobGas";
52+
const string c_blobGasUsed = "blobGasUsed";
53+
const string c_currentExcessBlobGas = "currentExcessBlobGas";
54+
const string c_parentExcessBlobGas = "parentExcessBlobGas";
55+
const string c_currentBlobGasUsed = "currentBlobGasUsed";
56+
const string c_parentBlobGasUsed = "parentBlobGasUsed";
57+
const string c_currentBeaconRoot = "currentBeaconRoot";
5158

5259
// Transactions
5360
const string c_data = "data";
@@ -61,7 +68,7 @@ const string c_r = "r";
6168
const string c_s = "s";
6269
const string c_maxFeePerGas = "maxFeePerGas";
6370
const string c_maxPriorityFeePerGas = "maxPriorityFeePerGas";
64-
const string c_maxFeePerDataGas = "maxFeePerDataGas";
71+
const string c_maxFeePerBlobGas = "maxFeePerBlobGas";
6572
const string c_blobVersionedHashes = "blobVersionedHashes";
6673
const string c_accessLists = "accessLists";
6774
const string c_accessList = "accessList";
@@ -70,7 +77,7 @@ const string c_code = "code";
7077
const string c_balance = "balance";
7178
const string c_storage = "storage";
7279
const string c_transactionHash = "transactionHash";
73-
const string c_blockHash = "transactionHash";
80+
const string c_blockHash = "blockHash";
7481

7582
}}}
7683

retesteth/Constants.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ extern const std::string c_transactionsRoot;
4242
extern const std::string c_transactionsTrie;
4343
extern const std::string c_baseFeePerGas;
4444
extern const std::string c_withdrawalsRoot;
45-
extern const std::string c_excessDataGas;
45+
extern const std::string c_parentBeaconBlockRoot;
46+
extern const std::string c_excessBlobGas;
47+
extern const std::string c_blobGasUsed;
48+
extern const std::string c_currentExcessBlobGas;
49+
extern const std::string c_currentBeaconRoot;
50+
extern const std::string c_parentExcessBlobGas;
51+
extern const std::string c_currentBlobGasUsed;
52+
extern const std::string c_parentBlobGasUsed;
4653

4754
// Transactions
4855
extern const std::string c_data;
@@ -56,7 +63,7 @@ extern const std::string c_r;
5663
extern const std::string c_s;
5764
extern const std::string c_maxFeePerGas;
5865
extern const std::string c_maxPriorityFeePerGas;
59-
extern const std::string c_maxFeePerDataGas;
66+
extern const std::string c_maxFeePerBlobGas;
6067
extern const std::string c_blobVersionedHashes;
6168
extern const std::string c_accessLists;
6269
extern const std::string c_accessList;

0 commit comments

Comments
 (0)