-
Notifications
You must be signed in to change notification settings - Fork 189
[SC] Added response handler for invalid txs #1295
Conversation
- Prevented sending anchoring txs if the period is not arrived. - Added remove handler for invalid bridge txs.
ServiceChainInvalidTxResponseMsg = 0x06 | ||
|
||
ServiceChainCall = 0x06 | ||
ServiceChainResponse = 0x07 | ||
ServiceChainNotify = 0x08 | ||
ServiceChainCall = 0x07 | ||
ServiceChainResponse = 0x08 | ||
ServiceChainNotify = 0x09 |
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.
This kind of protocol update can make a mismatch in the message protocol.
Why don't you increase the protocol version? We can consider a better protocol version management policy also
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.
What a great catch! Thank you so much. The SC protocol version scope is currently going on another PR(#1248). Once that PR is finalized, let me update it.
This PR should be delayed until #1248 is finalized. |
A handler of invalid tx removal is now moved to #1427. The remainder of TODO is to avoid sending duplicated anchoring tx https://github.com/klaytn/klaytn/pull/1295/files#diff-1623298e4e46f32d0a4b35ea8ba2fd0a9de08103caf3820b7ce69293b6e765e5R352-R364. |
Proposed changes
An observation that some bridge txs continuously stay in the bridge tx pool was reported. In order to remove bridge tx from the pool, the corresponding receipt from the counterpart chain must arrive as an answer of the successful process. That txs are resent until that corresponding receipt arrives. It makes sense. However, the problem is the sync is not matched between the sender side and receiver side.
As a pipeline of the current implementation, the sender sends two RPC requests:
The receiver receives two requests and handles, but that tx is not mined in the new block at the time of the request, which causes no receipt response at this point. After that, the sender sends two requests again. The number of tx is two since he didn't get a receipt from the previous request. The receiver's new block now contains the previous tx and sends a receipt but doesn't include the fresh tx that comes in this request. The same scenario is looped and pending tx never becomes zero.
This PR adds:
Refer to optimization issue at #1294.
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...