MCPcopy
hub / github.com/ethereum/research / pop

Method pop

ssz_research/ssz_hashable_list/hashable_list.py:79–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

77
78 # Pop from the list
79 def pop(self):
80 # Remove the item. Note that if the length of the chunks goes below a power
81 # of two, we do NOT remove the item (this is to prevent DoS attacks by
82 # repeatedly expanding and contracting a list around a power of 2, causing
83 # repeated O(n) resizes), instead we handle the size reduction in the root method
84 self[self.length-1] = b'\x00' * self.item_length
85 self.length -= 1
86
87 def __len__(self):
88 return self.length

Callers 15

__init__Method · 0.80
prove_from_witnessFunction · 0.80
__init__Method · 0.80
p_mod_shiftFunction · 0.80
testFunction · 0.80
random_graphs.pyFile · 0.80
ghost.pyFile · 0.80
generate_peersMethod · 0.80
updateFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected