Skip to content

Commit

Permalink
disable vid reuse compaction (#2276)
Browse files Browse the repository at this point in the history
The current implementation cannot be used practically since it causes
several full reallocations of the whole free list per deletion - it
needs to be reimplemented, or the chain cannot practically progress
beyond ~2.5M blocks where a lot of removals happen.

Co-authored-by: tersec <[email protected]>
  • Loading branch information
arnetheduck and tersec committed Jun 1, 2024
1 parent 9f87940 commit ef864ba
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions nimbus/db/aristo/aristo_delete.nim
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,13 @@ proc delSubTreeImpl(
db.layersPutVtx(VertexID(1), wp.vid, leaf)
db.layersResKey(VertexID(1), wp.vid)

# Squeze list of recycled vertex IDs
db.top.final.vGen = db.vGen.vidReorg()
# Squeeze list of recycled vertex IDs
# TODO this causes a reallocation of vGen which slows down subsequent
# additions to the list because the sequence must grow which entails a
# full copy in addition to this reorg itself - around block 2.5M this
# causes significant slowdown as the vid list is >1M entries long
# See also EIP-161 which is why there are so many deletions
# db.top.final.vGen = db.vGen.vidReorg()
ok()


Expand Down Expand Up @@ -393,8 +398,13 @@ proc deleteImpl(
db.layersPutVtx(VertexID(1), wp.vid, leaf)
db.layersResKey(VertexID(1), wp.vid)

# Squeze list of recycled vertex IDs
db.top.final.vGen = db.vGen.vidReorg()
# Squeeze list of recycled vertex IDs
# TODO this causes a reallocation of vGen which slows down subsequent
# additions to the list because the sequence must grow which entails a
# full copy in addition to this reorg itself - around block 2.5M this
# causes significant slowdown as the vid list is >1M entries long
# See also EIP-161 which is why there are so many deletions```
# db.top.final.vGen = db.vGen.vidReorg()
ok(emptySubTreeOk)

# ------------------------------------------------------------------------------
Expand Down

0 comments on commit ef864ba

Please sign in to comment.