-
Notifications
You must be signed in to change notification settings - Fork 86
feat(node): configure ntx script cache size via clap #1454
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
base: next
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,7 +95,7 @@ impl NetworkTransactionBuilder { | |
| /// | ||
| /// Each cached script contains the deserialized `NoteScript` object, so the actual memory usage | ||
| /// depends on the complexity of the scripts being cached. | ||
| const DEFAULT_SCRIPT_CACHE_SIZE: NonZeroUsize = NonZeroUsize::new(1000).unwrap(); | ||
| const DEFAULT_SCRIPT_CACHE_SIZE: NonZeroUsize = crate::DEFAULT_SCRIPT_CACHE_SIZE; | ||
|
|
||
| /// Creates a new instance of the network transaction builder. | ||
| pub fn new( | ||
|
|
@@ -105,7 +105,25 @@ impl NetworkTransactionBuilder { | |
| ticker_interval: Duration, | ||
| bp_checkpoint: Arc<Barrier>, | ||
| ) -> Self { | ||
| let script_cache = LruCache::new(Self::DEFAULT_SCRIPT_CACHE_SIZE); | ||
| Self::with_script_cache_size( | ||
| store_url, | ||
| block_producer_url, | ||
| tx_prover_url, | ||
| ticker_interval, | ||
| bp_checkpoint, | ||
| Self::DEFAULT_SCRIPT_CACHE_SIZE, | ||
| ) | ||
| } | ||
|
|
||
| pub fn with_script_cache_size( | ||
| store_url: Url, | ||
| block_producer_url: Url, | ||
| tx_prover_url: Option<Url>, | ||
| ticker_interval: Duration, | ||
| bp_checkpoint: Arc<Barrier>, | ||
| script_cache_size: NonZeroUsize, | ||
| ) -> Self { | ||
| let script_cache = LruCache::new(script_cache_size); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should just update
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
updated |
||
| let coordinator = Coordinator::new(MAX_IN_PROGRESS_TXS); | ||
| Self { | ||
| store_url, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to
bin/node/.envlike the other env vars.