-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
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.
A few comments, but I think we are in a good path, let me know if you need me to look deeper into anything. Thanks!
StateTree::new_from_root(ReadOnlyBlockstore::new(store), &state_params.state_root)?; | ||
let state_tree_root = state_params.state_root; | ||
|
||
let block_state_params_bytes = fvm_ipld_encoding::to_vec(&(state_params, block_height))?; |
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.
Here you are serializing a tuple of state_params
, height
, right? Wouldn't it be better to create a clear data structure that include both so its de/serialization is clearer?
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.
It's just two fields so I feel making a type alias is easier and clear.
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.
The way it is now, with the ability to inspect version
before trying to deserialize the actual payload, should make it possible to migrate later 👍
todo!() | ||
} | ||
|
||
async fn write_car(self, car: CarHeader, write: tokio::fs::File) -> anyhow::Result<()> { |
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 create the CarHeader
here, and then the car_header_roots
function is not needed, you can delay serializing the state_params
to a Block
to get the CID up to this point, and not need to store bytes and CID in the struct?
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 updated slightly to use stream instead. But originally I was thinking the caller, i.e. Snapshot
should control the root cids.
} | ||
|
||
#[pin_project::pin_project] | ||
struct StateTreeStreamer<BlockStore> { |
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.
Ususally we use BS
or DB
as a generic parameter.
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.
It would be more intuitive when you look at bs: BlockStore
that it's not a regular type.
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.
You gave a thumbs up but didn't change the parameter name, just resolved the comment. I'm not sure whether you intended to change it or not 🙂
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.
Wait, I changed them all. Oh, I know, the commit was lost when I was trying to rebase the branch. Will add them back. Updated them now
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.
Very nice!
There are some crates for me to catch up on, I have no idea about pin_project
:)
There shouldn't be any changes to the ipc_actors
, unless the dev
branched changed there. But definitely gateway.rs
should not exist any more if you rebase.
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.
Awesome! I have only very minor remarks left 👏
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.
Thanks for following up on all the comments, great job!
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.
Amazing job! A minor comment but I think this is good to go.
Initial attempt to add snapshot functionalities to fendermint. The ideas are as follows:
StateParams
,BlockHeight
andStateTree
. (Maybe we can consider snapshot some past StateParams?)list_snapshots
call, we can return the path of the snapshot files in metadata field and chunk the car file accordingly.This PR is starting to address point 1 and 2.