-
Notifications
You must be signed in to change notification settings - Fork 22
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 test: generate txs larger than the entire mempool #1230
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
f15f603
to
a7bd1c5
Compare
12e99f1
to
7a08ed5
Compare
703c758
to
2f5f06c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
6ad371d
to
9c022f3
Compare
7a08ed5
to
cb8d629
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor changes
ouroboros-consensus/src/unstable-mock-block/Ouroboros/Consensus/Mock/Ledger/State.hs
Outdated
Show resolved
Hide resolved
@@ -492,6 +508,7 @@ genValidTxs = go [] | |||
(tx, ledger') <- genValidTx ledger | |||
go (tx:txs) (n - 1) ledger' | |||
|
|||
-- | Generate a valid transaction (but ignoring any per-tx size limits). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is a bit confusing. Does mustBeValid
not check the per-tx size limit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not as we use testLedgerConfigNoSizeLimits
in this particular case. The current approach is to first generate "non-large" txs, and then use that to set the mempool size (already before this PR) and the per-tx limit.
cb8d629
to
5fb0684
Compare
Closes #1226
In addition to the previously valid/invalid txs (purely based on the UTxO ledger rules), we add an optional per-tx limit to the mock block.
As a second step, we generate very large txs that are larger than an entire mempool, in order to test that we do not block when adding them (just like the other txs), which is important as explained in #1226.
One way to validate this PR is to introduce a bug that would cause us to block on such transactions, and observe that the test now indeed catches that.
For example, retrying when the per-tx limited is not satisfied (this is basically what happened in #1168 and was fixed by #1225) via
or here
will cause many test failures with
FailureDeadlock [Labelled (ThreadId []) (Just "main")]'
viaio-sim
's nice deadlock detection.Stacked on top of #1175 to avoid boring rebase work