Skip to content

Commit

Permalink
common: drive getPendingRAVs from allocations eventual instead of re-…
Browse files Browse the repository at this point in the history
…querying, disable jsonify of allocations
  • Loading branch information
dwerner committed Dec 27, 2024
1 parent 77a412b commit 0b6f895
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
14 changes: 14 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
networkIdentifier: "hardhat"
indexerOptions:
geoCoordinates: [48.4682, -123.524]
defaultAllocationAmount: 10000
allocationManagementMode: "auto"
restakeRewards: true
poiDisputeMonitoring: false
voucherRedemptionThreshold: 0.00001
voucherRedemptionBatchThreshold: 10
rebateClaimThreshold: 0.00001
rebateClaimBatchThreshold: 10
subgraphs:
maxBlockDistance: 5000
freshnessSleepMilliseconds: 1000
13 changes: 2 additions & 11 deletions packages/indexer-common/src/allocations/tap-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
allocationSigner,
tapAllocationIdProof,
parseGraphQLAllocation,
sequentialTimerMap,
} from '..'
import { BigNumber } from 'ethers'
import pReduce from 'p-reduce'
Expand Down Expand Up @@ -184,12 +183,8 @@ export class TapCollector {
}

private getPendingRAVs(): Eventual<RavWithAllocation[]> {
return sequentialTimerMap(
{
logger: this.logger,
milliseconds: RAV_CHECK_INTERVAL_MS,
},
async () => {
return this.allocations.throttle(RAV_CHECK_INTERVAL_MS).tryMap(
async (allocations) => {
let ravs = await this.pendingRAVs()
if (ravs.length === 0) {
this.logger.info(`No pending RAVs to process`)
Expand All @@ -198,10 +193,6 @@ export class TapCollector {
if (ravs.length > 0) {
ravs = await this.filterAndUpdateRavs(ravs)
}
const allocations: Allocation[] = await this.getAllocationsfromAllocationIds(ravs)
this.logger.info(
`Retrieved allocations for pending RAVs \n: ${JSON.stringify(allocations)}`,
)
return ravs
.map((rav) => {
const signedRav = rav.getSignedRAV()
Expand Down
7 changes: 7 additions & 0 deletions tap-contracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"1337": {
"TAPVerifier": "0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7",
"AllocationIDTracker": "0x36b58F5C1969B7b6591D752ea6F5486D069010AB",
"Escrow": "0x0355B7B8cb128fA5692729Ab3AAa199C1753f726"
}
}

0 comments on commit 0b6f895

Please sign in to comment.