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

fix addr alignment in witness #366

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

jsign
Copy link
Collaborator

@jsign jsign commented Feb 7, 2024

This PR fixes a problem in EXTCODESIZE when the slot value had a value <20 bytes.

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@@ -244,7 +244,7 @@ type branchAccessKey struct {

func newBranchAccessKey(addr []byte, treeIndex uint256.Int) branchAccessKey {
var sk branchAccessKey
copy(sk.addr[:], addr)
copy(sk.addr[20-len(addr):], addr)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If len(addr)<20 this was doing the copy incorrectly.

Another option for this particular bug case is not doing this code line change, and do:
image

But I think this proposed change is more general, and if we have a similar situation in other place the current fix would cover it.

Open to opinions though.

@jsign jsign requested a review from gballet February 7, 2024 13:48
@gballet gballet added this to the verkle-gen-devnet-5 milestone Feb 7, 2024
@jsign jsign changed the title fix addr alignement fix addr alignment Feb 7, 2024
Copy link

@g11tech g11tech 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 changed the title fix addr alignment fix addr alignment in witness Feb 7, 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.

I have overthought it way too much, LGTM. Let's not merge it until we are ready to relaunch the testnet.

@gballet gballet merged commit a2cce69 into kaustinen-with-shapella Feb 15, 2024
2 of 3 checks passed
gballet pushed a commit that referenced this pull request May 7, 2024
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
gballet pushed a commit that referenced this pull request May 8, 2024
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
gballet pushed a commit that referenced this pull request May 8, 2024
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
gballet pushed a commit that referenced this pull request May 8, 2024
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
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.

None yet

3 participants