-
Notifications
You must be signed in to change notification settings - Fork 36.2k
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: add unit test for non-standard txs w/ too large tx size #17570
Conversation
The function IsStandardTx() returns rejection reason tx-size if the transaction's size is larger than MAX_STANDARD_TX_WEIGHT, which is as of now defined as 400000.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
Using numbers to close to the MAX_STANARD_TX_WEIGHT, might cause problems down the road. Since the actual tx weight depends on more than just the size of the input array, the test might fail if it is moved above or under other tests, which mutate the tx object. Was also the reason why the initial commit failed the test
Would it be easier to just make a new transaction, make the vin size large enough to just break the size, rather than using an arbitrarily large number? |
Sure. Completely new transaction object or reset the existing one to the default values? |
Needs rebase |
Hi @KaanKC, thanks for your pull request!
There is no need for a completely new object, you can just reuse the existing one ( |
Is anyone still working on this? |
Since this PR's author doesn't seem to be working on the unit test anymore, I created a new PR: #17947. |
Going to close in favour of #17947. |
Adds one of the missing tests of issue #17394: the function IsStandardTx() returns rejection reason
tx-size
if the transaction's size is larger than MAX_STANDARD_TX_WEIGHT, which is as of now defined as 400000.Simply increasing the size of
vin
seemed the easiest way to test this case.Heavily inspired by #17480