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

Send a batch of blocks #35

Closed
wants to merge 1 commit into from
Closed

Send a batch of blocks #35

wants to merge 1 commit into from

Conversation

vegarsti
Copy link
Member

@vegarsti vegarsti commented Jun 24, 2024

This PR changes the node indexer from sending one block at a time to sending a batch of blocks. Earlier we implemented concurrent block fetching with buffering (#32). On a configurable interval (defaults to every second), we now check the buffer and send all possible blocks.

This is still a WIP and probably should be split into two PRs

  1. Batch requests on the DuneAPI client
  2. Batch requests in the Ingester

We cannot use/merge this until we have support for batch requests on the API.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @vegarsti and the rest of your teammates on Graphite Graphite

client/duneapi/client.go Show resolved Hide resolved
client/duneapi/client.go Show resolved Hide resolved
client/duneapi/client.go Show resolved Hide resolved
client/duneapi/client.go Show resolved Hide resolved
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("unexpected status code: %v, %v", resp.StatusCode, resp.Status)
}
responseStatus = resp.Status
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought you need a header to say:
req.Header.Set(x-dune-batch-size", len(blocks)) or something, to simplify the server side, otherwise the server side needs to...

humm.. you're right, we don't need it, because "opstack" means 3 messages per block, so the server can derive how many blocks it has received.

when we use non-opstack, we we might need to pass additional information in the headers.

Copy link
Member Author

@vegarsti vegarsti Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, doesn't hurt to declare this in a header, that way we know what to expect!

client/duneapi/models.go Show resolved Hide resolved
@vegarsti
Copy link
Member Author

vegarsti commented Jun 24, 2024

Thanks for the feedback! I probably didn't make it very clear, but the Dune API client part was a bit rushed, but I know what to do there, I think. I do need more eyes/opinions on the Ingester part though

@vegarsti
Copy link
Member Author

Superseded by #36 and #37.

@vegarsti vegarsti closed this Jun 25, 2024
@vegarsti vegarsti deleted the batch-blocks branch June 25, 2024 12:32
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.

2 participants