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

indexer: affected objects include created+wrapped/unwrapped+deleted #19618

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

amnn
Copy link
Member

@amnn amnn commented Sep 30, 2024

Description

Broaden the definition of "affected object" to include objects that a transaction creates and then immediately wraps, or objects that it unwraps and then immediately deletes. This ensures that a transaction will show up in the response to an affectedObject query if and only if the Object's ID shows up in its objectChanges response.

Test plan

Updated GraphQL E2E test:

sui$ cargo nextest run -p sui-graphql-e2e-tests \
  --features staging -- affected_object

Stack


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: A transaction's "affected objects" include objects that it created and wrapped, or unwrapped.
  • JSON-RPC: A transaction's "affected objects" include objects that it created and wrapped, or unwrapped.
  • GraphQL: A transaction's "affected objects" include objects that it created and wrapped, or unwrapped.
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Sep 30, 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 Sep 30, 2024 5:12pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Sep 30, 2024 5:12pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Sep 30, 2024 5:12pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Sep 30, 2024 5:12pm

@amnn
Copy link
Member Author

amnn commented Sep 30, 2024

This PR ideally needs to be landed today so that it makes it into the next devnet cut and can be picked into 1.34 so that we don't need to wait another release to start backfilling mainnet, cc @ebmifa

@amnn
Copy link
Member Author

amnn commented Sep 30, 2024

#19620 <- pick to 1.34

## Description

This PR removes EventFilters from JSON-RPC that aren't supported
already by fullnode-backed JSON-RPC:

- Combination filters (`All`, `Any`, `Not`, `And`, `Or`)
- `Package`
- `EventField`

These filters were, however, supported by the now-deprecated
subscription system, so a question remains whether they are safe to
remove.

## Test plan

Manually tested, in particular `All: []` support, which we do still need
to keep as a way to get all filters (this was also added to the
`IndexerReader` implementation):

```
sui$ cargo run --bin sui -- --force-regenesis \
  --with-indexer --with-faucet
```

...run for some time, so that some system events accumulate, then test
that we get them from both the fullnode-backed JSONRPC and
indexer-backed:

Fullnode:
```
curl -LX POST  "http://localhost:9000" \
        --header 'Content-Type: application/json' \
        --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_queryEvents",
  "params": [
    {
      "All": []
    },
    null,
    50,
    true
  ]
}' | jq .
```

Indexer:
```
curl -LX POST  "http://localhost:9124" \
        --header 'Content-Type: application/json' \
        --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_queryEvents",
  "params": [
    {
      "All": []
    },
    null,
    50,
    true
  ]
}' | jq .
```
## Description

Broaden the definition of "affected object" to include objects that a
transaction creates and then immediately wraps, or objects that it
unwraps and then immediately deletes. This ensures that a transaction
will show up in the response to an `affectedObject` query if and only if
the Object's ID shows up in its `objectChanges` response.

## Test plan

Updated GraphQL E2E test:

```
sui$ cargo nextest run -p sui-graphql-e2e-tests \
  --features staging -- affected_object
```
@amnn amnn force-pushed the amnn/idx-rm-complex-ev-filters branch from 3524514 to 800fe53 Compare September 30, 2024 17:09
@amnn amnn force-pushed the amnn/idx-obj-changes-affected branch from e806823 to e5229c0 Compare September 30, 2024 17:09
Base automatically changed from amnn/idx-rm-complex-ev-filters to main September 30, 2024 18:02
@amnn amnn merged commit f30dfc9 into main Sep 30, 2024
46 of 47 checks passed
@amnn amnn deleted the amnn/idx-obj-changes-affected branch September 30, 2024 18:50
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