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 for Mempool and BP using different State Services #243

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ejMina226
Copy link
Collaborator

@ejMina226 ejMina226 commented Dec 13, 2024

A community member reported seeing an issue where a tx was stuck in pending, i.e. never included in a block. This was because when a block is produced it checks to see if a tx is valid, which involves checking the nonce (amongst other things). A previous tx had already been sent from the same sender, but this was not being noticed by the BP and so expected the tx in the mempool to have nonce 0, rather the the correct nonce of 1, which it in fact had. Consequently, the tx was never picked up and just sat there in the mempool.

@ejMina226 ejMina226 self-assigned this Dec 13, 2024
@ejMina226 ejMina226 requested review from maht0rz and rpanic December 13, 2024 09:12
@@ -337,6 +337,107 @@ describe("block production", () => {
expect(newState).toBeUndefined();
}, 30_000);

it("should produce txs in non-consecutive blocks", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

@ejMina226 What is the unique thing of this test that isn't covered in the others? Can this be modeled using the multiple blocks test in line 471(ish)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wanted the txs to appear in non-consecutive blocks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The should produce multiple blocks with multiple batches with multiple transactions has consecutive blocks of txs, I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Happy to remove if you think it overkill.

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by non-consecutive? If I understand it correctly, you have 1 tx per block here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are two different senders. I wanted the first sender to have their txs in non-consecutive blocks. The second sender is just to ensure the interim blocks are non-empty.

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