Skip to content

Commit

Permalink
agent,common: lower the default parameters for query fee claiming
Browse files Browse the repository at this point in the history
agent,common: lower the default parameters for query fee claiming
  • Loading branch information
cwtaras authored and chriswessels committed Jun 28, 2024
1 parent bda5d93 commit 60dd4fe
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,23 @@ Indexer Infrastructure
--rebate-claim-threshold Minimum value of rebate for a single
allocation (in GRT) in order for it to
be included in a batch rebate claim
on-chain [string] [default: "200"]
on-chain [string] [default: "1"]
--rebate-claim-batch-threshold Minimum total value of all rebates in an
batch (in GRT) before the batch is
claimed on-chain
[string] [default: "2000"]
[string] [default: "5"]
--rebate-claim-max-batch-size Maximum number of rebates inside a
batch. Upper bound is constrained by
available system memory, and by the
block gas limit [number] [default: 100]
--voucher-redemption-threshold Minimum value of rebate for a single
allocation (in GRT) in order for it to
be included in a batch rebate claim
on-chain [string] [default: "200"]
on-chain [string] [default: "1"]
--voucher-redemption-batch-threshold Minimum total value of all rebates in an
batch (in GRT) before the batch is
claimed on-chain
[string] [default: "2000"]
[string] [default: "5"]
--voucher-redemption-max-batch-size Maximum number of rebates inside a
batch. Upper bound is constrained by
available system memory, and by the
Expand Down
4 changes: 2 additions & 2 deletions docs/networks/arbitrum-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ option can be used.

| Environment Variable | CLI Argument | Value |
| -------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------- |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 200) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 2000) |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 1) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 5) |
| `INDEXER_AGENT_VOUCHER_EXPIRATION` | `--voucher-expiration` | Time (in seconds) to permanently delete vouchers with too few query fees (Default: 2160) |

### Indexer Service
Expand Down
28 changes: 14 additions & 14 deletions docs/networks/arbitrum-sepolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ testnet (for now) are Mainnet subgraphs. This means:

### Indexer Agent

| Environment Variable | CLI Argument | Value |
| ------------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------- |
| `INDEXER_AGENT_ETHEREUM` | `--ethereum` | An Arbitrum Sepolia node/provider |
| `INDEXER_AGENT_ETHEREUM_NETWORK` | `--ethereum-network` | `arbitrum-sepolia` |
| `INDEXER_AGENT_INDEXER_ADDRESS` | `--indexer-address` | Ethereum address of testnet indexer |
| `INDEXER_AGENT_INDEXER_GEO_COORDINATES` | `--indexer-geo-coordinates` | Geo coordinates of testnet indexer infrastructure |
| `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_COLLECT_RECEIPTS_ENDPOINT` | `--collect-receipts-endpoint` | `https://gateway-arbitrum.testnet.thegraph.com/collect-receipts` |
| `INDEXER_AGENT_EPOCH_SUBGRAPH_ENDPOINT` | `--epoch-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/BhnsdeZihU4SuokxZMLF4FQBVJ3jgtZf6v51gHvz3bSS`|
| Environment Variable | CLI Argument | Value |
| ------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `INDEXER_AGENT_ETHEREUM` | `--ethereum` | An Arbitrum Sepolia node/provider |
| `INDEXER_AGENT_ETHEREUM_NETWORK` | `--ethereum-network` | `arbitrum-sepolia` |
| `INDEXER_AGENT_INDEXER_ADDRESS` | `--indexer-address` | Ethereum address of testnet indexer |
| `INDEXER_AGENT_INDEXER_GEO_COORDINATES` | `--indexer-geo-coordinates` | Geo coordinates of testnet indexer infrastructure |
| `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_COLLECT_RECEIPTS_ENDPOINT` | `--collect-receipts-endpoint` | `https://gateway-arbitrum.testnet.thegraph.com/collect-receipts` |
| `INDEXER_AGENT_EPOCH_SUBGRAPH_ENDPOINT` | `--epoch-subgraph-endpoint` | `https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/BhnsdeZihU4SuokxZMLF4FQBVJ3jgtZf6v51gHvz3bSS` |

In order to avoid collecting or claiming query fees below a certain threshold
(e.g. below the cost of the two transactions), the following configuration
option can be used.

| Environment Variable | CLI Argument | Value |
| -------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 200) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 2000) |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 1) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 5) |
| `INDEXER_AGENT_VOUCHER_EXPIRATION` | `--voucher-expiration` | Time (in seconds) to permanently delete vouchers with too few query fees (Default: 2160) |

### Indexer Service
Expand Down
4 changes: 2 additions & 2 deletions docs/networks/ethereum-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ option can be used.

| Environment Variable | CLI Argument | Value |
| -------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------- |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 200) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 2000) |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 1) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 5) |
| `INDEXER_AGENT_VOUCHER_EXPIRATION` | `--voucher-expiration` | Time (in seconds) to permanently delete vouchers with too few query fees (Default: 2160) |

### Indexer Service
Expand Down
4 changes: 2 additions & 2 deletions docs/networks/ethereum-sepolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ option can be used.

| Environment Variable | CLI Argument | Value |
| -------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 200) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 2000) |
| `INDEXER_AGENT_REBATE_CLAIM_THRESHOLD` | `--rebate-claim-threshold` | Minimum rebate (in GRT) received for an allocation to claim (Default: 1) |
| `INDEXER_AGENT_REBATE_CLAIM_BATCH_THRESHOLD` | `--rebate-claim-batch-threshold` | Minimum total rebates (in GRT) before a batched claim is processed (Default: 5) |
| `INDEXER_AGENT_VOUCHER_EXPIRATION` | `--voucher-expiration` | Time (in seconds) to permanently delete vouchers with too few query fees (Default: 2160) |

### Indexer Service
Expand Down
8 changes: 4 additions & 4 deletions packages/indexer-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ Query Fees
allocation (in GRT) in order for it
to be included in a batch rebate
claim on-chain
[number] [default: 200]
[number] [default: 1]
--rebate-claim-batch-threshold Minimum total value of all rebates
in an batch (in GRT) before the
batch is claimed on-chain
[number] [default: 2000]
[number] [default: 5]
--rebate-claim-max-batch-size Maximum number of rebates inside a
batch. Upper bound is constrained by
available system memory, and by the
Expand All @@ -101,11 +101,11 @@ Query Fees
allocation (in GRT) in order for it
to be included in a batch rebate
claim on-chain
[number] [default: 200]
[number] [default: 1]
--voucher-redemption-batch-threshold Minimum total value of all rebates
in an batch (in GRT) before the
batch is claimed on-chain
[number] [default: 2000]
[number] [default: 5]
--voucher-redemption-max-batch-size Maximum number of rebates inside a
batch. Upper bound is constrained by
available system memory, and by the
Expand Down
8 changes: 4 additions & 4 deletions packages/indexer-agent/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ export const start = {
.option('rebate-claim-threshold', {
description: `Minimum value of rebate for a single allocation (in GRT) in order for it to be included in a batch rebate claim on-chain`,
type: 'number',
default: 200, // This value (the marginal gain of a claim in GRT), should always exceed the marginal cost of a claim (in ETH gas)
default: 1, // This value (the marginal gain of a claim in GRT), should always exceed the marginal cost of a claim (in ETH gas)
group: 'Query Fees',
})
.option('rebate-claim-batch-threshold', {
description: `Minimum total value of all rebates in an batch (in GRT) before the batch is claimed on-chain`,
type: 'number',
default: 2000,
default: 5,
group: 'Query Fees',
})
.option('rebate-claim-max-batch-size', {
Expand All @@ -219,13 +219,13 @@ export const start = {
.option('voucher-redemption-threshold', {
description: `Minimum value of rebate for a single allocation (in GRT) in order for it to be included in a batch rebate claim on-chain`,
type: 'number',
default: 200, // This value (the marginal gain of a claim in GRT), should always exceed the marginal cost of a claim (in ETH gas)
default: 1, // This value (the marginal gain of a claim in GRT), should always exceed the marginal cost of a claim (in ETH gas)
group: 'Query Fees',
})
.option('voucher-redemption-batch-threshold', {
description: `Minimum total value of all rebates in an batch (in GRT) before the batch is claimed on-chain`,
type: 'number',
default: 2000,
default: 5,
group: 'Query Fees',
})
.option('voucher-redemption-max-batch-size', {
Expand Down
8 changes: 4 additions & 4 deletions packages/indexer-common/src/network-specification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export const IndexerOptions = z
url: z.string().url(),
geoCoordinates: z.number().array().length(2).default([31.780715, -41.179504]),
restakeRewards: z.boolean().default(true),
rebateClaimThreshold: GRT().default(200),
rebateClaimBatchThreshold: GRT().default(200),
rebateClaimThreshold: GRT().default(1),
rebateClaimBatchThreshold: GRT().default(5),
rebateClaimMaxBatchSize: positiveNumber().default(100),
poiDisputeMonitoring: z.boolean().default(false),
poiDisputableEpochs: positiveNumber().default(1),
defaultAllocationAmount: GRT().default(0.1),
voucherRedemptionThreshold: GRT().default(200),
voucherRedemptionBatchThreshold: GRT().default(2000),
voucherRedemptionThreshold: GRT().default(1),
voucherRedemptionBatchThreshold: GRT().default(5),
voucherRedemptionMaxBatchSize: positiveNumber().default(100),
allocationManagementMode: z
.enum(ALLOCATION_MANAGEMENT_MODE)
Expand Down

0 comments on commit 60dd4fe

Please sign in to comment.