Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StateManager - storage and rlp encoding [breaking] #30

Closed
kumavis opened this issue Jan 6, 2016 · 2 comments
Closed

StateManager - storage and rlp encoding [breaking] #30

kumavis opened this issue Jan 6, 2016 · 2 comments

Comments

@kumavis
Copy link
Member

kumavis commented Jan 6, 2016

Background:

Raw storage values are RLP encoded when being put into the storageTree. This does not achieve anything as values can only be hex strings. It exists for historical reasons, and cannot be easily removed as if affects the stateRoot.

Motivation:

The StateManager has mostly been private, but as we solidify the api surface, more people would like to take advantage of its abstractions. Currently the necessary RLP encoding and decoding happens externally to the StateManager contractStorage api. When checking data in the state trie for debugging , tests, RPC implementations, its really easy to forget this strange antiquity.

Suggested Change:

Hide this complexity in the StateManager contractStorage api. This would be a breaking change.

Affected APIs:

stateManager.getContractStorage(address, key, cb)
stateManager.putContractStorage(address, key, value, cb)

current example:
stateManager.getContractStorage(address, key, function (err, value) {
  var loaded = rlp.decode(value)
  cb(err, loaded)
})
example after proposed change:
stateManager.getContractStorage(address, key, cb)
@kumavis
Copy link
Member Author

kumavis commented Jan 7, 2016

implementation here #31

@wanderer
Copy link
Member

been marged

holgerd77 added a commit to holgerd77/ethereumjs-vm that referenced this issue Nov 30, 2020
…-emit

Fix bug not let first ETH status message emit a message event
holgerd77 added a commit that referenced this issue Dec 1, 2020
Issue #17: Implemented eth_getBlockByNumber()
holgerd77 pushed a commit that referenced this issue Mar 11, 2021
Implement verifyPrivate for verifying a private key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants