-
Notifications
You must be signed in to change notification settings - Fork 370
Conversation
…lC/iri into add-transaction-solidifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8ed7600 Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits
src/main/java/com/iota/iri/service/validation/impl/TransactionSolidifierImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/com/iota/iri/service/validation/impl/TransactionSolidifierImpl.java
Outdated
Show resolved
Hide resolved
@@ -216,6 +280,12 @@ private void addToBroadcastQueue(TransactionViewModel tvm) { | |||
} | |||
} | |||
|
|||
@VisibleForTesting | |||
Set<Hash> getSolidificationQueue(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is funny that you call it getQueue
but you return a Set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fair point, i'll rename
@@ -98,11 +98,22 @@ public void verifyTxIsNotSolid() throws Exception { | |||
assertFalse("Expected transaction to fail solidity check", txSolidifier.checkSolidity(tx.getHash())); | |||
} | |||
|
|||
@Test | |||
public void getSolidificationQueue() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are testing add
to solidification queue not get
, so better rename
…SolidifierImpl.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com>
…SolidifierImpl.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
* Move validation to validation service package * Add Transaction Solidifier * Update Transaction Validator * Update Unit Tests * Remove tip field from solidify stage * Move broadcast queue retreival to solidify stage * Undo auto-formatting * More autoformatting * Re-remove refillBroadcast * Move propagation logic to inner class * Remove unused imports * Add comment to propagator * Remove unused txSolidifier private field * Remove separate thread logic, check solidity from milestone solidifier * Add solidification queue to transaction solidifier * LinkedHashSet -> ArrayDeque in checkSolidity * Update maxProcessedTransactions value determination * Make Transaction Propagator private * Add milestone stage * add heartbeat message (#1825) * add heartbeat message * added javadocs * print exception message * Regression: Update pruning test (#1775) * Update pruning test for before and after pruning status * m6 -> m1 Co-authored-by: Gal Rogozinski <gal.rogozinski@iota.org> * Fix: Update Broadcast Stage logic (#1827) * Update broadcast fetch logic * Comment * Feature: Add transaction solidifier queue (#1821) * Move validation to validation service package * Add Transaction Solidifier * Update Transaction Validator * Update Unit Tests * Remove tip field from solidify stage * Move broadcast queue retreival to solidify stage * Undo auto-formatting * More autoformatting * Re-remove refillBroadcast * Move propagation logic to inner class * Remove unused imports * Add comment to propagator * Remove unused txSolidifier private field * Remove separate thread logic, check solidity from milestone solidifier * Add solidification queue to transaction solidifier * LinkedHashSet -> ArrayDeque in checkSolidity * Update maxProcessedTransactions value determination * Make Transaction Propagator private * Fix test conflicts * Update src/main/java/com/iota/iri/service/validation/impl/TransactionSolidifierImpl.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com> * Update src/main/java/com/iota/iri/service/validation/impl/TransactionSolidifierImpl.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com> * Rename Co-authored-by: Gal Rogozinski <gal.rogozinski@iota.org> Co-authored-by: Gal Rogozinski <galrogogit@gmail.com> * Unit test for milestone stage Co-authored-by: Gal Rogozinski <gal.rogozinski@iota.org> Co-authored-by: Acha Bill <57879913+acha-bill@users.noreply.github.com> Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
* Move validation to validation service package * Add Transaction Solidifier * Update Transaction Validator * Update Unit Tests * Remove tip field from solidify stage * Move broadcast queue retreival to solidify stage * Undo auto-formatting * More autoformatting * Re-remove refillBroadcast * Move propagation logic to inner class * Remove unused imports * Add comment to propagator * Remove unused txSolidifier private field * Remove separate thread logic, check solidity from milestone solidifier * Add solidification queue to transaction solidifier * LinkedHashSet -> ArrayDeque in checkSolidity * Update maxProcessedTransactions value determination * Make Transaction Propagator private * Add milestone stage * add heartbeat message (#1825) * add heartbeat message * added javadocs * print exception message * Regression: Update pruning test (#1775) * Update pruning test for before and after pruning status * m6 -> m1 Co-authored-by: Gal Rogozinski <gal.rogozinski@iota.org> * Fix: Update Broadcast Stage logic (#1827) * Update broadcast fetch logic * Comment * Feature: Add transaction solidifier queue (#1821) * Move validation to validation service package * Add Transaction Solidifier * Update Transaction Validator * Update Unit Tests * Remove tip field from solidify stage * Move broadcast queue retreival to solidify stage * Undo auto-formatting * More autoformatting * Re-remove refillBroadcast * Move propagation logic to inner class * Remove unused imports * Add comment to propagator * Remove unused txSolidifier private field * Remove separate thread logic, check solidity from milestone solidifier * Add solidification queue to transaction solidifier * LinkedHashSet -> ArrayDeque in checkSolidity * Update maxProcessedTransactions value determination * Make Transaction Propagator private * Fix test conflicts * Update src/main/java/com/iota/iri/service/validation/impl/TransactionSolidifierImpl.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com> * Update src/main/java/com/iota/iri/service/validation/impl/TransactionSolidifierImpl.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com> * Rename Co-authored-by: Gal Rogozinski <gal.rogozinski@iota.org> Co-authored-by: Gal Rogozinski <galrogogit@gmail.com> * Unit test for milestone stage * Consolidate milestone solidification logic * Update milestone stage tests * update bootstrap * Minor refactor * Log correct milestones, add switch for processing solidification queue * Bootstrap milestone hash and index properly * set index and hash directly instead of through method * Place all milestone tails into solidifier from milestone stage * setLatestMilestone -> logNewMilestone * remove second LSM update in update milestones * Stop repeats and solid entry points in broadcast queue * Don't abort milestone stage for second transaction in milestone bundle * Shorten regression wait times * Clean up, syntax updates, comment clarification * Remove unecessary method, syntax * Atomic variables and syntax changes * Update scanMilestones in queue * Extract repair logic * Update src/main/java/com/iota/iri/service/milestone/MilestoneSolidifier.java Co-Authored-By: Gal Rogozinski <galrogogit@gmail.com> * Typo, check solidity in milestone stage * syntax and minor logic change * Rename logNewMilestone * log -> register in milestone stage * Update milestone payload to pass forward transaction, fix tests Co-authored-by: Gal Rogozinski <gal.rogozinski@iota.org> Co-authored-by: Acha Bill <57879913+acha-bill@users.noreply.github.com> Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
Description
Decouple the milestone and transaction solidification processes to handle transaction solidification asynchronously from milestone checking. Currently each time the
MilestoneSolidifier
checks the solidity of a transaction, it does theTransactionSolidifier
'scheckSolidity
call directly. This can cause a hanging when processing longer sync queues, which can delay theMilestoneSolidifier
processing newer received milestone transactions. In order to decouple this, theMilestoneSolidifier
will check the solid state of a transaction and add it to a processing queue in theTransactionSolidifier
so that there are no hanging moments during milestone processing. This is a step introduced within the process of updating milestone handling as per #1674.Follow up to #1805
Type of change
How Has This Been Tested?
Checklist: