-
Notifications
You must be signed in to change notification settings - Fork 339
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
evm tx skips a block before confirmation #2286
Comments
This is how currently the Polkadot/Substrate mechanism works for parachains. paritytech/polkadot#5022 will introduce a new mechanism that will allow shorter block time and bigger blocks also. Currently, a block is produced when it receives the relay block specifying the previous parachain has been included in the relay. The inclusion of a parachain block takes 2 relay blocks (2* 6s) so 12s but because the parachain block needs to be created as fast as possible to be included, here is what happens:
So every transaction that is sent after the block n°1 (between 0 and 12s) will wait between 12 and 24s before being considered "best" and returned by the API. |
gotcha, thanks for your clarification! So basically it takes 2 extra relay blocks (2 * 6s = 12s) for the para block to be considered "best", before it is returned by api. I was wondering if it makes sense to consider a tx to be "mined" at step 6, and return the receipt? I am assuming step 7 and 8 is to prevent forking, but in the normal evm context, the tx receipt can be found as soon as it's mined. Current substrate behavior looks like it uses safe tag as the default behavior. |
I think a more optimized behavior would be:
In this way users will be able to feel "instant confirmation" by default, whereas projects still have the option for "safe" tag if there business logic requires so. |
@tgmichel or @sorpaas , what do you think about it ? I remember we thought about doing that at the very beginning of frontier but chose not to. I don't see a reason not to do it so now |
I personally feel like 'latest' and 'finalized' state would be enough for most use cases:
'safe' state (current behavior) is somehow in the middle: not that smooth, and not that safe 😂 |
There are some nuances in the parachain context regarding best - as described in polkadot-evm/frontier#423. In the above PR, a special Give me some time to think if there is a solution for providing faster receipts that is compatible with what I just mentioned. Edit: the most inmediate/obvious solution I think is to remove |
If my understanding is correct, after the tx is mined, we will have to wait 12s for relay chain validation before the new state is applied. So even if we support So the current behavior in above PR's example is:
But this doesn't seem to be a "standard" evm behavior, where we should be able to send next tx on next block, with the new state already applied, so the expected behavior is:
I understand that in the engineering point of view, there might be some technical limitation. But just saying in a user's perspective (as a real moonbeam user myself), such |
Problem
When sending tx at block
X
, it is supposed to be mined at blockX + 1
, assuming no congestion. However, there seems to be a shared issue among substrate evms: such tx is usuallly mined at blockX + 2
, which basically mysteriously skipped a block.This causes a terrible UX. For 12s block time, expected confimation time should be 12/2 = 6s on average, which is great. However, with the current issue, expected confirmation time increases to 12/2 + 12 = 18s. This is super slow compared to these alternative evm networks, which usually confirms in less than 5s, sometimes even 2s.
18s confirmation time could be a huge blocker for mass adoption. Users will escape.
Reproduce Script
https://github.com/shunjizhan/tx-confirmation-test
The text was updated successfully, but these errors were encountered: