-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize transaction execution logic #5427
Comments
@halibobo1205 This involves multi-signatures. When broadcasting ordinary transactions and permission update transactions at the same time, it may be disconnected due to inconsistent broadcast order of transactions. |
Exclude multi-signatures, why don't the other errors indicate a |
There are many reasons for disconnection from the peer. Apart from the BAD_TRX exception, do transactions execute normally in other exceptional scenarios? |
@chengtx01 Mainly to maintain consistency with online logic and avoid introducing problems |
Refer to PR #5440 |
Rationale
Whether to execute a transaction from a peer should not be judged based on whether the peer is disconnected, but whether the peer is a malicious node or not.
In the current logic, when processing a transaction, if the peer is in the disconnected state, the transaction is discarded, so there is a problem. In the stress test scenario, because the broadcast TPS is too high, the network layer cache will be filled instantly, which may cause data acquisition failure during the peer interaction process, resulting in disconnection, and a large number of previously received transactions will be discarded, therefore, the actual TPS gets very low, and the event flow is as follows:
Implementation
There are several options for identifying malicious nodes:
The current code adopts the third scheme but only disconnects when the exception type is
BAD_TRX
. Other exceptions will not cause disconnection, so the judgment logic can be consistent with the presentWhen processing transactions, remove the following logic.
Add
isBadPeer
field in the peer data structure.Set
isBadPeer
to true in theBAD_TRX
exception.When processing a transaction, if
isBadPeer
is true, discard the transaction.The text was updated successfully, but these errors were encountered: