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

Parallelize begin block for dex module #771

Merged
merged 5 commits into from
May 15, 2023
Merged

Parallelize begin block for dex module #771

merged 5 commits into from
May 15, 2023

Conversation

yzang2019
Copy link
Contributor

@yzang2019 yzang2019 commented May 11, 2023

Describe your changes and provide context

To improve the begin block latency, this PR Parallelize begin block logic for dex module where we delete the historical prices. Removed the gas limit requirement and keep the deletion in order.

Testing performed to validate your change

x/dex/module.go Dismissed
Comment on lines 262 to 266
go func(contract types.ContractInfoV2) {
priceKeysToDelete := am.getPriceToDelete(cachedCtx, contract, cutOffTime)
allPricesToDelete[contract.ContractAddr] = priceKeysToDelete
wg.Done()
}(contract)

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty cool code scanning

@BrandonWeng BrandonWeng enabled auto-merge (squash) May 15, 2023 16:20
@yzang2019 yzang2019 disabled auto-merge May 15, 2023 19:13
@BrandonWeng BrandonWeng merged commit a3576fd into master May 15, 2023
27 checks passed
@BrandonWeng BrandonWeng deleted the yzang/SEI-4033 branch May 15, 2023 22:55
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.

None yet

2 participants