Skip to content

Conversation

@sashass1315
Copy link

reopen #1340
Fixes #1335

bp_checkpoint: Arc<Barrier>,
script_cache_size: NonZeroUsize,
) -> Self {
let script_cache = LruCache::new(script_cache_size);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should just update new() and not have with_script_cache_size().

Copy link
Author

Choose a reason for hiding this comment

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

I think we should just update new() and not have with_script_cache_size().

updated

const ENV_MAX_TXS_PER_BATCH: &str = "MIDEN_MAX_TXS_PER_BATCH";
const ENV_MAX_BATCHES_PER_BLOCK: &str = "MIDEN_MAX_BATCHES_PER_BLOCK";
const ENV_MEMPOOL_TX_CAPACITY: &str = "MIDEN_NODE_MEMPOOL_TX_CAPACITY";
const ENV_NTX_SCRIPT_CACHE_SIZE: &str = "MIDEN_NTX_DATA_STORE_SCRIPT_CACHE_SIZE";
Copy link
Collaborator

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/.env like the other env vars.

const COMPONENT: &str = "miden-ntx-builder";

pub const DEFAULT_SCRIPT_CACHE_SIZE: NonZeroUsize =
NetworkTransactionBuilder::DEFAULT_SCRIPT_CACHE_SIZE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need this do we?

/// 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();
pub const DEFAULT_SCRIPT_CACHE_SIZE: NonZeroUsize = NonZeroUsize::new(1000).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't need to be pub does it?

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.

Make NtxDataStore script cache size configurable

2 participants