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

Correctly calculate Client Deal Bytes for a given wallet address #129

Open
ianconsolata opened this issue Sep 25, 2024 · 2 comments
Open
Assignees

Comments

@ianconsolata
Copy link
Collaborator

ianconsolata commented Sep 25, 2024

@lanzafame pointed out that the Client Power is currently using the Market Balance of an address to calculate power (

resp, err := lotusRpcClient.Call(ctx, "Filecoin.StateMarketBalance", tipSetList)
), rather than the deal bytes. This means the client voting power is based on how much FIL they have spent on deals, not how many total bytes worth of deals they have submitted. This is incorrect. Instead, I believe we need to pull data from the StateMarketDeals endpoint (https://docs.filecoin.io/reference/json-rpc/state#statemarketdeals), and loop over all the deals for a wallet address to calculate the total deal bytes for that address.

This should only be the deal bytes of CURRENT deals. Expired deals should not be counted.

@ianconsolata ianconsolata self-assigned this Sep 25, 2024
@ianconsolata
Copy link
Collaborator Author

One additional complexity -- as @rvagg pointed out earlier in a slack chat, with Direct Data Onboarding this approach is no longer comprehensive, because "there exists the category of non-verified, non-market ... pieces, which you don’t get to know who owns that piece, or even if that piece has an owner other than the SP, “sparkling data” is the term that’s been thrown around for this"

So it sounds like calculating client deal bytes this way would not include sparkling data.

@ianconsolata
Copy link
Collaborator Author

Addressed partially by #136 -- it still doesn't account for the issue with direct data onboarding, but does now correctly calculate deal bytes for deals made the standard way.

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

No branches or pull requests

1 participant