Skip to content

Bug report: Breaking change in BorshIoError enum leading to deserialization errors #394

@pmantica11

Description

@pmantica11

BorshIoError enum got changed from BorshIoError(String) to only just BorshIoError here:
https://github.com/anza-xyz/solana-sdk/blob/master/instruction-error/src/lib.rs#L184C9-L184C21

This is leading to a tricky error in Anza archival where old blocks encode this error as an object:

{
   "BorshIoErrror": "Reason for the error" 
} 

New blocks simply encode this error as strings:

"BorshIoError"

Because of the two different ways to deserialize BorshIoError there is currently no solana-sdk that can correctly deserialize all blocks. To fix this, we need to implement a customer serde deserializer for the InstructionError that handles both cases.

Metadata

Metadata

Assignees

No one assigned

    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