Closed ithinker1991 closed 6 years ago
Yep, that was incorrect. Fixed by https://github.com/ethereum/ethereumj/commit/ec3ce8fccb75987f101096c61af137c4f5b17adb. Thank you for the report!
emmm...
32-bytes composed key should be [first 16-bytes of address hash:second 16-bytes of node key]
There seems a another BIG problem. I noticed in solidity, for dynamic type such as string
, bytes
first 16-bytes of node-key are same and second 16-bytes of node are different.
So if one field has been encoded to many storage-key. the composed key will be same.
For example s1 = "1111111111111111111111111111111111111112222222222222222222222222222222222222222333333333333333333333333333333333333";
encoded result:
key of storage node value of storage node
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000e7
290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563 3131313131313131313131313131313131313131313131313131313131313131
290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e564 3131313131313132323232323232323232323232323232323232323232323232
290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e565 3232323232323232323232323232323333333333333333333333333333333333
290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e566 3333333333333333333333333333333333333300000000000000000000000000
ethereumj-core/src/main/java/org/ethereum/datasource/NodeKeyCompositor.java This method
the output is not match the example