You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The P2P module handles exceptions normally when processing transaction messages.
Actual behaviour
The mainnet fullnode I was running printed the following exception stack log:
java.lang.IndexOutOfBoundsException: Index: 0
at org.tron.protos.Protocol$Transaction$raw.getContract(Protocol.java:37837)
at org.tron.core.net.messagehandler.TransactionsMsgHandler.processMessage(TransactionsMsgHandler.java:74)
at org.tron.core.net.P2pEventHandlerImpl.processMessage(P2pEventHandlerImpl.java:201)
at org.tron.core.net.P2pEventHandlerImpl.onMessage(P2pEventHandlerImpl.java:141)
at org.tron.p2p.connection.ChannelManager.handMessage(ChannelManager.java:261)
at org.tron.p2p.connection.ChannelManager.processMessage(ChannelManager.java:207)
at org.tron.p2p.connection.socket.MessageHandler.decode(MessageHandler.java:51)
at org.tron.p2p.stats.TrafficStats$TrafficStatHandler.channelRead(TrafficStats.java:36)
After analyzing the code, we found that the location of the exception log output is the TransactionsMsgHandler class that processes transaction messages. By default, each transaction carried by the transaction message in the processing logic contains at least 1 contract. Suppose the transaction received from the peer does not carry a contract. In that case, an IndexOutOfBoundsException exception will be reported when processing this transaction, and the connection with the peer will be disconnected.
Frequency
The exception stack appears occasionally.
Steps to reproduce the behaviour
Send transaction P2P messages without contracts to the node.
Backtrace
[backtrace]
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered:
After reviewing the code, I found that when processing transaction messages, the contract is indeed obtained directly for processing without checking whether the transaction carries a contract. Before obtaining the transaction contract, verification logic should be added to determine whether the transaction carries the contract.
@fyyhtx Thanks for your contribution to java-tron. This issue has already been fixed and will be included in the next release of java-tron. Please refer to #6181.
Software Versions
Expected behaviour
The P2P module handles exceptions normally when processing transaction messages.
Actual behaviour
The mainnet fullnode I was running printed the following exception stack log:
After analyzing the code, we found that the location of the exception log output is the TransactionsMsgHandler class that processes transaction messages. By default, each transaction carried by the transaction message in the processing logic contains at least 1 contract. Suppose the transaction received from the peer does not carry a contract. In that case, an IndexOutOfBoundsException exception will be reported when processing this transaction, and the connection with the peer will be disconnected.
Frequency
The exception stack appears occasionally.
Steps to reproduce the behaviour
Send transaction P2P messages without contracts to the node.
Backtrace
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered: