-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bundle mainnet genesis state #165
Conversation
|
6053e9a
to
dfa99dc
Compare
closing #163 in favor of this. |
@TalDerei feel free to take this over as it pairs with your other work |
Looking at the rust code here https://github.com/penumbra-zone/web/blob/main/packages/wasm/crate/src/view_server.rs#L116 , isn't the compact block passed into wasm as a binary-proto-encoded byte array? in that case, wouldn't it be best to store the compact block in that format to avoid serialization overhead, and which would also be smaller to include in the extension manifest? |
thanks taking over PR 👍 |
In theory, storing the compact block object as a binary-proto-encoded byte array should be more efficient in terms of both serialization and space costs. In terms of serialization, we'll still need to perform a deserialization operation in the extension when fetching the genesis file, In terms of space, the compact block object for the genesis block is ~10 MB, while its JSON representation is ~18 MB. Surprisingly, when serialized to a binary-proto-encoded byte array using cc @turbocrime |
I'm not sure where those numbers are coming from. The genesis compact block is 8035648 bytes. See penumbra-zone/penumbra#4824 for code to generate the data |
strange blowup, I was simply logging the binary representation of the compact block and manually saving to a file. |
Tested this out locally and things are working for me. @TalDerei after publishing the latest packages in penumbra-zone and pulling them in here, think you can merge. In general, it's nice this saves the 8mb download. However, for a full sync the user will still have to download another +60mb. Connectrpc downloads all of those in parallel to the block sync logic. That said, it's not really noticed on my machine as the CPU/IO tasks are the bottleneck and those downloaded blocks are just waiting to be processed. |
echoing the same observation on M3 pro |
@@ -103,7 +104,15 @@ export class Services implements ServicesInterface { | |||
idbConstants: indexedDb.constants(), | |||
}); | |||
|
|||
// Dynamically fetch binary file for genesis compact block |
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.
179bc86
to
4a4e42b
Compare
References #161, pairs with penumbra-zone/web#1706