-
Notifications
You must be signed in to change notification settings - Fork 651
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
chore: update borsh dependency #9432
Conversation
f0273d8
to
95314b5
Compare
5efb2ef
to
1ce3b3b
Compare
1ce3b3b
to
f0039ec
Compare
97b6b89
to
f41372b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dj8yfo Enormous effort! Borsh 1.0 is knocking on the door!
@dj8yfo Please, update to borsh 1.0, rebase, and let's merge it 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I totally did not expect so many places needed https://docs.rs/borsh/latest/borsh/fn.object_length.html
(mostly `borsh::to_vec(&obj).unwrap().len()` -> `borsh::object_length(&obj).unwrap()` )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dj8yfo Well done!
Looks great. Minor non-blocking question - why |
@matklad suggested that it didn't make sense to override this trait method => it should not be a trait method, but rather an external helper. Couldn't come up with counterexamples. It may make sense to override initial vector allocation capacity per type, but that can be done with introducing a constant on
i think more context can be found by following a trail hyperlinks, reachable from migration guide |
Specific reasons here:
|
It was useful for borsh-rs developers and for those who will also need to migrate from older version of borsh to the new one. nearcore team is lucky one for getting the migration done by borsh-rs maintainer, but solana (also uses borsh-rs) is not that lucky :-P, but at least they have some guides to follow. |
[borsh-rs 1.0.0 release](https://github.com/near/borsh-rs/releases/tag/borsh-v1.0.0) is a major milestone and it makes sense to update nearcore to use it. Here is the migration guide that was captured along the way: https://github.com/near/borsh-rs/blob/borsh-v1.0.0/docs/migration_guides/v0.10.2_to_v1.0.0_nearcore.md
[borsh-rs 1.0.0 release](https://github.com/near/borsh-rs/releases/tag/borsh-v1.0.0) is a major milestone and it makes sense to update nearcore to use it. Here is the migration guide that was captured along the way: https://github.com/near/borsh-rs/blob/borsh-v1.0.0/docs/migration_guides/v0.10.2_to_v1.0.0_nearcore.md
borsh-rs 1.0.0 release is a major milestone and it makes sense to update nearcore to use it.
Here is the migration guide that was captured along the way: https://github.com/near/borsh-rs/blob/borsh-v1.0.0/docs/migration_guides/v0.10.2_to_v1.0.0_nearcore.md