Skip to content
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

Update Rust crate borsh to v1 #395

Closed
wants to merge 1 commit into from
Closed

Update Rust crate borsh to v1 #395

wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Oct 30, 2023

Mend Renovate

This PR contains the following updates:

Package Type Update Change
borsh (source) dependencies major 0.10 -> 1.1
borsh (source) dev-dependencies major 0.10 -> 1.1

Release Notes

near/borsh-rs (borsh)

v1.1.1

Compare Source

Other
  • add test_schema_conflicts (#​254)
  • addressed warnings in docs generation (#​252)
  • simplify discriminants handling in schema derives (#​241)

v1.1.0

Compare Source

Added
  • relax schema_container_of target requirement with ?Sized to allow slices (#​245)
Fixed
  • fully qualify #cratename::BorshSchema in derive-generated code to void function name collisions leading to compilation errors (#​244)

v1.0.0

Compare Source

The year is 2653 and the best yet-to-be citizens of the Terran Federation are fighting
and mostly just dying in a relentless interstellar war against the Arachnids.
Yet the structure of our society has changed through the course of this confrontation.

The members of the Arachnid brain caste and queens have infiltrated the circles of our
most influential political and industrial leaders. Either directly, or via the Arachnid technology
called "Brain Bugs". This tech alone can accomplish what the Arachnid starship paratroopers
will not ever be capable to do.

Simple, straightforward and performant serialization libraries can set us in course to remedy this dangerous
stalemate situation by cleaning the minds of its users from even the tiniest of Brain Bugs.

v0.11.0

Compare Source

Added
  • add BorshSchema for PhantomData, BTreeMap and BTreeSet (#​93)
  • Add optional bson::oid::ObjectId support (#​135)
  • [breaking] ser/de enum discriminant (#​138)
Fixed
  • no-std tests did not run due to dev-dependencies re-enabling std feature (#​144)
Other
  • use release-plz and specify common rust version correctly (#​134)
  • Upgrade plain-HTTP links to HTTPS in Cargo.toml files (#​141)

v0.10.3

Compare Source

#[derive(BorshDeserialize, BorshSerialize, BorshSchema)] pub enum CurveType { ED25519 = 0, // 0 as u8 in enum tag SECP256K1 = 2, // 1 as u8 in enum tag }

#[derive(BorshDeserialize, BorshSerialize, BorshSchema)]
#[borsh(use_discriminant=false)]
pub enum CurveType {
ED25519 = 0, // 0 as u8 in enum tag
SECP256K1 = 2, // 1 as u8 in enum tag
}
// vs
#[derive(BorshDeserialize, BorshSerialize, BorshSchema)]
#[borsh(use_discriminant=true)]
pub enum CurveType {
ED25519 = 0, // 0 as u8 in enum tag
SECP256K1 = 2, // 2 as u8 in enum tag
}

borsh-v1.0.0

- [RUSTSEC-2023-0033](https://rustsec.org/advisories/RUSTSEC-2023-0033.html) has been resolved.
It has been resolved by forbidding collections with dynamic runtime length to contain zero-sized types
with runtime errors, happening on serialization or deserialization.
Arrays with non-`Copy` and non-`Clone` ZST singletons of length > 1 gracefully panic on deserialization,
not causing memory faults. 

Using collections with dynamic runtime length ([tagged sequences](https://docs.rs/borsh/1.0.0/borsh/schema/enum.Definition.html#variant.Sequence)) for containing ZSTs was also deemed
wasteful of CPU cycles and a way to perform dos attacks.
Such a case is now flagged as error when using new [`BorshSchemaContainer::validate`](https://docs.rs/borsh/1.0.0/borsh/schema/struct.BorshSchemaContainer.html#method.validate) method for user-defined
types or instantiations of `BorshSchema`-supporting types with inappropriate parameters, defined by the library:

```rust
let schema = BorshSchemaContainer::for_type::<Vec<core::ops::RangeFull>>();
assert_eq!(
    Err(
      SchemaContainerValidateError::ZSTSequence("Vec<RangeFull>".to_string())
    ), 
    schema.validate()
);
  • BorshSchema was extended with max_serialized_size implementation, which now unlocks support of borsh
    by a plethora of bounded types to express statically defined size limits of serialized representation of these types.

  • schema BorshSchemaContainer api was made future-proof.

  • schema Definition was extended with more variants, fields and details to uncover some of the
    implied details of serialization format.
    BorshSchema can now express a wider range of types. All types, which have BorshSchema defined by the library,
    now have a Definition.

  • schema Declaration-s were renamed to follow Rust-first rule and not be a mix of Rust types naming/syntax and syntax
    from other languages.

    use borsh::schema::BorshSchema;

v0.10.2

Compare Source

  • Prevent unbound allocation for vectors on deserialization

v0.10.1

Compare Source

  • Implemented (de)ser for core::ops::range
  • Introduce de::EnumExt trait with deserialize_variant method

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@emostov
Copy link
Contributor

emostov commented Oct 30, 2023

requires newer version of rust

@emostov emostov closed this Oct 30, 2023
@renovate
Copy link
Author

renovate bot commented Oct 30, 2023

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 1.x releases. But if you manually upgrade to 1.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/borsh-1.x branch October 30, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant