-
Notifications
You must be signed in to change notification settings - Fork 43
kaiax/builder: set timeout for bundle tx #309
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
Conversation
ce10da6
to
af8c4dd
Compare
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.
Just a quick thought: The EN and PN don't include module tx in txpool but only broadcast them
. So after broadcasting tx, no EN and PN has module tx, but only CN will have it. (CN only broadcasts tx to CNs)
It'll have side effects by not storing tx in txpool (Tx might be missing before reaching to CNs)
|
I changed pending timeout (30s to 10s) and known tx timeout (60s to 30s) for optimization. |
Proposed changes
This PR solves the dangling transaction problem.
Problem
Nodes have kept to hold potentially failed bundle transactions in the pending because they don't have any way to know if they succeed or fail and nodes haven't remove any transactions without results. Usually, nodes can know tx result through propagated created blocks but the results of the transactions in failed bundle aren't in any blocks.
Solution
How it works
The below image shows how a tx is propagated and is removed from pending if tx is failed bundle tx against before and after this pr.
[as-is]
[to-be]
(PS I had AI create most of the test. That's awesome😎)
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.
I have read the CLA Document and I hereby sign the CLA
in first time contribute$ 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...