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

test: Assumeutxo: snapshots with less work should not be loaded #29428

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

hernanmarino
Copy link
Contributor

@hernanmarino hernanmarino commented Feb 13, 2024

This PR adds a test which checks that snapshots with less accumulated work than the node's active chain, should not be loaded and return with an error. Although in a different context of discussion the missing test was detect in a thread in #29394 (see #29394 (comment))

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 13, 2024

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK maflcko, kevkevinpal, alfonsoromanz, achow101
Stale ACK BrandonOdiwuor, rkrux

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29996 (test: Assumeutxo: import snapshot in a node with a divergent chain by alfonsoromanz)
  • #29553 (assumeutxo: Add dumptxoutset height param, remove shell scripts by fjahr)

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.

@DrahtBot DrahtBot added the Tests label Feb 13, 2024
@maflcko
Copy link
Member

maflcko commented Feb 14, 2024

@aureleoules
Copy link
Member

Looks like corecheck.dev/bitcoin/bitcoin/pulls/29428 is dead?

@maflcko thanks for the ping. The code I added to filter out flaky coverage was too slow and isn't very reliable so I removed it. Unfortunately, the UI will now display flaky coverage.

@maflcko
Copy link
Member

maflcko commented Feb 19, 2024

You'll have to remove the TODO on the top of the file as well, when the test was added?

@hernanmarino
Copy link
Contributor Author

You'll have to remove the TODO on the top of the file as well, when the test was added?

Done. It'll be updated with my next push

Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor left a comment

Choose a reason for hiding this comment

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

Code Review ACK 8603741

Should remove the TODO fixed by this commit

@maflcko
Copy link
Member

maflcko commented Apr 23, 2024

Are you still working on this?

@hernanmarino hernanmarino marked this pull request as ready for review April 23, 2024 17:23
@hernanmarino
Copy link
Contributor Author

Are you still working on this?

I haven´t been able to think of / work on other tests to add, but the current commit test is ready for review, so i am taking the PR out of Draft status.

@maflcko
Copy link
Member

maflcko commented Apr 23, 2024

I was asking, because you said you'd update the branch in February: #29428 (comment)

@hernanmarino hernanmarino changed the title test: add missing tests for Assumeutxo test: Assumeutxo: snapshots with less work should not be loaded Apr 23, 2024
@hernanmarino
Copy link
Contributor Author

Updated to remove a (no lonnger valid) TODO comment as requested in #29428 (comment). Also updated the PR title and description.

@maflcko
Copy link
Member

maflcko commented Apr 24, 2024

Please delete the hidden comment in the pull description, because this will end up in the merge commit.

@hernanmarino
Copy link
Contributor Author

hernanmarino commented Apr 24, 2024

Please delete the hidden comment in the pull description, because this will end up in the merge commit.

Oh, sorry for that. Deleted.

Copy link
Contributor

@alfonsoromanz alfonsoromanz left a comment

Choose a reason for hiding this comment

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

Code review and tested ACK 4922f56

@maflcko
Copy link
Member

maflcko commented Apr 29, 2024

For detailed information about the code coverage, see the test coverage report.

@aureleoules @adamjonas Looks like this is down again. LambdaTimeout - 2024-04-29T11:09:51.844Z 3957d9f6-7e67-4e79-bf45-9569b4491cd0 Task timed out after 10.01 seconds

Copy link
Contributor

@alfonsoromanz alfonsoromanz left a comment

Choose a reason for hiding this comment

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

Re ACK 2f1b1ee

@hernanmarino
Copy link
Contributor Author

Updated to re add an incorrectly removed TODO comment.

@maflcko
Copy link
Member

maflcko commented May 1, 2024

lgtm ACK 2f1b1ee

Copy link

@rkrux rkrux left a comment

Choose a reason for hiding this comment

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

crACK, utACK 2f1b1eee

Thanks for adding the test, it's short and to the point. However, I've not been able to build the branch because it fails on my system (MAC i7) with the following error. I understand it is because this branch doesn't contain the latest changes of the master branch, notably this one: #29081.

util/time.cpp:54:9: error: use of undeclared identifier 'gmtime_s'; did you mean 'gmtime_r'?
    if (gmtime_s(&epoch, &time_val) != 0) {
        ^~~~~~~~
        gmtime_r

@achow101
Copy link
Member

achow101 commented May 9, 2024

Needs rebase (for some reason Drahtbot isn't detecting this)

@hernanmarino
Copy link
Contributor Author

Needs rebase (for some reason Drahtbot isn't detecting this)

Rebased. Also deleted a couple of redundant comment as suggested by @maflcko to retrigger the false negative CI

assert_equal(node.getblockcount(), FINAL_HEIGHT)
with node.assert_debug_log(expected_msgs=["[snapshot] activation failed - work does not exceed active chainstate"]):
assert_raises_rpc_error(-32603, "Unable to load UTXO snapshot", node.loadtxoutset, dump_output_path)
self.restart_node(0, extra_args=self.extra_args[0])
Copy link
Member

Choose a reason for hiding this comment

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

why restart if you aren't doing anything with the node?

@maflcko
Copy link
Member

maflcko commented May 23, 2024

utACK df6dc2a

@kevkevinpal
Copy link
Contributor

utACK df6dc2a

Copy link
Contributor

@alfonsoromanz alfonsoromanz left a comment

Choose a reason for hiding this comment

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

Re ACK df6dc2a. Make is successful and the test passes.

Screenshot 2024-05-28 at 09 55 15 Screenshot 2024-05-28 at 09 58 39

@achow101
Copy link
Member

achow101 commented Jun 4, 2024

ACK df6dc2a

@achow101 achow101 merged commit 56ea8ed into bitcoin:master Jun 4, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants