Skip to content

Conversation

@DariusParvin
Copy link
Contributor

Run mempool_reorg.py test even when the wallet is disabled, as discussed in #20078.

As part of this PR I created a new method in MiniWallet, create_self_transfer, to return a raw tx (without broadcasting it) and its associated utxo.

@DariusParvin DariusParvin force-pushed the mempool-reorg-to-miniwallet branch from 8e3f29e to 2ff5034 Compare February 15, 2021 04:05
@DrahtBot DrahtBot added the Tests label Feb 15, 2021
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 15, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

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

Concept ACK, very nice!

Copy link

@felipsoarez felipsoarez left a comment

Choose a reason for hiding this comment

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

Concept ACK

Copy link
Member

Choose a reason for hiding this comment

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

Generating blocks takes a few seconds in valgrind, so I am thinking if this test may benefit from using miniwallet.scan_blocks (to be introduced in #21200)

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 had a go but I don't think it helps in this case since the pre-mined chain doesn't send the coinbase transaction to self._address. I made it little bit faster though by only mining 100 blocks instead of 200.

Copy link
Member

@maflcko maflcko Apr 20, 2021

Choose a reason for hiding this comment

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

It should. Specifically the last 25 mature blocks (including block 100). And the last 25 immature blocks (including block 200), but you don't need those.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, there was a bug. If you rebase, the bug should fix itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it worked! I updated the PR to use miniwallet.scan_blocks starting from block 76.

Copy link
Contributor

@stackman27 stackman27 left a comment

Choose a reason for hiding this comment

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

Concept ACK. mempool_reorg looks really good except, is there a reason why we aren't using self.log.info(...)? I always thought of them to be really helpful while running tests. Therefore, i think it'll be really nice to add the logs :)

@fanquake
Copy link
Member

fanquake commented Apr 1, 2021

@DariusParvin are you planning on following up with the review comments here?

@DariusParvin
Copy link
Contributor Author

@fanquake Yes, thanks for prompting me, I'll push updates this weekend!

@DariusParvin DariusParvin force-pushed the mempool-reorg-to-miniwallet branch from 2ff5034 to 8062fb8 Compare April 5, 2021 05:01
@DariusParvin
Copy link
Contributor Author

I've addressed the comments, but since there are conflicting changes with #20874, it would probably make sense for that one to get merged first.

@DariusParvin
Copy link
Contributor Author

@stackman27 thanks for your review! I added logs instead of comments, as you suggested.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

cr ACK a856630c27cd28186d4e39dd1129f0cae8149261

@michaelfolkson
Copy link

michaelfolkson commented May 17, 2021

I've addressed the comments, but since there are conflicting changes with #20874, it would probably make sense for that one to get merged first.

Is this still waiting on #20874? Given Marco has reviewed this and not #20874 presumably this is closer to merging? 😅

edit: #20874 needs a rebase so yeah I think this is closer to merging. Obvious Concept ACK too btw.

@michaelfolkson
Copy link

michaelfolkson commented May 17, 2021

The test is still skipped when wallet is disabled. I think you need to delete:

def skip_test_if_missing_module(self):
        self.skip_if_no_wallet()

@DariusParvin DariusParvin force-pushed the mempool-reorg-to-miniwallet branch from a856630 to ded2a49 Compare May 17, 2021 15:22
@DariusParvin
Copy link
Contributor Author

DariusParvin commented May 17, 2021

@michaelfolkson oops! I removed those lines. And yes, since #21762 where create_self_transfer was added, this PR is relatively independent of everything else, so it's not waiting on anything. Cheers

@DariusParvin DariusParvin force-pushed the mempool-reorg-to-miniwallet branch 2 times, most recently from 25380cf to 65dd482 Compare May 18, 2021 07:15
Copy link

@michaelfolkson michaelfolkson left a comment

Choose a reason for hiding this comment

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

ACK 65dd482ba8c87443e4c27dc28f2027625ca43005

Reviewed code, test passes (and not skipped) with wallet disabled.

@michaelfolkson
Copy link

Re-ACK 163e8881e88a798462a60b5232a6b4ff62e1969a

@maflcko
Copy link
Member

maflcko commented May 31, 2021

s/disable/disabled/ in commit message 163e8881e88a798462a60b5232a6b4ff62e1969a

@DariusParvin DariusParvin force-pushed the mempool-reorg-to-miniwallet branch from 163e888 to 1c9d072 Compare May 31, 2021 16:18
- run mempool_reorg.py even when the wallet is not compiled
- add `locktime` argument to `create_self_transfer` and `send_self_transfer`
- use more logs instead of comments
@DariusParvin DariusParvin force-pushed the mempool-reorg-to-miniwallet branch from 1c9d072 to a3f0cbf Compare May 31, 2021 16:28
@DariusParvin
Copy link
Contributor Author

thanks @MarcoFalke! typo fixed and rebased

@maflcko
Copy link
Member

maflcko commented Jun 1, 2021

cr ACK a3f0cbf

@maflcko maflcko merged commit 7e83e74 into bitcoin:master Jun 1, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 1, 2021
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants