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 MpoolSelect #4197

Merged
merged 5 commits into from
Apr 17, 2024
Merged

feat(rpc): implement MpoolSelect #4197

merged 5 commits into from
Apr 17, 2024

Conversation

lemmih
Copy link
Contributor

@lemmih lemmih commented Apr 15, 2024

Summary of changes

Changes introduced in this pull request:

  • Expose select_messages, which was hidden behind #[cfg(test)].
  • Test schema of MpoolSelect against Lotus.

Reference issue to close (if applicable)

Closes #4196

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.

@lemmih lemmih marked this pull request as ready for review April 16, 2024 13:18
@lemmih lemmih requested a review from a team as a code owner April 16, 2024 13:18
@lemmih lemmih requested review from hanabi1224 and aatifsyed and removed request for a team April 16, 2024 13:18
@lemmih
Copy link
Contributor Author

lemmih commented Apr 16, 2024

The newly exposed code could use a lot of love.

@lemmih lemmih marked this pull request as draft April 16, 2024 13:50
@lemmih lemmih marked this pull request as ready for review April 17, 2024 06:35
@@ -1,6 +1,6 @@
// Copyright 2019-2024 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

#![allow(clippy::indexing_slicing)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather see documented unwraps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me too. I opened a new tracking issue: #4229

@@ -6,6 +6,7 @@
//! `select_messages` API which selects an appropriate set of messages such that
//! it optimizes miner reward and chain capacity. See <https://docs.filecoin.io/mine/lotus/message-pool/#message-selection> for more details

#![allow(clippy::indexing_slicing)]
Copy link
Contributor

Choose a reason for hiding this comment

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

As above

pub enum MpoolSelect {}
impl RpcMethod<2> for MpoolSelect {
const NAME: &'static str = "Filecoin.MpoolSelect";
const PARAM_NAMES: [&'static str; 2] = ["tsk", "tq"];
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use full words, tipset_key and, what is tq?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other commands also use 'tsk'. Not sure what tq means. I blatantly copied it from Lotus. Hopefully, we can fix it once we understand what these RPC methods should do.

@lemmih lemmih added this pull request to the merge queue Apr 17, 2024
Merged via the queue into main with commit 0c96584 Apr 17, 2024
30 checks passed
@lemmih lemmih deleted the lemmih/mpool-select branch April 17, 2024 11:53
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.

MpoolSelect
3 participants