-
Notifications
You must be signed in to change notification settings - Fork 7
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
regular node mode #399
Conversation
4311670 to
9f46355
Compare
khorolets
left a comment
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
|
Since we changed the database schema, it is not up-to-date. |
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_numberandarchival_modefields toGeneralRpcServerConfigandCommonGeneralRpcServerConfigto allow configuration of data ranges and archival mode. Default values and validation logic were also implemented. [1] [2] [3] [4] [5]default_env_configs.rsto include environment variables forKEEP_DATA_RANGES_NUMBERandARCHIVAL_MODE.Utility Functions:
get_data_range_id,get_earliest_available_block_height, andcheck_block_height_availabilityutility functions inutils.rsto calculate data range IDs, determine earliest available blocks, and validate block height availability.Database Schema and Partitioning:
create_new_range_tablesto dynamically create partitioned tables for state changes based on data range IDs.block_hashcolumn from state changes tables to simplify the schema.Database Logic Updates:
StateIndexerDbManagerto include a method for creating new range tables and removed theblock_hashparameter from state change methods.PostgresDBManagerto calculatedata_range_iddynamically 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_idis calculated and used.