-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
enhancementAn enhancement to existing implementationAn enhancement to existing implementation
Description
Why does Semux need the function PendingManager.processTransaction() ?
src/main/java/org/semux/core/PendingManager.java
protected ProcessingResult processTransaction(Transaction tx, boolean isIncludedBefore, boolean isFromThisNode) {
......
}
Because of the BlockGasLimit, it is possible for a block to fail to package all transactions in a tx pool.
Each time a block is added, let's assume that the block contains 300 transactions and the pool accumulates 1000 transactions due to receiving pressure.
The onBlockAdded() function triggers the 1000 transactions to be reexecuted, blocking block adding.
If the nodes are still receiving transactions at this point, the transactions will be packaged and consensused more slowly, and the tx pool will pile up transactions further, creating a vicious cycle.
@Override
public synchronized void onBlockAdded(Block block) {
List<PendingTransaction> txs = reset();
for (PendingTransaction tx : txs) {
accepted += processTransaction(tx.transaction, true, false).accepted;
}
}
So, what is the necessity of doing this?
Thx!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementAn enhancement to existing implementationAn enhancement to existing implementation