-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat(torii): read only torii #2795
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -90,6 +90,10 @@ impl Default for RelayOptions { | |||||||||||||||
#[derive(Debug, clap::Args, Clone, Serialize, Deserialize, PartialEq)] | ||||||||||||||||
#[command(next_help_heading = "Indexing options")] | ||||||||||||||||
pub struct IndexingOptions { | ||||||||||||||||
/// If indexing should be enabled | ||||||||||||||||
#[arg(long, default_value_t = true, help = "If indexing should be enabled.")] | ||||||||||||||||
pub enabled: bool, | ||||||||||||||||
Comment on lines
+93
to
+95
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. Why would we want this to be disabled? For replicates syncing from a single indexing Torii?
Comment on lines
+93
to
+95
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.
Suggested change
Add serde default to ensure it's not required to be given in configuration files. |
||||||||||||||||
|
||||||||||||||||
/// Chunk size of the events page when indexing using events | ||||||||||||||||
#[arg(long = "indexing.events_chunk_size", default_value_t = DEFAULT_EVENTS_CHUNK_SIZE, help = "Chunk size of the events page to fetch from the sequencer.")] | ||||||||||||||||
#[serde(default = "default_events_chunk_size")] | ||||||||||||||||
|
@@ -162,6 +166,7 @@ pub struct IndexingOptions { | |||||||||||||||
impl Default for IndexingOptions { | ||||||||||||||||
fn default() -> Self { | ||||||||||||||||
Self { | ||||||||||||||||
enabled: true, | ||||||||||||||||
events_chunk_size: DEFAULT_EVENTS_CHUNK_SIZE, | ||||||||||||||||
blocks_chunk_size: DEFAULT_BLOCKS_CHUNK_SIZE, | ||||||||||||||||
pending: true, | ||||||||||||||||
|
@@ -177,6 +182,10 @@ impl Default for IndexingOptions { | |||||||||||||||
impl IndexingOptions { | ||||||||||||||||
pub fn merge(&mut self, other: Option<&Self>) { | ||||||||||||||||
if let Some(other) = other { | ||||||||||||||||
if self.enabled { | ||||||||||||||||
self.enabled = other.enabled; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
if self.events_chunk_size == DEFAULT_EVENTS_CHUNK_SIZE { | ||||||||||||||||
self.events_chunk_size = other.events_chunk_size; | ||||||||||||||||
} | ||||||||||||||||
|
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.