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

Don't store RLPs in valueNodes (except tests). #170

Merged
merged 1 commit into from
Nov 15, 2019
Merged

Conversation

mandrigin
Copy link
Collaborator

fixes: #126

@@ -182,7 +182,8 @@ func TestSerialiseBlockWitness(t *testing.T) {
if err := bwb.WriteTo(&b); err != nil {
t.Errorf("Could not make block witness: %v", err)
}
expected := common.FromHex("0xa76862616c616e6365730065636f64657300666861736865731822646b65797300666e6f6e63657300697374727563747572650b6676616c75657300582023181a62d35fe01562158be610f84e047f99f5e74d896da21682d925964ece3a0601024704010402040304")

expected := common.FromHex("0xa76862616c616e6365730065636f64657300666861736865731822646b65797300666e6f6e63657300697374727563747572650b6676616c756573005820858f70a4b1e6aa71a7edc574d2ca946495a038aa37ce13dc7b7ed15661a6ff2f0601024704010402040304")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this value change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we no longer treat []byte("val1") and []byte("val2") in tr.Update(...) calls (lines 174-175) as RLP-encoded values, so we add a double prefix to them when hashing, so they produce different hash values.

} else if l < 56 {
buffer[pos] = byte(183 + 1)
pos++
buffer[pos] = byte(l + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is 183? Could you clarify it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will clarify in #171 if you don't mind :)

Next() (common.Hash, error)
}

// FIXME: comments here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want separate PR for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, will do in #171

@mandrigin mandrigin merged commit 50bb08d into master Nov 15, 2019
@mandrigin mandrigin deleted the issue-126-v2 branch February 4, 2020 11:13
battlmonstr pushed a commit that referenced this pull request Sep 14, 2023
* transition data

* Update tables.go
anshalshukla pushed a commit that referenced this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not to wrap values into RLP when storing the valueNode in the trie
3 participants