Skip to content

Commit

Permalink
feat(graphql)!: deprecate tx signer filters (#19430)
Browse files Browse the repository at this point in the history
## Description

`TransactionBlockFilter.signAddress` and
`AddressTransactionBlockFilter.SIGN` both claim to support filtering by
sender and sponsor, but this is not true, they only support sender, and
they should not be adapted to also filter by sponsor because we rely on
the there being only one sender per transaction to ensure filters that
combine sender with something else remain both space and time efficient.

## Test plan

Existing tests and CI, plus some new tests to make sure the new filter
options work, and interactions between the old and new filters work.

```
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: Deprecates `TransactionBlockFilter.signAddress`,
replacing it with `TransactionBlockFilter.sentAddress` which behaves
identically. Similarly `AddressTransactionBlockRelationship.SIGN` is
deprecated and replaced by `AddressTransactionBlockRelationship.SENT`.
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
amnn authored Sep 18, 2024
1 parent f2ab91e commit 81e9fdb
Show file tree
Hide file tree
Showing 11 changed files with 545 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,345 @@
processed 5 tasks

init:
A: object(0,0), B: object(0,1)

task 1, lines 9-11:
//# programmable --sender A --inputs 1000000 @B
//> SplitCoins(Gas, [Input(0)]);
//> TransferObjects([Result(0)], Input(1))
created: object(1,0)
mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0

task 2, lines 13-15:
//# programmable --sender B --inputs 2000000 @A
//> SplitCoins(Gas, [Input(0)]);
//> TransferObjects([Result(0)], Input(1))
created: object(2,0)
mutated: object(0,1)
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0

task 3, line 17:
//# create-checkpoint
Checkpoint created: 1

task 4, lines 19-87:
//# run-graphql
Response: {
"data": {
"bySentAddress": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
},
"bySignAddress": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
},
"bothAddresses": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
},
"differentAddresses": {
"nodes": []
},
"compoundBySentAddress": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
},
"compoundBySignAddress": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
},
"compoundBothAddresses": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
},
"compoundDifferentAddresses": {
"nodes": []
},
"sentViaAddress": {
"transactionBlocks": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
}
},
"signViaAddress": {
"transactionBlocks": {
"nodes": [
{
"effects": {
"objectChanges": {
"nodes": [
{
"inputState": null,
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "1000000"
}
}
}
},
{
"inputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "300000000000000"
}
}
},
"outputState": {
"asMoveObject": {
"asCoin": {
"coinBalance": "299999996024000"
}
}
}
}
]
}
}
}
]
}
}
}
}
Loading

0 comments on commit 81e9fdb

Please sign in to comment.