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

remove TxContext from the executor API #20000

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

remove TxContext from the executor API #20000

wants to merge 1 commit into from

Conversation

dariorussi
Copy link
Contributor

@dariorussi dariorussi commented Oct 23, 2024

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):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

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 Jan 22, 2025 0:00am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2025 0:00am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2025 0:00am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2025 0:00am

@aschran
Copy link
Contributor

aschran commented Oct 24, 2024

20000!!!

@dariorussi
Copy link
Contributor Author

20000!!!

and it's mine!!!

@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 2, 2025 21:50 — with GitHub Actions Inactive
@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 2, 2025 21:55 — with GitHub Actions Inactive
@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 2, 2025 22:57 — with GitHub Actions Inactive
@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 4, 2025 18:22 — with GitHub Actions Inactive
@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 4, 2025 19:53 — with GitHub Actions Inactive
@dariorussi dariorussi changed the title tx context remove TxContext from the executor API Jan 15, 2025
@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 16, 2025 15:46 — with GitHub Actions Inactive
@dariorussi dariorussi temporarily deployed to sui-typescript-aws-kms-test-env January 20, 2025 20:00 — with GitHub Actions Inactive
Comment on lines 882 to 891
tx_ctx.clone(),
gas_charger,
advance_epoch_pt,
);
// advance epoch has a non standard behavior in that it can run multiple `execute` functions
// with the same `TxContext`. This call updates the `TxContext` to reflect the new objects created.
// `objects_created_count` may contain the number of packages published as well and in that sense
// it is not a true count of objects created. However even with that we are growing the `ids_created`
// and we avoid conflicts anyway even if the range of values is not contiguous (has gaps).
tx_ctx.add_ids_created(temporary_store.objects_created_count() as u64);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fairly error prone to remember to update the ids created from the "older" instance of a context. If we're not careful we'll generate multiple object ids which are identical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, agree! and this is what the behavior as it has always been. This is just to make it more obvious.
If you have an idea of how to change all of that please let us know. I could not find a good, simple way to do it without reworking the entire space which, at the moment, feels outside the scope of this work.
Also please notice this is all inside execution, so from a "client" perspective no one sees this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

having said all of that I'll review the usage of TxContext and see is there is another way to plug that in cleanly

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.

4 participants