Skip to content

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

@ianconsolata

Description

@ianconsolata

@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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions