Skip to content

Conversation

@fpelliccioni
Copy link
Contributor

No description provided.

@fpelliccioni fpelliccioni requested a review from Copilot April 30, 2025 19:11
Copy link

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 pull request refactors the domain object deserialization logic by replacing calls to domain::create with domain::create_old and updating the associated deserialization methods. In addition, legacy inline deserialization templates and macros have been removed and updated across various database modules, and the catch2 dependency version in conanfile.py was bumped.

  • Replaced domain::create with domain::create_old in tests and database source/header files.
  • Removed obsolete conditional macros and inline legacy deserialization methods.
  • Updated dependency versions in conanfile.py.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

File Description
test/internal_database.cpp Updated calls to domain::create_old for block, output, transaction_entry, header, and point.
src/databases/*.cpp Updated deserialization calls to use domain::create_old instead of domain::create.
include/kth/database/databases/*.hpp Removed legacy, commented-out deserialization template overloads and updated declarations to use expect<…>.
conanfile.py Bumped catch2 dependency from 3.6.0 to 3.7.1.
Comments suppressed due to low confidence (3)

include/kth/database/databases/header_abla_entry.cpp:36

  • Consider adding explanatory comments detailing why a default tuple with zero values is returned when block_size (or subsequent values) fails to read, to clarify the error handling logic.
    auto const block_size = reader.read_little_endian<uint64_t>();

include/kth/database/databases/utxo_entry.hpp:36

  • Consider removing the commented-out legacy deserialization overloads to reduce clutter and improve code maintainability.
    bool from_data(const data_chunk& data);

include/kth/database/databases/transaction_unconfirmed_entry.hpp:41

  • Remove the commented-out legacy deserialization methods to avoid confusion and keep the interface focused on the updated 'expect<…>' based approach.
    bool from_data(const data_chunk& data);

@fpelliccioni fpelliccioni force-pushed the feat/domain-obj-deserialization-lite branch from 627083d to d57e9db Compare April 30, 2025 19:14
@fpelliccioni fpelliccioni requested a review from Copilot April 30, 2025 19:15
Copy link

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 refactors the deserialization logic across several domain objects by switching from domain::create to domain::create_old and migrating from custom from_data overloads to a unified expect‐based API. In addition, it removes conditional compilation branches for serialization/deserialization, and updates dependency versions in the conanfile.

  • Switched deserialization calls to use domain::create_old consistently.
  • Replaced legacy from_data implementations with new expect-based static functions.
  • Updated Catch2 dependency to v3.7.1.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/internal_database.cpp Updated deserialization calls for block, output, header, and transaction entries.
src/databases/utxo_entry.cpp Introduced an expect-based deserialization for utxo_entry.
src/databases/transaction_unconfirmed_entry.cpp Refactored deserialization and removed conditional compilation flags for serialization.
src/databases/transaction_entry.cpp Refactored deserialization to use expect-based API.
src/databases/history_entry.cpp Updated history_entry deserialization to use expect-based API.
src/databases/header_abla_entry.cpp Modified header/abla state deserialization to use a unified API.
include/kth/database/databases/*.hpp & .ipp Updated header and inline implementations in databases to match the new deserialization API and naming conventions.
conanfile.py Updated Catch2 version dependency.
Comments suppressed due to low confidence (2)

test/internal_database.cpp:45

  • [nitpick] The use of 'create_old' instead of 'create' may be ambiguous. Consider adding documentation to clarify the differences between these functions.
return domain::create_old<domain::chain::block>(data);

src/databases/transaction_unconfirmed_entry.cpp:48

  • Removing the conditional compilation branches that passed extra boolean flags changes the serialization behavior. Verify that always calling tx.to_data(sink, false) aligns with the intended design and does not affect expected serialization output.
return tx.serialized_size(false);

@fpelliccioni fpelliccioni merged commit 33a8fcf into master Apr 30, 2025
7 of 9 checks passed
@fpelliccioni fpelliccioni deleted the feat/domain-obj-deserialization-lite branch April 30, 2025 22:48
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.

2 participants