diff --git a/Dockerfile b/Dockerfile index 5cd6bf957..ef2df0758 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ ARG GETH_SRC="https://github.com/ethereum/go-ethereum.git" ARG NIMBUS_SRC="https://github.com/status-im/nimbus-eth1.git" ARG EVMONE_SRC="https://github.com/ethereum/evmone.git" ARG PYT8N_SRC="https://github.com/ethereum/execution-specs.git" +ARG NETHERMIND_SRC="https://github.com/NethermindEth/nethermind.git" # Leave empty to disable the build, can point to commit hash as well ARG BESU="main" @@ -18,6 +19,7 @@ ARG RETESTETH="develop" ARG PYSPECS="main" ARG EVMONE="master" ARG PYT8N="master" +ARG NETHERMIND="feature/t8n-test" SHELL ["/bin/bash", "-c"] ENV TZ=Etc/UTC @@ -30,6 +32,10 @@ RUN apt-get update \ && add-apt-repository -y ppa:deadsnakes/ppa \ && add-apt-repository ppa:linuxuprising/java \ && 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 \ + && wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + && apt-get install -y apt-transport-https \ + && apt-get install -y dotnet-sdk-8.0 \ && apt-get install --yes libboost-filesystem-dev libboost-system-dev libboost-program-options-dev libboost-test-dev \ && echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | /usr/bin/debconf-set-selections \ && apt-get install --yes oracle-java17-installer oracle-java17-set-default \ @@ -58,7 +64,7 @@ RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-sta && chmod +x /bin/solc # Pyspecs -RUN git clone $PYSPECS_SRC /execution-spec-tests +RUN git clone $PYSPECS_SRC /execution-spec-tests RUN cd /execution-spec-tests && git fetch && git checkout $PYSPECS \ && python3 -m venv ./venv/ \ && source ./venv/bin/activate \ @@ -87,6 +93,16 @@ RUN test -n "$GETH" \ && rm -rf /geth && rm -rf /usr/local/go \ || echo "Geth is empty" +# Nethermind +RUN test -n "$NETHERMIND" \ +&& git clone $NETHERMIND_SRC /nethermind \ +&& cd /nethermind && git fetch && git checkout $NETHERMIND \ +&& dotnet build ./src/Nethermind/Nethermind.sln \ +&& dotnet build ./src/Nethermind/EthereumTests.sln \ +&& dotnet build ./tools/Evm/Evm.sln \ +|| echo "Nethermind is empty" +# run the following command in order to run nethermind evm tool: /nethermind/tools/Evm/Evm/bin/Debug/net8.0/Evm t8n [options] + # Nimbus RUN test -n "$NIMBUS" \ && apt-get update \ diff --git a/dretesteth.sh b/dretesteth.sh index 03cdf6b8b..e0aa99dd8 100755 --- a/dretesteth.sh +++ b/dretesteth.sh @@ -112,6 +112,9 @@ if [ "$SCRIPT_NAME" = "dtf.sh" ]; then if [ "$var" = "nimbus" ]; then binpath="/bin/evm_nimbus" fi + if [ "$var" = "nethermind" ]; then + binpath="/nethermind/tools/Evm/Evm/bin/Debug/net8.0/Evm" + fi if [ "$var" = "besu" ]; then binpath="/usr/bin/besuevm" fi diff --git a/retesteth/configs/Options.h b/retesteth/configs/Options.h index 8de1945b3..d89cb2f05 100644 --- a/retesteth/configs/Options.h +++ b/retesteth/configs/Options.h @@ -57,6 +57,8 @@ extern std::string const t8ntool_start; #define DECLARE_ETHJS(X) \ FOR_EACH(X, ethereumjscfg) +#define DECLARE_NETHERMIND_T8N(X) \ +FOR_EACH(X, nethermindt8ncfg) // Main Configs (T8NTOOL is the base config that puts in to default for other clients as well) DECLARE_T8NTOOL(REGISTER) @@ -68,6 +70,7 @@ DECLARE_OEWRAP(REGISTER) DECLARE_ETHJS(REGISTER) DECLARE_NIMBUS(REGISTER) DECLARE_PYT8N(REGISTER) +DECLARE_NETHERMIND_T8N(REGISTER) // Example configs DECLARE_T8NTOOL_EIP(REGISTER) @@ -88,6 +91,7 @@ class OptionsInit DECLARE_ETHJS(INIT) DECLARE_NIMBUS(INIT) DECLARE_PYT8N(INIT) + DECLARE_NETHERMIND_T8N(INIT) DECLARE_T8NTOOL_EIP(INIT) DECLARE_ALETH(INIT) diff --git a/retesteth/configs/clientconfigs/nethermind.cpp b/retesteth/configs/clientconfigs/nethermind.cpp new file mode 100644 index 000000000..41e7bc530 --- /dev/null +++ b/retesteth/configs/clientconfigs/nethermind.cpp @@ -0,0 +1,382 @@ +#include +using namespace std; +using namespace dataobject; + +namespace retesteth::options +{ + + +string const nethermind_start = R"(#!/bin/sh + +wevm="/nethermind/tools/Evm/Evm/bin/Debug/net8.0/Evm" + +if [ ! -x "$wevm" ]; then + >&2 echo "Can't find executable evm at the specified path!" + exit 1 +fi +echo "evm executable found at $wevm" + + +if [ $1 = "eof" ] || [ $1 = "t8n" ] || [ $1 = "b11r" ]; then + evm $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 +elif [ $1 = "-v" ]; then + evm -v +else + stateProvided=0 + readErrorLog=0 + errorLogFile="" + cmdArgs="" + for index in ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} ${21} ${22} ${23} ${24} ${25} ${26}; do + if [ $index = "--input.alloc" ]; then + stateProvided=1 + fi + if [ $readErrorLog -eq 1 ]; then + errorLogFile=$index + readErrorLog=0 + continue + fi + if [ $index = "--output.errorlog" ]; then + readErrorLog=1 + continue + fi + cmdArgs=$cmdArgs" "$index + done + if [ $stateProvided -eq 1 ]; then + evm t8n $cmdArgs --verbosity 2 2> $errorLogFile + else + evm t9n $cmdArgs 2> $errorLogFile + fi +fi +)"; + +gennethermindt8ncfg::gennethermindt8ncfg() +{ + +string const nethermind_config = R"({ + "name" : "Ethereum GO on StateTool", + "socketType" : "tranition-tool", + "socketAddress" : "start.sh", + "initializeTime" : "0", + "checkDifficulty" : true, + "calculateDifficulty" : false, + "checkBasefee" : true, + "calculateBasefee" : false, + "checkLogsHash" : true, + "support1559" : true, + "supportBigint" : true, + "transactionsAsJson" : false, + "tmpDir" : "/dev/shm", + "defaultChainID" : 1, + "customCompilers" : { + ":yul" : "yul.sh", + ":mycompiler" : "mycompiler.sh" + }, + "forks" : [ + "Frontier", + "Homestead", + "EIP150", + "EIP158", + "Byzantium", + "Constantinople", + "ConstantinopleFix", + "Istanbul", + "Berlin", + "London", + "Merge", + "Shanghai", + "Cancun" + ], + "additionalForks" : [ + "FrontierToHomesteadAt5", + "HomesteadToEIP150At5", + "EIP158ToByzantiumAt5", + "HomesteadToDaoAt5", + "ByzantiumToConstantinopleFixAt5", + "BerlinToLondonAt5", + "ArrowGlacier", + "ArrowGlacierToMergeAtDiffC0000", + "GrayGlacier", + "MergeToShanghaiAtTime15k", + "ShanghaiToCancunAtTime15k" + ], + "fillerSkipForks" : [ + ], + "exceptions" : { + "PYSPECS_EXCEPTIONS" : "", + "Transaction without funds" : "insufficient funds for gas * price + value", + "insufficient account balance" : "insufficient funds for gas * price + value", + "invalid excess blob gas" : "Error in field: excessBlobGas", + "invalid excessBlobGas" : "Error in field: excessBlobGas", + "invalid blob gas used" : "Error in field: blobGasUsed", + "invalid pre fork blob fields" : "unknown block type!", + "blob fields missing post fork" : "unknown block type!", + "invalid transaction" : "expected to have exactly 14 elements", + "invalid blob versioned hash" : "hash version mismatch", + "zero blob tx" : "blob transaction missing blob hashes", + "insufficient_account_balance" : "Error importing raw rlp block", + "invalid_blob_count" : "Block has invalid number of blobs in txs >=7!", + "insufficient max fee per blob gas" : "max fee per blob gas less than block blob gas fee", + "insufficient max fee per gas" : "max fee per gas less than block base fee", + "invalid max fee per blob gas" : "max fee per blob gas less than block blob gas fee", + "too_many_blobs_tx" : "block max blob gas exceeded", + "too many blobs" : "Block has invalid number of blobs in txs >=7!", + "tx type 3 not allowed pre-Cancun" : "blob tx used but field env.ExcessBlobGas missing", + + "AddressTooShort" : "input string too short for common.Address", + "AddressTooLong" : "rlp: input string too long for common.Address, decoding into (types.Transaction)(types.LegacyTx).To", + "NonceMax" : "nonce exceeds 2^64-1", + "NonceTooLong" : "rlp: input string too long for uint64, decoding into (types.Transaction)(types.LegacyTx).Nonce", + "InvalidVRS" : "invalid transaction v, r, s values", + "InvalidV" : "rlp: expected input string or byte for *big.Int, decoding into (types.Transaction)(types.LegacyTx).V", + "InvalidR" : "rlp: expected input string or byte for *big.Int, decoding into (types.Transaction)(types.LegacyTx).R", + "InvalidS" : "rlp: expected input string or byte for *big.Int, decoding into (types.Transaction)(types.LegacyTx).S", + "InvalidChainID" : "invalid chain id for signer", + "ECRecoveryFail" : "recovery failed", + "ExtraDataTooBig" : "Error importing raw rlp block: Header extraData > 32 bytes", + "InvalidData" : "rlp: expected input string or byte for []uint8, decoding into (types.Transaction)(types.LegacyTx).Data", + "InvalidDifficulty" : "Invalid difficulty:", + "InvalidDifficulty2" : "Error in field: difficulty", + "InvalidWithdrawals" : "Error in field: withdrawalsRoot", + "InvalidDifficulty_TooLarge" : "Blockheader parse error: VALUE >u256", + "InvalidGasLimit" : "Header gasLimit > 0x7fffffffffffffff", + "InvalidGasLimit2" : "Invalid gaslimit:", + "InvalidGasLimit3" : "GasLimit must be < 0x7fffffffffffffff", + "InvalidGasLimit4" : "rlp: input string too long for uint64, decoding into (types.Transaction)(types.LegacyTx).Gas", + "InvalidGasLimit5" : "rlp: expected input string or byte for uint64, decoding into (types.Transaction)(types.LegacyTx).Gas", + "InvalidValue" : "value exceeds 256 bits", + "InvalidGasPrice" : "gasPrice exceeds 256 bits", + "InvalidMaxPriorityFeePerGas" : "maxPriorityFeePerGas exceeds 256 bits", + "InvalidMaxFeePerGas" : "maxFeePerGas exceeds 256 bits", + "InvalidNonce" : "rlp: expected input string or byte for uint64, decoding into (types.Transaction)(types.LegacyTx).Nonce", + "InvalidTo" : "rlp: expected input string or byte for common.Address, decoding into (types.Transaction)(types.LegacyTx).To", + "GasLimitPriceProductOverflow" : "gas * gasPrice exceeds 256 bits", + "TooMuchGasUsed" : "Invalid gasUsed:", + "TooMuchGasUsed2" : "Error importing raw rlp block: t8ntool didn't return a transaction with hash", + "LeadingZerosGasLimit" : "rlp: non-canonical integer (leading zero bytes) for uint64, decoding into (types.Transaction)(types.LegacyTx).Gas", + "LeadingZerosGasPrice" : "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.LegacyTx).GasPrice", + "LeadingZerosValue" : "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.LegacyTx).Value", + "LeadingZerosNonce" : "rlp: non-canonical integer (leading zero bytes) for uint64, decoding into (types.Transaction)(types.LegacyTx).Nonce", + "LeadingZerosR" : "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.LegacyTx).R", + "LeadingZerosS" : "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.LegacyTx).S", + "LeadingZerosV" : "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.LegacyTx).V", + "LeadingZerosDataSize" : "rlp: non-canonical size information for []uint8, decoding into (types.Transaction)(types.LegacyTx).Data", + "LeadingZerosNonceSize" : "rlp: non-canonical size information for uint64, decoding into (types.Transaction)(types.LegacyTx).Nonce", + "InvalidNumber" : "BlockHeader number != parent.number + 1", + "InvalidTimestampEqualParent" : "timestamp equals parent's", + "InvalidTimestampOlderParent" : "BlockHeader timestamp is less or equal then it's parent block!", + "InvalidLogBloom" : "Error in field: bloom", + "InvalidStateRoot" : "Error in field: stateRoot", + "InvalidGasUsed" : "Error in field: gasUsed", + "InvalidGasUsed2" : "t8ntool didn't return a transaction with hash", + "InvalidBlockMixHash" : "invalid mix digest", + "InvalidBlockNonce" : "", + "UnknownParent" : "unknown parent hash", + "UnknownParent2" : "unknown parent hash", + "InvalidReceiptsStateRoot" : "Error in field: receiptTrie", + "InvalidTransactionsRoot" : "Error in field: transactionsTrie", + "InvalidUnclesHash" : "Error in field: uncleHash", + "InvalidUncleParentHash" : "Parent block hash not found:", + "UncleInChain" : "Block is already in chain!", + "UncleIsAncestor" : "Block is already in chain!", + "UncleParentIsNotAncestor" : "Uncle number is wrong!", + "TooManyUncles" : "Too many uncles!", + "UncleIsBrother" : "Uncle is brother!", + "OutOfGas" : "out of gas", + "SenderNotEOA" : "sender not an eoa:", + "SenderNotEOAorNoCASH" : "sender not an eoa:", + "IntrinsicGas" : "intrinsic gas too low", + "ExtraDataIncorrectDAO" : "BlockHeader require Dao ExtraData!", + "InvalidTransactionVRS" : "t8ntool didn't return a transaction with hash", + "BLOCKHEADER_VALUE_TOOLARGE" : "Blockheader parse error: VALUE >u256", + "TRANSACTION_VALUE_TOOLARGE" : "TransactionLegacy convertion error: VALUE >u256", + "TRANSACTION_VALUE_TOOSHORT" : "t8ntool didn't return a transaction with hash", + "TR_NonceHasMaxValue" : "nonce has max value:", + "OVERSIZE_RLP" : "Error importing raw rlp block: OversizeRLP", + "RLP_BadCast" : "BadCast", + "RLP_ExpectedAsList" : "expected to be list", + "RLP_TooFewElements" : "rlp: too few elements ", + "RLP_TooManyElements" : "rlp: input list has too many elements ", + "RLP_InputContainsMoreThanOneValue" : "Error importing raw rlp block: OversizeRLP", + "RLP_VALUESIZE_MORE_AVAILABLEINPUTLENGTH" : "Error importing raw rlp block: UndersizeRLP", + "RLP_ELEMENT_LARGER_CONTAININGLIST_UNDERSIZE" : "Error importing raw rlp block: UndersizeRLP", + "RLP_ELEMENT_LARGER_CONTAININGLIST_OVERSIZE" : "Error importing raw rlp block: OversizeRLP", + "RLP_ExpectedInputList_EXTBLOCK" : "Error importing raw rlp block: RLP is expected to be list", + "RLP_InvalidArg0_UNMARSHAL_BYTES" : "Error importing raw rlp block: BadCast", + "RLP_ExpectedInputList_HEADER_DECODEINTO_BLOCK_EXTBLOCK" : "Error importing raw rlp block: BlockHeader RLP is expected to be list", + "RLP_InputList_TooManyElements_HEADER_DECODEINTO_BLOCK_EXTBLOCK_HEADER" : "Error importing raw rlp block: Uncleheader RLP is expected to be list", + "RLP_InputList_TooManyElements_TXDATA_DECODEINTO_BLOCK_EXTBLOCK_TXS0" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_HEADER_COINBASE" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_HEADER_COINBASE2" : "Blockheader parse error: Key `coinbase` is not hash20", + "RLP_InputString_TooShort_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_TXS0_RECIPIENT" : "TransactionLegacy convertion error: Key `to` is not hash20", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_ROOT" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_ROOT2" : "Blockheader parse error: Key `stateRoot` is not hash32", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_MIXDIGEST" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_MIXDIGEST2" : "Blockheader parse error: Key `mixHash` is not hash32", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_PARENTHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_PARENTHASH2" : "Blockheader parse error: Key `parentHash` is not hash32", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_RECEIPTHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_RECEIPTHASH2" : "Blockheader parse error: Key `receiptTrie` is not hash32", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TXHASH" : "Blockheader parse error: Key `transactionsTrie` is not hash32", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_UNCLEHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_UNCLEHASH2" : "Blockheader parse error: Key `uncleHash` is not hash32", + "RLP_InputString_TooLong_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASLIMIT" : "Blockheader parse error: VALUE >u256", + "RLP_InputString_TooLong_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASUSED" : "Blockheader parse error: VALUE >u256", + "RLP_InputString_TooLong_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TIME" : "Blockheader parse error: VALUE >u256", + "RLP_InputString_TooLong_UINT64_DECODEINTO_BLOCK_EXTBLOCK_TXS0_GASLIMIT" : "TransactionLegacy convertion error: VALUE >u256", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_RECEIPTHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_RECEIPTHASH2" : "Blockheader parse error: Key `receiptTrie` is not hash32", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_ROOT" : "Blockheader parse error: Key `stateRoot` is not hash32", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_MIXDIGEST" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_MIXDIGEST2" : "Blockheader parse error: Key `mixHash` is not hash32", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_PARENTHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_PARENTHASH2" : "Blockheader parse error: Key `parentHash` is not hash32", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_UNCLEHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_UNCLEHASH2" : "Blockheader parse error: Key `uncleHash` is not hash32", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TXHASH" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooShort_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TXHASH2" : "Blockheader parse error: Key `transactionsTrie` is not hash32", + "RLP_InputString_TooShort_BLOOM_DECODEINTO_BLOCK_EXTBLOCK_HEADER_BLOOM" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_HEADER_DIFFICULTY" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_HEADER_DIFFICULTY2" : "Blockheader parse error: VALUE has leading 0", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASLIMIT" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASLIMIT2" : "Blockheader parse error: VALUE has leading 0", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASUSED" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASUSED2" : "Blockheader parse error: VALUE has leading 0", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TIME" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TIME2" : "Blockheader parse error: VALUE has leading 0", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_TXS0_GASLIMIT" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_UINT64_DECODEINTO_BLOCK_EXTBLOCK_TXS0_GASLIMIT2" : "TransactionLegacy convertion error: VALUE has leading 0", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_HEADER_NUMBER" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_HEADER_NUMBER2" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_TXS0_TXDATA_PRICE" : "Error importing raw rlp block: OversizeRLP", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_TXS0_TXDATA_R" : "TransactionLegacy convertion error: VALUE has leading 0", + "RLP_NonCanonicalINT_LeadingZeros_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_TXS0_TXDATA_S" : "TransactionLegacy convertion error: VALUE has leading 0", + "RLP_InputString_TooLong_BLOOM_DECODEINTO_BLOCK_EXTBLOCK_HEADER_BLOOM" : "Blockheader parse error: Key `bloom` is not hash256", + "RLP_ExpectedInputString_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_PARENTHASH" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_RECEIPTHASH" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_ROOT" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_MIXDIGEST" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TXHASH" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_HASH_DECODEINTO_BLOCK_EXTBLOCK_HEADER_UNCLEHASH" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_HEADER_COINBASE" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_TX0_RECIPIENT" : "Error importing raw rlp block: Transaction RLP field is not data!", + "RLP_InputString_TooLong_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_HEADER_COINBASE" : "Blockheader parse error: Key `coinbase` is not hash20", + "RLP_InputString_TooLong_ADDRESS_DECODEINTO_BLOCK_EXTBLOCK_TXS0_RECIPIENT" : "TransactionLegacy convertion error: Key `to` is not hash20", + "RLP_ExpectedInputString_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_HEADER_DIFFICULTY" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_TXS0_TXR" : "Error importing raw rlp block: Transaction RLP field is not data!", + "RLP_ExpectedInputString_BIGINT_DECODEINTO_BLOCK_EXTBLOCK_TXS0_TXS" : "Error importing raw rlp block: Transaction RLP field is not data!", + "RLP_ExpectedInputString_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASLIMIT" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_GASUSED" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_UINT64_DECODEINTO_BLOCK_EXTBLOCK_HEADER_TIME" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_UINT64_DECODEINTO_BLOCK_EXTBLOCK_TXS0_GASLIMIT" : "Error importing raw rlp block: Transaction RLP field is not data!", + "RLP_ExpectedInputString_NONCE_DECODEINTO_BLOCK_EXTBLOCK_HEADER_NONCE" : "Error importing raw rlp block: Blockheader RLP field is not data!", + "RLP_ExpectedInputString_UINT8_DECODEINTO_BLOCK_EXTBLOCK_TXS0_PAYLOAD" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_BLOCKNONCE_DECODEINTO_BLOCK_EXTBLOCK_HEADER_NONCE" : "Error importing raw rlp block: OversizeRLP", + "RLP_InputString_TooLong_BLOCKNONCE_DECODEINTO_BLOCK_EXTBLOCK_HEADER_NONCE2" : "Blockheader parse error: Key `nonce` is not hash8", + "RLP_NonCanonical_SizeInfo_EXTBLOCK" : "Error importing raw rlp block: BadRLP", + "RLP_ExpectedInputList_TRANSACTION_DECODEINTO_BLOCK_EXTBLOCK_TXS" : "Error importing raw rlp block: BadCast", + "RLP_ExpectedInputList_HEADER_DECODEINTO_BLOCK_EXTBLOCK_UNCLES" : "Error importing raw rlp block: OversizeRLP", + "RLP_ExpectedInputList_TXDATA_DECODEINTO_BLOCK_EXTBLOCK_TXS0" : "Error importing raw rlp block: Transaction RLP is expected to be list", + "RLP_Error_EOF" : "ERROR(11): unexpected EOF", + "RLP_Error_RLP_Size" : "ERROR(11): rlp: value size exceeds available input length", + "RLP_Error_Size_Information" : "ERROR(11): rlp: non-canonical size information", + "LegacyBlockImportImpossible" : "Legacy block import is impossible", + "LegacyBlockImportImpossible2" : "Legacy block can only be on top of LegacyBlock", + "LegacyBlockBaseFeeTransaction" : "BaseFee transaction in a Legacy blcok", + "1559BlockImportImpossible_HeaderIsLegacy" : "1559 block must be on top of 1559", + "1559BlockImportImpossible_BaseFeeWrong": "Error in field: baseFeePerGas", + "1559BlockImportImpossible_InitialBaseFeeWrong": "Initial baseFee must be 1000000000", + "1559BlockImportImpossible_TargetGasLow": "gasTarget decreased too much", + "1559BlockImportImpossible_TargetGasHigh": "gasTarget increased too much", + "1559BlockImportImpossible_InitialGasLimitInvalid": "Invalid block1559: Initial gasLimit must be", + "MergeBlockImportImpossible" : "Trying to import Merge block on top of Shanghai block after transition", + "ShanghaiBlockImportImpossible" : "Trying to import Shanghai block on top of block that is not Shanghai!!", + "TR_IntrinsicGas" : "intrinsic gas too low:", + "TR_RLP_WRONGVALUE" : "insufficient funds for gas", + "TR_NoFunds" : "insufficient funds for gas * price + value", + "TR_NoFundsX" : "insufficient funds for gas * price + value", + "TR_NoFundsValue" : "insufficient funds for transfer", + "TR_NoFundsOrGas" : "insufficient funds for gas * price + value", + "TR_FeeCapLessThanBlocks" : "max fee per gas less than block base fee", + "TR_FeeCapLessThanBlocksORGasLimitReached" : "max fee per gas less than block base fee", + "TR_FeeCapLessThanBlocksORNoFunds" : "max fee per gas less than block base fee", + "TR_GasLimitReached" : "gas limit reached", + "TR_NonceTooHigh" : "nonce too high", + "TR_NonceTooLow" : "nonce too low", + "TR_TypeNotSupported" : "transaction type not supported", + "TR_TypeNotSupportedBlob" : "blob tx used but field env.ExcessBlobGas missing", + "TR_TipGtFeeCap": "max priority fee per gas higher than max fee per gas", + "TR_TooShort": "typed transaction too short", + "TR_InitCodeLimitExceeded" : "max initcode size exceeded", + "TR_BlobDecodeError" : "expected List", + "TR_EMPTYBLOB" : "blob transaction missing blob hashes", + "TR_BLOBCREATE" : "rlp: input string too short for common.Address", + "TR_BLOBVERSION_INVALID" : "hash version mismatch", + "TR_BLOBLIST_OVERSIZE" : "would exceed maximum allowance", + "1559BaseFeeTooLarge": "TransactionBaseFee convertion error: VALUE >u256", + "1559PriorityFeeGreaterThanBaseFee": "maxFeePerGas \u003c maxPriorityFeePerGas", + "2930AccessListAddressTooLong": "rlp: input string too long for common.Address, decoding into (types.Transaction)(types.AccessListTx).AccessList[0].Address", + "2930AccessListAddressTooShort": "rlp: input string too short for common.Address, decoding into (types.Transaction)(types.AccessListTx).AccessList[0].Address", + "1559LeadingZerosBaseFee": "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.DynamicFeeTx).GasFeeCap", + "1559LeadingZerosPriorityFee": "rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.DynamicFeeTx).GasTipCap", + "2930AccessListStorageHashTooShort": "rlp: input string too short for common.Hash, decoding into (types.Transaction)(types.AccessListTx).AccessList[0].StorageKeys[0]", + "2930AccessListStorageHashTooLong": "rlp: input string too long for common.Hash, decoding into (types.Transaction)(types.AccessListTx).AccessList[0].StorageKeys[0]", + "3675PoWBlockRejected" : "Invalid block1559: Chain switched to PoS!", + "3675PoSBlockRejected" : "Parent (transition) block has not reached TTD", + "3675PreMerge1559BlockRejected" : "Trying to import 1559 block on top of PoS block", + "INPUT_UNMARSHAL_ERROR" : "field >= 2**64", + "INPUT_UNMARSHAL_ADDRESS_ERROR" : "not a valid address!", + "RLP_BODY_UNMARSHAL_ERROR" : "Rlp structure is wrong", + "PostMergeUncleHashIsNotEmpty" : "block.uncleHash != empty", + "PostMergeDifficultyIsNot0" : "block.difficulty must be 0" + } +})"; + + string const customcompiler = R"(#!/bin/sh +# You can call a custom executable here +# The code src comes in argument $1 as a path to a file containg the code +# So if you have custom compiler installed in the system the command would look like: +# mycompiler $1 + +# Make sure your tool output clean bytecode only with no log or debug messages +echo "0x600360005500" + +# Copy this file under any name you want and make the changes +# In config file replace add the keyword and path to executable accordingly +# "customCompilers" : { +# ":mycompiler" : "mycompiler.sh", +# ":keyword" : "myscript.sh" +# }, +# Where :keyword would be looked in test's Filler files +# And myscript.sh located in the system or .retesteth/default/myscript.sh with a call to your custom tool +# just like described in this file." +)"; + + { + spDataObject obj; + (*obj)["path"] = "nethermind/config"; + (*obj)["content"] = nethermind_config; + map_configs.addArrayObject(obj); + } + { + spDataObject obj; + (*obj)["exec"] = true; + (*obj)["path"] = "nethermind/start.sh"; + (*obj)["content"] = nethermind_start; + map_configs.addArrayObject(obj); + } + { + spDataObject obj; + (*obj)["exec"] = true; + (*obj)["path"] = "nethermind/yul.sh"; + (*obj)["content"] = yul_compiler_sh; + map_configs.addArrayObject(obj); + } + { + spDataObject obj; + (*obj)["exec"] = true; + (*obj)["path"] = "nethermind/mycompiler.sh"; + (*obj)["content"] = customcompiler; + map_configs.addArrayObject(obj); + } +} +} // namespace retesteth::options diff --git a/retesteth/testStructures/types/BlockchainTests/Filled/BlockchainTestEnv.cpp b/retesteth/testStructures/types/BlockchainTests/Filled/BlockchainTestEnv.cpp index 9ac5e9367..d8a70d382 100644 --- a/retesteth/testStructures/types/BlockchainTests/Filled/BlockchainTestEnv.cpp +++ b/retesteth/testStructures/types/BlockchainTests/Filled/BlockchainTestEnv.cpp @@ -261,7 +261,6 @@ void BlockchainTestEnv::initializeCommonFields(DataObject const& _data) { m_currentNumber = sVALUE(_data.atKey(c_number)); m_currentTimestamp = sVALUE(_data.atKey(c_timestamp)); - m_previousHash = sFH32(_data.atKey(c_parentHash)); m_currentExtraData = sBYTES(_data.atKey(c_extraData)); m_currentNonce = sFH8(_data.atKey(c_nonce)); m_currentMixHash = sFH32(_data.atKey(c_mixHash)); diff --git a/retesteth/testStructures/types/BlockchainTests/Filler/BlockchainTestFillerEnv.cpp b/retesteth/testStructures/types/BlockchainTests/Filler/BlockchainTestFillerEnv.cpp index 8472d40d0..edc5d71f8 100644 --- a/retesteth/testStructures/types/BlockchainTests/Filler/BlockchainTestFillerEnv.cpp +++ b/retesteth/testStructures/types/BlockchainTests/Filler/BlockchainTestFillerEnv.cpp @@ -178,7 +178,6 @@ spDataObject formatRawDataToRPCformat(spDataObject& _data) (*out).atKeyPointer("currentNumber") = (*_data).atKeyPointerUnsafe(c_number); (*out).atKeyPointer("currentTimestamp") = (*_data).atKeyPointerUnsafe(c_timestamp); (*out).atKeyPointer("currentGasLimit") = (*_data).atKeyPointerUnsafe(c_gasLimit); - (*out).atKeyPointer("previousHash") = (*_data).atKeyPointerUnsafe(c_parentHash); if (_data->count(c_baseFeePerGas)) (*out).atKeyPointer("currentBaseFee") = (*_data).atKeyPointerUnsafe(c_baseFeePerGas); if (_data->count(c_excessBlobGas)) @@ -199,7 +198,6 @@ void BlockchainTestFillerEnv::initializeCommonFields(spDataObject const& _data, { m_currentNumber = sVALUE(_data->atKey(c_number)); m_currentTimestamp = sVALUE(_data->atKey(c_timestamp)); - m_previousHash = sFH32(_data->atKey(c_parentHash)); m_currentExtraData = sBYTES(_data->atKey(c_extraData)); m_currentCoinbase = sFH20(_data->atKey(c_coinbase)); m_currentGasLimit = sVALUE(_data->atKey(c_gasLimit)); diff --git a/retesteth/testStructures/types/StateTests/Base/StateTestEnvBase.h b/retesteth/testStructures/types/StateTests/Base/StateTestEnvBase.h index 9075cd337..b994ce484 100644 --- a/retesteth/testStructures/types/StateTests/Base/StateTestEnvBase.h +++ b/retesteth/testStructures/types/StateTests/Base/StateTestEnvBase.h @@ -19,7 +19,6 @@ struct StateTestEnvBase : GCP_SPointerBase BYTES const& currentExtraData() const { return m_currentExtraData; } FH8 const& currentNonce() const { return m_currentNonce; } FH32 const& currentMixHash() const { return m_currentMixHash; } - FH32 const& previousHash() const { return m_previousHash; } virtual spDataObject const& asDataObject() const; virtual ~StateTestEnvBase() {} @@ -40,7 +39,6 @@ struct StateTestEnvBase : GCP_SPointerBase spVALUE m_currentGasLimit; spVALUE m_currentNumber; spVALUE m_currentTimestamp; - spFH32 m_previousHash; spBYTES m_currentExtraData; spFH8 m_currentNonce; spFH32 m_currentMixHash; diff --git a/retesteth/testStructures/types/StateTests/Filled/StateTestEnv.cpp b/retesteth/testStructures/types/StateTests/Filled/StateTestEnv.cpp index d917ed4ff..befbae50f 100644 --- a/retesteth/testStructures/types/StateTests/Filled/StateTestEnv.cpp +++ b/retesteth/testStructures/types/StateTests/Filled/StateTestEnv.cpp @@ -23,8 +23,7 @@ void requireStateTestEnvScheme(DataObject const& _data) {c_parentExcessBlobGas, {{DataType::String}, jsonField::Optional}}, {c_parentBlobGasUsed, {{DataType::String}, jsonField::Optional}}, {c_currentBeaconRoot, {{DataType::String}, jsonField::Optional}}, - {"currentWithdrawalsRoot", {{DataType::String}, jsonField::Optional}}, - {"previousHash", {{DataType::String}, jsonField::Required}}}); + {"currentWithdrawalsRoot", {{DataType::String}, jsonField::Optional}}}); } } // namespace @@ -42,7 +41,6 @@ void StateTestEnv::initializeFields(DataObject const& _data) m_currentTimestamp = sVALUE(_data.atKey("currentTimestamp")); // Indicates zero block timestamp in StateTests m_genesisTimestamp = sVALUE(0); - m_previousHash = sFH32(_data.atKey("previousHash")); DataObject tmpD; tmpD = "0x00"; // State Tests extra data is 0x00 diff --git a/retesteth/testStructures/types/StateTests/Filler/StateTestFillerEnv.cpp b/retesteth/testStructures/types/StateTests/Filler/StateTestFillerEnv.cpp index 418dcbc51..56c6fe3e1 100644 --- a/retesteth/testStructures/types/StateTests/Filler/StateTestFillerEnv.cpp +++ b/retesteth/testStructures/types/StateTests/Filler/StateTestFillerEnv.cpp @@ -21,16 +21,14 @@ void requireStateTestsFillerEnvScheme(spDataObject const& _data) {"currentRandom", {{DataType::String}, jsonField::Optional}}, {c_parentExcessBlobGas, {{DataType::String}, jsonField::Optional}}, {c_parentBlobGasUsed, {{DataType::String}, jsonField::Optional}}, - {c_currentBeaconRoot, {{DataType::String}, jsonField::Optional}}, - {"previousHash", {{DataType::String}, jsonField::Required}}}); + {c_currentBeaconRoot, {{DataType::String}, jsonField::Optional}}}); } void convertEnvDecFieldsToHex(spDataObject& _data) { (*_data).performModifier(mod_valueToCompactEvenHexPrefixed, DataObject::ModifierOption::RECURSIVE, - {"currentCoinbase", "previousHash", "currentRandom"}); + {"currentCoinbase", "currentRandom"}); (*_data).atKeyUnsafe("currentCoinbase").performModifier(mod_valueInsertZeroXPrefix); - (*_data).atKeyUnsafe("previousHash").performModifier(mod_valueInsertZeroXPrefix); (*_data).performModifier(mod_valueToLowerCase); } } // namespace @@ -64,8 +62,6 @@ void StateTestFillerEnv::initializeFields(spDataObject const& _data) // Indicates zero block timestamp in StateTests m_genesisTimestamp = sVALUE(0); - m_previousHash = sFH32(_data->atKey("previousHash")); - spDataObject tmpD(new DataObject("0x00")); // State Tests extra data is 0x00 m_currentExtraData = sBYTES(tmpD); m_currentNonce = spFH8(FH8::zero().copy()); diff --git a/web/script.sh b/web/script.sh index 9f356e6bb..036843a4a 100755 --- a/web/script.sh +++ b/web/script.sh @@ -106,6 +106,20 @@ if [ "$1" = "nimbus" ] || [ -z "$1" ]; then make t8n -j2 fi +if [ "$1" = "nethermind" ] || [ "$1" = "nethermindt8ntool" ] || [ -z "$1" ]; then + echo "Fetch nethermind: " + cd $BUILDPATH/nethermind + git reset --hard HEAD~1 + git fetch origin + git checkout feature/t8n-test + git pull + rm ./src/Nethermind/artifacts + rm ./tools/Evm/Evm/bin + rm ./tools/Evm/Evm/obj + NETHERMIND_HEAD=$(git rev-parse HEAD | cut -c1-7) + echo "Build nethermind: " + make all +fi #if [ "$1" = "oewrap" ] || [ -z "$1" ]; then # echo "Fetch open-ethereum: " @@ -151,6 +165,7 @@ cleanMem() { killall python killall node killall nimbus + killall nethermind sleep 10 } @@ -194,6 +209,9 @@ runCmd() { if [ "$client" = "nimbus" ]; then headinfo="Nimbus: #$NIMBUS_HEAD" fi + if [ "$client" = "nethermind" ]; then + headinfo="Nethermind: #NETHERMIND_HEAD" + fi if [ "$client" = "retesteth" ]; then clientcfg="" fi @@ -289,6 +307,26 @@ if [ "$cname" = "t8ntool" ] || [ -z "$cname" ]; then fi fi +if [ "$cname" = "nethermind" ] || [ -z "$cname" ]; then + sleep 10 + threads=2 + client="nethermind" + CMD="-t GeneralStateTests -- --all -j$threads $arg2" + runCmd + CMD="-t BlockchainTests -- --all -j$threads $arg2" + runCmd + CMD="-t TransactionTests -- --all -j$threads $arg2" + runCmd + CMD="-t DifficultyTests -- --all -j$threads $arg2" + runCmd + if [ "$arg2" != "--filltests" ]; then + CMD="-t BCGeneralStateTests -- --all -j$threads $arg2" + runCmd + CMD="-t LegacyTests -- --all -j$threads $arg2" + runCmd + fi +fi + #if [ "$cname" = "oewrap" ] || [ -z "$cname" ]; then # sleep 10 # threads=1 @@ -374,6 +412,8 @@ if [ "$cname" = "dretesteth" ] || [ -z "$cname" ]; then client="dretesteth" CMD="-t GeneralStateTests/stExample -- --singletest add11 --clients t8ntool -j$threads $arg2" runCmd + CMD="-t GeneralStateTests/stExample -- --singletest add11 --clients nethermind -j$threads $arg2" + runCmd CMD="-t GeneralStateTests/stExample -- --singletest add11 --clients besu -j$threads $arg2" runCmd CMD="-t GeneralStateTests/stExample -- --singletest add11 --clients ethereumjs -j$threads $arg2"