Skip to main content

merge

Git Source

Merges two compact ranges along a given seed node.

Merge folds hashes in from leftRange and rightRange into seed in order to create a combined compact range. The merged range is left + seed + right. leftRange is assumed to start its coverage at index 0.

function merge(
bytes32[] calldata leftRange,
bytes32 seed,
uint256 seedHeight,
uint256 seedIndex,
bytes32[] calldata rightRange,
uint256 rightRangeEnd
) pure returns (bytes32[] calldata left, bytes32 newSeed, bytes32[] calldata right);

Parameters

NameTypeDescription
leftRangebytes32[]The left compact range to merge.
seedbytes32The seed node to merge along.
seedHeightuint256The height of the seed node.
seedIndexuint256The index of the seed node.
rightRangebytes32[]The right compact range to merge.
rightRangeEnduint256The end of the right range's coverage.

Returns

NameTypeDescription
leftbytes32[]The left portion of the merged compact range.
newSeedbytes32The new seed node of the merged range.
rightbytes32[]The right portion of the merged compact range.