parity-scale-codec-derive
Serialization and deserialization derive macro for Parity SCALE Codec
3.7.5
55M downloads/mo
#1161 most downloaded on crates.io
paritytech/parity-scale-codec
What this package is like to depend on
Last release 1 years ago
20 May 2025
Release timing varies
gaps range from 9 days to 6 months
Most releases are documented
notes for 21 of 33 stable releases
8 versions withdrawn
withdrawn after publishing
7 years old
45 releases · first in 2019
0 releases in the last 12 months
see the full history below
Release timeline
45 releases · Jul 2019 to May 2025Releases
latest 45-
3.7.520 May 2025Release notes
Open source →What's Changed
- chore: max MaxEncodedLen derivation as automatically_derived by @saiintbrisson in #703
- Bump quote from 1.0.38 to 1.0.39 by @dependabot in #707
- Bump syn from 2.0.98 to 2.0.99 by @dependabot in #708
- Bump proc-macro2 from 1.0.93 to 1.0.94 by @dependabot in #706
- Bump byte-slice-cast from 1.2.2 to 1.2.3 by @dependabot in #712
- Bump bytes from 1.10.0 to 1.10.1 by @dependabot in #710
- Bump trybuild from 1.0.103 to 1.0.104 by @dependabot in #714
- Bump rustversion from 1.0.19 to 1.0.20 by @dependabot in #711
- Bump serde from 1.0.217 to 1.0.218 by @dependabot in #704
- Implement
on_before_alloc_mem()forCountedInputby @serban300 in #716 - Bump quote from 1.0.39 to 1.0.40 by @dependabot in #719
- Bump syn from 2.0.99 to 2.0.100 by @dependabot in #718
- Make clippy happy for some casts by @bkchr in #715
- Bump honggfuzz from 0.5.56 to 0.5.57 by @dependabot in #720
- Bump serde from 1.0.218 to 1.0.219 by @dependabot in #717
- Fix typo by @PolkadotDom in #722
- Bump proc-macro2 from 1.0.94 to 1.0.95 by @dependabot in #725
- Fix derive(Decode) for enums with lifetime parameters and struct-like variants by @ImplOfAnImpl in #726
- Bump syn from 2.0.100 to 2.0.101 by @dependabot in #727
- Bump trybuild from 1.0.104 to 1.0.105 by @dependabot in #732
- Fix
DecodeWithMemTrackingbounds forCowby @bkchr in #735 - Fix performance regression by @serban300 in #731
New Contributors
- @saiintbrisson made their first contribution in #703
- @PolkadotDom made their first contribution in #722
- @ImplOfAnImpl made their first contribution in #726
Full Changelog: v3.7.4...v3.7.5
-
3.7.407 Feb 2025Release notes
Open source →What's Changed
- Follow-up on #663 by @serban300 in #693
- Bump syn from 2.0.96 to 2.0.98 by @dependabot in #697
- Fix breaking change: Do not enforce discriminant to be a literal + don't expect usize. by @gui1117 in #695
- update cargo lock by @gui1117 in #700
- Enforce
parity-scale-codec-deriveversion with=x.y.z. by @gui1117 in #696 - Have some release guideline by @gui1117 in #694
- Bump bytes from 1.9.0 to 1.10.0 by @dependabot in #698
- Bump criterion from 0.4.0 to 0.5.1 by @dependabot in #591
- Release 3.7.4 by @serban300 in #701
- Disallow duplicate indexes using constant evaluation #653
Full Changelog: v.3.7.3...v3.7.4
-
3.7.330 Jan 2025 withdrawn -
3.7.228 Jan 2025 withdrawnNothing published for this version
-
3.7.127 Jan 2025 withdrawnNothing published for this version
-
3.7.018 Nov 2024 withdrawnRelease notes
Open source →What's Changed
- Bump trybuild from 1.0.83 to 1.0.84 by @dependabot in #519
- Bump proc-macro2 from 1.0.66 to 1.0.67 by @dependabot in #523
- Bump trybuild from 1.0.84 to 1.0.85 by @dependabot in #524
- Bump proptest from 1.2.0 to 1.3.1 by @dependabot in #525
- Bump bytes from 1.4.0 to 1.5.0 by @dependabot in #513
- Bump proc-macro2 from 1.0.67 to 1.0.68 by @dependabot in #526
- Update UI tests for 1.73.0 by @bkchr in #530
- Bump arbitrary from 1.0.3 to 1.3.1 by @dependabot in #528
- Bump serde from 1.0.188 to 1.0.189 by @dependabot in #531
- Bump proc-macro2 from 1.0.68 to 1.0.69 by @dependabot in #527
- Bump rustix from 0.37.18 to 0.37.25 by @dependabot in #533
- [ci] Add job to publish crates by @alvicsam in #517
- Bump serde from 1.0.189 to 1.0.190 by @dependabot in #534
- Bump
proc-macro-crateto2.0.0by @ascjones in #535 - Adding gitspiegel-trigger workflow by @mutantcornholio in #537
- Bump arbitrary from 1.3.1 to 1.3.2 by @dependabot in #538
- Bump serde from 1.0.190 to 1.0.192 by @dependabot in #540
- Fixing gitspiegel trigger workflow by @mutantcornholio in #541
- Bump serde from 1.0.192 to 1.0.193 by @dependabot in #543
- Bump proc-macro2 from 1.0.69 to 1.0.70 by @dependabot in #544
- Bump proc-macro-crate from 2.0.0 to 2.0.1 by @dependabot in #547
- [ci] fix publish job by @alvicsam in #548
- Switch CI from GitLab to GitHub Actions by @sergejparity in #546
- Bump trybuild from 1.0.85 to 1.0.86 by @dependabot in #549
- Bump proc-macro2 from 1.0.70 to 1.0.73 by @dependabot in #553
- Bump quote from 1.0.33 to 1.0.34 by @dependabot in #552
- Bump proc-macro2 from 1.0.73 to 1.0.74 by @dependabot in #554
- Bump quote from 1.0.34 to 1.0.35 by @dependabot in #556
- Bump proc-macro-crate from 2.0.1 to 3.0.0 by @dependabot in #558
- Bump proc-macro2 from 1.0.74 to 1.0.75 by @dependabot in #557
- Bump serde from 1.0.193 to 1.0.194 by @dependabot in #559
- Bump serde from 1.0.194 to 1.0.195 by @dependabot in #561
- Bump proc-macro2 from 1.0.75 to 1.0.76 by @dependabot in #560
- Bump trybuild from 1.0.86 to 1.0.88 by @dependabot in #563
- Bump trybuild from 1.0.88 to 1.0.89 by @dependabot in #566
- Bump proc-macro-crate from 3.0.0 to 3.1.0 by @dependabot in #567
- Bump proc-macro2 from 1.0.76 to 1.0.78 by @dependabot in #568
- Bump serde from 1.0.195 to 1.0.196 by @dependabot in #570
- Bump serde from 1.0.196 to 1.0.197 by @dependabot in #571
- Bump proc-macro2 from 1.0.78 to 1.0.79 by @dependabot in #572
- Bump trybuild from 1.0.89 to 1.0.90 by @dependabot in #573
- Bump bytes from 1.5.0 to 1.6.0 by @dependabot in #574
- Bump trybuild from 1.0.90 to 1.0.91 by @dependabot in #577
- Bump quote from 1.0.35 to 1.0.36 by @dependabot in #578
- Bump serde from 1.0.197 to 1.0.198 by @dependabot in #580
- Bump proc-macro2 from 1.0.79 to 1.0.81 by @dependabot in #581
- Bump serde from 1.0.198 to 1.0.199 by @dependabot in #584
- Source code formatting by @kalaninja in #583
- Fix PrefixInput read by @kalaninja in #582
- Bump serde from 1.0.199 to 1.0.200 by @dependabot in #585
- Bump trybuild from 1.0.91 to 1.0.94 by @dependabot in #589
- Bump proc-macro2 from 1.0.81 to 1.0.82 by @dependabot in #588
- Bump serde from 1.0.200 to 1.0.201 by @dependabot in #592
- Bump trybuild from 1.0.94 to 1.0.95 by @dependabot in #593
- Bump paste from 1.0.14 to 1.0.15 by @dependabot in #594
- Add the repository field to Cargo.toml by @szabgab in #595
- Bump serde from 1.0.201 to 1.0.202 by @dependabot in #596
- Bump trybuild from 1.0.95 to 1.0.96 by @dependabot in #597
- Bump proc-macro2 from 1.0.82 to 1.0.83 by @dependabot in #598
- Bump honggfuzz from 0.5.55 to 0.5.56 by @dependabot in #599
- Bump proc-macro2 from 1.0.83 to 1.0.84 by @dependabot in #600
- Bump serde from 1.0.202 to 1.0.203 by @dependabot in #601
- Bump proc-macro2 from 1.0.84 to 1.0.85 by @dependabot in #604
- Bump proc-macro2 from 1.0.85 to 1.0.86 by @dependabot in #606
- Bump proptest from 1.3.1 to 1.5.0 by @dependabot in #607
- Bump serde from 1.0.203 to 1.0.204 by @dependabot in #611
- Bump trybuild from 1.0.96 to 1.0.97 by @dependabot in #612
- Bump bytes from 1.6.0 to 1.6.1 by @dependabot in #614
- Use
MAX_PREALLOCATIONconsistently by @serban300 in #605 - Follow-up on #605 by @serban300 in #615
- Bump trybuild from 1.0.97 to 1.0.98 by @dependabot in #617
- Bump bytes from 1.6.1 to 1.7.1 by @dependabot in #620
- Bump trybuild from 1.0.98 to 1.0.99 by @dependabot in #619
- Fix
MaxEncodedLenderive macro for enum with skipped variant by @gui1117 in #622 - Bump serde from 1.0.204 to 1.0.209 by @dependabot in #625
- Bump arrayvec from 0.7.4 to 0.7.6 by @dependabot in #624
- Bump quote from 1.0.36 to 1.0.37 by @dependabot in #626
- Bump serde from 1.0.209 to 1.0.210 by @dependabot in #627
- Bump bytes from 1.7.1 to 1.7.2 by @dependabot in #629
- Introduce
CountedInput. a wrapper which counts the number of bytes successfully read by @gui1117 in #630 - Bump proc-macro2 from 1.0.86 to 1.0.87 by @dependabot in #632
- Decode with mem limit by @serban300 in #616
- Bump trybuild from 1.0.99 to 1.0.100 by @dependabot in #635
- Bump rustversion from 1.0.17 to 1.0.18 by @dependabot in #634
- Bump proc-macro2 from 1.0.87 to 1.0.88 by @dependabot in #636
- Bump trybuild from 1.0.100 to 1.0.101 by @dependabot in #637
- Bump bytes from 1.7.2 to 1.8.0 by @dependabot in #638
- Bump serde from 1.0.210 to 1.0.211 by @dependabot in #639
- Bump serde from 1.0.211 to 1.0.213 by @dependabot in #644
- Bump proc-macro2 from 1.0.88 to 1.0.89 by @dependabot in #642
- chore(deps): Update to syn 2 by @jsdw in #640
- Bump syn from 2.0.82 to 2.0.85 by @dependabot in #647
- Bump arbitrary from 1.3.2 to 1.4.0 by @dependabot in #651
- Bump syn from 2.0.85 to 2.0.87 by @dependabot in #650
- Bump arbitrary from 1.4.0 to 1.4.1 by @dependabot in #652
- Bump serde from 1.0.213 to 1.0.214 by @dependabot in #648
- Bump serde from 1.0.214 to 1.0.215 by @dependabot in #654
- Prep to release 3.7.0 by @jsdw in #646
New Contributors
- @mutantcornholio made their first contribution in #537
- @kalaninja made their first contribution in #583
- @szabgab made their first contribution in #595
- @serban300 made their first contribution in #605
Full Changelog: v3.6.8...v3.7.0
Release notes
Open source →Added
- Allow decoding with a memory limit. (616)
- Introduce
CountedInput, an wrapper onInputthat counts the bytes read. (630)
Changed
- This release bumps some dependencies, primarily bumping
synto 2. (#640).
Fixed
-
3.6.1208 May 2024 -
3.6.1108 May 2024 -
3.6.1008 May 2024Release notes
Open source →What's Changed
- chore(docs): Restore missing doc for codec-
crateattribute by @gshep in #576 - Bump
proc-macro-crateto v3.1.0 in 3.6.x branch by @tdimitrov in #590
New Contributors
- @tdimitrov made their first contribution in #590
Full Changelog: v3.6.9...v3.6.10
- chore(docs): Restore missing doc for codec-
-
3.6.929 Nov 2023Release notes
Open source →What's Changed
- Bump trybuild from 1.0.83 to 1.0.84 by @dependabot in #519
- Bump proc-macro2 from 1.0.66 to 1.0.67 by @dependabot in #523
- Bump trybuild from 1.0.84 to 1.0.85 by @dependabot in #524
- Bump proptest from 1.2.0 to 1.3.1 by @dependabot in #525
- Bump bytes from 1.4.0 to 1.5.0 by @dependabot in #513
- Bump proc-macro2 from 1.0.67 to 1.0.68 by @dependabot in #526
- Update UI tests for 1.73.0 by @bkchr in #530
- Bump arbitrary from 1.0.3 to 1.3.1 by @dependabot in #528
- Bump serde from 1.0.188 to 1.0.189 by @dependabot in #531
- Bump proc-macro2 from 1.0.68 to 1.0.69 by @dependabot in #527
- Bump rustix from 0.37.18 to 0.37.25 by @dependabot in #533
- [ci] Add job to publish crates by @alvicsam in #517
- Bump serde from 1.0.189 to 1.0.190 by @dependabot in #534
- Bump
proc-macro-crateto2.0.0by @ascjones in #535 - Adding gitspiegel-trigger workflow by @mutantcornholio in #537
- Bump arbitrary from 1.3.1 to 1.3.2 by @dependabot in #538
- Bump serde from 1.0.190 to 1.0.192 by @dependabot in #540
- Fixing gitspiegel trigger workflow by @mutantcornholio in #541
- Bump serde from 1.0.192 to 1.0.193 by @dependabot in #543
- Bump proc-macro2 from 1.0.69 to 1.0.70 by @dependabot in #544
- Revert breaking changes, bump version to
3.6.9by @ascjones in #545
New Contributors
- @mutantcornholio made their first contribution in #537
Full Changelog: v3.6.8...v3.6.9
-
3.6.811 Sep 2023 withdrawnRelease notes
Open source →What's Changed
- impl compact<()> for MaxEncodedLen by @pgherveou in #516
- bump 3.6.8 by @pgherveou in #518
Full Changelog: v3.6.7...v3.6.8
-
3.6.8-alpha.110 Sep 2023 pre-releaseNothing published for this version
-
3.6.708 Sep 2023 withdrawnRelease notes
Open source →What's Changed
- Update MaxEncodedLen derive macro by @pgherveou in #512
- Bump to 3.6.7 by @pgherveou in #515
Full Changelog: v.3.6.6...v3.6.7
-
3.6.606 Sep 2023 withdrawnNothing published for this version
-
3.6.529 Aug 2023Nothing published for this version
-
3.6.418 Jul 2023Release notes
Open source →Added
- Now
#[derive(Encode)]implements thesize_hint()method for structures and enumerations. This improves the performance of theencode()method by pre-allocating memory.
- Now
-
3.6.303 Jul 2023Release notes
Open source →Fixed
- Provide full path to elements from
::coreinDecodederivation (caused compilation error whenno-implicit-preludewas used).
- Provide full path to elements from
-
3.6.230 Jun 2023Release notes
Open source →Fixed
- Trying to deserialize a boxed newtype containing a big array won't overflow the stack anymore.
-
3.6.119 Jun 2023 -
3.6.015 Jun 2023Release notes
Open source →Added
- Added
Decode::decode_intoto allow deserializing into unitialized memory. - Added a
DecodeFinishedtype to be used withDecode::decode_into.
Fixed
- Trying to deserialize a big boxed array (e.g.
Box<[u8; 1024 * 1024 * 1024]>) won't overflow the stack anymore. - Trying to deserialize big nested enums with many variants won't overflow the stack anymore.
- Elements of partially read arrays will now be properly dropped if the whole array wasn't decoded.
Changed
- The derive macros will now be reexported only when the
derivefeature is enabled, as opposed to how it was previously where enablingparity-scale-codec-derivewould suffice. - The
max-encoded-lenfeature won't automatically enable the derive macros nor pull in theparity-scale-codec-derivedependency.
- Added
-
3.1.418 Jan 2023Nothing published for this version
-
3.1.310 Jun 2022 -
3.1.217 Mar 2022Release notes
Open source →Be aware that version 3.0.0. up to 3.1.1 contained some bugs in the
BitVecencoder that could lead to an invalid encoding. Thus, we yanked these crate version and it is advised to upgrade to 3.1.2. Any release before 3.0.0 wasn't affected by this bug.Changed
- Optimised the
Decode::decodefor[T; N]by @xgreenx. #299 - Add some doc for the derive macro by @thiolliere. #301
- Add bytes::Bytes implementation by @vorot93. #309
- Upgrade to BitVec 1.0 by @bkchr. #311
- BREAKING CHANGE: DecodeLimit and DecodeAll extensions now advance input by @wigy-opensource-developer. #314
- Make
CompactRefpublic by @andrenth. #321 - Add ability to re-export parity-scale-codec crate by @gshep. #325
- BitVec: Improve the encoding and consolidate the implementations by @bkchr. #327
- Fix crate access by putting a leading
::by @bkchr. #328
- Optimised the
-
3.1.012 Mar 2022Nothing published for this version
-
3.0.003 Feb 2022 -
2.3.128 Sep 2021Release notes
Open source → -
2.3.011 Sep 2021Release notes
Open source →Added
decode_and_advance_with_depth_limitto theDecodeLimittrait. This allows advancing the cursor while decoding the input. PR #286
-
2.2.002 Jul 2021Release notes
Open source →Added
- Add support for custom where bounds
codec(mel_bound(T: MaxEncodedLen))when deriving the traits. PR #279 MaxEncodedLentrait for items that have a statically known maximum encoded size. (#268)#[codec(crate = <path>)]top-level attribute to be used with the newMaxEncodedLentrait, which allows to specify a different path to the crate that contains theMaxEncodedLentrait. Useful when using generating a type through a macro and this type should implementMaxEncodedLenand the final crate doesn't haveparity-scale-codecas dependency.
- Add support for custom where bounds
-
2.2.0-rc.325 Jun 2021 pre-releaseNothing published for this version
-
2.2.0-rc.224 Jun 2021 pre-releaseNothing published for this version
-
2.2.0-rc.123 Jun 2021 pre-releaseNothing published for this version
-
2.1.315 Jun 2021Release notes
Open source →Changed
- Lint attributes now pass through to the derived impls of
Encode,DecodeandCompactAs. PR #272
- Lint attributes now pass through to the derived impls of
-
2.1.006 Apr 2021Release notes
Open source →Fix
- Add support for custom where bounds
codec(encode_bound(T: Encode))andcodec(decode_bound(T: Decode))when deriving the traits. Pr #262 - Switch to const generics for array implementations. Pr #261
- Add support for custom where bounds
-
2.0.126 Feb 2021 -
2.0.026 Jan 2021Release notes
Open source →Added
Decode::skipallows to skip some encoded types. Pr #243Decode::encoded_fixed_sizeallows to get the fixed encoded size of a type. PR #243Errornow contains a chain of causes. This full error description can also be activated on no std using the featurechain-error. PR #242Encode::encoded_sizeallows to get the encoded size of a type more efficiently. PR #245
Changed
CompactAs::decode_fromnow returns result. This allow for decoding to fail from their compact form.- derive macro use literal index e.g.
#[codec(index = 15)]instead of#[codec(index = "15")] - Version of crates
bitvecandgeneric-arrayis updated. Encode::encode_tonow bounds the genericW: Output + ?Sizedinstead ofW: Output.Outputcan now be used as a trait object.
Removed
EncodeAppend::appendis removed in favor ofEncodeAppend::append_or_new.Output::pushis removed in favor ofEncode::encode_to.- Some bounds on
HasCompact::Typeare removed. Error::whatis removed in favor ofError::to_string(implemented through traitDisplay).Error::descriptionis removed in favor ofError::to_string(implemented through traitDisplay).
-
1.2.326 Feb 2021Nothing published for this version
-
1.2.207 Sep 2020Nothing published for this version
-
1.2.128 Jul 2020Nothing published for this version
-
1.2.003 Mar 2020Nothing published for this version
-
1.1.120 Dec 2019Nothing published for this version
-
1.1.013 Nov 2019Nothing published for this version
-
1.0.327 Sep 2019Nothing published for this version
-
1.0.229 Jul 2019Nothing published for this version
-
1.0.129 Jul 2019Nothing published for this version
-
1.0.017 Jul 2019 withdrawnNothing published for this version