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

blockchain sync: reduce disk writes from 2 to 1 per tx [RELEASE] #9740

Open
wants to merge 1 commit into
base: release-v0.18
Choose a base branch
from

Conversation

jeffro256
Copy link
Contributor

@jeffro256
Copy link
Contributor Author

The line changes differ significantly from the master branch because I deleted the core_proxy tests in this commit to match master, instead of reworking them.

@@ -158,6 +159,48 @@ def test_p2p_reorg(self):
loops -= 1
assert loops >= 0

# create a transaction which both daemons have in their pool

Choose a reason for hiding this comment

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

This file has changed quite a bit on the release branch, probably a good idea to rebase and then adjust any changes you want to keep.

daemon2 = Daemon(idx = 2)
daemon3 = Daemon(idx = 3)

# check precondition: txid in daemon2 mempool

Choose a reason for hiding this comment

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

Probably easier to follow if you just fold this test into the tx_propagation test at the end, as it's quite intimately related (the first part would test pooled tx propagation, and the second part tx in block propagation). For an example of the overlap, the "precondition" here vanishes, because it's already been checked at the end of the prior function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree, they really are testing different things, but there's just a precondition that overlaps with the previous test case.

Copy link

@iamamyth iamamyth Feb 21, 2025

Choose a reason for hiding this comment

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

If you want it to be wholly separate, then you could make it that way by explicitly adding a transaction to the pool in this test. Having tests depend on state configured by other tests makes failures all the more difficult to comprehend. Introducing such a dependency for efficiency purposes actually makes matters worse, because a fast E2E test suite requires parallelization, and independence makes that job a lot easier. I won't belabor the point because the functional test suite has so many structural flaws.

# wait until both are synced
loops = 5
while True:
res2 = daemon2.get_info()

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good point, I'll push a commit for this in a minute

@iamamyth
Copy link

I won't have time for further discussion/re-review, please proceed as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants