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

feat(indexer): index tx_affected_objects #19447

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Sep 19, 2024

Description

Similar to #19355, introduce tx_affected_objects table -- a combination of tx_input_objects and tx_changed_objects which will both eventually be removed in favour of the new table.

Test plan

sui$ cargo build -p sui-indexer

Tests based on reading this field will be included with the PR introducing changes to GraphQL.


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: Index the objects affected by a transaction (either because they are an input object or are changed by the transaction).
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

## Description

Similar to #19355, introduce `tx_affected_objects` table -- a
combination of `tx_input_objects` and `tx_changed_objects` which will
both eventually be removed in favour of the new table.

## Test plan

```
sui$ cargo build -p sui-indexer
```

Tests based on reading this field will be included with the PR
introducing changes to GraphQL.
@amnn amnn self-assigned this Sep 19, 2024
Copy link

vercel bot commented Sep 19, 2024

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Sep 19, 2024 0:53am
sui-kiosk ⬜️ Ignored (Inspect) Sep 19, 2024 0:53am
sui-typescript-docs ⬜️ Ignored (Inspect) Sep 19, 2024 0:53am

@amnn
Copy link
Contributor Author

amnn commented Sep 19, 2024

There was a choice with this PR to incorporate received objects in tx_affected_objects. I chose not to do this because if an object is to be received by a transaction, and it is actually received, then it will show up in changed_objects, and otherwise it will be considered "not affected" by the transaction, which seems right to me, but let me know if you disagree.

We may want to add a separate index for objects-to-be-received by a transaction, later (that's tracked in a separate issue already).

Comment on lines +30 to +31
pub affected: Vec<u8>,
pub sender: Vec<u8>,
Copy link
Contributor

Choose a reason for hiding this comment

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

At some point we should look into how to avoid needing to allocate for these...not a comment on this PR though

@amnn amnn merged commit f9698a6 into main Sep 19, 2024
47 of 48 checks passed
@amnn amnn deleted the amnn/tx-affected-obj-idx branch September 19, 2024 13:54
amnn added a commit that referenced this pull request Sep 19, 2024
## Description

Prune `tx_affected_objects` (added in #19447) along with other
transaction index tables.

## Test plan

TBD.
amnn added a commit that referenced this pull request Sep 19, 2024
## Description

Prune `tx_affected_objects` (added in #19447) along with other
transaction index tables.

## Test plan

TBD.
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.

2 participants