Added async utx cleaning#1735
Merged
Merged
Conversation
alexeykiselev
previously approved these changes
Jul 1, 2025
nickeskov
previously requested changes
Jul 1, 2025
nickeskov
left a comment
Collaborator
There was a problem hiding this comment.
Still can panic with already modifying state because TxValidation method can be called in parallel with other state methods.
* Added logs for functions and locks * Removed state locks from utx validator * Added logs for utx locking * removed logs * Added a state map around add tx to utx because there no state lock inside anymore * Changed workflow file to build with -race * fixed the workflow file * Fixed the workfile file * Fixed the workflow file * Changed the version back * Fixed platforms * Added args for amd64 only * Refactor 'UtxPool' and 'Validator'. * Added cancel context * removed a binary * removed a log * Replaced dockerfile ' * Removed cas when bulk validating * Removed cas from reset list * Fixed a go sum entry * Returned the old version of bip39 hash * Replaced channel to context cancellation * Hash sum fixed * Returned github actions and dockerfile code back --------- Co-authored-by: Nikolay Eskov <mr.eskov1@yandex.ru>
This reverts commit 04b643f. It's necessary to add failed tx to 'inapplicable' because the reason of failure may be connected with total block complexity limit.
alexeykiselev
requested changes
Sep 4, 2025
alexeykiselev
previously approved these changes
Sep 4, 2025
@alexeykiselev already reviewed this changes.
) * UTX clean-up reimplemented with in-place transactions validation. Pool item type heapItem added to store index of item in the heap. Item index management implemented in heap.Interface implementation. AllTransactions function now return slice of proto.Transaction. Function Clean added to UtxPool interface and implemented. Interface function Count renamed to Len, duplicated method removed from implementation. * Review issues fixed. Various pool implementation improvements. Errors documentation comments updated. * Check on space left in the block and fast path to abort micro-block mining added.
alexeykiselev
approved these changes
Sep 5, 2025
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 improvements and refactorings to transaction handling, logging, and microblock mining in the codebase. The main themes are better logging (including transaction IDs), improved error handling and reporting in the miner, and refactoring of the UTX pool and related APIs for clarity and robustness.
MicroMiner improvements and logging:
MicroMinerto include transaction IDs and more detailed debug/error messages, using a custom logger and new helpers inlogging.go. This includes logging dropped, inapplicable, and successfully applied transactions, and improved error reporting when returning transactions to the UTX pool. [1] [2] [3] [4] [5]ErrBlockIsFullto distinguish block fullness due to size or complexity limits.UTX pool and transaction API refactoring:
heapItemtype, improving heap safety and index tracking. This change also updates transaction selection logic for microblocks.Count()toLen(), changes to validator construction, and transaction addition methods to include state validation where appropriate). [1] [2] [3] [4] [5]Cleaner and validation changes:
schemeand use context for validation, improving testability and future extensibility. [1] [2] [3]stateWrapperinterface and its mocks, simplifying the interface and related tests.General codebase improvements:
These changes collectively improve the reliability, observability, and maintainability of transaction processing and microblock mining.