Giter Club home page Giter Club logo

Comments (9)

hydai avatar hydai commented on June 20, 2024 2

Hi, @meowsbits,
It's been a long time since last update. SSVM released 0.5.0 just now. In this release, we've resolved all issues. Please update to our latest commit and try again. Thanks 😊

from core-geth.

hydai avatar hydai commented on June 20, 2024 1

Update:
https://gist.github.com/hydai/5f9bbbcb7a1227e3e0f55fe00f110e23

It looks like SSVM get lots of wasm module instantiation errors. Please give me a moment to analyze these wasm bytecode.

from core-geth.

hydai avatar hydai commented on June 20, 2024 1

Update:

You can check out to our master branch to get the latest code.
Git Head: [ master ] ( 8631d4606531981524b347ebb72291cd0b343ab0 ).
Although we've fixed several issues, SSVM still failed on 8 test cases. Luckily, all of these 8 test cases will not create segmentation faults. We are going to the remaining issues in a few weeks.

Commit of fixing Passed Crashed Failed
Original 46 8 172
Delete cost table of wasm instructions in ewasm mode. 103 (+57) 8 115 (-57)
Fix EEI function signature error. 103 8 115
Fix bytecode not set into the ewasm environment. 103 8 115
Complete function import matching. 172 (+69) 8 46 (-69)
Fix state error when call function failed in VM. 175 (+3) 8 43 (-3)
Change out-of-gas case to fail rather than revert. 180 (+5) 8 38 (-5)
Fix error of return value in Call() related EEI functions. 198 (+18) 15 (+7) 13 (-25)
Fix memory resizing policy and bound checking in the memory instance. 198 15 13
Add memory bound checking when loading or storing values from memory in EEI functions. 216 (+18) 0 (-15) 10 (-3)
Add lost checking of flag in StorageStore(). 217 (+1) 0 9 (-1)
Handle overflow of uint128 loading and storing. 218 (+1) 0 8 (-1)

from core-geth.

meowsbits avatar meowsbits commented on June 20, 2024 1

Issue indeed resolved with SSVM's 0.5.0! 🎉 See 8354c39.

from core-geth.

meowsbits avatar meowsbits commented on June 20, 2024

With the latest updates in #57 (as of c93eb46), I have:

Hera fails two tests

		st.whitelist(`^stEWASM`)
		if strings.Contains(*testEWASM, "hera") {
			st.skipLoad(`^stEWASMTests/callSenderBalanceExceeds128Bits`)
			st.skipLoad(`^stEWASMTests/ecAddCallDataCopy`)

SSVM seems to fail some (I'm having a tough time isolating the failed test(s)...), but when running the suite continually causes a fatal error: unexpected signal during runtime execution.

> cat .ia/test-ewasm.sh 
#!/usr/bin/env bash

SO_SSVM=/home/ia/dev/second-state/SSVM/build/tools/ssvm-evmc/libssvmEVMC.so 
SO_HERA=/home/ia/dev/ewasm/hera/build/src/libhera.so 

SO_PATH=''

if [[ $1 = ssvm ]]; then 
        SO_PATH="$SO_SSVM"
elif [[ $1 = hera ]]; then
        SO_PATH="$SO_HERA"
fi

[[ -z "$SO_PATH" ]] && echo "Use 'hera' or 'ssvm' as arg1" && exit 1

echo "Running EWASM tests for $SO_PATH"

echo '> go test -v ./tests/... -run TestState -evmc.ewasm='"$SO_PATH" | tee test.$1.log
go test -v ./tests/... -run TestState -evmc.ewasm="$SO_PATH" &> test.$1.log
echo "=> test.$1.log"

# grep -A2 FAIL test.*.log
# grep -B5 -A5 'segementation violation' test.*.log

> t=ssvm; ./.ia/test-ewasm.sh $t; grep -B 10 -A 10 -E '(fatal|FAIL)' test.$t.log || tail -20 test.$t.log
Running EWASM tests for /home/ia/dev/second-state/SSVM/build/tools/ssvm-evmc/libssvmEVMC.so
> go test -v ./tests/... -run TestState -evmc.ewasm=/home/ia/dev/second-state/SSVM/build/tools/ssvm-evmc/libssvmEVMC.so
=> test.ssvm.log
 =================  Statistics  =================
 Total execution time: 14 us
 Wasm instructions execution time: 5 us
 Host functions execution time: 9 us
 Executed wasm instructions count: 19
 Gas costs: 21508
 Instructions per second: 3800000
usedGas: 21508
return_size: 0
return_data:
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x7fb88400a31f pc=0x7fb7b46adc40]

runtime stack:
runtime.throw(0xa80101, 0x2a)
        /home/ia/go1.13.5.linux-amd64/go/src/runtime/panic.go:774 +0x72
runtime.sigpanic()
        /home/ia/go1.13.5.linux-amd64/go/src/runtime/signal_unix.go:378 +0x47c

goroutine 5229 [syscall]:
runtime.cgocall(0x91c7c0, 0xc0009ef640, 0x40faa4)
--
created by testing.(*T).Run
        /home/ia/go1.13.5.linux-amd64/go/src/testing/testing.go:960 +0x350

goroutine 774 [chan send]:
testing.tRunner.func1(0xc00054c700)
        /home/ia/go1.13.5.linux-amd64/go/src/testing/testing.go:904 +0x282
testing.tRunner(0xc00054c700, 0xc000541900)
        /home/ia/go1.13.5.linux-amd64/go/src/testing/testing.go:913 +0xd3
created by testing.(*T).Run
        /home/ia/go1.13.5.linux-amd64/go/src/testing/testing.go:960 +0x350
FAIL    github.com/ethereum/go-ethereum/tests   1.703s
?       github.com/ethereum/go-ethereum/tests/fuzzers/keystore  [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/rlp       [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/trie      [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/txfetcher [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/whisperv6 [no test files]
FAIL

> ^ssvm^hera^
t=hera; ./.ia/test-ewasm.sh $t; grep -B 10 -A 10 -E '(fatal|FAIL)' test.$t.log || tail -20 test.$t.log
Running EWASM tests for /home/ia/dev/ewasm/hera/build/src/libhera.so
> go test -v ./tests/... -run TestState -evmc.ewasm=/home/ia/dev/ewasm/hera/build/src/libhera.so
=> test.hera.log
        --- PASS: TestState/stEWASMTests/createNonzero.json/Byzantium/0 (0.01s)
    --- PASS: TestState/stEWASMTests/validateBytecodeInvalidImportIsInvalid.json (0.00s)
        --- PASS: TestState/stEWASMTests/validateBytecodeInvalidImportIsInvalid.json/Byzantium/0 (0.00s)
    --- PASS: TestState/stEWASMTests/validateBytecodeInvalidImportFromTxIsInvalid.json (0.00s)
        --- PASS: TestState/stEWASMTests/validateBytecodeInvalidImportFromTxIsInvalid.json/Byzantium/0 (0.00s)
    --- PASS: TestState/stEWASMTests/validateBytecodeEmptyInitFromTxIsInvalid.json (0.00s)
        --- PASS: TestState/stEWASMTests/validateBytecodeEmptyInitFromTxIsInvalid.json/Byzantium/0 (0.00s)
    --- PASS: TestState/stEWASMTests/validateBytecodeEmptyInitIsInvalid.json (0.00s)
        --- PASS: TestState/stEWASMTests/validateBytecodeEmptyInitIsInvalid.json/Byzantium/0 (0.00s)
    --- PASS: TestState/stEWASMTests/createFromTransactionExceedGasLimit.json (0.00s)
        --- PASS: TestState/stEWASMTests/createFromTransactionExceedGasLimit.json/Byzantium/0 (0.00s)
    --- PASS: TestState/stEWASMTests/callDepth.json (0.07s)
        --- PASS: TestState/stEWASMTests/callDepth.json/Byzantium/0 (0.07s)
PASS
ok      github.com/ethereum/go-ethereum/tests   0.302s
?       github.com/ethereum/go-ethereum/tests/fuzzers/keystore  [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/rlp       [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/trie      [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/txfetcher [no test files]
?       github.com/ethereum/go-ethereum/tests/fuzzers/whisperv6 [no test files]

from core-geth.

meowsbits avatar meowsbits commented on June 20, 2024

As of 88f5c66, there's a way to run the test (files) individually with the --evmc.ewasm=/path/to/ewasm.so flag. #57 (comment)

from core-geth.

meowsbits avatar meowsbits commented on June 20, 2024
#!/usr/bin/env bash


ewasm_sos=(
	/home/ia/dev/second-state/SSVM/build/tools/ssvm-evmc/libssvmEVMC.so
	/home/ia/dev/ewasm/hera/build/src/libhera.so
)

set -e
make evmc
make all
set +e

find tests/testdata/GeneralStateTests/stEWASMTests -type f -name '*json' | while read -r line; do
	for so in "${ewasm_sos[@]}"; do
		resdir="test-ewasm-results/$(basename $so)"
		mkdir -p  "$resdir"
		./build/bin/evm --debug --dump --verbosity 2 statetest --evmc.ewasm="$so" "$line" |& tee "$resdir/$(basename $line)"
	done
done

for so in "${ewasm_sos[@]}"; do
	resfile="test-ewasm-results/batch"
	mkdir -p "$resfile"
	resfile="${resfile}/$(basename $so)"
	go test -v ./tests/ -run TestState -evmc.ewasm="${so}" ./tests |& tee "$resfile"
done

from core-geth.

meowsbits avatar meowsbits commented on June 20, 2024

As of fc424d7, all tests are passing with Hera.

But something is still clearly broken for SSVM, eg.

> ag panic test-ewasm-results/
libssvmEVMC.so/callStaticVeryLong.json
13:     /home/ia/go1.13.5.linux-amd64/go/src/runtime/panic.go:774 +0x72
14:runtime.sigpanic()

Run the script above to reproduce failures on a test-by-test basis.

@dm4 Can you give a hand here?

from core-geth.

hydai avatar hydai commented on June 20, 2024

Hi, @me020523
I am reproducing this issue and trying to fix SSVM in these test cases.

from core-geth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.