Skip to content

Commit

Permalink
remove DAI injection feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Nov 21, 2024
1 parent 6d8975f commit 63db850
Show file tree
Hide file tree
Showing 31 changed files with 8 additions and 639 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,6 @@ Protocol
--epoch-subgraph-endpoint Endpoint to query epoch start blocks from
[string] [required]
Cost Models
--inject-dai Inject the GRT to DAI/USDC conversion rate into cost model
variables [boolean] [default: true]
Postgres
--postgres-host Postgres host [string] [required]
--postgres-port Postgres port [number] [default: 5432]
Expand Down Expand Up @@ -238,9 +234,6 @@ Query Fees
Options:
--version Show version number [boolean]
--help Show help [boolean]
--dai-contract Address of the DAI or USDC contract to use for the
--inject-dai conversion rate
[string] [default: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"]
--offchain-subgraphs Subgraphs to index that are not on chain
(comma-separated) [array] [default: []]
```
Expand Down
1 change: 0 additions & 1 deletion docs/networks/arbitrum-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Other network contracts can be found in [graphprotocol/contracts](https://github
| `INDEXER_AGENT_MNEMONIC` | `--mnemonic` | Ethereum mnemonic for mainnet operator |
| `INDEXER_AGENT_NETWORK_SUBGRAPH_DEPLOYMENT` | `--network-subgraph-deployment` | [![Dynamic JSON Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fthegraph.com%2Fexplorer%2F_next%2Fdata%2F5PBypsdmUEy39BcWLsyp0%2Fsubgraphs%2FDZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp.json%3Fview%3DAbout%26chain%3Darbitrum-one%26id%3DDZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp&query=%24.pageProps.subgraph.currentVersion.subgraphDeployment.ipfsHash&label=deployment-id)](https://thegraph.com/explorer/subgraphs/DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp) |
| `INDEXER_AGENT_NETWORK_SUBGRAPH_ENDPOINT` | `--network-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp` |
| `INDEXER_AGENT_DAI_CONTRACT` | `--dai-contract` | TBD |
| `INDEXER_AGENT_GATEWAY_ENDPOINT` | `--gateway-endpoint` | `https://gateway-arbitrum.network.thegraph.com/` |
| `INDEXER_AGENT_GAS_PRICE_MAX` | `--gas-price-max` | `50` |
| `INDEXER_AGENT_EPOCH_SUBGRAPH_ENDPOINT` | `--epoch-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/4KFYqUWRTZQ9gn7GPHC6YQ2q15chJfVrX43ezYcwkgxB` |
Expand Down
1 change: 0 additions & 1 deletion docs/networks/arbitrum-sepolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ testnet (for now) are Mainnet subgraphs. This means:
| `INDEXER_AGENT_MNEMONIC` | `--mnemonic` | Ethereum mnemonic for testnet operator |
| `INDEXER_AGENT_NETWORK_SUBGRAPH_DEPLOYMENT` | `--network-subgraph-deployment` | `QmXnGVrg6DvscnvJd86aHAPLGyGrkM17weMrAsFAEMmQLL` |
| `INDEXER_AGENT_NETWORK_SUBGRAPH_ENDPOINT` | `--network-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/3xQHhMudr1oh69ut36G2mbzpYmYxwqCeU6wwqyCDCnqV` |
| `INDEXER_AGENT_DAI_CONTRACT` | `--dai-contract` | `0x9e7e607afd22906f7da6f1ec8f432d6f244278be` (GDAI) |
| `INDEXER_AGENT_GATEWAY_ENDPOINT` | `--gateway-endpoint` | `https://gateway-arbitrum.testnet.thegraph.com/` |
| `INDEXER_AGENT_EPOCH_SUBGRAPH_ENDPOINT` | `--epoch-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/BhnsdeZihU4SuokxZMLF4FQBVJ3jgtZf6v51gHvz3bSS` |
| `INDEXER_AGENT_TAP_SUBGRAPH_ENDPOINT` | `--tap-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/7ubx365MiqBH5iUz6XWXWT8PTof5BVAyEzdb8m17RvbD` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,3 @@ transactionMonitoring:
gasIncreaseTimeout: 90
gasIncreaseFactor: 1.5
maxTransactionAttempts: 20
dai:
contractAddress: '0x9e7e607afd22906f7da6f1ec8f432d6f244278be'
inject: true
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ transactionMonitoring:
gasIncreaseTimeout: 90
gasIncreaseFactor: 1.5
maxTransactionAttempts: 20
dai:
contractAddress: '0x9e7e607afd22906f7da6f1ec8f432d6f244278be'
inject: true
3 changes: 0 additions & 3 deletions network-configs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ tapAddressBook:
TAPVerifier: "0xf56b5d582920E4527A818FBDd801C0D80A394CB8"
AllocationIDTracker: "0xf56b5d582920E4527A818FBDd801C0D80A394CB8"
Escrow: "0xf56b5d582920E4527A818FBDd801C0D80A394CB8"
dai:
contractAddress: "0x4e8a4C63Df58bf59Fef513aB67a76319a9faf448"
inject: false
7 changes: 0 additions & 7 deletions packages/indexer-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ Query Fees
--gateway-endpoint, Gateway endpoint base URL
--collect-receipts-endpoint [string] [required]
Cost Models
--inject-dai Inject the GRT to DAI/USDC conversion rate into cost model
variables [boolean] [default: true]
Postgres
--postgres-host Postgres host [string] [required]
--postgres-port Postgres port [number] [default: 5432]
Expand All @@ -137,9 +133,6 @@ Options:
--help Show help [boolean]
--offchain-subgraphs Subgraphs to index that are not on chain
(comma-separated) [array] [default: []]
--dai-contract Address of the DAI or USDC contract to use for the
--inject-dai conversion rate
[string] [default: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"]
```

Expand Down
1 change: 0 additions & 1 deletion packages/indexer-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@graphprotocol/common-ts": "2.0.11",
"@graphprotocol/indexer-common": "^0.21.7",
"@thi.ng/heaps": "^1.3.1",
"@uniswap/sdk": "3.0.3",
"axios": "0.26.1",
"bs58": "5.0.0",
"delay": "^5.0.0",
Expand Down
37 changes: 0 additions & 37 deletions packages/indexer-agent/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
specification as spec,
} from '@graphprotocol/indexer-common'
import { Agent } from '../agent'
import { startCostModelAutomation } from '../cost'
import { createSyncingServer } from '../syncing-server'
import { injectCommonStartupOptions } from './common-options'
import pMap from 'p-map'
Expand Down Expand Up @@ -235,13 +234,6 @@ export const start = {
default: 100,
group: 'Query Fees',
})
.option('inject-dai', {
description:
'Inject the GRT to DAI/USDC conversion rate into cost model variables',
type: 'boolean',
default: false,
group: 'Cost Models',
})
.option('address-book', {
description: 'Graph contracts address book file path',
type: 'string',
Expand All @@ -257,13 +249,6 @@ export const start = {
type: 'number',
default: 3600,
})
.option('dai-contract', {
description:
'Address of the DAI or USDC contract to use for the --inject-dai conversion rate',
type: 'string',
// Default to USDC
default: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
})
.option('register', {
description: 'Whether to register the indexer on chain',
type: 'boolean',
Expand Down Expand Up @@ -394,11 +379,6 @@ export async function createNetworkSpecification(
},
}

const dai = {
contractAddress: argv.daiContractAddress,
inject: argv.injectDai,
}

const networkProvider = {
url: argv.networkProvider,
pollingInterval: argv.ethereumPollingInterval,
Expand Down Expand Up @@ -441,12 +421,6 @@ export async function createNetworkSpecification(
}
}

if (chainId !== 1 && dai.inject) {
throw new Error(
`The DAI injection feature for cost models is only supported on Ethereum Mainnet`,
)
}

const tapAddressBook = loadFile(argv.tapAddressBook)

try {
Expand All @@ -459,7 +433,6 @@ export async function createNetworkSpecification(
networkProvider,
addressBook: argv.addressBook,
tapAddressBook,
dai,
})
} catch (parsingError) {
displayZodParsingError(parsingError)
Expand Down Expand Up @@ -633,16 +606,6 @@ export async function run(
})
logger.info(`Successfully launched indexer management API server`)

// --------------------------------------------------------------------------------
// * Cost Model Automation
// --------------------------------------------------------------------------------
await startCostModelAutomation({
logger,
networks,
indexerManagement: indexerManagementClient,
metrics,
})

// --------------------------------------------------------------------------------
// * Syncing Server
// --------------------------------------------------------------------------------
Expand Down
118 changes: 0 additions & 118 deletions packages/indexer-agent/src/cost.ts

This file was deleted.

34 changes: 0 additions & 34 deletions packages/indexer-cli/src/__tests__/indexer/cost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,6 @@ describe('Indexer cost tests singleNetwork', () => {
timeout: 10000,
},
)
cliTest(
'Indexer cost set variable deployment id - success',
[
'indexer',
'cost',
'set',
'variables',
'QmQ44hgrWWt3Qf2X9XEX2fPyTbmQbChxwNm5c1t4mhKpGt',
`'{"DAI": "0.5"}'`,
],
'references/indexer-cost-variables-deployment',
{
expectedExitCode: 0,
cwd: baseDir,
timeout: 10000,
},
)
cliTest(
'Indexer cost set model deployment id - no arg',
[
Expand Down Expand Up @@ -257,22 +240,5 @@ describe('Indexer cost tests multiNetworks', () => {
timeout: 10000,
},
)
cliTest(
'Indexer cost set variable deployment id - reject multinetwork mode',
[
'indexer',
'cost',
'set',
'variables',
'QmQ44hgrWWt3Qf2X9XEX2fPyTbmQbChxwNm5c1t4mhKpGt',
`'{"DAI": "0.5"}'`,
],
'references/indexer-cost-variables-deployment-multinetworks',
{
expectedExitCode: 1,
cwd: baseDir,
timeout: 10000,
},
)
})
})
7 changes: 0 additions & 7 deletions packages/indexer-cli/src/__tests__/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import stripAnsi from 'strip-ansi'
import {
ActionStatus,
ActionType,
CostModelVariables,
createIndexerManagementClient,
createIndexerManagementServer,
defineIndexerManagementModels,
Expand Down Expand Up @@ -255,12 +254,6 @@ export const seedCostModels = async () => {
).toString(),
model: 'default => 0.00025;',
})
await models.CostModel.create({
deployment: new SubgraphDeploymentID(
'QmQ44hgrWWt3Qf2X9XEX2fPyTbmQbChxwNm5c1t4mhKpGt',
).toString(),
variables: { DAI: '0.5' } as CostModelVariables,
})
} catch (e) {
logger.error('Failed to seed CostModel table', { error: e })
process.exit(1)
Expand Down

This file was deleted.

Loading

0 comments on commit 63db850

Please sign in to comment.