Skip to content

Expose the internal state of Merkle Tree to allow more efficient sub root digest calculation #831

Closed
@masih

Description

@masih

As part of chain exchange, once we receive a chain the key for every subchain of it is calculated to speed up discovery, implemented here. The current implementation uses the naive/simple approach by calling merkle.Tree for every sub chain. This effectively re-hashes the same information over and over for smaller sub-chains.

The digest calculation can be made much cheaper if the merkle implementation exposes internal state such that the intermediate state from calculating the longest sub-chain can be used to calculate the smaller sub-chain digests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status

    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions