Skip to content

Commit

Permalink
Added Binary Fuse Filter XDR definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Jul 19, 2024
1 parent 70180d5 commit 4199970
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion Stellar-types.x
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,35 @@ struct HmacSha256Mac
{
opaque mac[32];
};
}

struct ShortHashSeed
{
opaque seed[16];
};

enum BinaryFuseFilterType
{
BINARY_FUSE_FILTER_8_BIT = 0,
BINARY_FUSE_FILTER_16_BIT = 1,
BINARY_FUSE_FILTER_32_BIT = 2
};

struct SerializedBinaryFuseFilter
{
BinaryFuseFilterType type;

// Seed used to hash input to filter
ShortHashSeed inputHashSeed;

// Seed used for internal filter hash operations
ShortHashSeed filterSeed;
uint32 segmentLength;
uint32 segementLengthMask;
uint32 segmentCount;
uint32 segmentCountLength;
uint32 fingerprintLength; // Length in terms of element count, not bytes

// Array of uint8_t, uint16_t, or uint32_t depending on filter type
opaque fingerprints<>;
};
}

0 comments on commit 4199970

Please sign in to comment.