Skip to content
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

Increase combiner request batch size #299

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant