Comments (6)
can't reproduce the bug even without your modified code,
my test example maybe not be the exact case you reported.
So I delegate this issue to @vbuterin
Please modify features/trie.feature
on line: 144
to reflect it.
from pyethereum.
maybe 44264f5 already fixed the bug,
but anyway, I want the example to be presented in the feature file.
from pyethereum.
That is weird. The bug is showing very clearly for me:
u = trie.Trie('/tmp/random_sub_directory')
u.root = ''
u.update('\x03\xe8','1')
[' \x03\xe8', '1']
u.update('\x03\xe9','2')
['\x10>', ['', '', '', '', '', '', '', '', [' ', '1'], [' ', '2'], '',
'', '', '', '', '', '']]
u.update('\x01\xf4','')
['\x10', 'D\xb2\x9fo\x17\x13<\xac\x02v\xb6\x90ke\x813\x99\x88v
\x8e\x0e\xf8\xdfk\xdd\xe3\xf3\x04\xf0\xe4\xca']
from pyethereum.
>> u.update('\x01\xf4','')
This will store a empty string
to key \x01\xf4
,
the current trie tree can accept and store any thing that can be rlp encoded, so emtpy string, list are all valid.
If you run
>> u.delete('\x01\xf4')
The result will be different, which internally has a empty string
together with a value_is_node=True
parameter invoked with _update
.
from pyethereum.
Okay, thanks. Didn't realize you separated out update-to-empty and
delete. I think that solves the problem.
On 14-04-10 05:55 AM, chenhouwu wrote:
u.update('\x01\xf4','')
This will store a empty string to '\x01\xf4',
the current trie tree can accept and store any thing that can be rlp
encoded, so emtpy string, array are all valid.If you run
u.delete('\x01\xf4')
The result will be different, which internally has a |empty string|
together with a |value_is_node=True| parameter invoked with _update.—
Reply to this email directly or view it on GitHub
#57 (comment).
from pyethereum.
- fixed the to_dict bug,
- also modified the test code, so now trie test has 1/3 probability to have empty string as value.
3 remove the extra normalization code
all test passed.
from pyethereum.
Related Issues (20)
- pyethereum depends on some python3-only packages HOT 5
- indicate ValueError: No matching functions found when call function contained in abi json file
- ImportError: cannot import name 'ALL_BYTES' HOT 15
- E TypeError: decode_hex() takes 1 positional argument but 2 were given
- pip install ethereum failed HOT 5
- RuntimeError: Format missing, but need one (identified source as text as no file with that name was found). HOT 1
- Broken argument positions cause method to repeat almost infinitely HOT 1
- Question: How do i get the raw txid to broadcast to jsonRPC using "eth_sendRawTransaction" method
- bitcoin import conflicts with python-bitcoinlib HOT 1
- Installing pye on windows
- Create doc section for `Installation`
- pip install ethereum failed on Windows 10 HOT 4
- .
- test_blocks.py throwing many errors
- How to call a function in smart contract by using tester.py
- Cannot install via pipenv HOT 1
- The new opcodes introduced in Constantinople are not supported
- Gonzalez950
- Error on building wheel for pyethash HOT 3
- Technical papers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyethereum.