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

feat: batch post results #187

Merged
merged 4 commits into from
Jul 3, 2024
Merged

feat: batch post results #187

merged 4 commits into from
Jul 3, 2024

Conversation

gluax
Copy link
Collaborator

@gluax gluax commented Jul 3, 2024

Motivation

Batching means less calls = goodness.

Explanation of Changes

I moved the logic for posting a result and creating an event to a common function.
Handler is now implemented on the PostResult type to retain the post_result behavior.
Implements the PostDataResults method. I don't collect the events to avoid allocations.

Testing

Add new tests.

Related PRs and Issues

Don't merge till sedaprotocol/seda-common-rs#12 is merged and we update the seda-common dep to point to main.

Closes #181.

@gluax gluax self-assigned this Jul 3, 2024
@gluax
Copy link
Collaborator Author

gluax commented Jul 3, 2024

I realized I need to name the events differently. I can also clean up the post-data results test helper a bit!

For the event @Thomasvdam do you have any preferences on how I name the events for batch posting? Or is it ok they are all still the same?

Copy link
Member

@Thomasvdam Thomasvdam left a comment

Choose a reason for hiding this comment

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

I don't really have an opinion on the events yet because I don't know how these show up in the block data 😬 I'm not relying on any of it so feel free to make changes.

contract/src/msgs/data_requests/sudo/post_results.rs Outdated Show resolved Hide resolved
contract/src/msgs/data_requests/sudo/post_result.rs Outdated Show resolved Hide resolved
contract/src/msgs/data_requests/sudo/mod.rs Outdated Show resolved Hide resolved
@gluax gluax merged commit 1b85cb9 into main Jul 3, 2024
2 checks passed
@gluax gluax deleted the feat/batch-post-results branch July 3, 2024 20:52
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.

✨ Batch Post Results
2 participants