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

Handle consumed balance #59

Merged
merged 5 commits into from
Nov 28, 2024
Merged

Conversation

andreibancioiu
Copy link
Contributor

@andreibancioiu andreibancioiu commented Nov 25, 2024

Make sure we don't select not-executable transactions (at all). Here, we handle transactions whose execution fee cannot be paid (anymore) by the sender.

Integration PR:

@andreibancioiu andreibancioiu self-assigned this Nov 25, 2024
senderBalance := item.senderState.Balance

willFeeExceedBalance := futureAccumulatedFee.Cmp(senderBalance) > 0
willFeeExceedBalance := futureConsumedBalance.Cmp(senderBalance) > 0
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 don't detect invalid transactions. We always assume that the value to be transferred is actually transferred (even if it isn't, actually, during processing).

We'll stop selecting transactions from a given sender once we detect (under the assumption above) that she doesn't have enough balance to pay the fee for the "currentTransaction".

@andreibancioiu andreibancioiu marked this pull request as ready for review November 27, 2024 08:27
raduchis
raduchis previously approved these changes Nov 28, 2024
Base automatically changed from MX-16179-guardians to feat/mempool November 28, 2024 11:02
@andreibancioiu andreibancioiu dismissed raduchis’s stale review November 28, 2024 11:02

The base branch was changed.

@AdoAdoAdo AdoAdoAdo merged commit a3a849d into feat/mempool Nov 28, 2024
2 checks passed
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