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

Parallelization Optimization for Hash Calculation #1603

Open
liudi4046 opened this issue Jan 7, 2025 · 0 comments
Open

Parallelization Optimization for Hash Calculation #1603

liudi4046 opened this issue Jan 7, 2025 · 0 comments

Comments

@liudi4046
Copy link
Collaborator

  1. In function sequencingBatchStep, it gets new transactions from pool, then compute the hash for each new transaction. This can be done in parralel.
	newTransactions, newIds, allConditionsOK, err = getNextPoolTransactions(ctx, cfg, executionAt, batchState.forkId, batchState.yieldedTransactions)
	if err != nil {
		return err
	}

	batchState.blockState.transactionsForInclusion = append(batchState.blockState.transactionsForInclusion, newTransactions...)
	for idx, tx := range newTransactions {
		batchState.blockState.transactionHashesToSlots[tx.Hash()] = newIds[idx]
	}
  1. In function extractTransactionsFromSlot, same idea can be applied when calling SenderWithContext.

Result

In my macbook pro m3, TPS slightly increased from 932 to 946. And pprof shows the time spent on sequencingBatchTransactions has decreased.

related PR: #1599

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

No branches or pull requests

1 participant