From 28ff4b01558ae2eccbad7e55d3a2cdff8d0e0a8b Mon Sep 17 00:00:00 2001 From: Marcos Pernambuco Motta <1091485+mpernambuco@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:17:12 -0300 Subject: [PATCH] feat!: Add support to ECALL and EBREAK --- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 2 +- Makefile | 77 +++++++++++----------- helper_scripts/generate_UArchConstants.lua | 2 + helper_scripts/generate_UArchStep.sh | 13 ++-- shasum-download | 4 +- src/UArchCompat.sol | 9 +++ src/UArchConstants.sol | 4 +- src/UArchStep.sol | 36 ++++++++-- templates/AccessLogs.sol.template | 10 +++ templates/UArchReplay.t.sol.template | 29 ++++---- test/UArchInterpret.t.sol | 39 +++++++---- test/UArchReset.t.sol | 9 +-- 13 files changed, 148 insertions(+), 88 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc8b7a8..9ef8474 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-7545c7a2857a873fa1909ec4174032c4e4702116 + version: nightly-008922d5165c764859bc540d7298045eebf5bc60 - run: forge build - run: forge fmt --check src test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a72a76..6ba172a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-7545c7a2857a873fa1909ec4174032c4e4702116 + version: nightly-008922d5165c764859bc540d7298045eebf5bc60 - name: Run all tests run: make test-all diff --git a/Makefile b/Makefile index 4f0ad6c..aa22d65 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ TEST_DIR := test DOWNLOADDIR := downloads SRC_DIR := src -EMULATOR_VERSION ?= v0.16.1 +EMULATOR_VERSION ?= v0.17.0 TESTS_DATA_FILE ?= cartesi-machine-tests-data-$(EMULATOR_VERSION).deb TESTS_DATA_DOWNLOAD_URL := https://github.com/cartesi/machine-emulator/releases/download/$(EMULATOR_VERSION)/$(TESTS_DATA_FILE) @@ -17,6 +17,7 @@ LOG_TEST_DIR := $(TEST_DIR)/uarch-log DOWNLOADFILES := $(TESTS_DATA_DOWNLOAD_FILEPATH) $(LOG_DOWNLOAD_FILEPATH) GENERATEDFILES := $(SRC_DIR)/*.sol +DEPDIRS = $(TESTS_DATA_DIR) $(LOG_TEST_DIR) help: @echo 'Cleaning targets:' @@ -36,59 +37,31 @@ help: @echo ' test-prod - test production code' @echo ' test-replay - test log files' -$(TESTS_DATA_DOWNLOAD_FILEPATH): - @mkdir -p $(DOWNLOADDIR) - @wget -nc $(TESTS_DATA_DOWNLOAD_URL) -P $(DOWNLOADDIR) - -$(LOG_DOWNLOAD_FILEPATH): - @mkdir -p $(DOWNLOADDIR) - @wget -nc $(LOG_DOWNLOAD_URL) -P $(DOWNLOADDIR) all: build test-all -build: generate-step generate-reset generate-constants - forge build --use 0.8.21 +build: generate-step generate-reset generate-constants generate-prod + forge build --use 0.8.21 clean: - rm -rf src/AccessLogs.sol test/UArchReplay_*.t.sol - rm -rf $(TESTS_DATA_DIR) $(LOG_TEST_DIR) $(DOWNLOADDIR) + rm -rf test/UArchReplay_*.t.sol + rm -rf $(DEPDIRS) $(DOWNLOADDIR) forge clean -shasum-download: $(DOWNLOADFILES) - shasum -a 256 $^ > $@ - -shasum-generated: $(GENERATEDFILES) - shasum -a 256 $^ > $@ - -checksum-download: $(DOWNLOADFILES) - @shasum -ca 256 shasum-download - -checksum-mock: - @shasum -ca 256 shasum-mock - -checksum-prod: - @shasum -ca 256 shasum-prod - -pretest: checksum-download - mkdir -p $(TESTS_DATA_DIR) $(LOG_TEST_DIR) - ar p $(TESTS_DATA_DOWNLOAD_FILEPATH) data.tar.xz | tar -xJf - --strip-components=7 -C $(TESTS_DATA_DIR) ./usr/share/cartesi-machine/tests/data/uarch - tar -xzf $(LOG_DOWNLOAD_FILEPATH) --strip-components=1 -C $(LOG_TEST_DIR) - rm -f $(TESTS_DATA_DIR)/*.dump $(TESTS_DATA_DIR)/*.elf - test-all: $(MAKE) test-mock - $(MAKE) test-prod $(MAKE) test-replay + $(MAKE) test-prod -test-mock: pretest +test-mock: dep $(MAKE) generate-mock forge test --use 0.8.21 -vv --match-contract UArchInterpret -test-prod: pretest +test-prod: dep $(MAKE) generate-prod forge test --use 0.8.21 -vv --no-match-contract "UArchInterpret|UArchReplay|UArchReset" -test-replay: pretest +test-replay: dep $(MAKE) generate-prod $(MAKE) generate-replay forge test --use 0.8.21 -vv --match-contract "UArchReplay|UArchReset" @@ -96,12 +69,10 @@ test-replay: pretest generate-mock: ./helper_scripts/generate_AccessLogs.sh mock $(MAKE) fmt - $(MAKE) checksum-mock generate-prod: ./helper_scripts/generate_AccessLogs.sh prod $(MAKE) fmt - $(MAKE) checksum-prod generate-replay: ./helper_scripts/generate_ReplayTests.sh @@ -119,7 +90,33 @@ generate-reset: $(EMULATOR_DIR)/src/uarch-reset-state.cpp fmt: forge fmt src test + +download: $(DOWNLOADDIR) + +dep: $(DEPDIRS) + +$(DOWNLOADDIR): + @mkdir -p $(DOWNLOADDIR) + @wget -nc $(TESTS_DATA_DOWNLOAD_URL) -P $(DOWNLOADDIR) + @wget -nc $(LOG_DOWNLOAD_URL) -P $(DOWNLOADDIR) + $(MAKE) checksum-download + +shasum-download: + shasum -a 256 $(DOWNLOADFILES) > shasum-download + +checksum-download: + @shasum -ca 256 shasum-download + +$(TESTS_DATA_DIR): | download + @mkdir -p $(TESTS_DATA_DIR) + @ar p $(TESTS_DATA_DOWNLOAD_FILEPATH) data.tar.xz | tar -xJf - --strip-components=7 -C $(TESTS_DATA_DIR) ./usr/share/cartesi-machine/tests/data/uarch + @rm -f $(TESTS_DATA_DIR)/*.dump $(TESTS_DATA_DIR)/*.elf + +$(LOG_TEST_DIR): | download + @mkdir -p $(LOG_TEST_DIR) + @tar -xzf $(LOG_DOWNLOAD_FILEPATH) --strip-components=1 -C $(LOG_TEST_DIR) + submodules: git submodule update --init --recursive -.PHONY: help all build clean checksum-download checksum-mock checksum-prod fmt generate-mock generate-prod generate-replay generate-step pretest submodules test-all test-mock test-prod test-replay generate-constants generate-reset +.PHONY: help all build clean checksum-download shasum-download fmt generate-mock generate-prod generate-replay generate-step pretest submodules test-all test-mock test-prod test-replay generate-constants generate-reset diff --git a/helper_scripts/generate_UArchConstants.lua b/helper_scripts/generate_UArchConstants.lua index 12a58ec..072b4cb 100755 --- a/helper_scripts/generate_UArchConstants.lua +++ b/helper_scripts/generate_UArchConstants.lua @@ -26,5 +26,7 @@ out:write(' uint64 constant UARCH_RAM_LENGTH = 0x' .. hex(cartesi.UARCH_RAM_L out:write(' uint64 constant RESET_POSITION = 0x' .. hex(cartesi.UARCH_STATE_START_ADDRESS) .. ';\n') out:write(' uint8 constant RESET_ALIGNED_SIZE = ' .. cartesi.UARCH_STATE_LOG2_SIZE .. ';\n') out:write(' bytes32 constant PRESTINE_STATE = 0x' .. hexstring(cartesi.UARCH_PRISTINE_STATE_HASH) .. ';\n') +out:write(' uint64 constant UARCH_ECALL_FN_HALT = ' .. cartesi.UARCH_ECALL_FN_HALT .. ';\n') +out:write(' uint64 constant UARCH_ECALL_FN_PUTCHAR = ' .. cartesi.UARCH_ECALL_FN_PUTCHAR .. ';\n') out:close() diff --git a/helper_scripts/generate_UArchStep.sh b/helper_scripts/generate_UArchStep.sh index 749365e..6e87923 100755 --- a/helper_scripts/generate_UArchStep.sh +++ b/helper_scripts/generate_UArchStep.sh @@ -10,13 +10,12 @@ CPP_STEP_H_PATH=${EMULATOR_DIR}"/src/uarch-step.h" TEMPLATE_FILE="./templates/UArchStep.sol.template" TARGET_FILE="src/UArchStep.sol" COMPAT_FILE="src/UArchCompat.sol" +CONSTANTS_FILE="src/UArchConstants.sol" KEYWORD_START="START OF AUTO-GENERATED CODE" KEYWORD_END="END OF AUTO-GENERATED CODE" # function with to be internal INTERNAL_FN="step" -# function with unused variable, to silence warning -UNUSED_INSN_FN="executeFENCE" # grab head and tail of the template start=`cat "$TEMPLATE_FILE" | grep "$KEYWORD_START" -n | grep -Eo "[0-9]*"` @@ -37,24 +36,26 @@ h_src=`echo "enum ${BASH_REMATCH[1]} {${BASH_REMATCH[2]}}"` COMPAT_FNS=`cat $COMPAT_FILE | grep -o "function [^(]*(" | $SED "s/function//g" | $SED "s/(//g"` COMPAT_FNS=`echo $COMPAT_FNS | $SED -E "s/( |\n)/|/g"` +# get constant names from UArchConstants.sol +CONSTANTS=`cat $CONSTANTS_FILE | grep -E -o 'constant\s+[^ ]*' | $SED -E "s/constant//g; s/ //g" | tr '\n' '|' | sed "s/.$//"` + cpp_src=`cat "$CPP_STEP_PATH"` pattern="namespace cartesi \{(.*)\}" [[ $cpp_src =~ $pattern ]] # replace cpp specific syntaxes with solidity ones cpp_src=`echo "${BASH_REMATCH[1]}" \ | $SED "/template/d" \ - | $SED "/dumpInsn/d" \ - | $SED "/note/d" \ + | $SED "/note = a.make_scoped_note/d" \ + | $SED "/(void) note/d" \ | $SED "s/constexpr//g" \ | $SED "s/UarchState &a/AccessLogs.Context memory a/g" \ - | $SED "s/throw std::runtime_error/revert/g" \ | $SED "s/::/./g" \ | $SED "s/UINT64_MAX/type(uint64).max/g" \ | $SED -E "s/UArchStepStatus uarch_step/static inline UArchStepStatus step/g" \ | $SED -E "s/static inline (\w+) ($INTERNAL_FN)\(([^\n]*)\) \{/function \2\(\3\) internal pure returns \(\1\)\{/g" \ | $SED -E "s/static inline (\w+) (\w+)\(([^\n]*)\) \{/function \2\(\3\) private pure returns \(\1\)\{/g" \ - | $SED -E "s/([^\n]*) $UNUSED_INSN_FN([^\n]*) uint32 insn,([^\n]*)/\1 $UNUSED_INSN_FN\2 uint32,\3/g" \ | $SED -E "s/($COMPAT_FNS)/UArchCompat.\1/g" \ + | $SED -E "s/([^a-zA-Z])($CONSTANTS)([^a-zA-Z])/UArchConstants.\1\2\3/g" \ | $SED "s/ returns (void)//g"` # compose the solidity file from all components diff --git a/shasum-download b/shasum-download index 571afa8..2ddbfe1 100644 --- a/shasum-download +++ b/shasum-download @@ -1,2 +1,2 @@ -583595858e749c5704d02fca312470a65077a0365ddbc62340b4d0205a81c8ef downloads/cartesi-machine-tests-data-v0.16.1.deb -4c845a39cc9186af33b99554aacae8cc4777f5de14851a8919280cdf9b2245b6 downloads/uarch-riscv-tests-json-logs-v0.16.1.tar.gz +d3b254f274fd6c32e6688365886fbe6b86f91aab733a83cdb73e2461ed7a0d96 downloads/cartesi-machine-tests-data-v0.17.0.deb +8f0cd797b78466b62184257b3276d6c029c5ea5a53672036ad507cbf417d0211 downloads/uarch-riscv-tests-json-logs-v0.17.0.tar.gz diff --git a/src/UArchCompat.sol b/src/UArchCompat.sol index 1135e24..a6c4547 100644 --- a/src/UArchCompat.sol +++ b/src/UArchCompat.sol @@ -230,4 +230,13 @@ library UArchCompat { { return v >> (count & 0x1f); } + + function throwRuntimeError( + AccessLogs.Context memory, /* a */ + string memory text + ) internal pure { + revert(text); + } + + function putChar(AccessLogs.Context memory a, uint8 c) internal pure {} } diff --git a/src/UArchConstants.sol b/src/UArchConstants.sol index 2f6c933..e9183fb 100644 --- a/src/UArchConstants.sol +++ b/src/UArchConstants.sol @@ -35,7 +35,9 @@ library UArchConstants { uint64 constant RESET_POSITION = 0x400000; uint8 constant RESET_ALIGNED_SIZE = 22; bytes32 constant PRESTINE_STATE = - 0x0ceeb27295050183aff6fbead83d1033b469737d9aef99e1a6e5cb6e2bf2af8a; + 0xc2b9cf2658f233f44c403aba6e9f9aa6709e00617b349c0190113517f03d13de; + uint64 constant UARCH_ECALL_FN_HALT = 1; + uint64 constant UARCH_ECALL_FN_PUTCHAR = 2; // END OF AUTO-GENERATED CODE uint64 constant LOG2_CYCLES_TO_RESET = 10; diff --git a/src/UArchStep.sol b/src/UArchStep.sol index ee70309..9c23c44 100644 --- a/src/UArchStep.sol +++ b/src/UArchStep.sol @@ -993,7 +993,7 @@ library UArchStep { return advancePc(a, pc); } - function executeFENCE(AccessLogs.Context memory a, uint32, uint64 pc) + function executeFENCE(AccessLogs.Context memory a, uint64 pc) private pure { @@ -1043,6 +1043,26 @@ library UArchStep { return advancePc(a, pc); } + function executeECALL(AccessLogs.Context memory a, uint64 pc) + private + pure + { + uint64 fn = UArchCompat.readX(a, 17); // a7 contains the function number + if (fn == UArchConstants.UARCH_ECALL_FN_HALT) { + return UArchCompat.setHaltFlag(a); + } else if (fn == UArchConstants.UARCH_ECALL_FN_PUTCHAR) { + uint64 character = UArchCompat.readX(a, 16); // a6 contains the character to print + UArchCompat.putChar(a, uint8(character)); + } else { + UArchCompat.throwRuntimeError(a, "unsupported ecall function"); + } + return advancePc(a, pc); + } + + function executeEBREAK(AccessLogs.Context memory a) private pure { + UArchCompat.throwRuntimeError(a, "uarch aborted"); + } + /// \brief Returns true if the opcode field of an instruction matches the provided argument function insnMatchOpcode(uint32 insn, uint32 opcode) private @@ -1198,9 +1218,13 @@ library UArchStep { } else if (insnMatchOpcodeFunct3(insn, 0x13, 0x2)) { return executeSLTI(a, insn, pc); } else if (insnMatchOpcodeFunct3(insn, 0xf, 0x0)) { - return executeFENCE(a, insn, pc); + return executeFENCE(a, pc); + } else if (insn == uint32(0x73)) { + return executeECALL(a, pc); + } else if (insn == uint32(0x100073)) { + return executeEBREAK(a); } - revert("illegal instruction"); + UArchCompat.throwRuntimeError(a, "illegal instruction"); } function step(AccessLogs.Context memory a) @@ -1227,11 +1251,11 @@ library UArchStep { return UArchStepStatus.Success; } - // Explicit instantiation for uarch_step_state_access + // Explicit instantiation for uarch_state_access - // Explicit instantiation for uarch_record_step_state_access + // Explicit instantiation for uarch_record_state_access - // Explicit instantiation for uarch_replay_step_state_access + // Explicit instantiation for uarch_replay_state_access // END OF AUTO-GENERATED CODE } diff --git a/templates/AccessLogs.sol.template b/templates/AccessLogs.sol.template index 48ee912..7254c6b 100644 --- a/templates/AccessLogs.sol.template +++ b/templates/AccessLogs.sol.template @@ -14,6 +14,16 @@ // limitations under the License. // +//:#ifdef test +// *********************************************************** +// WARNING: DO NOT COMMIT THIS FILE! +// This is the mock version of AccessLogs. +// It is intended solely for running the test binary programs. +// To generate production AccessLogs, run: +// make generate-prod +// *********************************************************** +//:#endif + //:#include macro.pp /// DEV_COMMENT(templates/AccessLogs.sol.template) diff --git a/templates/UArchReplay.t.sol.template b/templates/UArchReplay.t.sol.template index f1d9f52..4c5a4e5 100644 --- a/templates/UArchReplay.t.sol.template +++ b/templates/UArchReplay.t.sol.template @@ -36,22 +36,23 @@ contract UArchReplay_@X@_Test is Test { uint256 constant siblingsLength = 61; struct Entry { + string binaryFilename; string finalRootHash; string initialRootHash; - string path; + string logFilename; bool proof; uint256 proofsFrequency; uint256 steps; } struct RawAccess { - uint256 position; + uint256 addressAccess; string hash; - uint256 log2Size; - string readHash; - string[] rawSiblings; - string accessType; - string val; + uint256 log2_size; + string read_hash; + string[] sibling_hashes; + string typeAccess; + string value; } function testReplay_@X@() public { @@ -66,18 +67,18 @@ contract UArchReplay_@X@_Test is Test { for (uint256 i = 0; i < catalog.length; i++) { if ( - keccak256(abi.encodePacked(catalog[i].path)) + keccak256(abi.encodePacked(catalog[i].logFilename)) != keccak256(abi.encodePacked("@PATH@")) ) { continue; } - console.log("Replaying file %s ...", catalog[i].path); + console.log("Replaying log file %s ...", catalog[i].logFilename); require( catalog[i].proofsFrequency == 1, "require proof in every step" ); string memory rj = - loadJsonLog(string.concat(JSON_PATH, catalog[i].path)); + loadJsonLog(string.concat(JSON_PATH, catalog[i].logFilename)); bytes32 initialRootHash = vm.parseBytes32(string.concat("0x", catalog[i].initialRootHash)); @@ -140,23 +141,23 @@ contract UArchReplay_@X@_Test is Test { for (uint256 i = 0; i < arrayLength; i++) { if ( - keccak256(abi.encodePacked(rawAccesses[i].accessType)) + keccak256(abi.encodePacked(rawAccesses[i].typeAccess)) == keccak256(abi.encodePacked("read")) ) { bytes8 word = bytes8( - vm.parseBytes(string.concat("0x", rawAccesses[i].val)) + vm.parseBytes(string.concat("0x", rawAccesses[i].value)) ); buffer.writeBytes8(word); } buffer.writeBytes32( - vm.parseBytes32(string.concat("0x", rawAccesses[i].readHash)) + vm.parseBytes32(string.concat("0x", rawAccesses[i].read_hash)) ); for (uint256 j = 0; j < siblingsLength; j++) { buffer.writeBytes32( vm.parseBytes32( - string.concat("0x", rawAccesses[i].rawSiblings[j]) + string.concat("0x", rawAccesses[i].sibling_hashes[j]) ) ); } diff --git a/test/UArchInterpret.t.sol b/test/UArchInterpret.t.sol index fe188d4..fbd063b 100644 --- a/test/UArchInterpret.t.sol +++ b/test/UArchInterpret.t.sol @@ -18,6 +18,7 @@ import "forge-std/Test.sol"; import "forge-std/StdJson.sol"; import "./UArchInterpret.sol"; +import "src/UArchConstants.sol"; pragma solidity ^0.8.0; @@ -27,33 +28,45 @@ contract UArchInterpretTest is Test { using AccessLogs for AccessLogs.Context; struct Entry { - uint256 cycle; - string path; + string binaryFilename; + string finalRootHash; + string initialRootHash; + string logFilename; + bool proof; + uint256 proofsFrequency; + uint256 steps; } uint8 constant REGISTERS_LENGTH = 35; uint8 constant TEST_STATUS_X = 1; - uint64 constant PMA_UARCH_RAM_START = 0x600000; // TODO use the UArchConstants.UARCH_RAM_START_ADDRESS // test result code bytes8 constant TEST_SUCEEDED = 0x00000000be1e7aaa; // Indicates that test has passed bytes8 constant TEST_FAILED = 0x00000000deadbeef; // Indicates that test has failed - // configure the tests - string constant JSON_PATH = "./test/uarch-bin/"; - string constant CATALOG_PATH = "rv64ui-uarch-catalog.json"; - string constant ROM_PATH = "./test/uarch-bin/uarch-bootstrap.bin"; + string constant CATALOG_PATH = "catalog.json"; + string constant JSON_PATH = "./test/uarch-log/"; + string constant BINARIES_PATH = "./test/uarch-bin/"; function testBinaries() public { Entry[] memory catalog = loadCatalog(string.concat(JSON_PATH, CATALOG_PATH)); for (uint256 i = 0; i < catalog.length; i++) { - console.log("Testing %s ...", catalog[i].path); + if (bytes(catalog[i].binaryFilename).length == 0) { + // Skip entries with empty binaryFilename. + // These entries represent log files generated by the Cartesi machine API, e.g: log_uarch_reset + continue; + } + + console.log("Testing %s ...", catalog[i].binaryFilename); AccessLogs.Context memory a = newAccessLogsContext(); // load ramAccessLogs - loadBin(a.buffer, string.concat(JSON_PATH, catalog[i].path)); + loadBin( + a.buffer, + string.concat(BINARIES_PATH, catalog[i].binaryFilename) + ); // init pc to ram start - UArchCompat.writePc(a, PMA_UARCH_RAM_START); + UArchCompat.writePc(a, UArchConstants.UARCH_RAM_START_ADDRESS); // init cycle to 0 UArchCompat.writeCycle(a, 0); @@ -70,7 +83,7 @@ contract UArchInterpretTest is Test { assertTrue(halt, "machine should halt"); uint64 cycle = UArchCompat.readCycle(a); - assertEq(cycle, catalog[i].cycle, "cycle values should match"); + assertEq(cycle, catalog[i].steps, "cycle values should match"); } } @@ -78,7 +91,7 @@ contract UArchInterpretTest is Test { AccessLogs.Context memory a = newAccessLogsContext(); // init pc to ram start - UArchCompat.writePc(a, PMA_UARCH_RAM_START); + UArchCompat.writePc(a, UArchConstants.UARCH_RAM_START_ADDRESS); // init cycle to uint64.max UArchCompat.writeCycle(a, type(uint64).max); @@ -113,7 +126,7 @@ contract UArchInterpretTest is Test { AccessLogs.Context memory a = newAccessLogsContext(); // init pc to ram start - UArchCompat.writePc(a, PMA_UARCH_RAM_START); + UArchCompat.writePc(a, UArchConstants.UARCH_RAM_START_ADDRESS); // init cycle to 0 UArchCompat.writeCycle(a, 0); diff --git a/test/UArchReset.t.sol b/test/UArchReset.t.sol index 6c93ea3..555f4a2 100644 --- a/test/UArchReset.t.sol +++ b/test/UArchReset.t.sol @@ -33,14 +33,15 @@ contract UArchReset_Test is Test { // configure the tests string constant JSON_PATH = "./test/uarch-log/"; string constant CATALOG_PATH = "catalog.json"; - string constant RESET_PATH = "uarch-reset.json"; + string constant RESET_PATH = "uarch-reset-steps.json"; uint256 constant siblingsLength = 42; struct Entry { + string binaryFilename; string finalRootHash; string initialRootHash; - string path; + string logFilename; bool proof; uint256 proofsFrequency; uint256 steps; @@ -69,12 +70,12 @@ contract UArchReset_Test is Test { for (uint256 i = 0; i < catalog.length; i++) { if ( - keccak256(abi.encodePacked(catalog[i].path)) + keccak256(abi.encodePacked(catalog[i].logFilename)) != keccak256(abi.encodePacked("uarch-reset-steps.json")) ) { continue; } - console.log("Replaying file %s ...", catalog[i].path); + console.log("Replaying log file %s ...", catalog[i].logFilename); require( catalog[i].proofsFrequency == 1, "require proof in every step" );