Skip to content

Horizon fixes #1121

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

Merged
merged 4 commits into from
May 23, 2025
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
239 changes: 136 additions & 103 deletions README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions packages/indexer-agent/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ export const start = {
default: 0,
group: 'Ethereum',
})
.option('confirmation-blocks', {
description: 'The number of blocks to wait for a transaction to be confirmed',
type: 'number',
default: 3,
group: 'Ethereum',
})
.option('mnemonic', {
description: 'Mnemonic for the operator wallet',
type: 'string',
Expand Down Expand Up @@ -392,6 +398,7 @@ export async function createNetworkSpecification(
gasPriceMax: argv.gasPriceMax,
baseFeePerGasMax: argv.baseFeeGasMax,
maxTransactionAttempts: argv.maxTransactionAttempts,
confirmationBlocks: argv.confirmationBlocks,
}

const subgraphs = {
Expand Down
2 changes: 1 addition & 1 deletion packages/indexer-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@pinax/graph-networks-registry": "0.6.7",
"@graphprotocol/common-ts": "3.0.1",
"@graphprotocol/toolshed": "0.4.2",
"@graphprotocol/toolshed": "0.5.0",
"@semiotic-labs/tap-contracts-bindings": "2.0.0",
"@thi.ng/heaps": "1.2.38",
"@types/lodash.clonedeep": "^4.5.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export class CostModel
extends Model<CostModelAttributes, CostModelCreationAttributes>
implements CostModelAttributes
{
public id!: number
public deployment!: string
public model!: string | null
declare id: number
declare deployment: string
declare model: string | null
public variables!: CostModelVariables | null

public createdAt!: Date
public updatedAt!: Date
declare createdAt: Date
declare updatedAt: Date

// eslint-disable-next-line @typescript-eslint/ban-types
public toGraphQL(): object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,26 @@ export class IndexingRule
extends Model<IndexingRuleAttributes, IndexingRuleCreationAttributes>
implements IndexingRuleAttributes
{
public id!: number
public identifier!: string
public identifierType!: SubgraphIdentifierType
public allocationAmount!: string | null
public allocationLifetime!: number | null
public autoRenewal!: boolean
public parallelAllocations!: number | null
public maxAllocationPercentage!: number | null
public minSignal!: string | null
public maxSignal!: string | null
public minStake!: string | null
public minAverageQueryFees!: string | null
public custom!: string | null
public decisionBasis!: IndexingDecisionBasis
public requireSupported!: boolean
public safety!: boolean
public protocolNetwork!: string
declare id: number
declare identifier: string
declare identifierType: SubgraphIdentifierType
declare allocationAmount: string | null
declare allocationLifetime: number | null
declare autoRenewal: boolean
declare parallelAllocations: number | null
declare maxAllocationPercentage: number | null
declare minSignal: string | null
declare maxSignal: string | null
declare minStake: string | null
declare minAverageQueryFees: string | null
declare custom: string | null
declare decisionBasis: IndexingDecisionBasis
declare requireSupported: boolean
declare safety: boolean
declare protocolNetwork: string

public createdAt!: Date
public updatedAt!: Date
declare createdAt: Date
declare updatedAt: Date

// eslint-disable-next-line @typescript-eslint/ban-types
public toGraphQL(): object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ export class POIDispute
extends Model<POIDisputeAttributes, POIDisputeCreationAttributes>
implements POIDisputeAttributes
{
public allocationID!: string
public subgraphDeploymentID!: string
public allocationIndexer!: string
public allocationAmount!: string
public allocationProof!: string
public closedEpoch!: number
public closedEpochReferenceProof!: string | null
public closedEpochStartBlockHash!: string
public closedEpochStartBlockNumber!: number
public previousEpochReferenceProof!: string | null
public previousEpochStartBlockHash!: string
public previousEpochStartBlockNumber!: number
public status!: string
public protocolNetwork!: string
declare allocationID: string
declare subgraphDeploymentID: string
declare allocationIndexer: string
declare allocationAmount: string
declare allocationProof: string
declare closedEpoch: number
declare closedEpochReferenceProof: string | null
declare closedEpochStartBlockHash: string
declare closedEpochStartBlockNumber: number
declare previousEpochReferenceProof: string | null
declare previousEpochStartBlockHash: string
declare previousEpochStartBlockNumber: number
declare status: string
declare protocolNetwork: string

public createdAt!: Date
public updatedAt!: Date
declare createdAt: Date
declare updatedAt: Date

// eslint-disable-next-line @typescript-eslint/ban-types
public toGraphQL(): object {
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-common/src/network-specification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const TransactionMonitoring = z
.transform((x) => x * 10 ** 9)
.optional(),
maxTransactionAttempts: z.number().nonnegative().finite().default(0),
confirmationBlocks: positiveNumber().default(3),
})
.strict()
.default({}) // defaults will be used for instantiation when the TransactionMonitoring group is absent.
Expand Down
18 changes: 9 additions & 9 deletions packages/indexer-common/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export class Network {
deployment:
networkSubgraphDeploymentId !== undefined
? {
graphNode,
deployment: networkSubgraphDeploymentId,
}
graphNode,
deployment: networkSubgraphDeploymentId,
}
: undefined,
subgraphFreshnessChecker: networkSubgraphFreshnessChecker,
})
Expand All @@ -162,9 +162,9 @@ export class Network {
deployment:
tapSubgraphDeploymentId !== undefined
? {
graphNode,
deployment: tapSubgraphDeploymentId,
}
graphNode,
deployment: tapSubgraphDeploymentId,
}
: undefined,
endpoint: specification.subgraphs.tapSubgraph!.url,
subgraphFreshnessChecker: tapSubgraphFreshnessChecker,
Expand Down Expand Up @@ -218,9 +218,9 @@ export class Network {
deployment:
epochSubgraphDeploymentId !== undefined
? {
graphNode,
deployment: epochSubgraphDeploymentId,
}
graphNode,
deployment: epochSubgraphDeploymentId,
}
: undefined,
endpoint: specification.subgraphs.epochSubgraph.url,
subgraphFreshnessChecker: epochSubgraphFreshnessChecker,
Expand Down
4 changes: 2 additions & 2 deletions packages/indexer-common/src/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ export class TransactionManager {
tx = await this.wallet.sendTransaction(txRequest)
}

logger.info(`Transaction pending`, { tx: tx })
logger.info(`Transaction pending`, { tx: tx, confirmationBlocks: this.specification.confirmationBlocks })

const receipt = await this.ethereum.waitForTransaction(
tx.hash,
3,
this.specification.confirmationBlocks,
this.specification.gasIncreaseTimeout,
)

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@
resolved "https://registry.yarnpkg.com/@graphprotocol/subgraph-service/-/subgraph-service-0.3.4.tgz#38929c04d03ad06823f9a867c8a4aef4c7f581e7"
integrity sha512-POepREau0ExCz4ZJrlhzIS3RigEuzlbp/xlurpHkgaOn97cFAv3x9ZaE5a9uwh1azRm3Djz8RUBmXpqmwoK9NA==

"@graphprotocol/toolshed@0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@graphprotocol/toolshed/-/toolshed-0.4.2.tgz#511b2c7e1b6fbe229c01de0e5de484877534982b"
integrity sha512-qdIalumrmrh7+X0nVr+v/1ZFD0G0dgtE0W47tKZugiw7YKmwnBFkp9MnpYrNzm9NDbs2lk0hn8WBg3W980+hEw==
"@graphprotocol/toolshed@0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@graphprotocol/toolshed/-/toolshed-0.5.0.tgz#e1937d59a3d34bc5bacbc825827d6345ba662711"
integrity sha512-8KlLbee8TAhibUGpdSI04iOnI9gkfErchSqrp/SHU1V5RDuATNCuVe3MVmOt+Jdjc747bTU+OLU+7YxLcAa5Aw==
dependencies:
"@graphprotocol/contracts" "^7.1.2"
"@graphprotocol/horizon" "^0.3.2"
Expand Down
Loading