Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Increase combiner request batch size#299

Open
aomerk wants to merge 5 commits intomasterfrom
ali/forta-1521-increase-combiner-request-batch-size
Open

Increase combiner request batch size#299
aomerk wants to merge 5 commits intomasterfrom
ali/forta-1521-increase-combiner-request-batch-size

Conversation

@aomerk
Copy link
Contributor

@aomerk aomerk commented Jan 12, 2024

Changes:

  • Starts using fragments to reduce request footprint (see example request below)
  • increases batch size to 50. this seems to work well running locally against production public API. It'll retry with half the batch size in worst case scenario
  • Removed internal server error handler. Since the alert fetcher retries on all errors, needs unnecessary complexity

Improved query example:

fragment alertDetails on Alert {
    alertId
    addresses
    contracts {
        name
        projectId
    }
    createdAt
    description
    hash
    metadata
    name
    projects {
        id
    }
    protocol
    scanNodeCount
    severity
    source {
        transactionHash
        bot {
            chainIds
            createdAt
            description
            developer
            docReference
            enabled
            id
            image
            name
            reference
            repository
            projects
            scanNodes
            version
        }
        block {
            number
            hash
            timestamp
            chainId
        }
        sourceAlert {
            hash
            botId
            timestamp
            chainId
        }
    }
    alertDocumentType
    findingType
    relatedAlerts
    chainId
    labels {
        label
        confidence
        entity
        entityType
        remove
        metadata
        uniqueKey
        embedding
    }
    addressBloomFilter {
        bitset
        itemCount
        k
        m
    }
}

query getAlerts($input0: AlertsInput,$input1: AlertsInput,$input2: AlertsInput) {
    alerts0: alerts(input: $input0) { pageInfo { hasNextPage endCursor { alertId blockNumber } } alerts {...alertDetails}}
    alerts1: alerts(input: $input1) { pageInfo { hasNextPage endCursor { alertId blockNumber } } alerts {...alertDetails} }
    alerts2: alerts(input: $input2) { pageInfo { hasNextPage endCursor { alertId blockNumber } } alerts {...alertDetails} }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant