Skip to content

Conversation

@wlawt
Copy link
Contributor

@wlawt wlawt commented Sep 22, 2025

Overview

Add a queue to buffer transactions before writing to hot database.

This will allow the DB Writer to be a consumer of this queue and then be able to insert_bundle to datastore.

Tests

  • Wrote unit test
  • CI passes

TODO

  • Tests
  • Implement queue limit/size?

Copy link
Collaborator

@danyalprout danyalprout left a comment

Choose a reason for hiding this comment

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

lgtm, lets also update the docker-compose file here to add a new topic (tips-ingress) or something

Comment on lines +25 to +29
pub async fn enqueue_bundle(
&self,
bundle: &EthSendBundle,
sender: Address,
) -> Result<(), Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add some retry logic with a backoff to this function? Maybe we can pull in this crate:

https://crates.io/crates/backon

Comment on lines +64 to +66
.with_min_delay(Duration::from_millis(100))
.with_max_delay(Duration::from_secs(5))
.with_max_times(3),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could tune these params later?

command: |
sh -c "
kafka-topics --create --if-not-exists --topic tips-audit --bootstrap-server kafka:29092 --partitions 3 --replication-factor 1
kafka-topics --create --if-not-exists --topic tips-ingress --bootstrap-server kafka:29092 --partitions 3 --replication-factor 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we add a retention policy (time or size based)?

@wlawt wlawt marked this pull request as ready for review September 23, 2025 14:25
@wlawt wlawt requested a review from danyalprout September 23, 2025 14:26
@wlawt wlawt merged commit f21efc0 into master Sep 23, 2025
9 checks passed
@wlawt wlawt deleted the ingress-queue branch September 23, 2025 14:46
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.

3 participants