add optional basestore features, eliminate redundant block fetching#647
Merged
liangping merged 9 commits intoping-pub:masterfrom Jul 31, 2025
Merged
add optional basestore features, eliminate redundant block fetching#647liangping merged 9 commits intoping-pub:masterfrom
liangping merged 9 commits intoping-pub:masterfrom
Conversation
Member
|
There are a few issues:
|
Contributor
Author
Also, I retained the changes to the consensus page, I think are still desirable as this page is not very useful if the refresh rate is slower than the block time. Lastly, the issue I am trying to address by backfilling the missing blocks is that the transactions page uses 'txsInRecents' to populate data, thus missing blocks lead to missing transactions which has been a source of confusion from users. |
Member
|
thanks @2xburnt |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and refactors to improve the functionality, maintainability, and configurability of the blockchain application. Key changes include the addition of environment variables for block fetching configuration, integration of a new chain (
xion), refactoring of block-related stores and modules, and dynamic adjustment of blocktime intervals based on chain data.Environment Configuration Updates:
.env.example: Added new environment variables (VITE_REFRESH_INTERVAL,VITE_FETCH_ALL_BLOCKS,VITE_RECENT_BLOCK_LIMIT) to allow customization of refresh intervals, block fetching behavior, and the limit for recent blocks.Chain Integration:
chains/mainnet/xion.json: Added thexionchain for testing locallyStore and Module Refactoring:
src/modules/[chain]/block/block.ts: Refactored the block module to delegate most operations to theuseBaseStore, simplifying the module's logic and ensuring consistency across block-related actions. (src/modules/[chain]/block/block.tsL2-R39)src/stores/useBaseStore.ts: Enhanced the base store with new features, including dynamic blocktime calculation, support for fetching all blocks since the last known block, and improved error handling during RPC calls. Added configurable limits for recent blocks and a flag to enable fetching all blocks. [1] [2]Dynamic Refresh Interval Adjustments:
src/main.ts: Updated the block fetching interval to use the configurableVITE_REFRESH_INTERVALenvironment variable instead of a hardcoded value. [1] [2]src/modules/[chain]/consensus/index.vue: Adjusted timers for consensus updates to use half the dynamically calculated blocktime from the base store. (src/modules/[chain]/consensus/index.vueL34-R35, src/modules/[chain]/consensus/index.vueL90-R91)