Skip to content
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

The current way we consider ER as confirmed is wrong #1934

Closed
NingLin-P opened this issue Sep 7, 2023 · 0 comments · Fixed by #2194
Closed

The current way we consider ER as confirmed is wrong #1934

NingLin-P opened this issue Sep 7, 2023 · 0 comments · Fixed by #2194
Labels
execution Subspace execution

Comments

@NingLin-P
Copy link
Member

Currently, the ER of #N is considered as confirmed whenever the ER of #(N + BlockTreePruningDepth) is added to the block tree:

https://github.com/subspace/subspace/blob/17225c4b10efb10fb0d4277de657236f32d0798b/crates/pallet-domains/src/block_tree.rs#L252-L263

Suppose the challenge period (i.e. BlockTreePruningDepth) of ER is 10 domain blocks, so the ER of #1 is considered confirmed when ER of #11 is submitted into the block tree.

But in the current implementation, the ER of #1 can be submitted any time before it is considered confirmed, so a malicious operator can submit an invalid ER of #1 when the head receipt number is #10 and right before ER of #11 is submitted. In this way, the invalid ER will be considered as confirmed before there is a fraud proof submitted and pruning it, then we will have 2 ERs of #1 considered as confirmed and will result in a MultipleERsAfterChallengePeriod error.

The correct ER should be considered as confirmed is the one that has 10 ERs built on top of it, but it is non-trivial to identify such an ER currently. It is also unnecessary because #1731 will fix the issue automatically by rejecting the invalid ER of #1 being submitted, if an operator wants to submit another ER of #1 it must submit a fraud proof to prune the current ER of #1 first.

cc @vedhavyas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Subspace execution
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant