MCPcopy
hub / github.com/ethereum/EIPs / gti_split_below

Function gti_split_below

assets/eip-7745/binary_tree.py:146–156  ·  view source on GitHub ↗

Splits the path leading to the given generalized tree index at the specified height and returns the index at the given height. If the height of the given index is less than the specified level then the original index is returned.

(index: U256, level: Uint)

Source from the content-addressed store, hash-verified

144
145
146def gti_split_below(index: U256, level: Uint) -> U256:
147 """
148 Splits the path leading to the given generalized tree index at the
149 specified height and returns the index at the given height. If the height
150 of the given index is less than the specified level then the original
151 index is returned.
152 """
153 height = gti_height(index)
154 if height > level:
155 index >>= height - level
156 return index
157
158
159def gti_split_above(index: U256, level: Uint) -> U256:

Callers 7

log_index_empty_nodeFunction · 0.85
epoch_tree_empty_nodeFunction · 0.85
prog_list_empty_nodeFunction · 0.85
index_entry_empty_nodeFunction · 0.85
log_entry_empty_nodeFunction · 0.85

Calls 1

gti_heightFunction · 0.85

Tested by

no test coverage detected