Skip to content

sgns::securecrdt::ISignedCRDTData

Interface implemented by every CRDT-backed value that requires a quorum of authorized signers to create/update.

#include <ISignedCRDTData.hpp>

Inherited by sgns::account::BurnConfigPayload, sgns::trustedpeer::TrustedPeerListPayload

Public Functions

Name
virtual ~ISignedCRDTData() =default
virtual std::vector< uint8_t > SerializeToBytes() const =0
Serializes this instance's payload to raw bytes (codec, encode side).
virtual bool DeserializeFromBytes(const std::vector< uint8_t > & bytes) =0
Deserializes raw bytes into this instance's payload (codec, decode side).
virtual bool Verify(const std::vector< uint8_t > & payload) const =0
Performs type-specific semantic validation of payload beyond signature/quorum checks (e.g. field-range checks).
virtual void Apply() =0
Applies the side effect of this value once the caller has independently confirmed quorum (e.g. via SecureCrdt::ReadIfQuorum). Apply() itself does NOT check quorum.

Public Functions Documentation

function ~ISignedCRDTData

virtual ~ISignedCRDTData() =default

function SerializeToBytes

virtual std::vector< uint8_t > SerializeToBytes() const =0

Serializes this instance's payload to raw bytes (codec, encode side).

Return: Raw payload bytes representing this instance's current state.

Reimplemented by: sgns::account::BurnConfigPayload::SerializeToBytes, sgns::trustedpeer::TrustedPeerListPayload::SerializeToBytes

function DeserializeFromBytes

virtual bool DeserializeFromBytes(
    const std::vector< uint8_t > & bytes
) =0

Deserializes raw bytes into this instance's payload (codec, decode side).

Parameters:

  • bytes Raw payload bytes to decode.

Return: true if bytes decoded successfully, false if malformed.

Reimplemented by: sgns::account::BurnConfigPayload::DeserializeFromBytes, sgns::trustedpeer::TrustedPeerListPayload::DeserializeFromBytes

   Must return false on malformed/truncated input rather than throwing
   or asserting (V5 Input Validation) - mirrors
   ValidatorRegistry::DeserializeRegistryUpdate's parse-failure-returns-error
   pattern.

function Verify

virtual bool Verify(
    const std::vector< uint8_t > & payload
) const =0

Performs type-specific semantic validation of payload beyond signature/quorum checks (e.g. field-range checks).

Parameters:

  • payload Raw payload bytes to validate.

Return: true if payload is semantically valid for this type.

Reimplemented by: sgns::account::BurnConfigPayload::Verify, sgns::trustedpeer::TrustedPeerListPayload::Verify

function Apply

virtual void Apply() =0

Applies the side effect of this value once the caller has independently confirmed quorum (e.g. via SecureCrdt::ReadIfQuorum). Apply() itself does NOT check quorum.

Reimplemented by: sgns::account::BurnConfigPayload::Apply, sgns::trustedpeer::TrustedPeerListPayload::Apply


Updated on 2026-08-11 at 21:18:04 +0000