Skip to content

Commit d9fa2bf

Browse files
committed
common: fix endpoints that still required protocolNetwork
bump version to 0.23.3 common: attempt to fix actions and tests work on fixing protocolnetwork
1 parent d3a02f6 commit d9fa2bf

File tree

20 files changed

+49
-103
lines changed

20 files changed

+49
-103
lines changed

docs/networks/arbitrum-sepolia.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ The Graph Network's testnet is on Arbitrum Sepolia (eip155:421614). Sepolia netw
77
| Component | Release |
88
| ------------------ | ------------------------------------------------------------------------------------ |
99
| contracts | [5.3.3](https://github.com/graphprotocol/contracts/releases/tag/v5.3.3) |
10-
| indexer-agent | [0.23.2](https://github.com/graphprotocol/indexer/releases/tag/v0.23.2) |
11-
| indexer-cli | [0.23.2](https://github.com/graphprotocol/indexer/releases/tag/v0.23.2) |
10+
| indexer-agent | [0.23.3](https://github.com/graphprotocol/indexer/releases/tag/v0.23.3) |
11+
| indexer-cli | [0.23.3](https://github.com/graphprotocol/indexer/releases/tag/v0.23.3) |
1212
| indexer-service-rs | [1.0.0](https://github.com/graphprotocol/indexer-rs/releases/tag/v1.0.0) |
1313
| tap-agent | [1.0.0](https://github.com/graphprotocol/indexer-rs/releases/tag/v1.0.0) |
1414
| graph-node | [0.35.1](https://github.com/graphprotocol/graph-node/releases/tag/v0.35.1) |

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
],
55
"npmClient": "yarn",
66
"useWorkspaces": true,
7-
"version": "0.23.2"
7+
"version": "0.23.3"
88
}

packages/indexer-agent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/indexer-agent",
3-
"version": "0.23.2",
3+
"version": "0.23.3",
44
"description": "Indexer agent",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@graphprotocol/common-ts": "2.0.11",
32-
"@graphprotocol/indexer-common": "^0.23.2",
32+
"@graphprotocol/indexer-common": "^0.23.3",
3333
"@thi.ng/heaps": "^1.3.1",
3434
"axios": "0.26.1",
3535
"bs58": "5.0.0",

packages/indexer-agent/src/agent.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export class Agent {
669669
eligibleAllocations: Allocation[],
670670
): Promise<void> {
671671
const logger = this.logger.child({ function: 'reconcileDeployments' })
672-
logger.debug('Reconcile deployments')
672+
logger.debug('Reconcile deployments', { targetDeployments })
673673
// ----------------------------------------------------------------------------------------
674674
// Ensure the network subgraph deployment is _always_ indexed
675675
// ----------------------------------------------------------------------------------------
@@ -915,7 +915,7 @@ export class Agent {
915915
network.specification.indexerOptions.allocationManagementMode ===
916916
AllocationManagementMode.MANUAL
917917
) {
918-
this.logger.trace(
918+
this.logger.debug(
919919
`Skipping allocation reconciliation since AllocationManagementMode = 'manual'`,
920920
{
921921
protocolNetwork: network.specification.networkIdentifier,
@@ -948,7 +948,6 @@ export class Agent {
948948
// Do nothing if there are already approved actions in the queue awaiting execution
949949
const approvedActions = await operator.fetchActions({
950950
status: ActionStatus.APPROVED,
951-
protocolNetwork: network.specification.networkIdentifier,
952951
})
953952
if (approvedActions.length > 0) {
954953
this.logger.info(
@@ -964,7 +963,7 @@ export class Agent {
964963
const activeAllocations: Allocation[] =
965964
await network.networkMonitor.allocations(AllocationStatus.ACTIVE)
966965

967-
this.logger.trace(`Reconcile allocation actions`, {
966+
this.logger.debug(`Reconcile allocation actions`, {
968967
protocolNetwork: network.specification.networkIdentifier,
969968
epoch,
970969
maxAllocationEpochs,

packages/indexer-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/indexer-cli",
3-
"version": "0.23.2",
3+
"version": "0.23.3",
44
"description": "Indexer CLI for The Graph Network",
55
"main": "./dist/cli.js",
66
"files": [
@@ -27,7 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@graphprotocol/common-ts": "2.0.11",
30-
"@graphprotocol/indexer-common": "^0.23.2",
30+
"@graphprotocol/indexer-common": "^0.23.3",
3131
"@iarna/toml": "2.2.5",
3232
"@thi.ng/iterators": "5.1.74",
3333
"@urql/core": "3.1.0",

packages/indexer-cli/src/actions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
nullPassThrough,
1111
OrderDirection,
1212
parseBoolean,
13-
validateNetworkIdentifier,
1413
} from '@graphprotocol/indexer-common'
1514
import { validatePOI, validateRequiredParams } from './command-helpers'
1615
import gql from 'graphql-tag'
@@ -207,7 +206,6 @@ const ACTION_PARAMS_PARSERS: Record<keyof ActionUpdateInput, (x: never) => any>
207206
type: x => validateActionType(x),
208207
status: x => validateActionStatus(x),
209208
reason: nullPassThrough,
210-
protocolNetwork: x => validateNetworkIdentifier(x),
211209
}
212210

213211
/**

packages/indexer-cli/src/commands/indexer/actions/approve.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ module.exports = {
5858
if (actionIDs.join() == 'queued') {
5959
const queuedActions = await fetchActions(client, {
6060
status: ActionStatus.QUEUED,
61-
protocolNetwork: 'deprecated',
6261
})
6362

6463
numericActionIDs = queuedActions.map(action => action.id)

packages/indexer-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/indexer-common",
3-
"version": "0.23.2",
3+
"version": "0.23.3",
44
"description": "Common library for Graph Protocol indexer components",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/indexer-common/src/actions.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export interface ActionItem {
1818
type: ActionType
1919
reason: string
2020
status?: ActionStatus
21-
protocolNetwork: string
2221
}
2322

2423
export interface ActionUpdateInput {
@@ -30,7 +29,6 @@ export interface ActionUpdateInput {
3029
type?: ActionType
3130
status?: ActionStatus
3231
reason?: string
33-
protocolNetwork?: string
3432
}
3533

3634
export interface ActionInput {
@@ -146,7 +144,6 @@ export interface ActionFilter {
146144
source?: string
147145
reason?: string
148146
updatedAt?: WhereOperators
149-
protocolNetwork?: string
150147
}
151148

152149
export const actionFilterToWhereOptions = (filter: ActionFilter): WhereOptions => {

packages/indexer-common/src/indexer-management/__tests__/resolvers/actions.test.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const QUEUE_ACTIONS_MUTATION = gql`
5353
transaction
5454
failureReason
5555
status
56-
protocolNetwork
5756
}
5857
}
5958
`
@@ -74,7 +73,6 @@ const APPROVE_ACTIONS_MUTATION = gql`
7473
transaction
7574
failureReason
7675
status
77-
protocolNetwork
7876
}
7977
}
8078
`
@@ -95,7 +93,6 @@ const CANCEL_ACTIONS_MUTATION = gql`
9593
transaction
9694
failureReason
9795
status
98-
protocolNetwork
9996
}
10097
}
10198
`
@@ -116,7 +113,6 @@ const UPDATE_ACTIONS_MUTATION = gql`
116113
transaction
117114
failureReason
118115
status
119-
protocolNetwork
120116
}
121117
}
122118
`
@@ -141,7 +137,6 @@ const ACTIONS_QUERY = gql`
141137
transaction
142138
failureReason
143139
status
144-
protocolNetwork
145140
}
146141
}
147142
`
@@ -487,7 +482,6 @@ describe.skip('Actions', () => {
487482
['source', 'String'],
488483
['reason', 'String'],
489484
['priority', 'Int'],
490-
['protocolNetwork', 'String'],
491485
]
492486
const graphQLErrors = expectedFieldNamesAndTypes.map(
493487
([fieldName, fieldType]) =>
@@ -504,7 +498,7 @@ describe.skip('Actions', () => {
504498

505499
test('Reject action with invalid params for action type', async () => {
506500
const inputAction = invalidReallocateAction
507-
const expected = { ...inputAction, protocolNetwork: 'eip155:421614' }
501+
const expected = inputAction
508502
const fields = JSON.stringify(expected)
509503
await expect(
510504
client.mutation(QUEUE_ACTIONS_MUTATION, { actions: [inputAction] }).toPromise(),
@@ -715,6 +709,7 @@ describe.skip('Actions', () => {
715709
priority: 0,
716710
} as ActionInput
717711

712+
// models still store a protocolNetwork
718713
await managementModels.Action.create(
719714
{ ...failedAction, protocolNetwork: 'whatever' },
720715
{
@@ -725,7 +720,7 @@ describe.skip('Actions', () => {
725720

726721
const result = await client
727722
.mutation(QUEUE_ACTIONS_MUTATION, {
728-
actions: [{ ...proposedAction, protocolNetwork: 'whatever' }],
723+
actions: [proposedAction],
729724
})
730725
.toPromise()
731726

@@ -760,8 +755,6 @@ describe.skip('Actions', () => {
760755
source: 'indexerAgent',
761756
reason: 'indexingRule',
762757
priority: 0,
763-
// When writing directly to the database, `protocolNetwork` must be in the CAIP2-ID format.
764-
protocolNetwork: 'eip155:421614',
765758
} as ActionInput
766759

767760
const proposedAction = {
@@ -772,9 +765,9 @@ describe.skip('Actions', () => {
772765
source: 'indexerAgent',
773766
reason: 'indexingRule',
774767
priority: 0,
775-
protocolNetwork: 'arbitrum-sepolia',
776768
} as ActionInput
777769

770+
// models still store a protocolNetwork
778771
await managementModels.Action.create(
779772
{ ...successfulAction, protocolNetwork: 'whatever' },
780773
{
@@ -816,8 +809,6 @@ describe.skip('Actions', () => {
816809
source: 'indexerAgent',
817810
reason: 'indexingRule',
818811
priority: 0,
819-
// When writing directly to the database, `protocolNetwork` must be in the CAIP2-ID format.
820-
protocolNetwork: 'eip155:421614',
821812
} as ActionInput
822813

823814
const queuedAllocateAction = {
@@ -829,9 +820,9 @@ describe.skip('Actions', () => {
829820
source: 'indexerAgent',
830821
reason: 'indexingRule',
831822
priority: 0,
832-
protocolNetwork: 'arbitrum-sepolia',
833823
} as ActionInput
834824

825+
// models still store a protocolNetwork
835826
await managementModels.Action.create(
836827
{ ...queuedUnallocateAction, protocolNetwork: 'whatever' },
837828
{

0 commit comments

Comments
 (0)