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

[fastx adapter] We do not update the previous_transaction of mutable objects #312

Closed
gdanezis opened this issue Jan 30, 2022 · 9 comments · Fixed by #3783
Closed

[fastx adapter] We do not update the previous_transaction of mutable objects #312

gdanezis opened this issue Jan 30, 2022 · 9 comments · Fixed by #3783
Assignees
Labels
sui-node Type: Bug Something isn't working

Comments

@gdanezis
Copy link
Collaborator

Each object has a previous_transaction field which needs to contain the transaction digest that created or mutated the object last. However, right now we seem to not do that in the adapter, and have objects around with inconsistent state (new contents, old previous_transaction).

In PR #311 I added a hack to the temp_storage to add this information on object write. However this is fragile since we may use this information elsewhere (right now I do not think we do).

What about the type checking logic that provides the mutable objects to the execution, ensuring the tx_digest in previous_transaction is correct, somewhere around here?
https://github.com/MystenLabs/fastnft/blob/e856db7503c5c0218f65bde07e34c068abf9f2de/fastx_programmability/adapter/src/adapter.rs#L562

@gdanezis
Copy link
Collaborator Author

@oxade Is this now being taken care of?

@oxade
Copy link
Contributor

oxade commented Mar 30, 2022

@oxade Is this now being taken care of?

@gdanezis I will revisit this today and finalize the PR

@bholc646 bholc646 removed this from the GDC milestone Apr 6, 2022
@gdanezis
Copy link
Collaborator Author

@oxade any news :)

@oxade
Copy link
Contributor

oxade commented Apr 14, 2022

@oxade any news :)

I was not happy with the initial impl here #587 since its messy
I'm trying to do the enforcement in one central place but the risk is that we may have objects in inconsistent states in the adapter/authority. Working on a cleaner soln for this

@gdanezis gdanezis added this to the DevNet milestone Apr 19, 2022
@todd-mystenlabs todd-mystenlabs modified the milestones: DevNet, Pre Testnet Apr 21, 2022
@oxade oxade removed their assignment May 23, 2022
@lxfind lxfind removed this from the [A] Private Testing milestone Jun 29, 2022
@lxfind lxfind self-assigned this Aug 5, 2022
@lxfind lxfind added this to the [A] Internal Testing milestone Aug 5, 2022
@lxfind
Copy link
Contributor

lxfind commented Aug 5, 2022

It turns out that we are not updating previous_transaction properly in some paths.
Basically, relying on doing so in write_object is a bit fragile. We need to find a more robust way.

@oxade
Copy link
Contributor

oxade commented Aug 5, 2022

It turns out that we are not updating previous_transaction properly in some paths. Basically, relying on doing so in write_object is a bit fragile. We need to find a more robust way.

Can you pinpoint exactly what the holes are?
And can you see if this original impl I had covered all the edge cases? Granted it can be refined.

@lxfind
Copy link
Contributor

lxfind commented Aug 5, 2022

It turns out that we are not updating previous_transaction properly in some paths. Basically, relying on doing so in write_object is a bit fragile. We need to find a more robust way.

Can you pinpoint exactly what the holes are? And can you see if this original impl I had covered all the edge cases? Granted it can be refined.

In fact, it would have! What we are missing in this case is the code in ensure_active_inputs_mutated. I don't know if there are other new cases though.

@oxade
Copy link
Contributor

oxade commented Aug 5, 2022

It turns out that we are not updating previous_transaction properly in some paths. Basically, relying on doing so in write_object is a bit fragile. We need to find a more robust way.

Can you pinpoint exactly what the holes are? And can you see if this original impl I had covered all the edge cases? Granted it can be refined.

In fact, it would have! What we are missing in this case is the code in ensure_active_inputs_mutated. I don't know if there are other new cases though.

Great. Should I revive the core logic in the PR or do you wanna take this up?

@lxfind
Copy link
Contributor

lxfind commented Aug 5, 2022

I will probably take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sui-node Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants