Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: storage value encoding in forked trie. #658

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

nebojsa94
Copy link
Contributor

@nebojsa94 nebojsa94 commented Nov 4, 2020

This PR resolves #625

It extends the ethereumjs-util rlp encoding by forcing the removal of any leading zeros.

@nebojsa94
Copy link
Contributor Author

Hey @davidmurdoch @seesemichaelj I took the liberty of implementing the fix myself, as it wasn't that big! Do let me know if any changes are needed.

@mikeseese
Copy link
Contributor

mikeseese commented Nov 8, 2020

Thanks for the PR!

I'll defer to @davidmurdoch on this one. @nebojsa94 any chance you could add a test that demonstrates it's broken before the fix and fixed after it?

@nebojsa94
Copy link
Contributor Author

Done @seesemichaelj,

@davidmurdoch let me know if any other changes need to be made

@BogdanHabic
Copy link

Hey @davidmurdoch, I wanted to check if we could help out in any way to push this forward? 😄

@davidmurdoch
Copy link
Member

@BogdanHabic Ah, sorry I dropped the ball on this! I'll review this today!

@davidmurdoch davidmurdoch changed the title Fix storage value encoding in forked trie. fix: storage value encoding in forked trie. Nov 20, 2020
@davidmurdoch davidmurdoch merged commit 2de990f into trufflesuite:develop Nov 20, 2020
@lgrapenthin
Copy link

I just wanted to say that I ran into a similar issue (reading back contract after write in same call not correct), and this patch fixed it.
Please cut a new release, it will prevent many debugging headaches :)

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect gas cost for SSTORE opcode when using fork feature
5 participants