ics-cf-solana light-client: header verification & client update; protobuf impl#510
ics-cf-solana light-client: header verification & client update; protobuf impl#510vmarkushin wants to merge 21 commits intohyperspace-solanafrom
Conversation
mina86
left a comment
There was a problem hiding this comment.
If I understand correctly, Header contains the entire Solana block (i.e. all shreds)? That can be rather big, no?
| @@ -0,0 +1,263 @@ | |||
| //! File source: solana/ledger/src/shred/legacy.rs | |||
There was a problem hiding this comment.
I’m guessing we can get rid of legacy support?
There was a problem hiding this comment.
It's not being use in Solana anymore? Then I think it's crucial to make sure that the encoding is still correct, which seems a bit subtle to me... But I will add a TODO for it
There was a problem hiding this comment.
Honestly I don’t know, but that would be my assumption. It’s probably something to verify.
There is no requirement for that, but also no limit for how many shreds can be sent. I think it's reasonable to limit the amount of shreds only to be able to restore the last entry (to calculate the hash) + (potentially) some meta information, like validators change |
…eived shreds in a header =
Check that the consensus state for the header is the same as in the storage (if have any)
| /// 3. Doesn't contain duplicates | ||
| /// 4. All shreds have the same slot | ||
| #[derive(Clone, PartialEq, Eq, Debug)] | ||
| pub struct PreCheckedShreds(Vec<Shred>); |
There was a problem hiding this comment.
I’d say CheckedShreds is a better name. PreChecked is ambiguous and might mean that those are shreds before the check, i.e. pre being checked.
There was a problem hiding this comment.
They're not fully checked (the signature wasn't checked at least), that's why the name is like so
There was a problem hiding this comment.
What do you think about PartiallyCheckedShreds?
There was a problem hiding this comment.
Could also be SortedShreds I suppose?
Co-authored-by: Michal Nazarewicz <mina86@mina86.com>
…te' into vmarkushin/cf-solana-client-update
…-client-update # Conflicts: # contracts/pallet-ibc/src/light_clients.rs # light-clients/icsxx-cf-solana/src/client_def.rs
Implemented initial version of the client header verification and state update, and Protobuf (de)serialisation.
The library is based on
cf-guestcrate and reuses some functionality from there. The verification of Shreds is performed by the functions taken from Solana's codebase. Some code was copy-pasted from the repo due to absence of no-std support, mentioning the original's file source path.The current version of the code doesn't contain proper tests - they will be added when the client is supported in hyperspace-solana.