-
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
Simplify the consensus chain storage proof in FP by gathering necessary storage into one place #3281
Comments
I think I'm a bit lost here, is the code here something like: let fraud_proof_data = FraudProofData {
block_randomness: StorageKeyProvider::storage_key(FraudProofStorageKeyRequest::BlockRandomness),
...
};
In subspace/crates/sp-domains-fraud-proof/src/fraud_proof.rs Lines 318 to 352 in bdf31b8
|
What I mean is something like: pub struct FraudfProofDataStorageProof(StorageProof);
impl_storage_proof!(FraudfProofDataStorageProof);
impl<Block: BlockT> BasicStorageProof<Block> for FraudfProofDataStorageProof {
type StorageValue = FraudfProofData;
fn storage_key_request(_key: Self::Key) -> FraudProofStorageKeyRequest<NumberFor<Block>> {
FraudProofStorageKeyRequest::FraudfProofData
}
} and |
This is looking a bit complicated, I might start with one of the simpler proofs first. |
I've done some analysis here, and I think the It's also possible to merge the storage for The other proofs are either:
They're also stored using different keys, which might complicate things. |
Here's a copy of my notes for the successful bundles proof. We should consider merging this fraud proof data, if the savings on fraud proof generation outweigh the data duplication.
|
Let's leave |
Atm, there are many consensus chain storage proofs used by different fraud proof, see:
subspace/crates/sp-domains-fraud-proof/src/storage_proof.rs
Lines 55 to 67 in cd44905
And we need to generate and verify each of them during fraud proof generation & verification, to simplify that we can gather all the small storage into one place which does introduce duplicated storage but will simplify things a lot (and even remove some of the proof data) as we only need to generate/verify one storage proof to cover many proof data.
For example:
Then the storage proof of
FraudProofData
can replace many storage proofs usage in https://github.com/autonomys/subspace/blob/main/crates/sp-domains-fraud-proof/src/fraud_proof.rscc @teor2345
The text was updated successfully, but these errors were encountered: