-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add optional basestore features, eliminate redundant block fetching #647
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
Conversation
|
There are a few issues:
|
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. |
|
thanks @2xburnt |
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)