cosmos-sdk/orm/CHANGELOG.md
Emil Georgiev 4fea3fba73
fix(orm)!: properly encode/decode nanoseconds in Duration type (#19909)
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
2024-06-04 15:45:54 +00:00

3.1 KiB

Changelog

[Unreleased]

Feature

  • #15320 Add current sequence getter (LastInsertedSequence) for auto increment tables.

Improvements

  • Bump minimum Go version to 1.21.

API Breaking Changes

  • #15870 Rename the orm package to cosmossdk.io/orm.
  • #14822 Migrate to cosmossdk.io/core genesis API.

State-machine Breaking Changes

  • #12273 The timestamp key encoding was reworked to properly handle nil values. Existing users will need to manually migrate their data to the new encoding before upgrading.
  • #15138 The duration key encoding was reworked to properly handle nil values. Existing users will need to manually migrate their data to the new encoding before upgrading.
  • #19909 (Breaking) Adjusts the encoding of zero and positive nanoseconds to ensure consistent comparison of duration objects. In the previous implementation, when nanoseconds were greater than or equal to zero, the encoding format was simple: we just represented the number in bytes (for example, 0 with [0x0]). For negative nanoseconds, we added 999,999,999 to ensure they were non-negative. In the new implementation, we always add 999,999,999 to all nanoseconds to ensure consistency in encoding and to maintain lexicographical order when compared with other durations.

Bug Fixes

  • #16023 Fix bugs introduced by lack of CI tests in #15138 and #15813. This changes the duration encoding in #15138 to correctly order values with negative nanos.