consensus-specs icon indicating copy to clipboard operation
consensus-specs copied to clipboard

Deposit contract dapp test fatal error

Open kevin-chau opened this issue 4 years ago • 5 comments

I'm getting a fatal error when I run the dapp tests. It doesn't seem to stop the tests from running however, all of them seem to be passing for me:

kevinchau@Kevins-MBP eth2.0-specs % make test_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
dapp test -v --fuzz-runs 5
fatal: cannot change to './solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract': No such file or directory
child_process.js:650
    throw err;
    ^

Error: Command failed: git -C ./solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract rev-parse HEAD
fatal: cannot change to './solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract': No such file or directory

    at checkExecSyncError (child_process.js:629:11)
    at Object.execFileSync (child_process.js:647:13)
    at run (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:64:35)
    at ls.forEach.name (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:35:16)
    at Array.forEach (<anonymous>)
    at findRemappings (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:18:43)
    at Object.<anonymous> (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:5:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
Running 7 tests for ./solidity_deposit_contract/tests/deposit_contract.t.sol:DepositContractTest
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_sol(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_vyp(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_vyp(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] test_16_deposits(bytes32[16],bytes16[16],bytes32[16],bytes32[16],bytes32[16],bytes32[16],uint32[16]) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_deposit_not_divisible_by_gwei(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_sol(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
[PASS] test_empty_root() (gas: 281123)

Probably a really easy fix -- clearly the path for the directory referenced does not exist. But I can't seem to find any lines of code with the command git -C or ./solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract, so for now I'm stuck on this one without a solution.

kevin-chau avatar Feb 20 '21 03:02 kevin-chau

Hi @kevin-chau, could you try to run make compile_deposit_contract before running make test_deposit_contract?

My local output:

~/ethereum/eth2.0-specs on dev [$?] via venv via 🐍  system
✦7 ➜ make compile_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/tests/deposit_contract.t.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/lib/ds-test/src/test.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/tests/vyper_setup.sol


~/ethereum/eth2.0-specs on dev [$?] via venv via 🐍  system
✦7 ➜ make test_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
dapp test -v --fuzz-runs 5
Running 7 tests for ./solidity_deposit_contract/tests/deposit_contract.t.sol:DepositContractTest
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_sol(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_vyp(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_vyp(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] test_16_deposits(bytes32[16],bytes16[16],bytes32[16],bytes32[16],bytes32[16],bytes32[16],uint32[16]) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_deposit_not_divisible_by_gwei(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_sol(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
[PASS] test_empty_root() (gas: 281123)

hwwhww avatar Feb 21 '21 11:02 hwwhww

@hwwhww Appreciate the response!

I'm pretty sure I compiled the deposit contract before running the tests, otherwise I don't think the tests would run at all.

I'm still getting the fatal error when I run make compile_deposit_contract directly before running make test_deposit_contract. Here's my output:

kevinchau@Kevins-MBP eth2.0-specs % make compile_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/tests/deposit_contract.t.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/lib/ds-test/src/test.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/tests/vyper_setup.sol

kevinchau@Kevins-MBP eth2.0-specs % make test_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
dapp test -v --fuzz-runs 5
fatal: cannot change to './solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract': No such file or directory
child_process.js:650
    throw err;
    ^

Error: Command failed: git -C ./solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract rev-parse HEAD
fatal: cannot change to './solidity_deposit_contract/lib/ds-test/./solidity_deposit_contract': No such file or directory

    at checkExecSyncError (child_process.js:629:11)
    at Object.execFileSync (child_process.js:647:13)
    at run (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:64:35)
    at ls.forEach.name (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:35:16)
    at Array.forEach (<anonymous>)
    at findRemappings (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:18:43)
    at Object.<anonymous> (/nix/store/3m4ia98m1gia8d94shyarmkndx3hfiac-dapp-0.32.1/libexec/dapp/dapp-remappings:5:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
Running 7 tests for ./solidity_deposit_contract/tests/deposit_contract.t.sol:DepositContractTest
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_sol(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_vyp(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_vyp(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] test_16_deposits(bytes32[16],bytes16[16],bytes32[16],bytes32[16],bytes32[16],bytes32[16],uint32[16]) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_deposit_not_divisible_by_gwei(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_sol(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
[PASS] test_empty_root() (gas: 281123)

kevinchau@Kevins-MBP eth2.0-specs % 

Seeing how you're getting a clean output, there might be something else I'm missing?

kevin-chau avatar Feb 22 '21 04:02 kevin-chau

Hey @kevin-chau, I retried again from a clean, new git clone [email protected]:ethereum/eth2.0-specs.git folder:

~/ethereum/test via 🐍  system
➜ git clone [email protected]:ethereum/eth2.0-specs.git
Cloning into 'eth2.0-specs'...
remote: Enumerating objects: 263, done.
remote: Counting objects: 100% (263/263), done.
remote: Compressing objects: 100% (204/204), done.
remote: Total 37065 (delta 102), reused 169 (delta 54), pack-reused 36802
Receiving objects: 100% (37065/37065), 10.11 MiB | 2.86 MiB/s, done.
Resolving deltas: 100% (22554/22554), done.

~/ethereum/test via 🐍  system took 7s
➜ cd eth2.0-specs

ethereum/test/eth2.0-specs on dev via 🐍  system
➜ make compile_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
Submodule 'lib/ds-test' (https://github.com/dapphub/ds-test) registered for path 'solidity_deposit_contract/lib/ds-test'
Cloning into '/Users/hwwang/ethereum/test/eth2.0-specs/solidity_deposit_contract/lib/ds-test'...
Submodule path 'solidity_deposit_contract/lib/ds-test': checked out 'eb7148d43c1ca6f9890361e2e2378364af2430ba'
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/tests/deposit_contract.t.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/lib/ds-test/src/test.sol

Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> ./solidity_deposit_contract/tests/vyper_setup.sol


ethereum/test/eth2.0-specs on dev [?] via 🐍  system took 3s
➜ make test_deposit_contract
Makefile:168: warning: overriding commands for target `../eth2.0-spec-tests/tests'
Makefile:165: warning: ignoring old commands for target `../eth2.0-spec-tests/tests'
dapp test -v --fuzz-runs 5
Running 7 tests for ./solidity_deposit_contract/tests/deposit_contract.t.sol:DepositContractTest
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_sol(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_vyp(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_calldata_vyp(bytes,bytes,bytes,uint64) (runs: 5)
+++ OK, passed 5 tests.
[PASS] test_16_deposits(bytes32[16],bytes16[16],bytes32[16],bytes32[16],bytes32[16],bytes32[16],uint32[16]) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_deposit_not_divisible_by_gwei(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32) (runs: 5)
+++ OK, passed 5 tests.
[PASS] testFail_malformed_node_sol(bytes32,bytes16,bytes32,bytes32,bytes32,bytes32,uint64,bytes32) (runs: 5)
[PASS] test_empty_root() (gas: 281123)

Highlight the submodule:

Submodule 'lib/ds-test' (https://github.com/dapphub/ds-test) registered for path 'solidity_deposit_contract/lib/ds-test'
Cloning into '/Users/hwwang/ethereum/test/eth2.0-specs/solidity_deposit_contract/lib/ds-test'...
Submodule path 'solidity_deposit_contract/lib/ds-test': checked out 'eb7148d43c1ca6f9890361e2e2378364af2430ba'

Can you check if you've checked out the submodule lib/ds-test?

hwwhww avatar Feb 22 '21 05:02 hwwhww

@hwwhww Yup, I've got it checked out. Commit hash matches as well: eb7148d

kevinchau@Kevins-MBP eth2.0-specs % cd solidity_deposit_contract 
kevinchau@Kevins-MBP solidity_deposit_contract % cd lib
kevinchau@Kevins-MBP lib % cd ds-test 
kevinchau@Kevins-MBP ds-test % git status
HEAD detached at eb7148d
nothing to commit, working tree clean

kevin-chau avatar Feb 22 '21 06:02 kevin-chau

@kevin-chau

I finally know how to reproduce your error message! It seems our setting is not compatible with the latest dapp.

  • My local dapp version was 0.28.0.
  • In the CI job, dapp is fixed to a commit on 0.28.0: https://github.com/ethereum/eth2.0-specs/blob/09648cfd618f4043202c7878f264d5e24201ee52/solidity_deposit_contract/shell.nix#L1-L4
  • Your dapp is 0.32.1. Once I upgrade to 0.32.1, I saw the same error message when I executed make test_deposit_contract.

I'm not familiar with dapp to say if there is an easy fix for it. It's a low-priority task since (1) we no longer need to test the deployed deposit contract and (2) the tests passed anyway even with some weird error messages.

A naive workaround is updating the README file, changing "Install the latest version of dapp" to "Install dapp v0.28.0" 😓


/cc @MrChico 👋, I think it's a long shot, but any chance you know if there is any compatibility issue between 0.28.0 and the later versions, or if you've seen similar error messages before?

hwwhww avatar Mar 02 '21 18:03 hwwhww

I am closing this issue because it seems stale. Please, do not hesitate to reopen it if this is a mistake

leolara avatar Jun 04 '25 09:06 leolara