Skip to content

[consensus] Avoid Dynamic Computation of Namespace Helpers #2521

@patrick-ogrady

Description

@patrick-ogrady

In #2220, we dynamically generate namespaces like:

impl<D: Digest> Subject for &Item<D> {
    fn namespace_and_message(&self, namespace: &[u8]) -> (Bytes, Bytes) {
        (ack_namespace(namespace).into(), self.encode().freeze())
    }
}

We should instead construct these namespaces once and clone them (via Bytes::clone() rather than re-generating each time).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions