Open heikoheiko opened 10 years ago
from pyethereum import tester as t s = t.state() c1 = s.contract('1') c2 = s.contracT('2') Traceback (most recent call last): File "
", line 1, in AttributeError: state instance has no attribute 'contracT' c2 = s.contract('2') s.send(t.k0, c1, 0, []) [1] s.send(t.k0, c2, 0, [])
With '1' and '2' containing those pieces of code. Works perfectly fine for me. Try ethereum-serpent 1.6.4 and see what you get maybe?
Also, verify these:
vub@shadowcow 10:16:04 deps/CoinDB: serpent pretty_compile 1 [PUSH1, 33, DUP1, PUSH1, 11, PUSH1, 0, CODECOPY, PUSH1, 44, JUMP, PUSH1, 0, PUSH1, 31, MSTORE8, PUSH1, 32, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 0, MSTORE, PUSH1, 1, PUSH1, 0, PUSH1, 0, MLOAD, ADD, MSTORE, PUSH1, 32, PUSH1, 0, MLOAD, RETURN, PUSH1, 0, RETURN] vub@shadowcow 10:16:22 deps/CoinDB: serpent pretty_compile 2 [PUSH1, 38, DUP1, PUSH1, 11, PUSH1, 0, CODECOPY, PUSH1, 49, JUMP, PUSH1, 0, PUSH1, 63, MSTORE8, PUSH1, 32, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 0, MSTORE, PUSH1, 2, PUSH1, 32, MSTORE, PUSH1, 1, PUSH1, 0, PUSH1, 0, MLOAD, ADD, MSTORE, PUSH1, 32, PUSH1, 0, MLOAD, RETURN, PUSH1, 0, RETURN]
On Wed, Sep 10, 2014 at 7:02 AM, heikoheiko notifications@github.com wrote:
this code:
a = array(1) a[0] = 1 return(a, 1)
returns 0 (unexpected)
this code:
a = array(1) something = 2 a[0] = 1 return(a, 1)
for some reason returns 1 (expected)
Name: ethereum-serpent Version: 1.6.3
— Reply to this email directly or view it on GitHub https://github.com/ethereum/serpent/issues/8.
upgraded to 1.6.4, still fails added test to test_contracts.py https://github.com/ethereum/pyethereum/blob/master/tests/test_contracts.py#L363
def test_array():
s = tester.state()
c = s.contract(array_code)
> assert [1] == s.send(tester.k0, c, 0, [])
E assert [1] == [0]
E At index 0 diff: 1 != 0
11 passed in 3.96 seconds.
Very weird.
On Wed, Sep 10, 2014 at 7:25 AM, heikoheiko notifications@github.com wrote:
upgraded to 1.6.4, still fails added test to test_contracts.py
https://github.com/ethereum/pyethereum/blob/master/tests/test_contracts.py#L363
def test_post(): s = tester.state() c = s.contract(array_code)
assert [1] == s.send(tester.k0, c, 0, [])
E assert [1] == [0] E At index 0 diff: 1 != 0
— Reply to this email directly or view it on GitHub https://github.com/ethereum/serpent/issues/8#issuecomment-55122494.
serpent compiles slightly different here:
% serpent pretty_compile t.se
[PUSH1, 33, DUP1, PUSH1, 11, PUSH1, 0, CODECOPY, PUSH1, 44, JUMP, PUSH1, 0, PUSH1, 31, MSTORE8, PUSH1, 32, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 32, MSTORE, PUSH1, 1, PUSH1, 0, PUSH1, 32, MLOAD, ADD, MSTORE, PUSH1, 32, PUSH1, 32, MLOAD, RETURN, PUSH1, 0, RETURN]
% cat t.se
a = array(1)
a[0] = 1
return(a, 1)
Is that the shorter code or the longer code? It looks wrong for both. Maybe also provide the serpent compile_to_lll results for both samples?
On Wed, Sep 10, 2014 at 8:04 AM, heikoheiko notifications@github.com wrote:
serpent compiles slightly different here:
% serpent pretty_compile t.se
[PUSH1, 33, DUP1, PUSH1, 11, PUSH1, 0, CODECOPY, PUSH1, 44, JUMP, PUSH1, 0, PUSH1, 31, MSTORE8, PUSH1, 32, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 32, MSTORE, PUSH1, 1, PUSH1, 0, PUSH1, 32, MLOAD, ADD, MSTORE, PUSH1, 32, PUSH1, 32, MLOAD, RETURN, PUSH1, 0, RETURN]
% cat t.se
a = array(1) a[0] = 1 return(a, 1)
— Reply to this email directly or view it on GitHub https://github.com/ethereum/serpent/issues/8#issuecomment-55128930.
cat shorter.se:
a = array(1)
a[0] = 1
return(a, 1)
serpent compile_to_lll shorter.se
(return 0
(lll
(seq
(set 'a (alloc 32))
(mstore (add (get 'a) 0) 1)
(return (get 'a) 32)
)
0
)
)
serpent pretty_compile shorter.se
[PUSH1, 33, DUP1, PUSH1, 11, PUSH1, 0, CODECOPY, PUSH1, 44, JUMP, PUSH1, 0, PUSH1, 31, MSTORE8, PUSH1, 32, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 32, MSTORE, PUSH1, 1, PUSH1, 0, PUSH1, 32, MLOAD, ADD, MSTORE, PUSH1, 32, PUSH1, 32, MLOAD, RETURN, PUSH1, 0, RETURN]
cat longer.se
a = array(1)
something = 2
a[0] = 1
return(a, 1)
serpent compile_to_lll longer.se
(return 0
(lll
(seq
(set 'a (alloc 32))
(set 'something 2)
(mstore (add (get 'a) 0) 1)
(return (get 'a) 32)
)
0
)
)
serpent pretty_compile longer.se
[PUSH1, 38, DUP1, PUSH1, 11, PUSH1, 0, CODECOPY, PUSH1, 49, JUMP, PUSH1, 0, PUSH1, 63, MSTORE8, PUSH1, 32, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 32, MSTORE, PUSH1, 2, PUSH1, 64, MSTORE, PUSH1, 1, PUSH1, 0, PUSH1, 32, MLOAD, ADD, MSTORE, PUSH1, 32, PUSH1, 32, MLOAD, RETURN, PUSH1, 0, RETURN]
other behavior, that might provide a clue:
return(array(3), 3)
returns [0,0,0]
a = array(3)
return(a, 3)
returns [32,0,0]
i = 1
a = array(3)
return(a, 3)
returns [64, 0, 0]
j = 1
i = 1
a = array(3)
return(a, 3)
returns [96, 0, 0]
Ah. It's somehow doing ref instead of get for return. It definitely seems like we're not using the same version of serpent. Can you perhaps try a clean reinstall using the latest github?
done, getting the same result. i.e. test/test_contracts.py fails.
def test_array():
s = tester.state()
c = s.contract(array_code)
> assert [1] == s.send(tester.k0, c, 0, [])
E assert [1] == [0]
E At index 0 diff: 1 != 0
(default) ~/dev/ethereum/serpent (git)-[master] % pip uninstall ethereum-serpent
Uninstalling ethereum-serpent:
/Users/heiko/venvs/default/bin/serpent
/Users/heiko/venvs/default/bin/serpent.py
/Users/heiko/venvs/default/lib/python2.7/site-packages/ethereum_serpent-1.6.4-py2.7.egg-info
/Users/heiko/venvs/default/lib/python2.7/site-packages/pyserpent.py
/Users/heiko/venvs/default/lib/python2.7/site-packages/pyserpent.pyc
/Users/heiko/venvs/default/lib/python2.7/site-packages/serpent.py
/Users/heiko/venvs/default/lib/python2.7/site-packages/serpent.pyc
/Users/heiko/venvs/default/lib/python2.7/site-packages/serpent_pyext.so
Proceed (y/n)? y
Successfully uninstalled ethereum-serpent
(default) ~/dev/ethereum/serpent (git)-[master] % serpent
zsh: command not found: serpent
127 (default) ~/dev/ethereum/serpent (git)-[master] % git pull
Already up-to-date.
(default) ~/dev/ethereum/serpent (git)-[master] % python setup.py install
running install
running bdist_egg
running egg_info
writing ethereum_serpent.egg-info/PKG-INFO
writing top-level names to ethereum_serpent.egg-info/top_level.txt
writing dependency_links to ethereum_serpent.egg-info/dependency_links.txt
writing entry points to ethereum_serpent.egg-info/entry_points.txt
reading manifest file 'ethereum_serpent.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'ethereum_serpent.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.8-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.8-x86_64-2.7
copying serpent.py -> build/lib.macosx-10.8-x86_64-2.7
copying pyserpent.py -> build/lib.macosx-10.8-x86_64-2.7
running build_ext
building 'serpent_pyext' extension
creating build/temp.macosx-10.8-x86_64-2.7
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c bignum.cpp -o build/temp.macosx-10.8-x86_64-2.7/bignum.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c util.cpp -o build/temp.macosx-10.8-x86_64-2.7/util.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c tokenize.cpp -o build/temp.macosx-10.8-x86_64-2.7/tokenize.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lllparser.cpp -o build/temp.macosx-10.8-x86_64-2.7/lllparser.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c parser.cpp -o build/temp.macosx-10.8-x86_64-2.7/parser.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c rewriter.cpp -o build/temp.macosx-10.8-x86_64-2.7/rewriter.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c compiler.cpp -o build/temp.macosx-10.8-x86_64-2.7/compiler.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c funcs.cpp -o build/temp.macosx-10.8-x86_64-2.7/funcs.o
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pyserpent.cpp -o build/temp.macosx-10.8-x86_64-2.7/pyserpent.o
c++ -bundle -undefined dynamic_lookup -L/usr/local/lib build/temp.macosx-10.8-x86_64-2.7/bignum.o build/temp.macosx-10.8-x86_64-2.7/util.o build/temp.macosx-10.8-x86_64-2.7/tokenize.o build/temp.macosx-10.8-x86_64-2.7/lllparser.o build/temp.macosx-10.8-x86_64-2.7/parser.o build/temp.macosx-10.8-x86_64-2.7/rewriter.o build/temp.macosx-10.8-x86_64-2.7/compiler.o build/temp.macosx-10.8-x86_64-2.7/funcs.o build/temp.macosx-10.8-x86_64-2.7/pyserpent.o -o build/lib.macosx-10.8-x86_64-2.7/serpent_pyext.so
creating build/bdist.macosx-10.8-x86_64
creating build/bdist.macosx-10.8-x86_64/egg
copying build/lib.macosx-10.8-x86_64-2.7/pyserpent.py -> build/bdist.macosx-10.8-x86_64/egg
copying build/lib.macosx-10.8-x86_64-2.7/serpent.py -> build/bdist.macosx-10.8-x86_64/egg
copying build/lib.macosx-10.8-x86_64-2.7/serpent_pyext.so -> build/bdist.macosx-10.8-x86_64/egg
byte-compiling build/bdist.macosx-10.8-x86_64/egg/pyserpent.py to pyserpent.pyc
byte-compiling build/bdist.macosx-10.8-x86_64/egg/serpent.py to serpent.pyc
creating stub loader for serpent_pyext.so
byte-compiling build/bdist.macosx-10.8-x86_64/egg/serpent_pyext.py to serpent_pyext.pyc
creating build/bdist.macosx-10.8-x86_64/egg/EGG-INFO
installing scripts to build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
copying serpent.py -> build/scripts-2.7
changing mode of build/scripts-2.7/serpent.py from 644 to 755
creating build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/serpent.py -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts/serpent.py to 755
copying ethereum_serpent.egg-info/PKG-INFO -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO
copying ethereum_serpent.egg-info/SOURCES.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO
copying ethereum_serpent.egg-info/dependency_links.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO
copying ethereum_serpent.egg-info/entry_points.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO
copying ethereum_serpent.egg-info/top_level.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg' and adding 'build/bdist.macosx-10.8-x86_64/egg' to it
removing 'build/bdist.macosx-10.8-x86_64/egg' (and everything under it)
Processing ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg
Copying ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg to /Users/heiko/venvs/default/lib/python2.7/site-packages
Adding ethereum-serpent 1.6.2 to easy-install.pth file
Installing serpent.py script to /Users/heiko/venvs/default/bin
Installing serpent script to /Users/heiko/venvs/default/bin
Installed /Users/heiko/venvs/default/lib/python2.7/site-packages/ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg
Processing dependencies for ethereum-serpent==1.6.2
Finished processing dependencies for ethereum-serpent==1.6.2
python setup.py install 10,57s user 1,39s system 94% cpu 12,607 total
(default) ~/dev/ethereum/serpent (git)-[master] % serpent
serpent <command> <arg1> <arg2> ...
Installed /Users/heiko/venvs/default/lib/python2.7/site-packages/ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg Processing dependencies for ethereum-serpent==1.6.2 Finished processing dependencies for ethereum-serpent==1.6.2 python setup.py install 10,57s user 1,39s system 94% cpu 12,607 total
Ah, you should be on 1.6.4. You getting master?
On Wed, Sep 10, 2014 at 1:17 PM, heikoheiko notifications@github.com wrote:
done, getting the same result. i.e. test/test_contracts.py fails.
def test_array(): s = tester.state() c = s.contract(array_code)
assert [1] == s.send(tester.k0, c, 0, [])
E assert [1] == [0] E At index 0 diff: 1 != 0
(default) ~/dev/ethereum/serpent (git)-[master] % pip uninstall ethereum-serpent Uninstalling ethereum-serpent: /Users/heiko/venvs/default/bin/serpent /Users/heiko/venvs/default/bin/serpent.py /Users/heiko/venvs/default/lib/python2.7/site-packages/ethereum_serpent-1.6.4-py2.7.egg-info /Users/heiko/venvs/default/lib/python2.7/site-packages/pyserpent.py /Users/heiko/venvs/default/lib/python2.7/site-packages/pyserpent.pyc /Users/heiko/venvs/default/lib/python2.7/site-packages/serpent.py /Users/heiko/venvs/default/lib/python2.7/site-packages/serpent.pyc /Users/heiko/venvs/default/lib/python2.7/site-packages/serpent_pyext.so Proceed (y/n)? y Successfully uninstalled ethereum-serpent (default) ~/dev/ethereum/serpent (git)-[master] % serpent zsh: command not found: serpent 127 (default) ~/dev/ethereum/serpent (git)-[master] % git pull Already up-to-date. (default) ~/dev/ethereum/serpent (git)-[master] % python setup.py install running install running bdist_egg running egg_info writing ethereum_serpent.egg-info/PKG-INFO writing top-level names to ethereum_serpent.egg-info/top_level.txt writing dependency_links to ethereum_serpent.egg-info/dependency_links.txt writing entry points to ethereum_serpent.egg-info/entry_points.txt reading manifest file 'ethereum_serpent.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'ethereum_serpent.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.8-x86_64/egg running install_lib running build_py creating build creating build/lib.macosx-10.8-x86_64-2.7 copying serpent.py -> build/lib.macosx-10.8-x86_64-2.7 copying pyserpent.py -> build/lib.macosx-10.8-x86_64-2.7 running build_ext building 'serpent_pyext' extension creating build/temp.macosx-10.8-x86_64-2.7 cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c bignum.cpp -o build/temp.macosx-10.8-x86_64-2.7/bignum.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c util.cpp -o build/temp.macosx-10.8-x86_64-2.7/util.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c tokenize.cpp -o build/temp.macosx-10.8-x86_64-2.7/tokenize.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lllparser.cpp -o build/temp.macosx-10.8-x86_64-2.7/lllparser.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c parser.cpp -o build/temp.macosx-10.8-x86_64-2.7/parser.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c rewriter.cpp -o build/temp.macosx-10.8-x86_64-2.7/rewriter.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c compiler.cpp -o build/temp.macosx-10.8-x86_64-2.7/compiler.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c funcs.cpp -o build/temp.macosx-10.8-x86_64-2.7/funcs.o cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pyserpent.cpp -o build/temp.macosx-10.8-x86_64-2.7/pyserpent.o c++ -bundle -undefined dynamic_lookup -L/usr/local/lib build/temp.macosx-10.8-x86_64-2.7/bignum.o build/temp.macosx-10.8-x86_64-2.7/util.o build/temp.macosx-10.8-x86_64-2.7/tokenize.o build/temp.macosx-10.8-x86_64-2.7/lllparser.o build/temp.macosx-10.8-x86_64-2.7/parser.o build/temp.macosx-10.8-x86_64-2.7/rewriter.o build/temp.macosx-10.8-x86_64-2.7/compiler.o build/temp.macosx-10.8-x86_64-2.7/funcs.o build/temp.macosx-10.8-x86_64-2.7/pyserpent.o -o build/lib.macosx-10.8-x86_64-2.7/serpent_pyext.so creating build/bdist.macosx-10.8-x86_64 creating build/bdist.macosx-10.8-x86_64/egg copying build/lib.macosx-10.8-x86_64-2.7/pyserpent.py -> build/bdist.macosx-10.8-x86_64/egg copying build/lib.macosx-10.8-x86_64-2.7/serpent.py -> build/bdist.macosx-10.8-x86_64/egg copying build/lib.macosx-10.8-x86_64-2.7/serpent_pyext.so -> build/bdist.macosx-10.8-x86_64/egg byte-compiling build/bdist.macosx-10.8-x86_64/egg/pyserpent.py to pyserpent.pyc byte-compiling build/bdist.macosx-10.8-x86_64/egg/serpent.py to serpent.pyc creating stub loader for serpent_pyext.so byte-compiling build/bdist.macosx-10.8-x86_64/egg/serpent_pyext.py to serpent_pyext.pyc creating build/bdist.macosx-10.8-x86_64/egg/EGG-INFO installing scripts to build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts running install_scripts running build_scripts creating build/scripts-2.7 copying serpent.py -> build/scripts-2.7 changing mode of build/scripts-2.7/serpent.py from 644 to 755 creating build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/serpent.py -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts changing mode of build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/scripts/serpent.py to 755 copying ethereum_serpent.egg-info/PKG-INFO -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO copying ethereum_serpent.egg-info/SOURCES.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO copying ethereum_serpent.egg-info/dependency_links.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO copying ethereum_serpent.egg-info/entry_points.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO copying ethereum_serpent.egg-info/top_level.txt -> build/bdist.macosx-10.8-x86_64/egg/EGG-INFO writing build/bdist.macosx-10.8-x86_64/egg/EGG-INFO/native_libs.txt zip_safe flag not set; analyzing archive contents... creating dist creating 'dist/ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg' and adding 'build/bdist.macosx-10.8-x86_64/egg' to it removing 'build/bdist.macosx-10.8-x86_64/egg' (and everything under it) Processing ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg Copying ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg to /Users/heiko/venvs/default/lib/python2.7/site-packages Adding ethereum-serpent 1.6.2 to easy-install.pth file Installing serpent.py script to /Users/heiko/venvs/default/bin Installing serpent script to /Users/heiko/venvs/default/bin
Installed /Users/heiko/venvs/default/lib/python2.7/site-packages/ethereum_serpent-1.6.2-py2.7-macosx-10.8-x86_64.egg Processing dependencies for ethereum-serpent==1.6.2 Finished processing dependencies for ethereum-serpent==1.6.2 python setup.py install 10,57s user 1,39s system 94% cpu 12,607 total (default) ~/dev/ethereum/serpent (git)-[master] % serpent serpent
... — Reply to this email directly or view it on GitHub https://github.com/ethereum/serpent/issues/8#issuecomment-55176293.
yes on master. i did a new git clone
but it still ends with:
Finished processing dependencies for ethereum-serpent==1.6.2
i get 1.6.4 if i install via pip, but that's the version which i was using already, when i first encountered the issue.
pip show ethereum-serpent
---
Name: ethereum-serpent
Version: 1.6.4
Location: /Users/heiko/venvs/default/lib/python2.7/site-packages
Requires:
version on github is 1.6.2 https://github.com/ethereum/serpent/blob/master/setup.py#L16
Try latest version.
vub@shadowcow 18:04:35 ethereum/serpent: cat 1 a = array(3) return(a, 3)
vub@shadowcow 18:05:41 ethereum/serpent: serpent pretty_compile_chunk 1 [PUSH1, 0, PUSH1, 31, MSTORE8, PUSH1, 96, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 0, MSTORE, PUSH1, 96, PUSH1, 0, MLOAD, RETURN]
Note the pretty_compile_chunk method; added that in to compile without wrappers.
updated and the new option is available, but i still get a different output.
(default) ~/dev/ethereum/pyethereum (git)-[master] % cat a.se
a = array(3)
return(a, 3)
(default) ~/dev/ethereum/pyethereum (git)-[master] % serpent pretty_compile_chunk a.se
[PUSH1, 0, PUSH1, 31, MSTORE8, PUSH1, 96, MSIZE, SWAP1, MSIZE, ADD, PUSH1, 0, SWAP1, MSTORE, PUSH1, 32, MSTORE, PUSH1, 96, PUSH1, 32, MLOAD, RETURN]
(default) ~/dev/ethereum/serpent/build (git)-[master] % otool -L lib.macosx-10.8-x86_64-2.7/serpent_pyext.so
lib.macosx-10.8-x86_64-2.7/serpent_pyext.so:
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
it might be an OSX specific issue. Neither me nor the CI system could reproduce it on Linux. But for catux (thx!) this test also fails on OSX: http://0bin.net/paste/v2btwVJ+Muj3b8GD#X18MfuquiFSn+pq07RmJ1VeWyS9CQywRxU6-olBUy6b
linked libs from the other mac:
build/lib.macosx-10.9-x86_64-2.7/serpent_pyext.so:
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
I also get wrong results when an array is initialized from the return values of a "msg", i.e.:
contract A:
move = [4, 0, 16948]
call(debug, move, 3) # <- the data received is correct, so above array init worked
return(move, 3)
contract B:
msg(gas, A, value, data, datalen, 3)
> [0, 22799104, 314134472612349596776836902531781179115707815948032L]
this code:
returns
0
(unexpected)this code:
for some reason returns
1
(expected)