Skip to content

Filecoin.StateReadState: Serialization error for Cbor protocol: TypeMismatch { name: \"CBOR tag\", byte: 0 } #5596

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

Open
AlexeyKrasnoperov opened this issue Apr 23, 2025 · 3 comments · Fixed by #5620 · May be fixed by #5666
Assignees
Labels
Type: Bug Something isn't working

Comments

@AlexeyKrasnoperov
Copy link
Member

Describe the bug

I request Filecoin.StateReadState and receive an error from Forest, while Lotus (ankr) returns correct results.

To reproduce

Lotus request:

curl -X POST https://rpc.ankr.com/filecoin \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "method": "Filecoin.StateReadState",
  "params": [
    "f01234",
    [
      { "/": "bafy2bzacec2pdpnwwznkbm44dl7ehuyqu5igtupo7r5ejgmvvnrjiywaauhaw" },
      { "/": "bafy2bzaceb6dxlcrvo27q5zycy7tizq7n7nhf3bm7vrijm56lugxj6fpbbfs4" }
    ]
  ],
  "id": 1
}'

Lotus response:

{"id":1,"jsonrpc":"2.0","result":{"Balance":"0","Code":{"/":"bafk2bzacectp5rumce4kekelolp6abrtfbbdjwl3ydjvurmfd6nbk3tott4ks"},"State":{"AllocatedSectors":{"/":"bafy2bzacedgt3fssxtvxnnlrmcwshsf3lyzts52ca744ujq4uwqlzwkst4rcm"},"CurrentDeadline":1,"DeadlineCronActive":false,"Deadlines":{"/":"bafy2bzacedogdgi67tk44dhdetx7mvx65kgb3v4o47gf6xsmejaiwi672n476"},"EarlyTerminations":[0],"FeeDebt":"0","Info":{"/":"bafy2bzacebr6djrnzgpf7fc5pvmke6wwufmfldcosovr6cb5bkmw5nomxorjc"},"InitialPledge":"0","LockedFunds":"0","PreCommitDeposits":"0","PreCommittedSectors":{"/":"bafy2bzaceamp42wmmgr2g2ymg46euououzfyck7szknvfacqscohrvaikwfay"},"PreCommittedSectorsCleanUp":{"/":"bafy2bzaceaa2jny7gkgdwnid4kuldau6bnvgyss5bszo4uy6uikrncvdu5mc2"},"ProvingPeriodStart":3120720,"Sectors":{"/":"bafy2bzaceb47p7svfxpwp7bclt6og7kl73fvrz2fd6owhecugnci55zbcfwd2"},"VestingFunds":null}}}

Forest request:

curl -X POST http://localhost:2345/rpc/v1 \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "method": "Filecoin.StateReadState",
  "params": [
    "f01234",
    [
      { "/": "bafy2bzacec2pdpnwwznkbm44dl7ehuyqu5igtupo7r5ejgmvvnrjiywaauhaw" },
      { "/": "bafy2bzaceb6dxlcrvo27q5zycy7tizq7n7nhf3bm7vrijm56lugxj6fpbbfs4" }
    ]
  ],
  "id": 1
}'

Forest response:

{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Serialization error for Cbor protocol: TypeMismatch { name: \"CBOR tag\", byte: 0 }"}}

Expected behaviour

Forest returns correct results.

@AlexeyKrasnoperov AlexeyKrasnoperov added the Type: Bug Something isn't working label Apr 23, 2025
@LesnyRumcajs LesnyRumcajs moved this from New to Ready in Forest Backlog 🌲 Apr 23, 2025
@LesnyRumcajs LesnyRumcajs self-assigned this Apr 23, 2025
@LesnyRumcajs
Copy link
Member

This will be more work to make it the way it works in Lotus. We don't have reflection in Rust. See #5484 for a similar problem.

@LesnyRumcajs
Copy link
Member

I might be pushed for time in the coming weeks due to holidays and travelling. @akaladarshi would you like to take it?

@akaladarshi
Copy link
Collaborator

I might be pushed for time in the coming weeks due to holidays and travelling. @akaladarshi would you like to take it?

@LesnyRumcajs Yeah sure I can start working on this, please assign it to me 👍🏼

@LesnyRumcajs LesnyRumcajs moved this from Ready to In progress in Forest Backlog 🌲 May 7, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Forest Backlog 🌲 May 28, 2025
@akaladarshi akaladarshi reopened this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
Status: Done
3 participants