-
Notifications
You must be signed in to change notification settings - Fork 10
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
ServiceID generation incorrect, Incorrect Wrangling of Work Results, Demonstrate Option<Hash> in assurances/orderedaccumulation data #74
Comments
Also unable to match starting with assurances/1_004. My PVM executes it using the code hash and tracing it shows: PC:5 - Jump ( jump to PC 22) There is no output hash since reg7=0. What is the expected output @sourabhniyogi ? |
We are amidst modernizing the bootstrap/fib/trib/service built with polkatool (and then fib+trib+megatron) to ensure it conforms to wrangled tuples and |
Argh, we did not update our jump points 0/5/10/15 to 0/5/10 in 0.5.x. Thank you for the hint, we will do our fluffy difference check more thoroughly... |
Alright, thank you @sourabhniyogi. To move the needle forward would be nice to first be able to execute the bootstrap accumulate code in https://github.com/jam-duna/jamtestnet/blob/main/data/assurances/state_transitions/1_004.json with matching results. Please ping me when this is ready for another shot. Ty |
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
@jaymansfield We have updated with new I believe we'll have a first attempt to solve the |
Small progress after your update, looks like now we're able to run the bootstrap code blob contained in 0004 trace. This is a detailed execution trace for your reference, after each instruction there is some detail about the effect of the executed instruction.
|
We believe we have corrected our services in 0.6.2.3 release but are still working on:
|
@sourabhniyogi I tested again with your updated blob, but I'm still encountering unexpected behavior in all three hostcalls. Let's tackle the issues one at a time, beginning with the first one: new service creation. Rather than sharing the entire trace, I'll only provide the hostcall arguments I'm seeing in our hostcall handler:
The first thing I notice is that this appears to be an invalid code hash.
Let's start by tackling issues 1, 2, and 3 for this NEW service creation. Taking this step-by-step approach should make the debugging process more manageable—otherwise, this could turn into a lengthy process! 😄 |
Can confirm that I am also arriving at a new service ID of 272334947 and code hash of 0x10000000000000000100241f2acc37e37dc4f99c3fc50202c92d0c148c6e73ef. My balance is different though. |
Alright, thank you for taking the time to work with us on this. Its very clear to us that when you help one team you help like a dozen others, and we see that this step-by-step public derivation will help like two dozen others going through the process. ServiceID computationOur x_i computation of 0.6.2 (B.9)
Which part did we get wrong? Another team seems to have the same answer above here, we must have a conceptual bug above.. hostNewFor the inputs and memory read of the host
we appear to be off by 11 bytes somewhere
vs
We realized we are still getting our wrangling in order and hope we can explain this 11 byte shift soon -- thank you. Also:
Totally makes sense to work step by step -- but rather than republish a new bootstrap service without a write + transfer (which I totally agree makes reasoning harder), we'll just disable the effects of our "hostWrite()" and "hostTransfer()" host function implementation until we have consensus on "hostNew()" for getting the serviceid correct and the Again -- thank you for engaging with us! Having so many teams coming into spec alignment is a new kind of joy, relative to making things work as just one team. |
For the service ID generation here is my encode(s, eta_0', timeslot) value: The beginning differs from yours. You seem to have a "20" between service ID and eta_0'. |
Excellent -- since eta_0' is a Hash (see 6.21) and "this is omitted in case of fixed-length terms such as hashes" applies: ![]() Then by C.3 we should drop the 0x20. Then we arrive at the same answer:
Is that the correct reasoning? |
Addresses * fix of serviceid generation + Demonstrate Option<Hash> in assurances/orderedaccumulation data #74 as reported by @davxy - there was an extra 0x20 which should not have been there since 32-byte hashes are special, see #74 for derivation, confirmed by @jaymansfield + @davxy - added SetServiceStorage lines in { assurances.txt, orderedaccumulation.txt } * fix of Incorrect items/bytes for service #82 as reported by @jaymansfield - added a_i + a_o lines in { assurances.txt, orderedaccumulation.txt } for derivation * fix of state merklization for storage as reported by @dakk - previous was 0.4.x based (TODO: check tool https://github.com/dakk/jambiato0
…#87) Addresses * fix of serviceid generation + Demonstrate Option<Hash> in assurances/orderedaccumulation data #74 as reported by @davxy - there was an extra 0x20 which should not have been there since 32-byte hashes are special, see #74 for derivation, confirmed by @jaymansfield + @davxy - added SetServiceStorage lines in { assurances.txt, orderedaccumulation.txt } * fix of Incorrect items/bytes for service #82 as reported by @jaymansfield - added a_i + a_o lines in { assurances.txt, orderedaccumulation.txt } for derivation * fix of state merklization for storage as reported by @dakk - previous was 0.4.x based (TODO: check tool https://github.com/dakk/jambiato0
We believe we addressed the 2 major issues in 0.6.2.4:
Important: We have temporarily removed the "Transfer" operation in bootstrap service as per @davxy 's suggestion, which temporarily necessitates removing a FULL check in our host ![]() We believe a bootstrap operation should have a transfer operation at the end, but maybe for debugging team implementations having 3 host function calls (new, write, transfer) there is a better idea than re-enabling this. Can you suggest one and check if we have solved the Incorrect Wrangling of Work Results problem @davxy @jaymansfield
|
@sourabhniyogi It's definitely looking a lot better in this version. Two things:
In your post state: Service 0 has a balance of 9999999900. I believe this is incorrect since the balance for 272334947 is under it's threshold balance. When creating the new service you may need to set its balance after adding (c,l)↦ [] and not prior. My implementation ends up with: Service 0 has a balance of 9999998650.
I end up with a key of 0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c instead of 0xffffffff00000000000000000000000000000000000000000000000000000000. |
Hmm. With GP Eq 9.8 ![]() computed from
being used for ![]() we believe there are TWO possible values for 272334947
and its unclear which one is the correct one for the new service. Generally, we'd like to be able to do this: This seems to be a case of ambiguity, but probably we missed something -- What did we miss? But for service 0, we do not have any ambiguity:
thus s_b > (x_s)_t and we do not have an underflow CASH error in case 1: s_b = 10000000000 - 100 = 9999999900
See #86
Here's a log of a large number of other traces https://github.com/jam-duna/jamtestnet/blob/main/assurances.txt#L9 |
So now looks like you removed all the hostcalls? If yes, maybe you need to at least call the "new" to check that I receive the correct args in the hostcall. Your bootstrap sources now doesn't compile to the blob in accumulate right? |
@sourabhniyogi I was referring to the storage key that is created in the write host call and not the state key for storage. ![]() E4(s)⌢ µko ⋅⋅⋅+kz H(E4(s)⌢ µko ⋅⋅⋅+kz ) |
When I first ran the latest version I had a similar issue where I ended up in halt with no host calls executed. But I noticed an issue with one of my pvm instructions and after correctly it, the "new" and "write" host calls were performed again. |
What issue? We're using @koute pvm Would be very helpful to have a trace from the program start to the point where "new" host call is performed (a pastebin somewhere is fine, just to not bloat too much this discussion). |
Here is a trace from mine of the whole program. First host call is PC 647. Ignore the gas values shown I think I had it hardcoded to 500 to start to debug something and forgot to switch it back. |
Alright, from the disassembled blob I can see the HF calls, but we never reach them during execution because of 2 independent problems:
From what I can can tell instruction at 636 tries to load in jamtestnet/services/jam-duna/bootstrap/src/main.rs Lines 147 to 148 in f5b2a03
Where apparently the @jaymansfield I see from your execution trace that you just continue, probably loading incorrect stuff from 0xfffffffc? Isn't access from that address supposed to trigger a trap? |
I think this is why I hardcoded the gas limit previously when testing this.
My instruction 636 loads from memory location 4278124587 which exists. Reg 6=4278124591 and immediate=-4 and I end up with a matching code length same as the vector. |
Creating new issue #90 and closing this one, we will take 48 hours to resolve this trap/gas issue, the storage key issue (our side), general gas computation (our issue) and |
We're not able to successfully execute the vector data/assurances/state_transitions/1_004.bin.
In particular the failure is due to an unexpected PVM execution result for code of service 0.
Looks like you expect this service code to write something somewhere, but as far as I can see the service accumulate exits almost immediately.
Have you built this pvm blob using the last pvm crates releases?
I ask because I see that :
Service
trait defined byjam-pvm-common
crate (e.g. now accumulate is defined to return anOption<Hash>
.Service
trait definition. E.g. now accumulate returns anOption<Hash>
Using https://pvm.fluffylabs.dev I'm able to load
bootstrap.pvm
from this folder here: https://github.com/jam-duna/jamtestnet/tree/main/services/jam-duna/bootstrap. (but I'm not able to loadbootsrap_blob.pvm
. What is the difference between these two?)The fluffylabs debugger shows that indeed the program exits immediately.
I don't know what's the issue exactly, so may be worth investigate together.
The text was updated successfully, but these errors were encountered: