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

tx context #20000

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

tx context #20000

wants to merge 2 commits into from

Conversation

dariorussi
Copy link
Contributor

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 1:17pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 1:17pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 1:17pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 1:17pm

@aschran
Copy link
Contributor

aschran commented Oct 24, 2024

20000!!!

@dariorussi
Copy link
Contributor Author

20000!!!

and it's mine!!!

@@ -257,7 +257,7 @@ mod checked {
metrics,
move_vm,
&mut temporary_store,
tx_context,
tx_context.clone(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to change this API to have a TXContext and not a &mut requires a change in the executor API (so all version) and I am wondering whether we should do it or just let it go.
Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need an API change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this API used to take a &mut TxContext (boundary between core and execution) though here we take the TxContext by value. So we clone the mutable reference in order to pass it by value, which is kind of lame as we could have passed the context by value in the first place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though there may be issues the way the code is changed now, looking into it and we'll talk more

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a fix for what I think was an oversight on my part. Take a look at the 2 commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it turns out the "fix" I put breaks a genesis test exactly because it's updating the context in what seems an incompatible way.
Now I am really confused

gas_charger,
advance_epoch_pt,
);
tx_ctx.add_ids_created(temporary_store.objects_created_count() as u64);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could do this operation according to the result but I figured this is the simplest way to do it and it should be safe, thought?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me

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

Successfully merging this pull request may close these issues.

3 participants