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

Incorrect service_account storage_key #76

Closed
emielsebastiaan opened this issue Feb 17, 2025 · 3 comments
Closed

Incorrect service_account storage_key #76

emielsebastiaan opened this issue Feb 17, 2025 · 3 comments

Comments

@emielsebastiaan
Copy link

Incorrect ServiceAccount StorageKey

We found an inconsistency between our [{PyJAMaz}] implementation and the JAM-Duna implementation in the test data for the Assurances mode.
Reference:

"0xffa64892e8000000000000000000000000000000000000000000000000000000",

Analysis

Our implementation cannot retrieve a service_account_id for service 3901900966 where we expect to find it in the state K/V-database.
It seems that the state key of JAM-Duna data is not conform the Graypaper specification in equation D.1. (https://graypaper.fluffylabs.dev/#/5f542d7/38f00038fb00)

Difference

JAM Duna Data

0xffa64892e8000000000000000000000000000000000000000000000000000000

[{PyJAMaz}] Data

0xffa60048009200e8000000000000000000000000000000000000000000000000
@danicuki
Copy link
Contributor

The service with id 3901900966 seems to be introduced in block 0004 (migration to state 0005), but I don't see how it gets into the state. I am trying to pass block 0004 in my tests and this is one of the inconsistencies.

@sourabhniyogi
Copy link
Contributor

We will publish a new dataset with a hopefully 0.5/0.6 GP compliance bootstrap/fib/... service to address #74 and provide a derivation of the service id and new service key. Stay tuned!

sourabhniyogi added a commit that referenced this issue Feb 18, 2025
Addresses:
* #77 in full - proper assurances statistics
* #76 in full - see GP 0.6.2 C(255,s)  https://graypaper.fluffylabs.dev/#/5f542d7/38f00038f000
* #74 in part - updated entrypoints 

WIP:
* full authorizer pool/queue treatment including genesis
* full Option<Hash> treatment of #74
@sourabhniyogi
Copy link
Contributor

The derivation we published on this commit:

s = 0
eta_0 = 592170100ab4055c92a269faf579e29e7e453d13549c0dc4f0120fc670ff357d
timeslot = 16
encode(s, eta_0, timeslot)_ = 0000000020592170100ab4055c92a269faf579e29e7e453d13549c0dc4f0120fc670ff357d10000000
hash(encoded) = a64792e833b594bab9bd59fabb3415502ea07256a3744896bf44847ee899efc4
hashed[:4] = a64792e8
decode(hashed[:4]) = 3901900710
decoded mod 4294966784 + 256= 3901900966

We agree on the 3901900966 (hex a64792e8), great!

Then with GP 0.6.2 C(255,s)

C(255, s=3901900966 (hex=e89248a6))=0xffa60048009200e8000000000000000000000000000000000000000000000000

It changed in GP 0.4.5 to include 0s in between, which escaped both of us it appears, I think you can confirm this

Image

(We are doing a thorough review of 0.5.x + 0.6.x now that fluffy has pretty good annotations, but 0.4.x changes we might have to grind through them together... hope its not too annoying)

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