This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Description Expected behavior
Is this expected behavior?
Milestone publishing calls the TransactionValidator.runValidation method at least three times on the same set of transactions...
This seems to be accidental.
Trace details
The API.storeAndBroadcast method
private void storeAndBroadcast (Hash tip1 , Hash tip2 , int mwm , List <String > txs ) throws Exception {
calls the API.attachToTangleStatement method
public synchronized List <String > attachToTangleStatement (final Hash trunkTransaction , final Hash branchTransaction , int minWeightMagnitude , final List <String > txs ) {
which leads to a call of TransactionValidator.runValidation method
runValidation (transactionViewModel , minWeightMagnitude );
through the tx validator's validateBytes method.
final TransactionViewModel transactionViewModel = transactionValidator .validateBytes (txBytes , transactionValidator .getMinWeightMagnitude ());
(END FIRST CALL)
After finishing with the above, the API.storeAndBroadcast method calls the API. storeTransactionsStatement method,
storeTransactionsStatement (powResult );
which results in the API.addValidTxvmToList method,
final List <TransactionViewModel > elements = addValidTxvmToList (txString );
calling TransactionValidator.runValidation method for the second time.
final TransactionViewModel transactionViewModel = transactionValidator .validateBytes (
txBytes , transactionValidator .getMinWeightMagnitude ()
);
(END SECOND CALL)
Finally, the broadcastTransactionsStatement at the end of the API.storeAndBroadcast method
broadcastTransactionsStatement (powResult );
calls again the API.addValidTxvmToList method
final List <TransactionViewModel > elements = addValidTxvmToList (txString );
which results in a final call to TransactionValidator.runValidation for presumably the same set of tx that had already undergone validation twice before. (END THIRD CALL)
Reactions are currently unavailable
Expected behavior
Is this expected behavior?
Milestone publishing calls the TransactionValidator.runValidation method at least three times on the same set of transactions...
This seems to be accidental.
Trace details
The API.storeAndBroadcast method
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 1523 in 77fbd58
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 1220 in 77fbd58
pendulum/src/main/java/net/helix/pendulum/TransactionValidator.java
Line 215 in 77fbd58
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 1263 in 77fbd58
After finishing with the above, the API.storeAndBroadcast method calls the API. storeTransactionsStatement method,
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 1526 in 77fbd58
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 592 in 77fbd58
pendulum/src/main/java/net/helix/pendulum/service/API.java
Lines 616 to 618 in 77fbd58
Finally, the broadcastTransactionsStatement at the end of the API.storeAndBroadcast method
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 1527 in 77fbd58
pendulum/src/main/java/net/helix/pendulum/service/API.java
Line 1096 in 77fbd58