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

trie/verkle: change tree key generation #401

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

jsign
Copy link
Collaborator

@jsign jsign commented Mar 6, 2024

This PR changes how we transform a point to bytes to be used as a tree key.

Note: still in draft since it's waiting for a small PR merge in go-verkle, but it's ready for review.
Note: we should merge this PR as soon as the target branch is ready for the new testnet.

go.mod Show resolved Hide resolved
// The output of Byte() is big engian for banderwagon. This
// introduces an imbalance in the tree, because hashes are
// elements of a 253-bit field. This means more than half the
// tree would be empty. To avoid this problem, use a little
// endian commitment and chop the MSB.
retb := evaluated.Bytes()
for i := 0; i < 16; i++ {
retb[31-i], retb[i] = retb[i], retb[31-i]
}
retb := verkle.HashPointToBytes(evaluated)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For more info: ethereum/go-verkle#428

@jsign jsign marked this pull request as ready for review March 6, 2024 11:59
@jsign jsign requested a review from gballet March 6, 2024 11:59
@jsign jsign marked this pull request as draft March 6, 2024 12:00
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
@jsign jsign marked this pull request as ready for review March 6, 2024 13:37
@gballet gballet added this to the verkle-gen-devnet-5 milestone Mar 6, 2024
Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

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

LGTM

@gballet gballet merged commit 43be114 into kaustinen-with-shapella Mar 26, 2024
2 of 3 checks passed
gballet pushed a commit that referenced this pull request May 7, 2024
* trie/verkle: change tree key generation

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix tests

Signed-off-by: Ignacio Hagopian <[email protected]>

* update go-verkle

Signed-off-by: Ignacio Hagopian <[email protected]>

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
gballet pushed a commit that referenced this pull request May 8, 2024
* trie/verkle: change tree key generation

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix tests

Signed-off-by: Ignacio Hagopian <[email protected]>

* update go-verkle

Signed-off-by: Ignacio Hagopian <[email protected]>

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
gballet pushed a commit that referenced this pull request May 8, 2024
* trie/verkle: change tree key generation

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix tests

Signed-off-by: Ignacio Hagopian <[email protected]>

* update go-verkle

Signed-off-by: Ignacio Hagopian <[email protected]>

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
gballet added a commit that referenced this pull request Dec 5, 2024
This imports the following fixes:

 - update gnark to 1.1.0
 - update go-verkle to 0.2.2
 - fix: main storage offset bug (#329)
 - fix: tree key generation (#401)

co-authored-by: Ignacio Hagopian <[email protected]>
gballet added a commit to ethereum/go-ethereum that referenced this pull request Dec 6, 2024
…n7 (#30856)

This imports the following fixes:

 - update gnark to 1.1.0
 - update go-verkle to 0.2.2
 - fix: main storage offset bug (gballet#329)
 - fix: tree key generation (gballet#401)

---------

Signed-off-by: Guillaume Ballet <[email protected]>
Co-authored-by: Ignacio Hagopian <[email protected]>
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.

3 participants