-
Notifications
You must be signed in to change notification settings - Fork 5
regular node mode #399
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: develop
Are you sure you want to change the base?
regular node mode #399
Conversation
4311670
to
9f46355
Compare
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.
Really good job, I've left a few comments mostly about naming to polish. Overall, looks great!
/// 2. 261 * 5 = 1305 | ||
/// | ||
/// Output: 1305 | ||
pub async fn get_data_range_id( |
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.
Consider get_data_range_suffix
, this is not a strong opinion just an idea
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.
I would keep the name get_data_range_id
because the usage of this function is not limited to the database crate.
e724f0d
to
21350a1
Compare
block garbage collected
2. rewrite indexer to save data into specific data_range by block_height
7812fd3
to
9d66715
Compare
This pull request introduces significant changes to enhance the database's handling of state changes by implementing data range partitioning, adding configuration options for archival mode and data ranges, and updating database schema and logic accordingly. These changes improve scalability, allow for more efficient data storage, and provide flexibility in managing historical data.
Configuration Enhancements:
keep_data_ranges_number
andarchival_mode
fields toGeneralRpcServerConfig
andCommonGeneralRpcServerConfig
to allow configuration of data ranges and archival mode. Default values and validation logic were also implemented. [1] [2] [3] [4] [5]default_env_configs.rs
to include environment variables forKEEP_DATA_RANGES_NUMBER
andARCHIVAL_MODE
.Utility Functions:
get_data_range_id
,get_earliest_available_block_height
, andcheck_block_height_availability
utility functions inutils.rs
to calculate data range IDs, determine earliest available blocks, and validate block height availability.Database Schema and Partitioning:
create_new_range_tables
to dynamically create partitioned tables for state changes based on data range IDs.block_hash
column from state changes tables to simplify the schema.Database Logic Updates:
StateIndexerDbManager
to include a method for creating new range tables and removed theblock_hash
parameter from state change methods.PostgresDBManager
to calculatedata_range_id
dynamically and use it in SQL queries to access partitioned tables. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Documentation and Comments:
data_range_id
is calculated and used.