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

Open
wants to merge 2 commits into
base: master
Choose a base branch
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📌 Triage
Development

Successfully merging this pull request may close these issues.

3 participants