paritytech / parity-common

Collection of crates used in Parity projects
https://www.paritytech.io/
Apache License 2.0
288 stars 218 forks source link

Support for BorshDeserialize and BorshSerialize #640

Open ivanceras opened 2 years ago

ivanceras commented 2 years ago

Hi, is there any plan to support BorshSerialize and BorshDeserialize for the ethereum-types. I notice that borsh is used in NEAR and in Solana which provides compatibility with ethereum.

ordian commented 2 years ago

Hey @ivanceras. If there's enough demand for it, we might consider adding this feature. However, that would mean tying any major releases to a breaking change to ethereum-types, which we'd like to avoid.

sloboste commented 1 year ago

Borsh support would be useful to hyperlane and eclipse.

@ordian to address your concern about avoiding being tied to breaking changes - given that borsh is still in 0.x, what do you think about feature gating borsh support behind an experimental-impl-borsh feature and documenting explicitly that there may be breaking changes to anything related to borsh?

ordian commented 1 year ago

@sloboste hey, sorry for the long delay in reply. I think your suggestion is a reasonable workaround we can live with.

tkporter commented 1 year ago

@ordian would love to see https://github.com/paritytech/parity-common/pull/698 get merged with the feature gate :) are there any changes you'd like to see there?

ordian commented 1 year ago

@tkporter yes, see point 2 in https://github.com/paritytech/parity-common/pull/698#issuecomment-1331827459. Instead of introducing a new crate with a regular macro, we could just use derive with a feature gate.