Skip to content

Conversation

@lisicky
Copy link
Contributor

@lisicky lisicky commented Sep 2, 2025

No description provided.

@lisicky lisicky requested review from Copilot and vsubhuman September 2, 2025 18:19
Copy link
Contributor Author

@lisicky lisicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/check

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the pointer address decoder to follow Cardano ledger logic by implementing proper variable-length encoding/decoding and overflow normalization behavior. The changes ensure compatibility with the Haskell implementation by normalizing pointer values to (0,0,0) when any component exceeds its maximum allowed value.

  • Implements new variable-length u64 decoder that matches Haskell's decodeVariableLengthWord64 function
  • Adds overflow normalization logic that resets pointers to (0,0,0) when values exceed u32::MAX, u16::MAX, or u16::MAX for slot, tx_index, and cert_index respectively
  • Refactors Pointer struct into separate module with comprehensive test coverage

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rust/src/protocol_types/pointer.rs New module containing Pointer struct with Cardano-compliant variable-length encoding/decoding
rust/src/protocol_types/address.rs Removes old Pointer implementation and variable-length nat functions, updates to use new Pointer module
rust/src/protocol_types/numeric/big_num.rs Adds From implementation for BigNum
rust/src/protocol_types/mod.rs Exports new pointer module
rust/src/tests/pointer.rs Comprehensive test suite for pointer functionality
rust/src/tests/mod.rs Adds pointer test module
rust/src/tests/address.rs Updates test expectations for overflow normalization behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor Author

@lisicky lisicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/check

@lisicky lisicky merged commit b74777c into master Sep 17, 2025
4 checks passed
@lisicky lisicky deleted the evgenii/crazy-pointers branch September 17, 2025 17:35
@lisicky lisicky added this to the 15.0.2 milestone Sep 17, 2025
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.

3 participants