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

assurances data: Wrong state merklization for storage (assurances, block 1_004) #86

Closed
dakk opened this issue Feb 21, 2025 · 8 comments
Closed
Assignees

Comments

@dakk
Copy link

dakk commented Feb 21, 2025

Account storage for service 0 is encoded as "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250", while the formula is the following:

Image

So, in theory, since 2**32-1 is 0xffffff and service id is 0x000000, the first bytes should to be 0x00ff00ff00ff00ff.

@sourabhniyogi
Copy link
Contributor

Will post a derivation after a new update!

@sourabhniyogi
Copy link
Contributor

We agree with your derivation, we still had some 0.4.x code around... will update!

ComputeC_sh(s=0, h=0xffffffff00000000000000000000000000000000000000000000000000000000)=00ff00ff00ff00ff000000000000000000000000000000000000000000000000

@dakk
Copy link
Author

dakk commented Feb 21, 2025

We agree with your derivation, we still had some 0.4.x code around... will update!

ComputeC_sh(s=0, h=0xffffffff00000000000000000000000000000000000000000000000000000000)=00ff00ff00ff00ff000000000000000000000000000000000000000000000000

I suspected it (y) You may find my tool jambiato useful in those situation; you can tag GP version/formula on your code, and check if there's something outdated: https://github.com/dakk/jambiato

@sourabhniyogi
Copy link
Contributor

fixed in 0.6.2.4

@dakk
Copy link
Author

dakk commented Feb 22, 2025

This is still wrong in my opinion; this would be correct if "k" is a zero hash

Image

@sourabhniyogi
Copy link
Contributor

sourabhniyogi commented Feb 22, 2025

We have k as 00000000 here and padded to a zero hash.

SetServiceStorage(s=0, k=00000000, v=63803b10) C(s, concat(0xFFFFFFFF,k[0:28])=0xffffffff00000000000000000000000000000000000000000000000000000000)=00ff00ff00ff00ff000000000000000000000000000000000000000000000000

but I see we missed this hash so you are right..

@sourabhniyogi sourabhniyogi reopened this Feb 22, 2025
@jaymansfield
Copy link

We have k as 00000000 here and padded to a zero hash.

SetServiceStorage(s=0, k=00000000, v=63803b10) C(s, concat(0xFFFFFFFF,k[0:28])=0xffffffff00000000000000000000000000000000000000000000000000000000)=00ff00ff00ff00ff000000000000000000000000000000000000000000000000

but I see we missed this hash so you are right..

I get a different value for k see #74 (comment)

@sourabhniyogi sourabhniyogi changed the title Wrong state merklization for storage (assurances, block 1_004) assurances data: Wrong state merklization for storage (assurances, block 1_004) Feb 22, 2025
@sourabhniyogi sourabhniyogi self-assigned this Feb 22, 2025
@sourabhniyogi
Copy link
Contributor

I get a different value for k see #74 (comment)

We are in agreement --
https://github.com/jam-duna/jamtestnet/blob/main/data/assurances/state_transitions/1_004.json#L206-L207

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

No branches or pull requests

3 participants