-
Notifications
You must be signed in to change notification settings - Fork 247
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
Introduce the stateless fraud proof #2761
Conversation
f1c90f6
to
3beb4d8
Compare
This is for the upcoming stateless FP because previous MMR only prove that there is a historical state root but stateless FP need to ensure this is the exact state root of a specific block. Note that XDM doesn't has this concern since it also check the channel nonce Signed-off-by: linning <linningde25@gmail.com>
Notice some of the fraud proof unit tests in pallet-domains is removed in this commit because we already have end-to-end fraud proof integration tests in domain-operator while these unit tests are mannully constructing the fraud proof and only cover some of the verification steps thus just remove them instead of updating them base on the new defination Signed-off-by: linning <linningde25@gmail.com>
Signed-off-by: linning <linningde25@gmail.com>
Signed-off-by: linning <linningde25@gmail.com>
Signed-off-by: linning <linningde25@gmail.com>
ac44719
to
a2610d1
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.
LGTM. Left some questions/nits
@@ -34,7 +33,7 @@ use sp_domains::{ | |||
InvalidBundleType, Transfers, | |||
}; | |||
use sp_domains_fraud_proof::fraud_proof::{ | |||
ApplyExtrinsicMismatch, ExecutionPhase, FinalizeBlockMismatch, FraudProof, | |||
ApplyExtrinsicMismatch, ExecutionPhase, FinalizeBlockMismatch, FraudProofVariant, |
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.
Its already an enum with bunch of variants. Feels redundant to call it FraudProofVariant
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.
I agree, naming is hard as always :) WDYT FraudProofType
?
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.
I would leave it as FraudProof like we have initially
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.
FraudProof
is already used by
pub struct FraudProof<Number, Hash, DomainHeader: HeaderT, MmrHash> {
...
pub proof: FraudProofVariant<Number, Hash, DomainHeader>,
}
If you mean enum FraudProof
and letting each variant contain duplicated fields like domain_id
, bad_receipt_hash
that is not the direction I would like to go, and I rather stick with FraudProofVariant
@@ -423,10 +423,6 @@ mod pallet { | |||
#[pallet::storage] | |||
pub type SuccessfulBundles<T> = StorageMap<_, Identity, DomainId, Vec<H256>, ValueQuery>; | |||
|
|||
/// Fraud proofs submitted successfully in current block. | |||
#[pallet::storage] | |||
pub(super) type SuccessfulFraudProofs<T: Config> = |
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.
why do we not need this anymore on the client?
How is client going to fetch the what fraud proofs are included in the previous consensus block ?
What am I missing here ?
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.
This is previously required by the client to maintain all the mismatched ER in the aux storage, e.g. the client uses FP as a signal of bad ER pruning, but it is not more needed since #2329
This PR is the last PR of #2652
This PR introduces the definition, generation, and verification of the stateless fraud proof.
NOTE: this PR removed the
register_only
for the new host function so it should only land (via a runtime upgrade) into gemini-3h after most of the nodes in the network have upgraded to release that includes #2755Code contributor checklist: