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

eval: split TestTransactionGroup from BlockEvaluator using TransactionGroupTester #5818

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

cce
Copy link
Contributor

@cce cce commented Nov 3, 2023

Summary

eval.TestTransactionGroup (and TestTransaction) need only read-only access to a few details about the next pending block. This introduces an interface TestEvalContext that is used by the transaction pool, so that there can be parallel TX backlog workers checking if transactions are well-formed and move them from the backlogQueue to the postVerificationQueue.

Test Plan

Updated TxHandler test that was checking Remember() vs Test() and counting metrics bumped by different kinds of err returns.

@cce cce added the Enhancement label Nov 3, 2023
@cce cce force-pushed the parallelizable-test-txn branch from 506b9ed to b09a797 Compare September 11, 2024 16:27
@cce cce marked this pull request as ready for review October 4, 2024 18:31
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 51.14%. Comparing base (b7b3e5e) to head (d04bda9).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
data/pools/transactionPool.go 55.55% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5818      +/-   ##
==========================================
- Coverage   51.88%   51.14%   -0.75%     
==========================================
  Files         639      639              
  Lines       85489    85511      +22     
==========================================
- Hits        44359    43736     -623     
- Misses      38320    38909     +589     
- Partials     2810     2866      +56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gmalouf
gmalouf previously approved these changes Oct 17, 2024
data/txHandler.go Show resolved Hide resolved
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.

Seems like a good idea, I had small comments, but willing to approve as is.

data/txHandler.go Show resolved Hide resolved
data/pools/transactionPool.go Outdated Show resolved Hide resolved
@cce cce requested a review from jannotti November 8, 2024 14:09
@cce cce changed the title eval: split TestTransactionGroup from BlockEvaluator using TestEvalContext eval: split TestTransactionGroup from BlockEvaluator using TransactionGroupTester Nov 8, 2024
Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

So the idea is to have txpool.Test executed without taking pool.mu so do not block actual evaluation. LGTM

@@ -904,10 +904,34 @@ func (eval *BlockEvaluator) ResetTxnBytes() {
eval.blockTxBytes = 0
}

// TestTransactionGroup is only called by tests.
func (eval *BlockEvaluator) TestTransactionGroup(txgroup []transactions.SignedTxn) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

then move it to eval_test.go?

@@ -1163,6 +1188,7 @@ func (eval *BlockEvaluator) transaction(txn transactions.SignedTxn, evalParams *
}

// Transaction already in the ledger?
// this checks against the txns added to this evaluator; testTransaction currently only checks against committed txns.
Copy link
Contributor

Choose a reason for hiding this comment

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

// this checks against the txns added to this evaluator; testTransaction currently only checks against committed txns.

This is not 100% accurate, checkDup checks the ledger as well, maybe reword to "against the txns added to this evaluator and the ledger" ?

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.

4 participants