-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] - cncli.sh - integration of full stakepool history load int…
…o epochdata table (#1793) Hello CNTools/Koios Team, I would like to propose the integration in cncli.sh of a process I wrote to perform a full load of epochdata table in blocklog db. It checks all previous epochs where your pool got at least one block based on the query "SELECT DISTINCT epoch FROM blocklog." It also takes into account the current epoch and the next epoch if it's found in the blocklog table. Depending of the pool history it can take some minutes or a lot of hours. It took 2 hours and ~30 minutes to process 138 epochs. It is shown in cncli.sh menu as: > epochdata Manually re-calculate leaderlog to load stakepool history into epochdata table of blocklog db. Needs completion of cncli.sh sync process. all One-time re-calculation of all epochs (avg execution duration: 1hr / 50 epochs) epoch One-time re-calculation for the specified epoch Following the logic of validate all and validate epoch, I added the feature to process a single epoch, with overwrite if epoch already exists. Altough the most important is epochdata all which requires to run only once, or more if is needed for some reason. @Scitz0 thanks a lot for your suggestions in PR 1782, it looks much better now. Anyway I wait for your feedback in case something needs to be reviewed. Thank you, kind regards, Manuel ## Description Added new function cncliEpochData in cncli.sh ## Where should the reviewer start? Run: "cncli.sh epochdata all" or "cncli.sh epochdata epoch" ## Motivation and context The scenario is this: An operator runs a stakepool for months or years without using cntools/cncli and makes blocks during this period. At some point, the operator starts using cntools/cncli, and when cncli initializes, all block schedules from the first pool block until the last are entered into the blocklog table in blocklog.db. Meanwhile, the epochdata table is updated at every slot leader check, so you only have data in epochdata from when you started using CNTools, not from before. ## How has this been tested? New function cncliEpochData has been extensively tested during mainnet epochs 500. A new function getProtocolParamsHist has been added in env file and added in getConsensus func of cncli.sh to handle consensus choice in previous epochs. Needed variables in cncli.sh : >POOL_ID POOL_ID_BECH32 --------- Co-authored-by: Manuel <[email protected]> Co-authored-by: Ola [AHLNET] <[email protected]> Co-authored-by: illuminatus <[email protected]> Co-authored-by: RdLrT <[email protected]>
- Loading branch information
1 parent
dd06e9d
commit f737d0a
Showing
2 changed files
with
208 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters