-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat(rpc): implement Filecoin.StateSectorPartition #4381
Conversation
src/shim/actors/convert.rs
Outdated
@@ -0,0 +1,276 @@ | |||
// Copyright 2019-2024 ChainSafe Systems |
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.
Could you please explain why you copied https://github.com/ChainSafe/fil-actor-states/blob/main/fil_actor_interface/src/convert.rs here? If you intend to move it out of fil-actor-states
, let's have a separate PR for this.
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.
These methods are not publicly exported.
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.
So right now we have two lengthy implementations doing basically the same thing. I'd rather we have only one.
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.
Fixed.
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.
Thank you!
src/shim/actors/miner/state.rs
Outdated
@@ -114,4 +118,33 @@ impl MinerStateExt for State { | |||
} | |||
} | |||
} | |||
|
|||
fn find_sector<BS: 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.
I would expect this method to be a part of fil-actor-states
just like we do it for other actors. Then we don't need all of those from...*
method in forest
either.
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's a PR for inspiration: ChainSafe/fil-actor-states#299
Basically we could do the same with find_sector
and then just call that in Forest
rpc code.
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'd prefer getting rid of the process of updating and releasing fil-actor-states
crates during the RPC development and we can backport all missing functions all at once after all RPC work is done. What do you think?
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 up to you, though this creates unnecessary confusion. I'd rather go through an ordeal of having to reference a working branch in fil-actor-states than introducing these helpers and then moving them to another repo.
This also introduces another potential problem which boils down to potential mistakes when moving the code around and ultimately requires an additional round of testing once the refactoring is done.
Which is why I'm not 100% sure this saves us any hassle, while adding to the noise in forest
commit history.
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.
find_sector
added in ChainSafe/fil-actor-states#303
I'd rather go through an ordeal of having to reference a working branch in fil-actor-states
Referencing a working branch without publishing would block cargo publish --dry-run
for forest.
introducing these helpers and then moving them to another repo.
I think the ordeal is because with the current development process of fil_actor_interface
, there's no way to make the crate carefully designed, when the requirement of what are needed and what are not needed is unclear, and the rest of the crates in the repo are mostly copy-pasted code. Although I really love the idea of having an interface crate, I doubt the usefulness of fil_actor_interface
after spending so much maintenance effort when it's not (and not likely possible to be ) a carefully designed library.
By not a carefully designed library
, I mean, e.g. when the other crates are mostly copy-pasted code, why don't we use a separate version number for fil_actor_interface
instead of publishing all other crates without changing anything in most of the time
Let's add changelog entry. |
734158b
to
5b4bade
Compare
Summary of changes
Changes introduced in this pull request:
Filecoin.StateSectorPartition
Reference issue to close (if applicable)
Closes #4380
Other information and links
Change checklist