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

recent_history absorbing accumulation result r derived from ${\bf C}$ prematurely #77

Closed
arjanz opened this issue Feb 18, 2025 · 5 comments
Assignees

Comments

@arjanz
Copy link

arjanz commented Feb 18, 2025

When importing 1_004 of assurances we notice an inconsistency with the assurances 'current' statistics:

JAM Duna Data

[{'assurances': 1, 'blocks': 1, 'guarantees': 0, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 3}, {'assurances': 0, 'blocks': 0, 'guarantees': 1, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 0}, {'assurances': 0, 'blocks': 0, 'guarantees': 1, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 0}, {'assurances': 0, 'blocks': 0, 'guarantees': 1, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 0}, {'assurances': 0, 'blocks': 3, 'guarantees': 0, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 6}, {'assurances': 0, 'blocks': 1, 'guarantees': 0, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 3}]

[{PyJAMaz}] data

[{'assurances': 1, 'blocks': 1, 'guarantees': 0, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 3}, {'assurances': 1, 'blocks': 0, 'guarantees': 1, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 0}, {'assurances': 1, 'blocks': 0, 'guarantees': 1, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 0}, {'assurances': 1, 'blocks': 0, 'guarantees': 1, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 0}, {'assurances': 1, 'blocks': 3, 'guarantees': 0, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 6}, {'assurances': 1, 'blocks': 1, 'guarantees': 0, 'pre_images': 0, 'pre_images_size': 0, 'tickets': 3}]

We expect the current statistics for assurances to be updated for the validator index in each assurance extrinsic, according to GP 13.4, but it seems there is only one update for the author of the block.

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

sourabhniyogi commented Feb 18, 2025

Thank you, our fault -- See here for all 6 assurances going to "1" and then here for all going to "2" and then here for the epoch change. Let us know if this appears correct (or not!) --

@arjanz
Copy link
Author

arjanz commented Feb 19, 2025

Confirmed, the assurances statistics in 1_004 matches ours now.

However, our state trie root (0x15ce8da3...9ab911ac) still doesn't match the one in the trace file, we identified the following difference:

{'values_changed': {"root['recent_history']['recent_history'][4]['mmr']['peaks'][0]": {'pyjamaz': '0x0000000000000000000000000000000000000000000000000000000000000000', 'trace': '0x85c18c1d0fd636dd782a34e81ac2a24ba2bdd6c28d46f3646b260eadd424c99d'}}}

Not 100% sure, but could this be same H_0 issue we encountered before?

@sourabhniyogi sourabhniyogi reopened this Feb 19, 2025
@sourabhniyogi sourabhniyogi changed the title Inconsistent assurance statistics State trie root mismatch, recent_history peaks difference Feb 19, 2025
@sourabhniyogi
Copy link
Contributor

sourabhniyogi commented Feb 19, 2025 via email

@sourabhniyogi sourabhniyogi self-assigned this Feb 19, 2025
@sourabhniyogi
Copy link
Contributor

sourabhniyogi commented Feb 19, 2025

Ok after realizing that 0x85c18c1d0fd636dd782a34e81ac2a24ba2bdd6c28d46f3646b260eadd424c99d is the accumulation result $r$ from ${\bf C}$ (as described in GP Sec 7 here), we see that we prematurely used $r$ derived from ${\bf C}$ immediately after accumulation but GP Eq 4.7 shows that (like the state root inclusion ) we have to wait until the next state transition to use that value of $r$!

Image Image

Its not that the accumulate root $r$ (derived from ${\bf C}$) is0x0000..0000 -- instead its that after the very first accumulate in this assurances/state_transitions/1_004.json resulting in a non-0x0000...0000 $r$ will affect the NEXT state C3/Beta -- which will absorb this new non-0x0000..0000 value of $r$ (again, derived from ${\bf C}$ from the accumulation in the PREVIOUS state transition.

Thank you for pointing out the problem, we will provide a derivation for ${\bf C}$ and thus $r$ to cover this very tricky two-state footwork in the hopes that we can fully get on the same page.

Stay tuned!

@sourabhniyogi sourabhniyogi changed the title State trie root mismatch, recent_history peaks difference recent_history absorbing accumulation result r derived from ${\bf C}$ prematurely Feb 19, 2025
sourabhniyogi added a commit that referenced this issue Feb 20, 2025
Addresses:
* new traces with bootstrap service using modern non-hardcoded memory vals
* recent_history fix (premature use of accumulation root r) #77
* service metadata fix #79
@sourabhniyogi
Copy link
Contributor

We now have 0x0000...0000 in C3 here and believe it is necessary to add a new accumulation root parameter $r$ to StateTransition to concisely summarize ${\bf C}$

We are improving our fib/trib/megatron services to output actual 32-byte outputs so that this $r$ value actually changes.

But in the meantime you can check this!

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

2 participants