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

graphql: unstage affected_addresses #19708

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

amnn
Copy link
Member

@amnn amnn commented Oct 4, 2024

Description

Ungate access to the parts of the GraphQL schema that depend on tx_affected_addresses as this has now been fully rolled out in the indexer

Test plan

sui$ cargo nextest run -p sui-graphql-rpc
sui$ cargo nextest run -p sui-graphql-e2e-tests

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: Adds support for TransactionBlockFilter.affectedAddress, and AddressTransactionBlockRelationship.AFFECTED to find transactions associated with any address they touch (sender, recipient, or payer).
  • CLI:
  • Rust SDK:
  • REST API:

@amnn amnn self-assigned this Oct 4, 2024
Copy link

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

## Description

Ungate access to the parts of the GraphQL schema that depend on
`tx_affected_addresses` as this has now been fully rolled out in the
indexer

## Test plan

```
sui$ cargo nextest run -p sui-graphql-rpc
sui$ cargo nextest run -p sui-graphql-e2e-tests
```
@amnn amnn merged commit d46416f into main Oct 10, 2024
49 checks passed
@amnn amnn deleted the amnn/tx-unstage-affected-addresses branch October 10, 2024 21:11
amnn added a commit that referenced this pull request Oct 10, 2024
## Description

Ungate access to the parts of the GraphQL schema that depend on
`tx_affected_addresses` as this has now been fully rolled out in the
indexer

## Test plan

```
sui$ cargo nextest run -p sui-graphql-rpc
sui$ cargo nextest run -p sui-graphql-e2e-tests
```

---

## 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: 
- [x] GraphQL: Adds support for
`TransactionBlockFilter.affectedAddress`, and
`AddressTransactionBlockRelationship.AFFECTED` to find transactions
associated with any address they touch (sender, recipient, or payer).
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
amnn added a commit that referenced this pull request Oct 11, 2024
## Description

Replace uses of `tx_senders` in `IndexerReader`, with other tables that
can offer equivalent functionality, so that we can eventually get rid of
this table.

In transaction filtering, we support filtering by sender using
`tx_affected_addresses` (where setting both `sender` and `affected` is
equivalent to querying `tx_senders` by `sender`).

In event filtering, we support filtering by sender using the
`event_senders` table.

## Test plan

Manually tested Indexer Reader on the following package:

```move
module test::test;

use sui::event;

public struct Event(u64) has copy, drop, store;

public fun emit() {
  10u64.do!(|i| event::emit(Event(i)))
}
```

Start the local network:

```
sui$ sui start --force-regenesis --with-faucet --with-indexer
```

Set-up two addresses, and call the test function:

```
sui$ sui client faucet
sui$ sui client ptb --call "$PKG::test::emit"
sui$ sui client switch --address X
sui$ sui client faucet
sui$ sui client ptb --call "$PKG::test::emit"
```

Run the query against both addresses:

```
curl -LX POST "http://localhost:9124" \
        --header 'Content-Type: application/json' \
        --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_queryEvents",
  "params": [
    {
      "Sender": "'(sui client active-address)'"
    },
    null,
    5
  ]
}' | jq .
```

## Stack

- #19708 

---

## 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:
amnn added a commit that referenced this pull request Oct 11, 2024
## Description

Replace references to `tx_senders` with `tx_affected_addresses` so that
we can eventually get rid of the former table entirely.

## Test plan

This should be a behaviour preserving transformation:

```
sui$ cargo nextest run -p sui-graphql-rpc
sui$ cargo nextest run -p sui-graphql-e2e-tests
```

## Stack

- #19708 
- #19802 

---

## 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:
amnn added a commit that referenced this pull request Oct 11, 2024
…tionBlockRelationship.SIGN (#19804)

## Description

Formally remove

- `TransactionBlockFilter.signAddress` and
- `AddressTransactionBlockRelationship.SIGN`

which were deprecated two releases ago. They have been replaced by

- `TransactionBlockFilter.sentAddress` and
- `AddressTransactionBlockRelationship.SENT`

which offer the same features under clearer names.

## Test plan

```
sui$ cargo nextest run -p sui-graphql-rpc
sui$ cargo nextest run -p sui-graphql-rpc --features staging
sui$ cargo nextest run -p sui-graphql-e2e-tests
```

## Stack

- #19708 
- #19802 
- #19803 
---

## 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: 
- [x] GraphQL: Formally remove `TransactionBlockFilter.signAddress` and
`AddressTransactionBlockRelationship.SIGN` which were deprecated two
releases ago. They have been replaced by
`TransactionBlockFilter.sentAddress` and
`AddressTransactionBlockRelationship.SENT` which offer the same features
under clearer names.
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
amnn added a commit that referenced this pull request Oct 11, 2024
…tionBlockRelation.RECV (#19805)

## Description

These fields were flagged for deprecation in 1.34 and have been replaced
in 1.35 by

- `TransactionBlockFilter.affectedAddress` and
- `AddressTransactionBlockRelation.AFFECTED`

Which offer a similar (but not exactly the same) semantics, but without
confusion around the sender address which was often also an implicit
recipient of a transaction.

## Test plan

```
sui$ cargo nextest run -p sui-graphql-rpc
sui$ cargo nextest run -p sui-graphql-rpc --features staging
sui$ cargo nextest run -p sui-graphql-e2e-tests
```

## Stack

- #19708 
- #19802 
- #19803 
- #19804 

---

## 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: 
- [x] GraphQL: `TransactionBlockFilter.recvAddress` and
`AddressTransactionBlockRelation.RECV` have been replace by
`TransactionBlockFilter.affectedAddress` and
`AddressTransactionBlockRelation.AFFECTED` which offer similar
semantics, but without confusion around the sender address which was
also often (but not always) an implicit recipient. Now we don't
distinguish between senders and recipients -- we only have senders and
"affected" addresses which were touched by the transaction in some way.
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
amnn added a commit that referenced this pull request Oct 14, 2024
## Description

All references to these fields have been removed from readers, so we can
stop keeping it up-to-date. Once this change lands, we can also clean
these tables from the schema.

## Test plan

```
sui$ cargo nextest run -p sui-indexer
```

## Stack

- #19708 
- #19802 
- #19803 
- #19804 
- #19805 

---

## 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): 
- [x] Indexer: Indexer no longer fills the `tx_sender` and
`tx_recipient` tables.
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
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