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
{{ message }}
Repository navigation
DAPI returns "state transition already in chain" on invalid transactions #2261
changed the title [-]DAPI returns "state transition already in chain" on broadcastStateTransition[/-][+]DAPI returns "state transition already in chain" on invalid transactions[/+]on Oct 21, 2024
A bug in DAPI client retry logic was introduced in feat(sdk)!: detect stale nodes #2254: it retires when it is not supposed to retry. I will provide a fix soon.
If we broadcast an invalid ST a second time we are getting just state transition already in cache and there is no way to see validation errors on the client side. This happens because of invalid tx cache. I remember we enabled it because of some invalid tx ghosts jumping between node mempools forever.
Disabling invalid tx cache and adding tx expiration period instead.
Storing tx result in the tx cache so instead of state transition already in cache for both invalid and valid txs we will get the tx result and pass it back to the user.
@lklimek, do you propose to call check_tx in DAPI if we get state transition already in cache form broadcast_tx? Unfortunately, It won't help because if the tx was already committed, you will get a new error due to invalid nounces. If it was invalidated, then there is a chance that it was invalidated by block processing with additional validations, so check tx will say, ' Everything is fine. '
Activity
[-]DAPI returns "state transition already in chain" on broadcastStateTransition[/-][+]DAPI returns "state transition already in chain" on invalid transactions[/+]shumkov commentedon Oct 22, 2024
Here is a combination of two problems:
state transition already in cacheand there is no way to see validation errors on the client side. This happens because of invalid tx cache. I remember we enabled it because of some invalid tx ghosts jumping between node mempools forever.@lklimek @QuantumExplorer I see two solutions for the second problem:
I prefer the second solution.
shumkov commentedon Oct 22, 2024
@lklimek, do you propose to call
check_txin DAPI if we getstate transition already in cacheformbroadcast_tx? Unfortunately, It won't help because if the tx was already committed, you will get a new error due to invalid nounces. If it was invalidated, then there is a chance that it was invalidated by block processing with additional validations, so check tx will say, ' Everything is fine. 'Here is the PR for the first problem #2261
shumkov commentedon Oct 22, 2024
@lklimek have you deleted your comment? :)))
lklimek commentedon Oct 22, 2024
Yep, I didn't think you have already seen it. Sorry. I realized check tx is not solution.
shumkov commentedon Oct 22, 2024
@pshenmic we are working on defining a solution for this problem. I will let you know when we have something.
shumkov commentedon Oct 29, 2024
The problem is fixed #2270. We still need to switch to new unconfirmed txs filter when dashpay/tenderdash#963 is done