Skip to content

Conversation

@cce
Copy link
Contributor

@cce cce commented Oct 28, 2022

Summary

TestTransactionGroup is used by the transaction message handler to see if a transaction is already in the pool. It makes a child cow, which allocates a fair amount of objects, only to look up the transaction ID later from an empty map (and afterwards looking up the ID in the parent's map). This skips those allocations in TestTransactionGroup.

Test Plan

Existing tests should pass, new tests could be written to assert that TestTransactionGroup does not modify the parent cow.

Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

How about remove the cow parameter from eval.TestTransaction method, and use eval.state for the checkDup call that's inside?

@cce
Copy link
Contributor Author

cce commented Oct 28, 2022

@jannotti updated as per feedback

@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Merging #4706 (cd687ae) into master (ad08f74) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4706      +/-   ##
==========================================
- Coverage   54.49%   54.46%   -0.03%     
==========================================
  Files         407      407              
  Lines       52389    52388       -1     
==========================================
- Hits        28548    28535      -13     
- Misses      21455    21466      +11     
- Partials     2386     2387       +1     
Impacted Files Coverage Δ
ledger/internal/eval.go 67.79% <100.00%> (-0.05%) ⬇️
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
crypto/merkletrie/trie.go 66.42% <0.00%> (-2.19%) ⬇️
agreement/cryptoVerifier.go 67.60% <0.00%> (-2.12%) ⬇️
agreement/proposalManager.go 96.07% <0.00%> (-1.97%) ⬇️
crypto/merkletrie/node.go 91.62% <0.00%> (-1.87%) ⬇️
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
data/transactions/verify/txn.go 76.19% <0.00%> (-0.96%) ⬇️
ledger/acctupdates.go 69.59% <0.00%> (-0.60%) ⬇️
network/wsPeer.go 68.44% <0.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cce cce marked this pull request as ready for review October 28, 2022 18:31
Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

ship it

@algorandskiy algorandskiy merged commit 7602d4f into algorand:master Oct 31, 2022
@cce cce deleted the txhandler-no-child-dup-check branch November 2, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants