Skip to content

Conversation

@shanimal08
Copy link
Collaborator

@shanimal08 shanimal08 commented Jan 28, 2026

Description

(still WIP)

  • re-implement the block height events

Motivation and Context

How Has This Been Tested?

  • locally:

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shanimal08, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request re-implements the core logic for handling new block events within the application, focusing on a more robust and centralized approach for wallet-related updates. It standardizes the transaction data used in events, streamlines the emission of new block mined events, and enhances the wallet's ability to track and react to coinbase transactions. These changes aim to improve the accuracy and responsiveness of block height and balance updates across the application, particularly for mining-related features.

Highlights

  • Event Payload Standardization: The NewBlockHeightPayload event (now NewBlockMined) has been updated to use DisplayedTransaction instead of the custom TransactionInfo for coinbase transaction details, ensuring consistent transaction data across the application.
  • Centralized Block Event Emission: Logic for emitting NewBlockMined events, including associated coinbase transactions and notifications, has been moved to and centralized within the BalanceTracker in the wallet module for better management.
  • Enhanced Wallet Balance Tracking: The BalanceTracker now actively identifies and tracks confirmed coinbase transactions during balance updates, enabling specific events and notifications to be triggered when a new block is mined and results in a wallet gain.
  • Frontend Event Handling & Block Tip Logic: Frontend components and hooks have been adjusted to correctly listen for the refactored NewBlockHeight events. The useBlockTip hook now uses useEffect for more reactive block tip fetching and processing, with an updated refetch interval.
  • Code Cleanup and Deprecation: The TransactionInfo struct and interface have been removed or marked as deprecated, and various commented-out code blocks have been cleaned up across the codebase.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the block event handling by replacing TransactionInfo with DisplayedTransaction and renaming NewBlockHeightPayload to NewBlockMined. The logic for detecting new blocks and associated coinbase transactions has been moved from events_manager to the balance_tracker in the wallet, which is a good architectural improvement. The frontend has also been updated to align with these backend changes, including a new synchronization mechanism in useBlockTip.

While the direction of these changes is positive, I've identified a few areas for improvement. There are several debug log messages that should be removed. More importantly, there's a potential logic issue in balance_tracker that could prevent new block events from being emitted correctly, and a potential for an infinite refetch loop in the useBlockTip hook on the frontend. I've provided specific comments and suggestions to address these points. Given this is a work-in-progress, I hope this feedback is helpful for finalizing the feature.

…ement emits ..

wip: clean up useBlockTip for new block timing on the animation ..
wip: rm unused/uneeded code
@shanimal08
Copy link
Collaborator Author

closing & will re-open a new one as the direction changed (re. coinbases txs/solo mining animations)

@shanimal08 shanimal08 closed this Jan 29, 2026
@shanimal08 shanimal08 deleted the fix/new_block_logic branch January 29, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant