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

fake_peer_set::mempool_requests_for_transactions failed with Nil response #5384

Closed
teor2345 opened this issue Oct 11, 2022 · 15 comments · Fixed by #5398 or #5753
Closed

fake_peer_set::mempool_requests_for_transactions failed with Nil response #5384

teor2345 opened this issue Oct 11, 2022 · 15 comments · Fixed by #5398 or #5753
Labels
C-bug Category: This is a bug C-testing Category: These are tests I-integration-fail Continuous integration fails, including build and test failures

Comments

@teor2345
Copy link
Contributor

teor2345 commented Oct 11, 2022

Motivation

In PR #5383, fake_peer_set::mempool_requests_for_transactions failed with:

internal error: entered unreachable code: MempoolTransactionIds requests should always respond Ok(Vec<UnminedTxId>), got Ok(Nil)

Originally posted by @teor2345 in #5383 (comment)

Solution

Just allow a Nil response, the other tests cover this case as well.

@teor2345 teor2345 added C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures P-Low ❄️ labels Oct 11, 2022
@arya2 arya2 self-assigned this Oct 12, 2022
@mergify mergify bot closed this as completed in #5398 Oct 13, 2022
@teor2345 teor2345 reopened this Nov 8, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 8, 2022

Failed again in PR #5561

Message: response to MempoolTransactionIds request should match added_transaction_ids [Legacy(transaction::Hash("c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb"))]

https://github.com/ZcashFoundation/zebra/actions/runs/3413929832/jobs/5681223874#step:14:8817

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 9, 2022

Failed again locally:

Message: response to MempoolTransactionIds request should match added_transaction_ids [Legacy(transaction::Hash("c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb"))]
Location: zebrad/src/components/inbound/tests/fake_peer_set.rs:81
failures:
components::inbound::tests::fake_peer_set::mempool_requests_for_transactions

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 9, 2022

Failed in CI:
https://github.com/ZcashFoundation/zebra/actions/runs/3423847000/jobs/5703529589#step:3:9323

@mpguerra this test seems to be failing a lot, maybe we should just fix it quickly by accepting a Nil response as well?

@mpguerra
Copy link
Contributor

mpguerra commented Nov 9, 2022

How do we know that it failed with Nil response, as opposed to a different unexpected response? It's not clear to me from the logs...

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 9, 2022

How do we know that it failed with Nil response, as opposed to a different unexpected response? It's not clear to me from the logs...

That specific log message is only used when Nil is returned:

Ok(Response::Nil) => assert!(
added_transaction_ids.is_empty(),
"response to `MempoolTransactionIds` request should match added_transaction_ids {:?}",
added_transaction_ids
),

The log should probably also say Nil, or log the actual response.

@teor2345 teor2345 added the C-testing Category: These are tests label Nov 9, 2022
@mpguerra
Copy link
Contributor

mpguerra commented Nov 17, 2022

@mpguerra
Copy link
Contributor

@teor2345
Copy link
Contributor Author

I think we should just allow a Nil response here.

We could also retry the request until it is not Nil, with a sleep in between, and a limit on the number of retries. But that will only work if the transactions are pending, rather than ignored or deleted.

@teor2345
Copy link
Contributor Author

Failed on PR #5696 in the mergify queue:
https://github.com/ZcashFoundation/zebra/actions/runs/3528199882/jobs/5918491910#step:3:9480

@mpguerra can we schedule this fix in the next sprint? It is a very quick fix.

@teor2345
Copy link
Contributor Author

@teor2345
Copy link
Contributor Author

@mpguerra
Copy link
Contributor

Failed on PR #5696 in the mergify queue: https://github.com/ZcashFoundation/zebra/actions/runs/3528199882/jobs/5918491910#step:3:9480

@mpguerra can we schedule this fix in the next sprint? It is a very quick fix.

Added to current sprint (sprint 24)

@teor2345
Copy link
Contributor Author

@teor2345
Copy link
Contributor Author

This has failed at least 5 times today, so I think it's a high priority.

@oxarbitrage can you fix this tomorrow, or would you like me to?

@arya2
Copy link
Contributor

arya2 commented Dec 1, 2022

I think we should just allow a Nil response here.

We could also retry the request until it is not Nil, with a sleep in between, and a limit on the number of retries. But that will only work if the transactions are pending, rather than ignored or deleted.

I think the dummy_call() happening when the mempool is enabled for tests calls reject_and_remove_same_effects and the transaction ids are rejected/ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug C-testing Category: These are tests I-integration-fail Continuous integration fails, including build and test failures
Projects
None yet
3 participants