-
Notifications
You must be signed in to change notification settings - Fork 62
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
bug: ant register edit / ant register get not working #2751
Comments
I implemented a markwylde@Marks-MacBook-Pro autonomi % ./target/release/ant register history --name markwylde3
🔗 Connected to the Network Getting register history with name: markwylde3
✅ Register history found at: markwylde3
History of values:
[hello]
[&��AF�5��C����^t��������53��D]
markwylde@Marks-MacBook-Pro autonomi % ./target/release/ant register get --name markwylde3
🔗 Connected to the Network Getting register with name: markwylde3
✅ Register found at: markwylde3
With value: [hello] So I think this shows that |
Hi @markwylde, thanks for your contributions! Although I did not manage to reproduce your issue on a local testnet, I did manage to reproduce it in production. After some digging I've confirmed the underlying Registers keep track of their latest versions through a The register I had the issue with was healed after some time and some retries: you can fetch it here to try: Did you retry after a while? You might encounter the corrupt head pointer error, which is okay as it is the case, but retrying should fix it, and time should make the fix visible (need time for pointer update to replicate). We are working on improving Pointer update speed, which hopefully will reduce the chance of having issues like the above down the line. I understand that until then, depending on network conditions, it results in a poor register experience, we will do our best to improve that over time and greatly appreciate your input! Closing this one for now, but feel free to re-open it if your issue persists even after retries and time (replication). If so, please include your register address so we can dig more into it (you can get the address with |
Thanks for investigating @grumbach and for the great explanation. It's strange, because I did
Sorry that one from a few days ago is a little unclear. I've made a new one an hour ago
It's still showing the first value. I'll try it again tonight to see if it eventually updates. I do think you're right as if I try and update it a
How long would you expect it to take to sync? Could it be longer than a day? |
@grumbach I think this issue should remain open until pointers update within say <1s and the behaviour should be noted in Pointer and Register docs as it is a serious bug/litation. Nice catch @markwylde. I haven't noticed this on local, and have not used the live network yet. It's similar to problems we had with the old Register imp going back many months. |
Thanks both! I just tried again, and it's still not synced (7 hours later) > markwylde in autonomi % ./target/release/ant register list
Retrieving local user data...
✅ You have 3 register(s):
markwylde5: 8266f4664e49b4f0d59e952ea7be0618fa8170b8122e7ba4488cb6841c446fbdc02414a1e5bffda063cd867b136bcd78
markwylde4: a84d4ee56bef626faaab864244c04d09919aa7fff5fd1183b49b14437acd334702b86c81b8cefdcff06b1af6a81a8c4e
markwylde3: 9260f5777b4c2ad1d127930ff195babfc0ac85f00d048b43453cfe412b9c1dd66d78bb55e87ea4330aea6464990bbad1
-------------------------------------------------------------
> markwylde in autonomi % ./target/release/ant register get --name markwylde5
🔗 Connected to the Network Getting register with name: markwylde5
✅ Register found at: markwylde5
With value: [first]
-------------------------------------------------------------
> markwylde in autonomi % ./target/release/ant register get 8266f4664e49b4f0d59e952ea7be0618fa8170b8122e7ba4488cb6841c446fbdc02414a1e5bffda063cd867b136bcd78
🔗 Connected to the Network Getting register at address: 8266f4664e49b4f0d59e952ea7be0618fa8170b8122e7ba4488cb6841c446fbdc02414a1e5bffda063cd867b136bcd78
✅ Register found at: 8266f4664e49b4f0d59e952ea7be0618fa8170b8122e7ba4488cb6841c446fbdc02414a1e5bffda063cd867b136bcd78
With value: [first]
-------------------------------------------------------------
> markwylde in autonomi % ./target/release/ant register edit --name markwylde5 third
🔗 Connected to the Network Enter password to decrypt wallet:
Attempting to update register at markwylde5 with new value: third
Error:
0: Failed to update register at address: markwylde5
1: Corrupt register: Pointer is apparently not at head, attempting to heal the register by updating it to point to the next entry at GraphEntryAddress(25a6d3), please retry the operation
Location:
ant-cli/src/commands/register.rs:140
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
-------------------------------------------------------------
> markwylde in autonomi % |
As a follow up: I think we can assume there will always be a delay or the possibility of a delay, and for different gets of a pointer to return different values. I saw this with the earlier register implementation and think it is just a property of not trying for true concensus. So I propose:
I think that should be good enough and will be implementing this for my |
I just tried again, been a day and a half, but still not synced. > markwylde in autonomi % ./target/release/ant register edit --name markwylde5 third
🔗 Connected to the Network Enter password to decrypt wallet:
Attempting to update register at markwylde5 with new value: third
Error:
0: Failed to update register at address: markwylde5
1: Corrupt register: Pointer is apparently not at head, attempting to heal the register by updating it to point to the next entry at GraphEntryAddress(25a6d3), please retry the operation
Location:
ant-cli/src/commands/register.rs:140
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
-------------------------------------------------------------
> markwylde in autonomi % ./target/release/ant register get --name markwylde5
🔗 Connected to the Network Getting register with name: markwylde5
✅ Register found at: markwylde5
With value: [first]
-------------------------------------------------------------
> markwylde in autonomi % ./target/release/ant register history --name markwylde5
🔗 Connected to the Network Getting register history with name: markwylde5
✅ Register history found at: markwylde5
History of values:
[first]
[second]
@grumbach would you please reopen this issue, if that's okay? |
Thanks guys! Reopened the issue as indeed a "day and a half" is not a reasonable wait time to get a Pointer updated! Will keep digging! I've got an attempt here to improve |
Thanks @grumbach This is looking much better. Create a register
Get the register value
Update the register value
Confirm the register value is updated
Edit a third time
Get history
Get latest value
The timings are quite slow: ant register get: 19.142s ant register edit: 100.59s ant register edit: 69.64s ant register get: 22.782s |
@markwylde I've implemented the above for That takes more than 20s which is too long. So I've:
On the last point, it means you can for example keep track of the most recent BTW Mark, I have pushed this to github but not yet to crates.io. I want to update the README before doing that. I have also realised it would be possible to allow @grumbach any faster than ~20s ways my code could discover that a |
@markwylde glad this helped fix the issue! Performance is still not ideal indeed! |
FYI |
I'm trying to use registers to maintain a mutable reference to my game files, but I'm encountering some unexpected behavior with register updates.
I've raised this on the forums too:
https://forum.autonomi.community/t/understanding-registers/41208/1
What I'm trying to do
Create a register that can point to different versions of my game file, allowing me to update which version players should download.
Steps to reproduce
ant register get --name autonomi-blocks-game # Shows value: [testing]
ant register get --name autonomi-blocks-game # Still shows original value: [testing]
Expected behavior
After updating the register, reading it should show the new value ("edit-test").
Actual behavior
The register appears to retain its original value ("testing") even after a seemingly successful update operation.
Additional context
The CLI reports success on the update operation and even shows a transaction cost, but the change doesn't seem to persist.
Questions
Is this expected? Am I missing something in how registers should be updated, or is this possibly a bug in how updates are being processed?
The text was updated successfully, but these errors were encountered: