Skip to content
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.MsigGetVested and Filecoin.MsigGetVestingSchedule #4304

Merged
merged 11 commits into from
May 10, 2024

Conversation

sudo-shashank
Copy link
Contributor

@sudo-shashank sudo-shashank commented May 9, 2024

Summary of changes

Changes introduced in this pull request:

  • Implemented Filecoin.MsigGetVested and Filecoin.MsigGetVestingSchedule RPC method
  • Moved Filecoin.MsigGetAvailableBalance and Filecoin.MsigGetPending (10) from state.rs to msig.rs
forest-tool api compare forest_snapshot_calibnet_2024-05-09_height_1597332.forest.car.zst --filter Msig
| RPC Method                            | Forest | Lotus |
|---------------------------------------|--------|-------|
| Filecoin.MsigGetAvailableBalance (10) | Valid  | Valid |
| Filecoin.MsigGetPending (10)          | Valid  | Valid |
| Filecoin.MsigGetVested (10)           | Valid  | Valid |
| Filecoin.MsigGetVestingSchedule (10)  | Valid  | Valid |

Reference issue to close (if applicable)

contributes to #4164

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@sudo-shashank sudo-shashank marked this pull request as ready for review May 10, 2024 08:30
@sudo-shashank sudo-shashank requested a review from a team as a code owner May 10, 2024 08:30
@sudo-shashank sudo-shashank requested review from ruseinov and LesnyRumcajs and removed request for a team May 10, 2024 08:30
@sudo-shashank sudo-shashank changed the title feat(rpc): implement Filecoin.MsigGetVested feat(rpc): implement Filecoin.MsigGetVested and Filecoin.MsigGetVestingSchedule May 10, 2024
Comment on lines 146 to 177
let msig_vesting = match &ms {
multisig::State::V8(st) => MsigVesting {
initial_balance: st.initial_balance.atto().clone(),
start_epoch: st.start_epoch,
unlock_duration: st.unlock_duration,
},
multisig::State::V9(st) => MsigVesting {
initial_balance: st.initial_balance.atto().clone(),
start_epoch: st.start_epoch,
unlock_duration: st.unlock_duration,
},
multisig::State::V10(st) => MsigVesting {
initial_balance: st.initial_balance.atto().clone(),
start_epoch: st.start_epoch,
unlock_duration: st.unlock_duration,
},
multisig::State::V11(st) => MsigVesting {
initial_balance: st.initial_balance.atto().clone(),
start_epoch: st.start_epoch,
unlock_duration: st.unlock_duration,
},
multisig::State::V12(st) => MsigVesting {
initial_balance: st.initial_balance.atto().clone(),
start_epoch: st.start_epoch,
unlock_duration: st.unlock_duration,
},
multisig::State::V13(st) => MsigVesting {
initial_balance: st.initial_balance.atto().clone(),
start_epoch: st.start_epoch,
unlock_duration: st.unlock_duration,
},
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a good place for this? @hanabi1224 implemented it src/shim/actors/market/balance_table.rs, which allows re-usability.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember we usually have this state matching code in fil-actor-states, I guess we should either keep it that way or move all of that logic out to shim. It's much better to have all the similar logic in predictable places, otherwise it's hard to navigate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we have a custom struct here. Then perhaps it belongs to forest.

The stuff I was talking about before:

https://github.com/ChainSafe/fil-actor-states/blob/main/fil_actor_interface/src/builtin/market/mod.rs#L171

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved inside src/shim/actors/multisig

@ruseinov ruseinov added this pull request to the merge queue May 10, 2024
Merged via the queue into main with commit 10d9224 May 10, 2024
28 checks passed
@ruseinov ruseinov deleted the shashank/rpc-msig-vested branch May 10, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants