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

fix(sidecar): process pending bundle diffs #169

Merged
merged 4 commits into from
Jul 29, 2024
Merged

Conversation

merklefruit
Copy link
Collaborator

@merklefruit merklefruit commented Jul 29, 2024

Overview

When validating requests containing multiple transactions, we need to take into account the previous transactions in the bundle as increasing the nonce (and decreasing the balance) of the account that sent it, even if they haven't been committed yet to the template.

This fixes the issue by introducing two maps to keep track of the pending state due to these requests.

Note that if anything in the request fails validation, the whole bundle won't be committed, as expected.

Tests

@merklefruit merklefruit marked this pull request as ready for review July 29, 2024 10:55
Copy link
Contributor

@thedevbirb thedevbirb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! The changes make sense. If you have time, can please add some unit tests with bundles?

bolt-sidecar/src/state/execution.rs Outdated Show resolved Hide resolved
Base automatically changed from fix/bolt-client to unstable July 29, 2024 11:36
Copy link
Contributor

@mempirate mempirate left a comment

Choose a reason for hiding this comment

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

Lgtm!

@merklefruit merklefruit added C: bolt-sidecar Component: bolt-sidecar T: bug Type: Bug labels Jul 29, 2024
@thedevbirb thedevbirb merged commit 792b00e into unstable Jul 29, 2024
2 checks passed
@thedevbirb thedevbirb deleted the fix/sidecar/bundles branch July 29, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-sidecar Component: bolt-sidecar T: bug Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants