Skip to content

Commit

Permalink
[graphql] Remove usage of legacy objects snapshot processing (#19175)
Browse files Browse the repository at this point in the history
## Description 

A separate task is solely responsible for updating `objects_snapshot`,
which means the graphql e2e tests, which depend on forcing
`objects_snapshot` changes through an update query, also need to obey
this. In lieu of the current behavior, we instead configure the snapshot
lag per test scenario, and

```
//# advance-clock --duration-ns 1

//# create-checkpoint
```

to get the desired `objects_snapshot` state

## 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): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
wlmyng authored Sep 5, 2024
1 parent 28feff4 commit 9a3a085
Show file tree
Hide file tree
Showing 20 changed files with 864 additions and 1,105 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
processed 5 tasks
processed 17 tasks

task 1, lines 6-28:
task 1, lines 8-30:
//# run-graphql
Response: {
"data": {
Expand All @@ -25,35 +25,105 @@ Response: {
}
}

task 2, line 30:
task 3, line 34:
//# create-checkpoint
Checkpoint created: 1

task 3, line 33:
task 4, lines 36-46:
//# run-graphql
Response: {
"data": {
"availableRange": {
"first": {
"sequenceNumber": 0
},
"last": {
"sequenceNumber": 1
}
}
}
}

task 6, line 50:
//# create-checkpoint
Checkpoint created: 2

task 4, lines 36-58:
task 7, lines 52-62:
//# run-graphql
Response: {
"data": {
"availableRange": {
"first": {
"digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k",
"sequenceNumber": 0
},
"last": {
"digest": "5GTvEftM57hVrNtNapMU73cE5Wj6mYFuzd9K644n1Zqs",
"sequenceNumber": 2
}
}
}
}

task 9, line 66:
//# create-checkpoint
Checkpoint created: 3

task 10, lines 68-78:
//# run-graphql
Response: {
"data": {
"availableRange": {
"first": {
"sequenceNumber": 1
},
"last": {
"sequenceNumber": 3
}
}
}
}

task 12, line 82:
//# create-checkpoint
Checkpoint created: 4

task 13, lines 84-94:
//# run-graphql
Response: {
"data": {
"availableRange": {
"first": {
"sequenceNumber": 2
},
"last": {
"sequenceNumber": 4
}
}
}
}

task 15, line 98:
//# create-checkpoint
Checkpoint created: 5

task 16, lines 100-120:
//# run-graphql
Response: {
"data": {
"availableRange": {
"first": {
"sequenceNumber": 3
},
"last": {
"sequenceNumber": 5
}
},
"first": {
"digest": "ZQawQqeikA4pRqKnkcuHuMnGZuKJTSt3V3EVmMjG56k",
"sequenceNumber": 0
},
"last": {
"digest": "5GTvEftM57hVrNtNapMU73cE5Wj6mYFuzd9K644n1Zqs",
"sequenceNumber": 2
"digest": "9C7jQMv4YDXtBQFVawbAJTtQf7JefT3XPNUNoWSot5T2",
"sequenceNumber": 5
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//# init --protocol-version 51 --simulator
// Test that available range is correctly updated per objects_snapshot catching up

//# init --protocol-version 51 --simulator --objects-snapshot-min-checkpoint-lag 2

//# run-graphql
{
Expand All @@ -27,21 +29,81 @@
}
}

//# advance-clock --duration-ns 1

//# create-checkpoint

//# run-graphql
{
availableRange {
first {
sequenceNumber
}
last {
sequenceNumber
}
}
}

//# advance-clock --duration-ns 1

//# create-checkpoint

//# run-graphql
{
availableRange {
first {
sequenceNumber
}
last {
sequenceNumber
}
}
}

//# advance-clock --duration-ns 1

//# create-checkpoint

//# run-graphql
{
availableRange {
first {
sequenceNumber
}
last {
sequenceNumber
}
}
}

//# advance-clock --duration-ns 1

//# create-checkpoint

//# run-graphql
{
availableRange {
first {
sequenceNumber
}
last {
sequenceNumber
}
}
}

//# advance-clock --duration-ns 1

//# create-checkpoint

//# run-graphql
{
availableRange {
first {
digest
sequenceNumber
}
last {
digest
sequenceNumber
}
}
Expand Down
Loading

0 comments on commit 9a3a085

Please sign in to comment.