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

Fix Slow down on BadInputsUTxO error #1943

Merged
merged 1 commit into from
Oct 27, 2020
Merged

Conversation

TimSheard
Copy link
Contributor

The BadInputsUTxO error computes an error report in a way that is very expensive.
This was first brought to my attention by this node issue.
IntersectMBO/cardano-node#2022

Further analysis showed that that it might be related to
IntersectMBO/ouroboros-consensus#732
because a high instance of BadInputsUTxO failures were correlated with the slowdown.

Some analysis showed the computing the error report for BadInputsUTxO required computing this expression: (txins txb Set.difference eval (dom utxo))

Computing the domain of utxo is very expensive. Change this line to
(Set.filter (\ x -> not(Map.member x (unUTxO utxo))) (txins txb))
and things are fixed. This PR solves that problem.

We have added an issue IntersectMBO/ouroboros-network#1942 to add set difference to the set algebra, using this mapping (set difference to set filter) when time permits

Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

thank you @TimSheard ! (looks like ormolu is complaining)

@JaredCorduan JaredCorduan merged commit f931e30 into master Oct 27, 2020
@iohk-bors iohk-bors bot deleted the ts-fix-BadInputsUTxO branch October 27, 2020 20:07
@JaredCorduan
Copy link
Contributor

@nc6 I just remembered that we should be using the proper commit structure. Apologies, I will do my best to remember not to merge PRs without the proper structure.

mrBliss added a commit to IntersectMBO/ouroboros-network that referenced this pull request Oct 28, 2020
mrBliss added a commit to IntersectMBO/ouroboros-network that referenced this pull request Oct 28, 2020
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Oct 28, 2020
iohk-bors bot added a commit to IntersectMBO/ouroboros-network that referenced this pull request Oct 28, 2020
2712: Update dependency on cardano-ledger-specs r=deepfire a=mrBliss

The main reason is to pull in:
IntersectMBO/cardano-ledger#1943

Co-authored-by: Thomas Winant <[email protected]>
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Oct 28, 2020
iohk-bors bot added a commit to IntersectMBO/cardano-node that referenced this pull request Oct 28, 2020
2029: Update dependency on ledger and consensus r=mrBliss a=mrBliss

The main reason is to pull in:
IntersectMBO/cardano-ledger#1943

Co-authored-by: Thomas Winant <[email protected]>
JaredCorduan pushed a commit to IntersectMBO/cardano-node that referenced this pull request Nov 3, 2020
nc6 added a commit that referenced this pull request Feb 18, 2021
PR #1943 addressed a problem that caused low performance when certain
types of transactions were rejected. However, this fix was only applied
in the Shelley era, not the MA era. Consequently, when we bumped to
Shelley MA, a regression was caused.

This commit applies the same fix as used in the Shelley era into the MA
eras.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants