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

SVM: add new bootstrap method #3203

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

buffalojoec
Copy link

@buffalojoec buffalojoec commented Oct 17, 2024

Problem

In order to properly configure a TransactionBatchProcessor, one must use the new_unitialized method to create a new batch processor whose program cache is uninitialized. Subsequently, users must obtain a write lock on the cache and update it with the necessary configs (fork graph, loaders).

It would be much easier and cleaner to offer a method on the TransactionBatchProcessor that can handle all of this setup in one go.

Summary of Changes

Introduce TransactionBatchProcessor::new for creating a new, fully initialized batch processor with the provided program-runtime configurations.

@buffalojoec buffalojoec force-pushed the svm-processor-new-mthd branch from 5a1ed8e to 0c26506 Compare October 17, 2024 14:24
@buffalojoec buffalojoec marked this pull request as ready for review October 22, 2024 14:43
runtime/src/bank.rs Outdated Show resolved Hide resolved
@buffalojoec buffalojoec force-pushed the svm-processor-new-mthd branch from 0c26506 to 5db5fb8 Compare October 22, 2024 14:59
LucasSte
LucasSte previously approved these changes Oct 22, 2024
@buffalojoec
Copy link
Author

@pgarg66 @LucasSte This is ready for another look. I believe I've simplified the approach, and addressed both of your concerns (no double write-locking, guarding slot & epoch behind a method).

Now we have new, which creates a fully initialized processor, and configure_program_runtime_environments, which is used by bank.

In a follow-up PR, I'd really like to simplify both the mock_bank and RPC example using these new methods.

@pgarg66 pgarg66 self-requested a review November 8, 2024 16:10
@buffalojoec buffalojoec merged commit 20dde4b into anza-xyz:master Nov 9, 2024
40 checks passed
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.

3 participants