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

Enforce the bundles contain ER that pointing to the last domain block or extend the head receipt #1731

Closed
Tracked by #1706
NingLin-P opened this issue Jul 31, 2023 · 1 comment · Fixed by #2194
Closed
Tracked by #1706
Assignees
Labels
execution Subspace execution fraud-proof

Comments

@NingLin-P
Copy link
Member

NingLin-P commented Jul 31, 2023

Add more constraints to the ER to simply the overall design:

  • If last_domain_block_number == current_head_receipt, then only ER that points to the last domain block is acceptable
  • If last_domain_block_number > current_head_receipt, then the bundle can contain multiple ERs, the first ER must extend the head receipt and these ERs must be consecutive.
  • ER that points to domain block > last_domain_block_number is rejected since it is invalid obviously.

With the above changes most of the ReceiptType::NewBranch usage can be eliminated, and with the multiple ER changes #1673 is also fixed.

Estimation: 3-4 days

@NingLin-P NingLin-P mentioned this issue Jul 31, 2023
30 tasks
@NingLin-P NingLin-P self-assigned this Jul 31, 2023
@jfrank-summit jfrank-summit added execution Subspace execution fraud-proof labels Aug 30, 2023
NingLin-P added a commit that referenced this issue Sep 6, 2023
This storage item is used to keek track of the immediate descendants of an
ER, it is used during fraud proof processing to prune all the descendants of
the targetted fraudulent ER. This storage item can be removed after this task
#1731 is implemented, by then every
ER should only have one immediate descendant

Signed-off-by: linning <linningde25@gmail.com>
NingLin-P added a commit that referenced this issue Sep 7, 2023
The receipt may already been pruned if there is fraud proof being processed and
the  is reverted. Test cases is added accordingly. This commit
also add TODO for a non-trival to fix issue, and it is intended to fix with
#1731

Signed-off-by: linning <linningde25@gmail.com>
@NingLin-P
Copy link
Member Author

NingLin-P commented Oct 27, 2023

We also need this constraint to reject invalid bundles that are produced accidentally by honest operators that lag behind the latest domain chain.

Without this constraint, the lagging operator could win the challenge and produce a bundle, but the bundle is validated against the lagging domain chain instead of the latest domain chain, so it may be considered an invalid bundle and cause the operator to get slashed.

With this constraint, the lagging operator's bundle will be rejected (thus no slash) since its ER is not deriving from the latest domain block and doesn't extend the head ER. The constraint will ensure only the operator has progressed its local domain chain to the latest and carries the latest ER in its bundle, which means the bundle is validated against the latest domain chain, and then the bundle will be accepted.

Noted, there is still a race condition that, the operator has build & import the latest domain block, and then it immediately builds and submits the bundle with the tx in its tx pool, before the tx is validated against the latest block (which happens asynchronously in the txpool-notifications worker). Thus we will also need to manually re-validate the tx when constructing the bundle to fix the problem completely.

cc @vedhavyas @ParthDesai @jfrank-summit

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

Successfully merging a pull request may close this issue.

2 participants