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

mempool: Disable during initial block download #1135

Merged
merged 4 commits into from
Aug 4, 2023
Merged

Conversation

iljakuklic
Copy link
Contributor

This also changes slightly how IBD is detected, where block timestamp is taken into account even for genesis.

chainstate/src/config.rs Outdated Show resolved Hide resolved
chainstate/src/detail/mod.rs Show resolved Hide resolved
mempool/src/pool/reorg.rs Outdated Show resolved Hide resolved
mempool/src/pool/tests/mod.rs Outdated Show resolved Hide resolved
mempool/src/pool/tests/mod.rs Outdated Show resolved Hide resolved
mempool/src/error/mod.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@TheQuantumPhysicist TheQuantumPhysicist left a comment

Choose a reason for hiding this comment

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

No complaints from my side. Looks good.

@TheQuantumPhysicist
Copy link
Collaborator

Can we add functional tests though? How hard would that be?

@iljakuklic
Copy link
Contributor Author

Can we add functional tests though? How hard would that be?

Not sure, the existing tests for this functionality all rely on the ability to mock time.

@TheQuantumPhysicist
Copy link
Collaborator

Not sure, the existing tests for this functionality all rely on the ability to mock time.

You can mock time in functional tests too. There's a command line argument for the initial time, and there's an rpc function to set the mock time. You can give it a shot. I don't believe any of us used it before though.

@iljakuklic iljakuklic force-pushed the mempool-ibd branch 2 times, most recently from 6d20cf8 to 5039d28 Compare August 3, 2023 22:30
@iljakuklic
Copy link
Contributor Author

Not sure, the existing tests for this functionality all rely on the ability to mock time.

You can mock time in functional tests too. There's a command line argument for the initial time, and there's an rpc function to set the mock time. You can give it a shot. I don't believe any of us used it before though.

A basic functional test is now there

This also changes slightly how IBD is detected, where block timestamp is
taken into account even for genesis.
@iljakuklic iljakuklic merged commit 72b0e1c into master Aug 4, 2023
23 checks passed
@iljakuklic iljakuklic deleted the mempool-ibd branch August 4, 2023 18:02
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.

None yet

5 participants