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

chore(gateway): add new methods #12727

Closed
wants to merge 2 commits into from

Conversation

dumikau
Copy link
Contributor

@dumikau dumikau commented Nov 27, 2024

No description provided.

@@ -34,6 +35,12 @@ import (
// * Generate openrpc blobs

type Gateway interface {
ChainGetNode(ctx context.Context, p string) (*IpldObject, error)
Copy link
Member

Choose a reason for hiding this comment

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

why this one @dumikau ?

Copy link
Member

Choose a reason for hiding this comment

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

tbh I can't see this one making it to the v2 API that's under development now without a really good use-case, are people asking for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this method was added by request of a user from Neti-Soft

StateMinerSectors(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error)
StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)
StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]MarketBalance, error)
Copy link
Member

Choose a reason for hiding this comment

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

This one isn't small - mainnet currently gives a map with 6175 entries, 361Kb of JSON. It's not inefficient, so probably not too big a problem to expose, except for the fact that it's a big chunk of data for a simple call. Are people asking for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, all these methods were added by requests of different users

@eshon
Copy link
Contributor

eshon commented Dec 4, 2024

  • I checked with the requestor teams, and the only one still needed is StateMinerAvailableBalance which is safe to add. The other StateMiner* calls can be removed from this PR.

  • As for ChainGetNode, ChainReadObj would be a better option because it goes to the blockstore and not the network, so a workaround is being discussed.

@rvagg
Copy link
Member

rvagg commented Dec 5, 2024

I'm not completely against ChainGetNode if people really want it. I'd just consider it a legacy API, so not ideal to encourage use of. But it is more efficient at getting to your data than ChainReadObj if you know exactly where you need to navigate to through a series of blocks.

@rjan90 rjan90 added the need/author-input Hint: Needs Author Input label Feb 10, 2025
@BigLep
Copy link
Member

BigLep commented Feb 10, 2025

2025-02-10 maintainer conversation: next steps are for @dumikau to either:

  1. Fix up this PR OR
  2. Create a new PR if want to avoid conflict resolution
    assuming this is still wanted. Otherwise lets close.

Copy link

Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 72 hours. You are always more than welcome to reopen the PR later as well!

@rjan90
Copy link
Contributor

rjan90 commented Feb 20, 2025

Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 72 hours

Closing since it has been over 72 hours, and stalebot was unable to close.

@rjan90 rjan90 closed this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/stale need/author-input Hint: Needs Author Input
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

5 participants