Skip to content

Conversation

@AHaliq
Copy link

@AHaliq AHaliq commented Dec 19, 2025

Purpose

Sub task of ZKP-41. To eventually deprecate use of serde on non primitive data types.

Changes

Guard non primitive serde::Serialize, serde::Deserialize behind a flag. List of data types can be found here

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@AHaliq AHaliq requested a review from allanbrondum December 19, 2025 11:56
@AHaliq AHaliq added [Type] Maintenance Cleanup or handling of technical debt. backlog labels Dec 19, 2025
@AHaliq AHaliq force-pushed the haliq/serde-deprecated branch from ae9942b to 966b6cd Compare December 22, 2025 16:44
@AHaliq AHaliq force-pushed the haliq/serde-deprecated branch from 966b6cd to 07508c6 Compare December 22, 2025 16:49
@AHaliq AHaliq marked this pull request as ready for review December 22, 2025 17:20
use crate::common::cbor::{cbor_decode, cbor_encode, value};

/// Serialize a `HashMap<String, value::Value>` as hex-encoded CBOR.
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to put the map_hex_cbor_values module behind the feature flag instead of allowing dead code?

Copy link
Contributor

Choose a reason for hiding this comment

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

I seems that this module should just be removed. Since it is not used. But would be nice with a separate PR for fixing this. So in this PR I suggest leaving the warning there. And then raise a PR to fix the warnings.

///
/// * A problem decoding to a group element
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[allow(dead_code)]

///
/// * A problem decompressing to a scalar or group element,
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[allow(dead_code)]

Same here, remove the error module in a separate PR

}

/// Serialize `Bytes` as a hex string.
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to put this behind a feature flag. We should very rarely need to use #[allow(dead_code)]

}

/// Deserialize `Bytes` from a hex string.
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same, use the feature flag to guard the function

use itertools::izip;
use std::rc::Rc;

#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[allow(dead_code)]

Lets keep it here for now and ignore the warning

},
};

#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[allow(dead_code)]

Same

Copy link
Contributor

@allanbrondum allanbrondum left a comment

Choose a reason for hiding this comment

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

Generally looks good

@DOBEN DOBEN force-pushed the haliq/serde-deprecated branch from a42a040 to e5928f6 Compare January 16, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog [Type] Maintenance Cleanup or handling of technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants