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

release version 0.21.8-2 #1045

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/networks/arbitrum-sepolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ The Graph Network's testnet is on Arbitrum Sepolia (eip155:421614). Sepolia netw
| Component | Release |
| ------------------ | ------------------------------------------------------------------------------------ |
| contracts | [5.3.3](https://github.com/graphprotocol/contracts/releases/tag/v5.3.3) |
| indexer-agent | [0.21.7](https://github.com/graphprotocol/indexer/releases/tag/v0.21.7) |
| indexer-cli | [0.21.7](https://github.com/graphprotocol/indexer/releases/tag/v0.21.7) |
| indexer-agent | [0.21.8-2](https://github.com/graphprotocol/indexer/releases/tag/v0.21.8-2) |
| indexer-cli | [0.21.8-2](https://github.com/graphprotocol/indexer/releases/tag/v0.21.8-2) |
| indexer-service-rs | [1.0.0](https://github.com/graphprotocol/indexer-rs/releases/tag/v1.0.0) |
| tap-agent | [1.0.0](https://github.com/graphprotocol/indexer-rs/releases/tag/v1.0.0) |
| graph-node | [0.35.1](https://github.com/graphprotocol/graph-node/releases/tag/v0.35.1) |
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.21.7"
"version": "0.21.8-2"
}
4 changes: 2 additions & 2 deletions packages/indexer-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/indexer-agent",
"version": "0.21.7",
"version": "0.21.8-2",
"description": "Indexer agent",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@graphprotocol/common-ts": "2.0.11",
"@graphprotocol/indexer-common": "^0.21.7",
"@graphprotocol/indexer-common": "^0.21.8-2",
"@thi.ng/heaps": "^1.3.1",
"@uniswap/sdk": "3.0.3",
"axios": "0.26.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/indexer-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/indexer-cli",
"version": "0.21.7",
"version": "0.21.8-2",
"description": "Indexer CLI for The Graph Network",
"main": "./dist/cli.js",
"files": [
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {
"@graphprotocol/common-ts": "2.0.11",
"@graphprotocol/indexer-common": "^0.21.7",
"@graphprotocol/indexer-common": "^0.21.8-2",
"@iarna/toml": "2.2.5",
"@thi.ng/iterators": "5.1.74",
"@urql/core": "3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/indexer-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/indexer-common",
"version": "0.21.7",
"version": "0.21.8-2",
"description": "Common library for Graph Protocol indexer components",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ describe('Monitor: CI', () => {
test('Fetch subgraph deployments (unconstrained block)', async () => {
const deployments = await networkMonitor.subgraphDeployments()
await expect(deployments.length).toBeGreaterThan(500)
}, 30000)
}, 40000)
})

describe('Network layer detection', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ interface AllocationInfo {

const ALLOCATION_QUERIES = {
[AllocationQuery.all]: gql`
query allocations($indexer: String!) {
allocations(where: { indexer: $indexer }, first: 1000) {
query allocations($indexer: String!, $lastId: String!) {
allocations(
where: { indexer: $indexer, id_gt: $lastId }
orderBy: id
orderDirection: asc
first: 1000
) {
id
subgraphDeployment {
id
Expand All @@ -87,8 +92,13 @@ const ALLOCATION_QUERIES = {
}
`,
[AllocationQuery.active]: gql`
query allocations($indexer: String!) {
allocations(where: { indexer: $indexer, status: Active }, first: 1000) {
query allocations($indexer: String!, $lastId: String!) {
allocations(
where: { indexer: $indexer, id_gt: $lastId, status: Active }
orderBy: id
orderDirection: asc
first: 1000
) {
id
subgraphDeployment {
id
Expand All @@ -108,8 +118,13 @@ const ALLOCATION_QUERIES = {
}
`,
[AllocationQuery.closed]: gql`
query allocations($indexer: String!) {
allocations(where: { indexer: $indexer, status: Closed }, first: 1000) {
query allocations($indexer: String!, $lastId: String!) {
allocations(
where: { indexer: $indexer, id_gt: $lastId, status: Closed }
orderBy: id
orderDirection: asc
first: 1000
) {
id
subgraphDeployment {
id
Expand All @@ -129,8 +144,13 @@ const ALLOCATION_QUERIES = {
}
`,
[AllocationQuery.allocation]: gql`
query allocations($allocation: String!) {
allocations(where: { id: $allocation }, first: 1000) {
query allocations($allocation: String!, $lastId: String!) {
allocations(
where: { id: $allocation, id_gt: $lastId }
orderBy: id
orderDirection: asc
first: 1000
) {
id
subgraphDeployment {
id
Expand Down Expand Up @@ -203,27 +223,44 @@ async function queryAllocations(
)
}

const result = await networkSubgraph.checkedQuery(
ALLOCATION_QUERIES[filterType],
filterVars,
)
let lastId = ''
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const resultAllocations: any[] = []
for (;;) {
const pageVars = {
...filterVars,
lastId,
}
const result = await networkSubgraph.checkedQuery(
ALLOCATION_QUERIES[filterType],
pageVars,
)

if (result.error) {
logger.warning('Querying allocations failed', {
error: result.error,
lastId: lastId,
})
throw result.error
}

if (result.data.allocations.length == 0) {
if (result.data.allocations.length == 0) {
break
}
// merge results
resultAllocations.push(...result.data.allocations)
lastId = result.data.allocations.slice(-1)[0].id
}

if (resultAllocations.length == 0) {
// TODO: Is 'Claimable' still the correct term here, after Exponential Rebates?
logger.info(`No 'Claimable' allocations found`)
return []
}

if (result.error) {
logger.warning('Query failed', {
error: result.error,
})
throw result.error
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
return pMap(
result.data.allocations,
resultAllocations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async (allocation: any): Promise<AllocationInfo> => {
const deadlineEpoch = allocation.createdAtEpoch + context.maxAllocationEpochs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,33 +124,52 @@ export default {
const address = network.specification.indexerOptions.address

try {
const result = await network.networkSubgraph.checkedQuery(
gql`
query allocations($indexer: String!) {
allocations(
where: { indexer: $indexer, status: Active }
first: 1000
orderDirection: desc
) {
id
allocatedTokens
createdAtEpoch
closedAtEpoch
subgraphDeployment {
let lastId = ''
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const allAllocations: any[] = []
for (;;) {
const result = await network.networkSubgraph.checkedQuery(
gql`
query allocations($indexer: String!, $lastId: String!) {
allocations(
where: { indexer: $indexer, status: Active, id_gt: $lastId }
first: 1000
orderBy: id
orderDirection: asc
) {
id
stakedTokens
signalledTokens
allocatedTokens
createdAtEpoch
closedAtEpoch
subgraphDeployment {
id
stakedTokens
signalledTokens
}
}
}
}
`,
{ indexer: address.toLocaleLowerCase() },
)
if (result.error) {
throw result.error
`,
{ indexer: address.toLocaleLowerCase(), lastId },
)

if (result.error) {
logger.warning('Querying allocations failed', {
error: result.error,
lastId: lastId,
})
throw result.error
}

if (result.data.allocations.length === 0) {
break
}

allAllocations.push(...result.data.allocations)
lastId = result.data.allocations.slice(-1)[0].id
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
return result.data.allocations.map((allocation: any) => ({
return allAllocations.map((allocation: any) => ({
...allocation,
subgraphDeployment: new SubgraphDeploymentID(allocation.subgraphDeployment.id)
.ipfsHash,
Expand Down
4 changes: 2 additions & 2 deletions packages/indexer-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/indexer-service",
"version": "0.21.7",
"version": "0.21.8-2",
"description": "Indexer service",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@google-cloud/profiler": "6.0.1",
"@graphprotocol/common-ts": "2.0.11",
"@graphprotocol/indexer-common": "^0.21.7",
"@graphprotocol/indexer-common": "^0.21.8-2",
"@graphprotocol/indexer-native": "0.21.6",
"@graphql-tools/load": "8.0.0",
"@graphql-tools/url-loader": "8.0.0",
Expand Down
Loading