From 7fda2312aa39185923939e41635f816e926de496 Mon Sep 17 00:00:00 2001 From: Cody Littley Date: Fri, 1 May 2026 09:18:47 -0500 Subject: [PATCH 1/3] add pebbledb keymap, remove leveldb keymap --- sei-db/db_engine/litt/README.md | 4 +- sei-db/db_engine/litt/cli/table_info_test.go | 2 +- .../litt/disktable/disk_table_test.go | 20 +- .../litt/disktable/keymap/keymap_test.go | 10 +- .../litt/disktable/keymap/keymap_type.go | 8 +- .../litt/disktable/keymap/keymap_type_file.go | 8 +- .../litt/disktable/keymap/level_db_keymap.go | 179 ---------------- .../litt/disktable/keymap/pebble_db_keymap.go | 201 ++++++++++++++++++ sei-db/db_engine/litt/docs/architecture.md | 2 +- .../docs/benchmark-data/8-27-2025/README.md | 2 +- .../db_engine/litt/docs/filesystem_layout.md | 4 +- sei-db/db_engine/litt/docs/littdb_cli.md | 2 +- sei-db/db_engine/litt/go.mod | 25 ++- sei-db/db_engine/litt/go.sum | 101 ++++----- .../db_engine/litt/littbuilder/build_utils.go | 6 +- sei-db/db_engine/litt/littdb_config.go | 6 +- sei-db/db_engine/litt/test/db_test.go | 22 +- .../litt/test/keymap_migration_test.go | 22 +- sei-db/db_engine/litt/test/table_test.go | 20 +- .../testdata/v0/test/keymap/data/000001.log | Bin 2648 -> 0 bytes .../test/testdata/v0/test/keymap/data/CURRENT | 1 - .../test/testdata/v0/test/keymap/data/LOG | 8 - .../v0/test/keymap/data/MANIFEST-000000 | Bin 54 -> 0 bytes .../testdata/v0/test/keymap/keymap-type.txt | 1 - .../test/testdata/v0/test/segments/0-0.values | Bin 98 -> 0 bytes .../test/testdata/v0/test/segments/0-1.values | Bin 55 -> 0 bytes .../test/testdata/v0/test/segments/0-2.values | Bin 80 -> 0 bytes .../test/testdata/v0/test/segments/0-3.values | Bin 116 -> 0 bytes .../test/testdata/v0/test/segments/0.keys | Bin 479 -> 0 bytes .../test/testdata/v0/test/segments/0.metadata | Bin 21 -> 0 bytes .../test/testdata/v0/test/segments/1-0.values | Bin 82 -> 0 bytes .../test/testdata/v0/test/segments/1-1.values | Bin 36 -> 0 bytes .../test/testdata/v0/test/segments/1-2.values | Bin 51 -> 0 bytes .../test/testdata/v0/test/segments/1-3.values | Bin 114 -> 0 bytes .../test/testdata/v0/test/segments/1.keys | Bin 401 -> 0 bytes .../test/testdata/v0/test/segments/1.metadata | Bin 21 -> 0 bytes .../test/testdata/v0/test/segments/2-0.values | Bin 96 -> 0 bytes .../test/testdata/v0/test/segments/2-1.values | Bin 93 -> 0 bytes .../test/testdata/v0/test/segments/2-2.values | Bin 20 -> 0 bytes .../test/testdata/v0/test/segments/2-3.values | Bin 108 -> 0 bytes .../test/testdata/v0/test/segments/2.keys | Bin 455 -> 0 bytes .../test/testdata/v0/test/segments/2.metadata | Bin 21 -> 0 bytes .../test/testdata/v0/test/segments/3-0.values | Bin 115 -> 0 bytes .../test/testdata/v0/test/segments/3-1.values | Bin 15 -> 0 bytes .../test/testdata/v0/test/segments/3-2.values | Bin 67 -> 0 bytes .../test/testdata/v0/test/segments/3-3.values | Bin 45 -> 0 bytes .../test/testdata/v0/test/segments/3.keys | Bin 344 -> 0 bytes .../test/testdata/v0/test/segments/3.metadata | Bin 21 -> 0 bytes .../test/testdata/v0/test/segments/4-0.values | Bin 85 -> 0 bytes .../test/testdata/v0/test/segments/4-1.values | Bin 55 -> 0 bytes .../test/testdata/v0/test/segments/4-2.values | Bin 109 -> 0 bytes .../test/testdata/v0/test/segments/4-3.values | Bin 30 -> 0 bytes .../test/testdata/v0/test/segments/4.keys | Bin 425 -> 0 bytes .../test/testdata/v0/test/segments/4.metadata | Bin 21 -> 0 bytes .../test/testdata/v0/test/segments/5-0.values | Bin 103 -> 0 bytes .../test/testdata/v0/test/segments/5-1.values | Bin 53 -> 0 bytes .../test/testdata/v0/test/segments/5-2.values | Bin 33 -> 0 bytes .../test/testdata/v0/test/segments/5-3.values | 0 .../test/testdata/v0/test/segments/5.keys | Bin 255 -> 0 bytes .../test/testdata/v0/test/segments/5.metadata | Bin 21 -> 0 bytes .../test/testdata/v0/test/segments/6-0.values | Bin 17 -> 0 bytes .../test/testdata/v0/test/segments/6-1.values | Bin 52 -> 0 bytes .../test/testdata/v0/test/segments/6-2.values | Bin 22 -> 0 bytes .../test/testdata/v0/test/segments/6-3.values | Bin 85 -> 0 bytes .../test/testdata/v0/test/segments/6.keys | Bin 256 -> 0 bytes .../test/testdata/v0/test/segments/6.metadata | Bin 21 -> 0 bytes .../litt/test/testdata/v0/test/table.metadata | Bin 16 -> 0 bytes .../testdata/v1/test/keymap/data/000001.log | Bin 2648 -> 0 bytes .../test/testdata/v1/test/keymap/data/CURRENT | 1 - .../test/testdata/v1/test/keymap/data/LOCK | 0 .../test/testdata/v1/test/keymap/data/LOG | 8 - .../v1/test/keymap/data/MANIFEST-000000 | Bin 54 -> 0 bytes .../test/testdata/v1/test/keymap/initialized | 0 .../testdata/v1/test/keymap/keymap-type.txt | 1 - .../test/testdata/v1/test/segments/0-0.values | Bin 112 -> 0 bytes .../test/testdata/v1/test/segments/0-1.values | Bin 85 -> 0 bytes .../test/testdata/v1/test/segments/0-2.values | Bin 79 -> 0 bytes .../test/testdata/v1/test/segments/0-3.values | Bin 40 -> 0 bytes .../test/testdata/v1/test/segments/0.keys | Bin 459 -> 0 bytes .../test/testdata/v1/test/segments/0.metadata | Bin 33 -> 0 bytes .../test/testdata/v1/test/segments/1-0.values | Bin 50 -> 0 bytes .../test/testdata/v1/test/segments/1-1.values | Bin 60 -> 0 bytes .../test/testdata/v1/test/segments/1-2.values | Bin 109 -> 0 bytes .../test/testdata/v1/test/segments/1-3.values | Bin 56 -> 0 bytes .../test/testdata/v1/test/segments/1.keys | Bin 403 -> 0 bytes .../test/testdata/v1/test/segments/1.metadata | Bin 33 -> 0 bytes .../test/testdata/v1/test/segments/2-0.values | Bin 110 -> 0 bytes .../test/testdata/v1/test/segments/2-1.values | Bin 48 -> 0 bytes .../test/testdata/v1/test/segments/2-2.values | Bin 89 -> 0 bytes .../test/testdata/v1/test/segments/2-3.values | Bin 51 -> 0 bytes .../test/testdata/v1/test/segments/2.keys | Bin 447 -> 0 bytes .../test/testdata/v1/test/segments/2.metadata | Bin 33 -> 0 bytes .../test/testdata/v1/test/segments/3-0.values | 0 .../test/testdata/v1/test/segments/3-1.values | Bin 35 -> 0 bytes .../test/testdata/v1/test/segments/3-2.values | Bin 52 -> 0 bytes .../test/testdata/v1/test/segments/3-3.values | Bin 103 -> 0 bytes .../test/testdata/v1/test/segments/3.keys | Bin 294 -> 0 bytes .../test/testdata/v1/test/segments/3.metadata | Bin 33 -> 0 bytes .../test/testdata/v1/test/segments/4-0.values | Bin 114 -> 0 bytes .../test/testdata/v1/test/segments/4-1.values | Bin 78 -> 0 bytes .../test/testdata/v1/test/segments/4-2.values | Bin 48 -> 0 bytes .../test/testdata/v1/test/segments/4-3.values | Bin 35 -> 0 bytes .../test/testdata/v1/test/segments/4.keys | Bin 384 -> 0 bytes .../test/testdata/v1/test/segments/4.metadata | Bin 33 -> 0 bytes .../test/testdata/v1/test/segments/5-0.values | Bin 55 -> 0 bytes .../test/testdata/v1/test/segments/5-1.values | Bin 70 -> 0 bytes .../test/testdata/v1/test/segments/5-2.values | Bin 121 -> 0 bytes .../test/testdata/v1/test/segments/5-3.values | Bin 34 -> 0 bytes .../test/testdata/v1/test/segments/5.keys | Bin 376 -> 0 bytes .../test/testdata/v1/test/segments/5.metadata | Bin 33 -> 0 bytes .../test/testdata/v1/test/segments/6-0.values | Bin 81 -> 0 bytes .../test/testdata/v1/test/segments/6-1.values | Bin 40 -> 0 bytes .../test/testdata/v1/test/segments/6-2.values | Bin 57 -> 0 bytes .../test/testdata/v1/test/segments/6-3.values | Bin 23 -> 0 bytes .../test/testdata/v1/test/segments/6.keys | Bin 252 -> 0 bytes .../test/testdata/v1/test/segments/6.metadata | Bin 33 -> 0 bytes .../litt/test/testdata/v1/test/table.metadata | Bin 16 -> 0 bytes .../testdata/v2/test/keymap/data/000001.log | Bin 2667 -> 0 bytes .../testdata/v2/test/keymap/data/000002.log | Bin 0 -> 2687 bytes .../test/testdata/v2/test/keymap/data/CURRENT | 1 - .../test/testdata/v2/test/keymap/data/LOG | 8 - .../v2/test/keymap/data/MANIFEST-000000 | Bin 54 -> 0 bytes .../v2/test/keymap/data/MANIFEST-000001 | Bin 0 -> 39 bytes .../v2/test/keymap/data/OPTIONS-000003 | 118 ++++++++++ .../data/marker.format-version.000001.013} | 0 .../marker.manifest.000001.MANIFEST-000001} | 0 .../testdata/v2/test/keymap/keymap-type.txt | 2 +- .../test/testdata/v2/test/segments/0-0.values | Bin 18 -> 35 bytes .../test/testdata/v2/test/segments/0-1.values | Bin 55 -> 103 bytes .../test/testdata/v2/test/segments/0-2.values | Bin 106 -> 59 bytes .../test/testdata/v2/test/segments/0-3.values | Bin 22 -> 0 bytes .../test/testdata/v2/test/segments/0.keys | Bin 294 -> 290 bytes .../test/testdata/v2/test/segments/0.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/1-0.values | Bin 17 -> 41 bytes .../test/testdata/v2/test/segments/1-1.values | Bin 36 -> 107 bytes .../test/testdata/v2/test/segments/1-2.values | Bin 110 -> 70 bytes .../test/testdata/v2/test/segments/1-3.values | Bin 76 -> 0 bytes .../test/testdata/v2/test/segments/1.keys | Bin 391 -> 366 bytes .../test/testdata/v2/test/segments/1.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/2-0.values | Bin 34 -> 82 bytes .../test/testdata/v2/test/segments/2-1.values | Bin 60 -> 102 bytes .../test/testdata/v2/test/segments/2-2.values | Bin 87 -> 17 bytes .../test/testdata/v2/test/segments/2-3.values | Bin 105 -> 0 bytes .../test/testdata/v2/test/segments/2.keys | Bin 514 -> 338 bytes .../test/testdata/v2/test/segments/2.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/3-0.values | Bin 101 -> 115 bytes .../test/testdata/v2/test/segments/3-1.values | Bin 77 -> 67 bytes .../test/testdata/v2/test/segments/3-2.values | Bin 76 -> 45 bytes .../test/testdata/v2/test/segments/3-3.values | Bin 83 -> 88 bytes .../test/testdata/v2/test/segments/3.keys | Bin 577 -> 532 bytes .../test/testdata/v2/test/segments/3.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/4-0.values | Bin 103 -> 75 bytes .../test/testdata/v2/test/segments/4-1.values | Bin 53 -> 77 bytes .../test/testdata/v2/test/segments/4-2.values | Bin 19 -> 59 bytes .../test/testdata/v2/test/segments/4-3.values | Bin 22 -> 101 bytes .../test/testdata/v2/test/segments/4.keys | Bin 331 -> 482 bytes .../test/testdata/v2/test/segments/4.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/5-0.values | Bin 112 -> 69 bytes .../test/testdata/v2/test/segments/5-1.values | Bin 35 -> 101 bytes .../test/testdata/v2/test/segments/5-2.values | Bin 20 -> 52 bytes .../test/testdata/v2/test/segments/5-3.values | Bin 36 -> 94 bytes .../test/testdata/v2/test/segments/5.keys | Bin 338 -> 527 bytes .../test/testdata/v2/test/segments/5.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/6-0.values | Bin 104 -> 17 bytes .../test/testdata/v2/test/segments/6-1.values | Bin 77 -> 56 bytes .../test/testdata/v2/test/segments/6-2.values | Bin 19 -> 110 bytes .../test/testdata/v2/test/segments/6-3.values | Bin 54 -> 93 bytes .../test/testdata/v2/test/segments/6.keys | Bin 392 -> 480 bytes .../test/testdata/v2/test/segments/6.metadata | Bin 37 -> 37 bytes .../test/testdata/v2/test/segments/7-0.values | Bin 58 -> 0 bytes .../test/testdata/v2/test/segments/7-1.values | Bin 22 -> 0 bytes .../test/testdata/v2/test/segments/7-3.values | Bin 38 -> 0 bytes .../test/testdata/v2/test/segments/7.keys | Bin 178 -> 0 bytes .../test/testdata/v2/test/segments/7.metadata | Bin 37 -> 37 bytes 174 files changed, 455 insertions(+), 338 deletions(-) delete mode 100644 sei-db/db_engine/litt/disktable/keymap/level_db_keymap.go create mode 100644 sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/000001.log delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/CURRENT delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/LOG delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/MANIFEST-000000 delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/keymap/keymap-type.txt delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/0-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/0-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/0-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/0-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/0.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/0.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/1-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/1-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/1-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/1-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/1.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/1.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/2-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/2-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/2-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/2-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/2.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/2.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/3-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/3-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/3-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/3-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/3.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/3.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/4-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/4-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/4-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/4-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/4.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/4.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/5-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/5-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/5-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/5-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/5.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/5.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/6-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/6-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/6-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/6-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/6.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/segments/6.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v0/test/table.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/data/000001.log delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/data/CURRENT delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/data/LOCK delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/data/LOG delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/data/MANIFEST-000000 delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/initialized delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/keymap/keymap-type.txt delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/0-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/0-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/0-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/0-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/0.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/0.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/1-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/1-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/1-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/1-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/1.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/1.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/2-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/2-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/2-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/2-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/2.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/2.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/3-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/3-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/3-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/3-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/3.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/3.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/4-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/4-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/4-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/4-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/4.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/4.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/5-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/5-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/5-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/5-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/5.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/5.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/6-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/6-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/6-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/6-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/6.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/segments/6.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v1/test/table.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/000001.log create mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/000002.log delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/CURRENT delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/LOG delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/MANIFEST-000000 create mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/MANIFEST-000001 create mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/OPTIONS-000003 rename sei-db/db_engine/litt/test/testdata/{v0/test/keymap/data/LOCK => v2/test/keymap/data/marker.format-version.000001.013} (100%) rename sei-db/db_engine/litt/test/testdata/{v0/test/keymap/initialized => v2/test/keymap/data/marker.manifest.000001.MANIFEST-000001} (100%) diff --git a/sei-db/db_engine/litt/README.md b/sei-db/db_engine/litt/README.md index 5566694448..4a3740330a 100644 --- a/sei-db/db_engine/litt/README.md +++ b/sei-db/db_engine/litt/README.md @@ -336,9 +336,9 @@ At a conceptual level, a keymap is a mapping from [keys](#key) to [addresses](#a [value](#value) in the database one needs to know two things: the [key](#key) and the [address](#address). The keymap is therefore necessary to lookup data given a specific [key](#key). -There are currently two implementations of the keymap in LittDB: an in-memory keymap and a keymap that uses levelDB. +There are currently two implementations of the keymap in LittDB: an in-memory keymap and a keymap that uses PebbleDB. There are tradeoffs to each implementation. The in-memory keymap is faster, but has higher memory usage and longer -startup times (it has to be rebuilt at boot time). The levelDB keymap is slower, but has a lower memory footprint and +startup times (it has to be rebuilt at boot time). The PebbleDB keymap is slower, but has a lower memory footprint and faster startup times. From a thread safety point of view, if a mapping is present in the keymap, the [value](#value) associated with the diff --git a/sei-db/db_engine/litt/cli/table_info_test.go b/sei-db/db_engine/litt/cli/table_info_test.go index cd1f35b1f8..f063aeba02 100644 --- a/sei-db/db_engine/litt/cli/table_info_test.go +++ b/sei-db/db_engine/litt/cli/table_info_test.go @@ -120,7 +120,7 @@ func TestTableInfo(t *testing.T) { require.False(t, info.IsSnapshot) require.Greater(t, info.Size, uint64(0)) require.Equal(t, info.KeyCount, uint64(100)) - require.Equal(t, "LevelDBKeymap", info.KeymapType) + require.Equal(t, "PebbleDBKeymap", info.KeymapType) } // A non-existent table should return an error for the core directories as well. diff --git a/sei-db/db_engine/litt/disktable/disk_table_test.go b/sei-db/db_engine/litt/disktable/disk_table_test.go index c8beae9570..749bcfa6f4 100644 --- a/sei-db/db_engine/litt/disktable/disk_table_test.go +++ b/sei-db/db_engine/litt/disktable/disk_table_test.go @@ -41,12 +41,12 @@ var tableBuilders = []*tableBuilder{ builder: buildMemKeyDiskTableMultiShard, }, { - name: "LevelDBKeyDiskTableSingleShard", - builder: buildLevelDBKeyDiskTableSingleShard, + name: "PebbleDBKeyDiskTableSingleShard", + builder: buildPebbleDBKeyDiskTableSingleShard, }, { - name: "LevelDBKeyDiskTableMultiShard", - builder: buildLevelDBKeyDiskTableMultiShard, + name: "PebbleDBKeyDiskTableMultiShard", + builder: buildPebbleDBKeyDiskTableMultiShard, }, } @@ -174,19 +174,19 @@ func buildMemKeyDiskTableMultiShard( return table, nil } -func buildLevelDBKeyDiskTableSingleShard( +func buildPebbleDBKeyDiskTableSingleShard( clock func() time.Time, name string, paths []string) (litt.ManagedTable, error) { logger := slog.Default() keymapPath := filepath.Join(paths[0], keymap.KeymapDirectoryName) - keymapTypeFile, err := setupKeymapTypeFile(keymapPath, keymap.UnsafeLevelDBKeymapType) + keymapTypeFile, err := setupKeymapTypeFile(keymapPath, keymap.UnsafePebbleDBKeymapType) if err != nil { return nil, fmt.Errorf("failed to load keymap type file: %w", err) } - keys, _, err := keymap.NewUnsafeLevelDBKeymap(logger, keymapPath, false) + keys, _, err := keymap.NewUnsafePebbleDBKeymap(logger, keymapPath, false) if err != nil { return nil, fmt.Errorf("failed to create keymap: %w", err) } @@ -220,19 +220,19 @@ func buildLevelDBKeyDiskTableSingleShard( return table, nil } -func buildLevelDBKeyDiskTableMultiShard( +func buildPebbleDBKeyDiskTableMultiShard( clock func() time.Time, name string, paths []string) (litt.ManagedTable, error) { logger := slog.Default() keymapPath := filepath.Join(paths[0], name, keymap.KeymapDirectoryName) - keymapTypeFile, err := setupKeymapTypeFile(keymapPath, keymap.UnsafeLevelDBKeymapType) + keymapTypeFile, err := setupKeymapTypeFile(keymapPath, keymap.UnsafePebbleDBKeymapType) if err != nil { return nil, fmt.Errorf("failed to load keymap type file: %w", err) } - keys, _, err := keymap.NewUnsafeLevelDBKeymap(logger, keymapPath, true) + keys, _, err := keymap.NewUnsafePebbleDBKeymap(logger, keymapPath, true) if err != nil { return nil, fmt.Errorf("failed to create keymap: %w", err) } diff --git a/sei-db/db_engine/litt/disktable/keymap/keymap_test.go b/sei-db/db_engine/litt/disktable/keymap/keymap_test.go index 19dad5e95f..a81ecdbc73 100644 --- a/sei-db/db_engine/litt/disktable/keymap/keymap_test.go +++ b/sei-db/db_engine/litt/disktable/keymap/keymap_test.go @@ -15,7 +15,7 @@ import ( var builders = []keymapBuilder{ buildMemKeymap, - buildLevelDBKeymap, + buildPebbleDBKeymap, } type keymapBuilder func(logger *slog.Logger, path string) (Keymap, error) @@ -29,8 +29,8 @@ func buildMemKeymap(logger *slog.Logger, path string) (Keymap, error) { return kmap, nil } -func buildLevelDBKeymap(logger *slog.Logger, path string) (Keymap, error) { - kmap, _, err := NewUnsafeLevelDBKeymap(logger, path, true) +func buildPebbleDBKeymap(logger *slog.Logger, path string) (Keymap, error) { + kmap, _, err := NewUnsafePebbleDBKeymap(logger, path, true) if err != nil { return nil, err } @@ -139,7 +139,7 @@ func TestRestart(t *testing.T) { testDir := t.TempDir() dbDir := path.Join(testDir, "keymap") - keymap, _, err := NewUnsafeLevelDBKeymap(logger, dbDir, true) + keymap, _, err := NewUnsafePebbleDBKeymap(logger, dbDir, true) require.NoError(t, err) expected := make(map[string]types.Address) @@ -209,7 +209,7 @@ func TestRestart(t *testing.T) { err = keymap.Stop() require.NoError(t, err) - keymap, _, err = NewUnsafeLevelDBKeymap(logger, dbDir, true) + keymap, _, err = NewUnsafePebbleDBKeymap(logger, dbDir, true) require.NoError(t, err) // Expected data should be present diff --git a/sei-db/db_engine/litt/disktable/keymap/keymap_type.go b/sei-db/db_engine/litt/disktable/keymap/keymap_type.go index c30e6b8bca..dc7be33615 100644 --- a/sei-db/db_engine/litt/disktable/keymap/keymap_type.go +++ b/sei-db/db_engine/litt/disktable/keymap/keymap_type.go @@ -5,12 +5,12 @@ package keymap // KeymapType represents the type of a keymap. type KeymapType string -// LevelDBKeymapType is the type of a LevelDBKeymap. -const LevelDBKeymapType = "LevelDBKeymap" +// PebbleDBKeymapType is the type of a PebbleDBKeymap. +const PebbleDBKeymapType = "PebbleDBKeymap" -// UnsafeLevelDBKeymapType is similar to LevelDBKeymapType, but it is not safe to use in production. +// UnsafePebbleDBKeymapType is similar to PebbleDBKeymapType, but it is not safe to use in production. // It runs a lot faster, but with weaker crash recovery guarantees. -const UnsafeLevelDBKeymapType = "UnsafeLevelDBKeymap" +const UnsafePebbleDBKeymapType = "UnsafePebbleDBKeymap" // MemKeymapType is the type of a MemKeymap. const MemKeymapType = "MemKeymap" diff --git a/sei-db/db_engine/litt/disktable/keymap/keymap_type_file.go b/sei-db/db_engine/litt/disktable/keymap/keymap_type_file.go index 9fdbe859cb..353a3766ae 100644 --- a/sei-db/db_engine/litt/disktable/keymap/keymap_type_file.go +++ b/sei-db/db_engine/litt/disktable/keymap/keymap_type_file.go @@ -53,10 +53,10 @@ func LoadKeymapTypeFile(keymapPath string) (*KeymapTypeFile, error) { switch string(fileContents) { case MemKeymapType: keymapType = MemKeymapType - case LevelDBKeymapType: - keymapType = LevelDBKeymapType - case UnsafeLevelDBKeymapType: - keymapType = UnsafeLevelDBKeymapType + case PebbleDBKeymapType: + keymapType = PebbleDBKeymapType + case UnsafePebbleDBKeymapType: + keymapType = UnsafePebbleDBKeymapType default: return nil, fmt.Errorf("unknown keymap type: %s", string(fileContents)) } diff --git a/sei-db/db_engine/litt/disktable/keymap/level_db_keymap.go b/sei-db/db_engine/litt/disktable/keymap/level_db_keymap.go deleted file mode 100644 index 5c83186621..0000000000 --- a/sei-db/db_engine/litt/disktable/keymap/level_db_keymap.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build littdb_wip - -package keymap - -import ( - "errors" - "fmt" - "log/slog" - "os" - "sync/atomic" - - "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/types" - "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/util" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/opt" -) - -var _ Keymap = &LevelDBKeymap{} - -// LevelDBKeymap is a keymap that uses LevelDB as the underlying storage. Methods on this struct are goroutine safe. -type LevelDBKeymap struct { - logger *slog.Logger - db *leveldb.DB - // if true, then return an error if an update would overwrite an existing key - doubleWriteProtection bool - keymapPath string - alive atomic.Bool - // This is a "test mode only" flag. Should be true in production use cases or anywhere that data consistency - // is critical. Unit tests write lots of little values, and syncing each one is slow, so it may be desirable - // to set this to false in some tests. - syncWrites bool -} - -var _ BuildKeymap = NewLevelDBKeymap - -// NewLevelDBKeymap creates a new LevelDBKeymap instance. -func NewLevelDBKeymap( - logger *slog.Logger, - keymapPath string, - doubleWriteProtection bool) (kmap Keymap, requiresReload bool, err error) { - - return newLevelDBKeymap(logger, keymapPath, doubleWriteProtection, true) -} - -// NewUnsafeLevelDBKeymap creates a new LevelDBKeymap instance. It does not use sync writes. This makes it faster, -// but unsafe if data consistency is critical (i.e. production use cases). -func NewUnsafeLevelDBKeymap( - logger *slog.Logger, - keymapPath string, - doubleWriteProtection bool) (kmap Keymap, requiresReload bool, err error) { - - return newLevelDBKeymap(logger, keymapPath, doubleWriteProtection, false) -} - -// newLevelDBKeymap creates a new LevelDBKeymap instance. -func newLevelDBKeymap( - logger *slog.Logger, - keymapPath string, - doubleWriteProtection bool, - syncWrites bool) (kmap *LevelDBKeymap, requiresReload bool, err error) { - - exists, err := util.Exists(keymapPath) - if err != nil { - return nil, false, fmt.Errorf("error checking for keymap directory: %w", err) - } - - if !exists { - err = os.MkdirAll(keymapPath, 0755) - if err != nil { - return nil, false, fmt.Errorf("error creating keymap directory: %w", err) - } - } - requiresReload = !exists - - db, err := leveldb.OpenFile(keymapPath, nil) - if err != nil { - return nil, false, fmt.Errorf("failed to open LevelDB: %w", err) - } - - kmap = &LevelDBKeymap{ - logger: logger, - db: db, - keymapPath: keymapPath, - doubleWriteProtection: doubleWriteProtection, - syncWrites: syncWrites, - } - kmap.alive.Store(true) - - return kmap, requiresReload, nil -} - -func (l *LevelDBKeymap) Put(keys []*types.ScopedKey) error { - - if l.doubleWriteProtection { - for _, k := range keys { - _, ok, err := l.Get(k.Key) - if err != nil { - return fmt.Errorf("failed to get key: %w", err) - } - if ok { - return fmt.Errorf("key %s already exists", k.Key) - } - } - } - - batch := new(leveldb.Batch) - for _, k := range keys { - batch.Put(k.Key, k.Address.Serialize()) - } - - writeOptions := &opt.WriteOptions{ - Sync: l.syncWrites, - } - - err := l.db.Write(batch, writeOptions) - if err != nil { - return fmt.Errorf("failed to put batch to LevelDB: %w", err) - } - return nil -} - -func (l *LevelDBKeymap) Get(key []byte) (types.Address, bool, error) { - addressBytes, err := l.db.Get(key, nil) - if err != nil { - if errors.Is(err, leveldb.ErrNotFound) { - return 0, false, nil - } - return 0, false, fmt.Errorf("failed to get key from LevelDB: %w", err) - } - - address, err := types.DeserializeAddress(addressBytes) - if err != nil { - return 0, false, fmt.Errorf("failed to deserialize address: %w", err) - } - - return address, true, nil -} - -func (l *LevelDBKeymap) Delete(keys []*types.ScopedKey) error { - batch := new(leveldb.Batch) - for _, key := range keys { - batch.Delete(key.Key) - } - - err := l.db.Write(batch, nil) - if err != nil { - return fmt.Errorf("failed to delete keys from LevelDB: %w", err) - } - - return nil -} - -func (l *LevelDBKeymap) Stop() error { - alive := l.alive.Swap(false) - if !alive { - return nil - } - - err := l.db.Close() - if err != nil { - return fmt.Errorf("failed to close LevelDB: %w", err) - } - return nil -} - -func (l *LevelDBKeymap) Destroy() error { - err := l.Stop() - if err != nil { - return fmt.Errorf("failed to stop LevelDB: %w", err) - } - - l.logger.Info("deleting LevelDB keymap", "keymap", l.keymapPath) - err = os.RemoveAll(l.keymapPath) - if err != nil { - return fmt.Errorf("failed to remove LevelDB data directory: %w", err) - } - - return nil -} diff --git a/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go b/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go new file mode 100644 index 0000000000..222f67848c --- /dev/null +++ b/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go @@ -0,0 +1,201 @@ +//go:build littdb_wip + +package keymap + +import ( + "bytes" + "errors" + "fmt" + "log/slog" + "os" + "sync/atomic" + + "github.com/cockroachdb/pebble/v2" + "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/types" + "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/util" +) + +var _ Keymap = &PebbleDBKeymap{} + +// PebbleDBKeymap is a keymap that uses PebbleDB as the underlying storage. Methods on this struct are goroutine safe. +type PebbleDBKeymap struct { + logger *slog.Logger + db *pebble.DB + // if true, then return an error if an update would overwrite an existing key + doubleWriteProtection bool + keymapPath string + alive atomic.Bool + // This is a "test mode only" flag. Should be true in production use cases or anywhere that data consistency + // is critical. Unit tests write lots of little values, and syncing each one is slow, so it may be desirable + // to set this to false in some tests. + syncWrites bool +} + +var _ BuildKeymap = NewPebbleDBKeymap + +// NewPebbleDBKeymap creates a new PebbleDBKeymap instance. +func NewPebbleDBKeymap( + logger *slog.Logger, + keymapPath string, + doubleWriteProtection bool) (kmap Keymap, requiresReload bool, err error) { + + return newPebbleDBKeymap(logger, keymapPath, doubleWriteProtection, true) +} + +// NewUnsafePebbleDBKeymap creates a new PebbleDBKeymap instance. It does not use sync writes. This makes it faster, +// but unsafe if data consistency is critical (i.e. production use cases). +func NewUnsafePebbleDBKeymap( + logger *slog.Logger, + keymapPath string, + doubleWriteProtection bool) (kmap Keymap, requiresReload bool, err error) { + + return newPebbleDBKeymap(logger, keymapPath, doubleWriteProtection, false) +} + +// newPebbleDBKeymap creates a new PebbleDBKeymap instance. +func newPebbleDBKeymap( + logger *slog.Logger, + keymapPath string, + doubleWriteProtection bool, + syncWrites bool) (kmap *PebbleDBKeymap, requiresReload bool, err error) { + + exists, err := util.Exists(keymapPath) + if err != nil { + return nil, false, fmt.Errorf("error checking for keymap directory: %w", err) + } + + if !exists { + err = os.MkdirAll(keymapPath, 0755) + if err != nil { + return nil, false, fmt.Errorf("error creating keymap directory: %w", err) + } + } + requiresReload = !exists + + db, err := pebble.Open(keymapPath, &pebble.Options{}) + if err != nil { + return nil, false, fmt.Errorf("failed to open PebbleDB: %w", err) + } + + kmap = &PebbleDBKeymap{ + logger: logger, + db: db, + keymapPath: keymapPath, + doubleWriteProtection: doubleWriteProtection, + syncWrites: syncWrites, + } + kmap.alive.Store(true) + + return kmap, requiresReload, nil +} + +func (p *PebbleDBKeymap) writeOptions() *pebble.WriteOptions { + if p.syncWrites { + return pebble.Sync + } + return pebble.NoSync +} + +func (p *PebbleDBKeymap) Put(keys []*types.ScopedKey) error { + + if p.doubleWriteProtection { + for _, k := range keys { + _, ok, err := p.Get(k.Key) + if err != nil { + return fmt.Errorf("failed to get key: %w", err) + } + if ok { + return fmt.Errorf("key %s already exists", k.Key) + } + } + } + + batch := p.db.NewBatch() + for _, k := range keys { + if err := batch.Set(k.Key, k.Address.Serialize(), nil); err != nil { + _ = batch.Close() + return fmt.Errorf("failed to add put to batch: %w", err) + } + } + + err := p.db.Apply(batch, p.writeOptions()) + if err != nil { + _ = batch.Close() + return fmt.Errorf("failed to put batch to PebbleDB: %w", err) + } + if err := batch.Close(); err != nil { + return fmt.Errorf("failed to close PebbleDB batch: %w", err) + } + return nil +} + +func (p *PebbleDBKeymap) Get(key []byte) (types.Address, bool, error) { + val, closer, err := p.db.Get(key) + if err != nil { + if errors.Is(err, pebble.ErrNotFound) { + return 0, false, nil + } + return 0, false, fmt.Errorf("failed to get key from PebbleDB: %w", err) + } + // Clone the bytes before closing, since the slice is only valid until closer.Close(). + cloned := bytes.Clone(val) + if cerr := closer.Close(); cerr != nil { + return 0, false, fmt.Errorf("failed to close PebbleDB get closer: %w", cerr) + } + + address, err := types.DeserializeAddress(cloned) + if err != nil { + return 0, false, fmt.Errorf("failed to deserialize address: %w", err) + } + + return address, true, nil +} + +func (p *PebbleDBKeymap) Delete(keys []*types.ScopedKey) error { + batch := p.db.NewBatch() + for _, key := range keys { + if err := batch.Delete(key.Key, nil); err != nil { + _ = batch.Close() + return fmt.Errorf("failed to add delete to batch: %w", err) + } + } + + err := p.db.Apply(batch, p.writeOptions()) + if err != nil { + _ = batch.Close() + return fmt.Errorf("failed to delete keys from PebbleDB: %w", err) + } + if err := batch.Close(); err != nil { + return fmt.Errorf("failed to close PebbleDB batch: %w", err) + } + + return nil +} + +func (p *PebbleDBKeymap) Stop() error { + alive := p.alive.Swap(false) + if !alive { + return nil + } + + err := p.db.Close() + if err != nil { + return fmt.Errorf("failed to close PebbleDB: %w", err) + } + return nil +} + +func (p *PebbleDBKeymap) Destroy() error { + err := p.Stop() + if err != nil { + return fmt.Errorf("failed to stop PebbleDB: %w", err) + } + + p.logger.Info("deleting PebbleDB keymap", "keymap", p.keymapPath) + err = os.RemoveAll(p.keymapPath) + if err != nil { + return fmt.Errorf("failed to remove PebbleDB data directory: %w", err) + } + + return nil +} diff --git a/sei-db/db_engine/litt/docs/architecture.md b/sei-db/db_engine/litt/docs/architecture.md index 11cbb849c9..a769670e48 100644 --- a/sei-db/db_engine/litt/docs/architecture.md +++ b/sei-db/db_engine/litt/docs/architecture.md @@ -74,7 +74,7 @@ When deleting a value, remove the key from the keymap in addition to removing th At startup time, we will have to rebuild the keymap, since we are only storing it in memory. In order to do so, iterate over the file and reconstruct the keymap. If this is too slow, consider storing the keymap on disk (perhaps -using an off-the-shelf key-value store like levelDB). +using an off-the-shelf key-value store like PebbleDB). The database needs to do a little extra bookkeeping when it deletes data from the file. If it deletes X bytes from the beginning of the file, then the offsets recorded in the keymap are off by a factor of X. The key map doesn't diff --git a/sei-db/db_engine/litt/docs/benchmark-data/8-27-2025/README.md b/sei-db/db_engine/litt/docs/benchmark-data/8-27-2025/README.md index dee92d77cd..67a87624ea 100644 --- a/sei-db/db_engine/litt/docs/benchmark-data/8-27-2025/README.md +++ b/sei-db/db_engine/litt/docs/benchmark-data/8-27-2025/README.md @@ -65,7 +65,7 @@ I ran the test for 14 days. The first 7 days (i.e. 168 hours) were spent ramping The test completed successfully with no errors. All metrics reported healthy values. There were no signs of performance degradation or resource leaks over the course of the test. Although read latency and memory use did increase slightly over time, I suspect this can be explained by the growth in size of the keymap (i.e. an internal -LevelDB instance used for tracking metadata). Once the size of the data reached a steady state, this minor growth +embedded key-value store used for tracking metadata). Once the size of the data reached a steady state, this minor growth in read latency and memory appeared to flatten out and enter a steady state as well. ## Is the benchmark code available? diff --git a/sei-db/db_engine/litt/docs/filesystem_layout.md b/sei-db/db_engine/litt/docs/filesystem_layout.md index 7bb742dab0..fefb4821de 100644 --- a/sei-db/db_engine/litt/docs/filesystem_layout.md +++ b/sei-db/db_engine/litt/docs/filesystem_layout.md @@ -41,7 +41,7 @@ tables in a DB then there may be multiple keymap directories. - The file `keymap/keymap-type.txt` contains the name of the keymap implementation. - The file `keymap/initialized` is a marker file used to indicate if a keymap has been fully initialized or not (relevant if the process crashes during keymap initialization). -- If the keymap writes data to disk (e.g. levelDB, as pictured below), then the data will be stored in the +- If the keymap writes data to disk (e.g. PebbleDB, as pictured below), then the data will be stored in the `keymap/data` directory. Even if there are multiple root paths, each table only has a single keymap directory. The directory will be located @@ -155,7 +155,7 @@ A little data has been written to the DB. ### Keymap -The keymap is implemented using levelDB. +The keymap is implemented using PebbleDB. ### Snapshot diff --git a/sei-db/db_engine/litt/docs/littdb_cli.md b/sei-db/db_engine/litt/docs/littdb_cli.md index 6c22a0c027..ab5b37536f 100644 --- a/sei-db/db_engine/litt/docs/littdb_cli.md +++ b/sei-db/db_engine/litt/docs/littdb_cli.md @@ -147,7 +147,7 @@ Jun 18 11:32:11.236 INF cli/table_info.go:83 Newest segment seal time: 2025-0 Jun 18 11:32:11.236 INF cli/table_info.go:84 Segment span: 12.27 minutes Jun 18 11:32:11.236 INF cli/table_info.go:85 Lowest segment index: 0 Jun 18 11:32:11.236 INF cli/table_info.go:86 Highest segment index: 95 -Jun 18 11:32:11.236 INF cli/table_info.go:87 Key map type: LevelDBKeymap +Jun 18 11:32:11.236 INF cli/table_info.go:87 Key map type: PebbleDBKeymap ``` ## `litt rebase` diff --git a/sei-db/db_engine/litt/go.mod b/sei-db/db_engine/litt/go.mod index caaea918f3..5d17a909b7 100644 --- a/sei-db/db_engine/litt/go.mod +++ b/sei-db/db_engine/litt/go.mod @@ -32,22 +32,31 @@ module github.com/sei-protocol/sei-chain/sei-db/db_engine/litt go 1.25.6 require ( + github.com/cockroachdb/pebble/v2 v2.1.3 github.com/dchest/siphash v1.2.3 github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/prometheus/client_golang v1.23.2 github.com/stretchr/testify v1.11.1 - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/urfave/cli/v2 v2.27.7 golang.org/x/crypto v0.50.0 golang.org/x/time v0.15.0 ) require ( + github.com/DataDog/zstd v1.5.7 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/RaduBerinde/axisds v0.0.0-20250419182453-5135a0650657 // indirect + github.com/RaduBerinde/btreemap v0.0.0-20250419174037-3d62b7205d54 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/crlib v0.0.0-20241112164430-1264a2edc35b // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/containerd/errdefs v1.0.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect @@ -55,11 +64,15 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect + github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect + github.com/klauspost/compress v1.18.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect @@ -72,6 +85,7 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.66.1 // indirect github.com/prometheus/procfs v0.16.1 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect @@ -81,9 +95,12 @@ require ( go.opentelemetry.io/otel/metric v1.43.0 // indirect go.opentelemetry.io/otel/trace v1.43.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/sys v0.43.0 // indirect + golang.org/x/text v0.36.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect google.golang.org/protobuf v1.36.11 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.2 // indirect ) diff --git a/sei-db/db_engine/litt/go.sum b/sei-db/db_engine/litt/go.sum index 0ccabb6a65..a447a0b859 100644 --- a/sei-db/db_engine/litt/go.sum +++ b/sei-db/db_engine/litt/go.sum @@ -1,13 +1,39 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/DataDog/zstd v1.5.7 h1:ybO8RBeh29qrxIhCA9E8gKY6xfONU9T6G6aP9DTKfLE= +github.com/DataDog/zstd v1.5.7/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/RaduBerinde/axisds v0.0.0-20250419182453-5135a0650657 h1:8XBWWQD+vFF+JqOsm16t0Kab1a7YWV8+GISVEP8AuZ8= +github.com/RaduBerinde/axisds v0.0.0-20250419182453-5135a0650657/go.mod h1:UHGJonU9z4YYGKJxSaC6/TNcLOBptpmM5m2Cksbnw0Y= +github.com/RaduBerinde/btreemap v0.0.0-20250419174037-3d62b7205d54 h1:bsU8Tzxr/PNz75ayvCnxKZWEYdLMPDkUgticP4a4Bvk= +github.com/RaduBerinde/btreemap v0.0.0-20250419174037-3d62b7205d54/go.mod h1:0tr7FllbE9gJkHq7CVeeDDFAFKQVy5RnCSSNBOvdqbc= +github.com/aclements/go-perfevent v0.0.0-20240301234650-f7843625020f h1:JjxwchlOepwsUWcQwD2mLUAGE9aCp0/ehy6yCHFBOvo= +github.com/aclements/go-perfevent v0.0.0-20240301234650-f7843625020f/go.mod h1:tMDTce/yLLN/SK8gMOxQfnyeMeCg8KGzp0D1cbECEeo= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cockroachdb/crlib v0.0.0-20241112164430-1264a2edc35b h1:SHlYZ/bMx7frnmeqCu+xm0TCxXLzX3jQIVuFbnFGtFU= +github.com/cockroachdb/crlib v0.0.0-20241112164430-1264a2edc35b/go.mod h1:Gq51ZeKaFCXk6QwuGM0w1dnaOqc/F5zKT2zA9D6Xeac= +github.com/cockroachdb/datadriven v1.0.3-0.20250407164829-2945557346d5 h1:UycK/E0TkisVrQbSoxvU827FwgBBcZ95nRRmpj/12QI= +github.com/cockroachdb/datadriven v1.0.3-0.20250407164829-2945557346d5/go.mod h1:jsaKMvD3RBCATk1/jbUZM8C9idWBJME9+VRZ5+Liq1g= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= +github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= +github.com/cockroachdb/pebble/v2 v2.1.3 h1:irU503OnjRoJBrkZQIJvwv9c4WvpUeOJxhRApojB8D8= +github.com/cockroachdb/pebble/v2 v2.1.3/go.mod h1:B1UgWsyR+L+UvZXNgpxw+WqsUKA8VQ/bb//FXOHghB8= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b h1:VXvSNzmr8hMj8XTuY0PT9Ane9qZGul/p67vGYwl9BFI= +github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b/go.mod h1:yBRu/cnL4ks9bgy4vAASdjIW+/xMlFwuHKqtmh3GZQg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= @@ -16,6 +42,7 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= @@ -30,10 +57,12 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9 h1:r5GgOLGbza2wVHRzK7aAj6lWZjfbAwiu/RDCVOKjRyM= +github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -41,26 +70,14 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e h1:4bw4WeyTYPp0smaXiJZCNnLrvVBqirQVreixayXezGc= +github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= @@ -71,6 +88,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882 h1:0lgqHvJWHLGW5TuObJrfyEi6+ASTKDBWikGvPqy9Yiw= +github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= @@ -83,19 +102,13 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -108,6 +121,7 @@ github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9Z github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -116,8 +130,6 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU= github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= @@ -153,38 +165,29 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= @@ -197,7 +200,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:7QBABkRtR8z+TEnmXTqIqwJLlzrZKVfAUm7tY3yGv0M= @@ -205,24 +207,11 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= diff --git a/sei-db/db_engine/litt/littbuilder/build_utils.go b/sei-db/db_engine/litt/littbuilder/build_utils.go index d742fe2620..646e6580ec 100644 --- a/sei-db/db_engine/litt/littbuilder/build_utils.go +++ b/sei-db/db_engine/litt/littbuilder/build_utils.go @@ -23,9 +23,9 @@ import ( // keymapBuilders contains builders for all supported keymap types. var keymapBuilders = map[keymap.KeymapType]keymap.BuildKeymap{ - keymap.MemKeymapType: keymap.NewMemKeymap, - keymap.LevelDBKeymapType: keymap.NewLevelDBKeymap, - keymap.UnsafeLevelDBKeymapType: keymap.NewUnsafeLevelDBKeymap, + keymap.MemKeymapType: keymap.NewMemKeymap, + keymap.PebbleDBKeymapType: keymap.NewPebbleDBKeymap, + keymap.UnsafePebbleDBKeymapType: keymap.NewUnsafePebbleDBKeymap, } // cacheWeight is a function that calculates the weight of a cache entry. diff --git a/sei-db/db_engine/litt/littdb_config.go b/sei-db/db_engine/litt/littdb_config.go index 1ed06b9a3c..af3c2b5e73 100644 --- a/sei-db/db_engine/litt/littdb_config.go +++ b/sei-db/db_engine/litt/littdb_config.go @@ -36,8 +36,8 @@ type Config struct { // The logger for the database. If nil, slog.Default() is used. Logger *slog.Logger - // The type of the keymap. Choices are keymap.MemKeymapType and keymap.LevelDBKeymapType. - // Default is keymap.LevelDBKeymapType. + // The type of the keymap. Choices are keymap.MemKeymapType and keymap.PebbleDBKeymapType. + // Default is keymap.PebbleDBKeymapType. KeymapType keymap.KeymapType // The default TTL for newly created tables (either ones with data on disk or new tables). @@ -191,7 +191,7 @@ func DefaultConfigNoPaths() *Config { GCBatchSize: 10_000, ShardingFactor: 8, SaltShaker: saltShaker, - KeymapType: keymap.LevelDBKeymapType, + KeymapType: keymap.PebbleDBKeymapType, ControlChannelSize: 64, TargetSegmentFileSize: math.MaxUint32, MaxSegmentKeyCount: 50_000, diff --git a/sei-db/db_engine/litt/test/db_test.go b/sei-db/db_engine/litt/test/db_test.go index 234031fcf6..1d9cbf71d2 100644 --- a/sei-db/db_engine/litt/test/db_test.go +++ b/sei-db/db_engine/litt/test/db_test.go @@ -35,8 +35,8 @@ var builders = []*dbBuilder{ builder: buildMemKeyDiskDB, }, { - name: "levelDB keymap disk table", - builder: buildLevelDBDiskDB, + name: "pebbleDB keymap disk table", + builder: buildPebbleDBDiskDB, }, } @@ -46,14 +46,14 @@ var restartableBuilders = []*dbBuilder{ builder: buildMemKeyDiskDB, }, { - name: "levelDB keymap disk table", - builder: buildLevelDBDiskDB, + name: "pebbleDB keymap disk table", + builder: buildPebbleDBDiskDB, }, } var flushLimitedBuilder = &dbBuilder{ - name: "levelDB keymap disk table with flush limiter", - builder: buildLevelDBDiskDBWithFlushLimiter, + name: "pebbleDB keymap disk table with flush limiter", + builder: buildPebbleDBDiskDBWithFlushLimiter, } func buildMemDB(t *testing.T, path string) (litt.DB, error) { @@ -88,10 +88,10 @@ func buildMemKeyDiskDB(t *testing.T, path string) (litt.DB, error) { return littbuilder.NewDB(config) } -func buildLevelDBDiskDB(t *testing.T, path string) (litt.DB, error) { +func buildPebbleDBDiskDB(t *testing.T, path string) (litt.DB, error) { config, err := litt.DefaultConfig(path) require.NoError(t, err) - config.KeymapType = keymap.UnsafeLevelDBKeymapType + config.KeymapType = keymap.UnsafePebbleDBKeymapType config.WriteCacheSize = 1000 config.TargetSegmentFileSize = 100 config.ShardingFactor = 4 @@ -101,10 +101,10 @@ func buildLevelDBDiskDB(t *testing.T, path string) (litt.DB, error) { return littbuilder.NewDB(config) } -func buildLevelDBDiskDBWithFlushLimiter(t *testing.T, path string) (litt.DB, error) { +func buildPebbleDBDiskDBWithFlushLimiter(t *testing.T, path string) (litt.DB, error) { config, err := litt.DefaultConfig(path) require.NoError(t, err) - config.KeymapType = keymap.UnsafeLevelDBKeymapType + config.KeymapType = keymap.UnsafePebbleDBKeymapType config.WriteCacheSize = 1000 config.TargetSegmentFileSize = 100 config.ShardingFactor = 4 @@ -114,7 +114,7 @@ func buildLevelDBDiskDBWithFlushLimiter(t *testing.T, path string) (litt.DB, err db, err := littbuilder.NewDB(config) if err != nil { - return nil, fmt.Errorf("failed to build levelDB: %w", err) + return nil, fmt.Errorf("failed to build pebbleDB: %w", err) } return db, nil } diff --git a/sei-db/db_engine/litt/test/keymap_migration_test.go b/sei-db/db_engine/litt/test/keymap_migration_test.go index cf24a8684d..4c5ebca425 100644 --- a/sei-db/db_engine/litt/test/keymap_migration_test.go +++ b/sei-db/db_engine/litt/test/keymap_migration_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" + "github.com/cockroachdb/pebble/v2" "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt" "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/disktable/keymap" "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/littbuilder" "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/types" "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/util" "github.com/stretchr/testify/require" - "github.com/syndtr/goleveldb/leveldb" ) // Tests migration from one type of Keymap to another. @@ -30,11 +30,11 @@ func TestKeymapMigration(t *testing.T) { shardDirectories = append(shardDirectories, path.Join(directory, rand.String(32))) } - // Build the table using LevelDBKeymap. + // Build the table using PebbleDBKeymap. config, err := litt.DefaultConfig(shardDirectories...) require.NoError(t, err) config.ShardingFactor = uint32(directoryCount) - config.KeymapType = keymap.UnsafeLevelDBKeymapType + config.KeymapType = keymap.UnsafePebbleDBKeymapType config.Fsync = false // fsync is too slow for unit test workloads config.DoubleWriteProtection = true @@ -147,10 +147,10 @@ func TestKeymapMigration(t *testing.T) { _, err = os.Stat(keymapDataPath) require.True(t, os.IsNotExist(err)) - // Close the table and reopen it using a LevelDBKeymap + // Close the table and reopen it using a PebbleDBKeymap err = db.Close() require.NoError(t, err) - config.KeymapType = keymap.UnsafeLevelDBKeymapType + config.KeymapType = keymap.UnsafePebbleDBKeymapType db, err = littbuilder.NewDB(config) require.NoError(t, err) @@ -179,11 +179,11 @@ func TestFailedKeymapMigration(t *testing.T) { shardDirectories = append(shardDirectories, path.Join(directory, rand.String(32))) } - // Build the table using LevelDBKeymap. + // Build the table using PebbleDBKeymap. config, err := litt.DefaultConfig(shardDirectories...) require.NoError(t, err) config.ShardingFactor = uint32(directoryCount) - config.KeymapType = keymap.UnsafeLevelDBKeymapType + config.KeymapType = keymap.UnsafePebbleDBKeymapType config.Fsync = false // fsync is too slow for unit test workloads config.DoubleWriteProtection = true @@ -265,16 +265,16 @@ func TestFailedKeymapMigration(t *testing.T) { // To verify that the migration works, manually load the old keymap and corrupt it. If things work as they should, // the keymap should be reloaded from disk, and the corrupted keymap should be deleted. - levelDBPath := path.Join(shardDirectories[0], "test", keymap.KeymapDirectoryName, keymap.KeymapDataDirectoryName) - ldb, err := leveldb.OpenFile(levelDBPath, nil) + pebbleDBPath := path.Join(shardDirectories[0], "test", keymap.KeymapDirectoryName, keymap.KeymapDataDirectoryName) + pdb, err := pebble.Open(pebbleDBPath, &pebble.Options{}) require.NoError(t, err) for key := range expectedValues { - err = ldb.Put([]byte(key), []byte(fmt.Sprintf("%d", rand.Uint64())), nil) + err = pdb.Set([]byte(key), []byte(fmt.Sprintf("%d", rand.Uint64())), pebble.NoSync) require.NoError(t, err) } - err = ldb.Close() + err = pdb.Close() require.NoError(t, err) // Reload the table and check the data diff --git a/sei-db/db_engine/litt/test/table_test.go b/sei-db/db_engine/litt/test/table_test.go index 946c72dba3..2db5402831 100644 --- a/sei-db/db_engine/litt/test/table_test.go +++ b/sei-db/db_engine/litt/test/table_test.go @@ -46,12 +46,12 @@ var tableBuilders = []*tableBuilder{ buildCachedMemKeyDiskTable, }, { - "leveldb keymap disk table", - buildLevelDBKeyDiskTable, + "pebbledb keymap disk table", + buildPebbleDBKeyDiskTable, }, { - "cached leveldb keymap disk table", - buildCachedLevelDBKeyDiskTable, + "cached pebbledb keymap disk table", + buildCachedPebbleDBKeyDiskTable, }, } @@ -65,8 +65,8 @@ var noCacheTableBuilders = []*tableBuilder{ buildMemKeyDiskTable, }, { - "leveldb keymap disk table", - buildLevelDBKeyDiskTable, + "pebbledb keymap disk table", + buildPebbleDBKeyDiskTable, }, } @@ -159,7 +159,7 @@ func buildMemKeyDiskTable( return table, nil } -func buildLevelDBKeyDiskTable( +func buildPebbleDBKeyDiskTable( clock func() time.Time, name string, path string) (litt.ManagedTable, error) { @@ -172,7 +172,7 @@ func buildLevelDBKeyDiskTable( return nil, fmt.Errorf("failed to load keymap type file: %w", err) } - keys, _, err := keymap.NewUnsafeLevelDBKeymap(logger, keymapPath, true) + keys, _, err := keymap.NewUnsafePebbleDBKeymap(logger, keymapPath, true) if err != nil { return nil, fmt.Errorf("failed to create keymap: %w", err) } @@ -246,12 +246,12 @@ func buildCachedMemKeyDiskTable( return dbcache.NewCachedTable(baseTable, writeCache, readCache, nil), nil } -func buildCachedLevelDBKeyDiskTable( +func buildCachedPebbleDBKeyDiskTable( clock func() time.Time, name string, path string) (litt.ManagedTable, error) { - baseTable, err := buildLevelDBKeyDiskTable(clock, name, path) + baseTable, err := buildPebbleDBKeyDiskTable(clock, name, path) if err != nil { return nil, err } diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/000001.log b/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/000001.log deleted file mode 100644 index 02312aebc387c056e3f3c42b281751c119c0a7b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2648 zcmYjT$*$vA8Lrb!BXpBnNp6Z}1ya+kD%1!mo??e$P!ij596KHoPobNZ;~}1sIB{$z z-XT_O*diW)B|Dyg6}$l}7Q6#ngza0-?IRr}`o4cW|9}4D`1r}!{{jHKdS3nV2RynP zE<54@xmrb<_`MI*EAWu)@Dwu1TU5M&k1laTuPKk=CtBLQ;2p~5WI+t*L3Ea6%y?lQ zVU>0b{HAG`MI{aX8uWZ##V>;iM|&}$kr(9dr3<=+fas*Mu=lj)6*)&VYJJd|MmQQ+ zYn-=^J0YDnObbXA;dY7 z8qa+Z!u^K$=1>0-{_sZt-h8NGrz&rIF&#yLK3_R_# zo3Umo0k+uT(LgvnRcX^Et1%Zi*>&?$3eurpV@W z5>U%IWRj=o=ewgG=vj6|=Mv%<;&5l%Ywd3E9e7yE=PPxd%lti+UxI#cCS{R@QeEU6 z_L^@=J8nYjf%cVNO{Y3Fkz94sz&{6VbYW?mw8)|rUstdSOaQNaW@_4gvVm=s^Snmh z{@doOfBYSQ&r6|d^~w$UivzRqND-x+V!yPQVQ$iu!bg<^XtM)v0@H?B?L? zsC7g93Owk$(FJ!0*U{a62Rt2Ck*SSw{5&L2+X&%qS)=iN(7R$c_NXL8F65!_`{uFX z-hz&;sM!ggjIe1q7ns8f(~XSFcu!%1Gsq2xTh}+W3L6KHmRIbHLyE%G8m(Kq!ZFZM zU~0tif|m|b10uP`Sb3oiL$rt{qut_iPyZF@4zDN{tIkBULTV&$@9FcPW5AGvM(G4L zQ;Nnf!c^$M&@?g1z~Q9I=pADJIavISb8_@6mRuKQ1{m})e4R2MTORO z9te%GZh4r?Js+zxQHqt&QmBUc9JEj+J{7RISjl(iKLC#kA5AG(U>HNDqDJ}&v~MvV zj}Z)YN7s7VS5BdF(!^o7%r|>_C)}-k0eYtiLG$=xq4LlO-fFnjSb7g0h$2X4NRI69 zcKGrN!X$wmPg8$IX9$XB^>BDjtRD>MOflflwrI!8SM*w}2SLSJJ@88Y3jpKls$@fb3OXBPPMsIr=DfN%0bI}Y zXQd~OpBA)AsSHQlj)j^ddZSjpgE9nX3Av+28MCUdZ>7`+?bLyH_}0o#(6yfJ75pXW z1jKAEY?Nti9WU9ke%UJK9q5jPxfEJAYJ;i+Z^zd6tD@e6jt|KvF=SwUAqQxFH&?Z{ zF)~~Y$5sV-nu@n3uGi&b$g`r$ID@r~?lG3TXIehd`gN>m!mzlpjeH-p%z~sHWR`gc zxj|>3<84N|utcw@=4T>{G)!4BQyLhf^A=M4#83tZtu@?R@VKEImEEk1A%eqpgMahS zfB$}2enm)SPStuSH+UFMpgb=h!F4@4KBTI>uJA8Fo0N3YR@jX9gGJ-~r{Jj^#T+^Fg+w0|1$W(@t_?W` ztw@tXPEjeEud7yBl7IK-uRi+-fZvq=t5u&vi+9IRL_q3+sRzqn7d@{p(g%$Y8BFzfD>8VUZiRNh1C_Cnp6*aCsA78-eRLRa zC#VNp-%PT&!GBzy=4tMUo;NT3rjG|LK8BDcvGx03vA+gS kYbRL9gn7KIqV+_>3I5VpEepNEdEx3>j#f8HrSZf61MS%bNdN!< diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/CURRENT b/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/CURRENT deleted file mode 100644 index feda7d6b24..0000000000 --- a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000000 diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/LOG b/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/LOG deleted file mode 100644 index 9ff9a197f2..0000000000 --- a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/LOG +++ /dev/null @@ -1,8 +0,0 @@ -=============== May 7, 2025 (CDT) =============== -09:33:37.810933 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -09:33:37.824567 db@open opening -09:33:37.825148 version@stat F·[] S·0B[] Sc·[] -09:33:37.828724 db@janitor F·2 G·0 -09:33:37.828751 db@open done T·4.167625ms -09:33:37.859690 db@close closing -09:33:37.859770 db@close done T·79.375µs diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/MANIFEST-000000 b/sei-db/db_engine/litt/test/testdata/v0/test/keymap/data/MANIFEST-000000 deleted file mode 100644 index 9d54f6733b1364dc8d53dd15ca59a6ec36a1c29d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 54 zcmdmC5aOo9z{n_-lUkOVlai$8R9TW*o>`pgoS$2eSd>_jU&O?~%*ev9Y~pbaHU>r} JMrI}!1^~s!4paaD diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/keymap-type.txt b/sei-db/db_engine/litt/test/testdata/v0/test/keymap/keymap-type.txt deleted file mode 100644 index 02d4ce5d35..0000000000 --- a/sei-db/db_engine/litt/test/testdata/v0/test/keymap/keymap-type.txt +++ /dev/null @@ -1 +0,0 @@ -LevelDBKeymap \ No newline at end of file diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/0-0.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/0-0.values deleted file mode 100644 index c79f0ee40bfa5d8a1ad5c96801c8f69b2dda3a02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 98 zcmZQzVBiWX$n{S*O)-m1WME+6DXSJ;aQ^k9?VobbHdd>~)Q-6JzEDk9A{+&wL-Fs;ZnGz$Qs2^pjS diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/0-1.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/0-1.values deleted file mode 100644 index ff4315b838790c22be22e09d6601e12790010ba7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55 zcmZQzVBpP249O_*baT%QG)gpNU|%{y-iY`13?;%-A#iW(@ZVG MLvss5Tmw^60L<|oV*mgE diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/0.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/0.keys deleted file mode 100644 index 8697025a972bbea89fd8b95fca09c3d6a421bfd6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 479 zcmYk1&2NG*96&ki{Mzn2Zpo4*3Su$aWeSK;6l4f^SrCSTAP6GDU%$H4XfH2$ukEiT z2%_Pw;3)&E5U|`@k332x@ajWtO4-U;U%})jZn-K|A diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/1-2.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/1-2.values deleted file mode 100644 index dbc9dcb172e77a00944aeafecf1aafcb9e1b29ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51 zcmZQzVBiV#FiI&5N~!WN4=Z9|VBif5jIvBF3~((p3JVJY3h{ diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/1.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/1.keys deleted file mode 100644 index b0f355a99ab3f0e6ff3f7d15dde3e426bb0fd1e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 401 zcmYk2TW^9e7(lyML(J6ufjw=Hn-p); z`3e9K=IA3ik|;^BjsO4;>^7&bhmy3A$45iIC-77U6NlNh4q%#Gs2n)NtkWvQL#V)i zxhI>Yc$LPt!jGY+PPCH8N5&4^sdXCRoJib0GxpC#z45VX4+$P!Hlhhvygo4sO7%8z zZKy%TJ8=KX*hS-0Y#3Is-{;b5#tQ@JA#r=X+K`05g%hpTS^HS8iG(Iv>4@=tIXY14 z2kp!k7CQ?!tJKVJt#+j^W(UV?>MrqnzFwLkuF9V&O_^>!q?ssGnupL@Rh<2|!u@CC e;hY59{9YuUWpHmZcH(kC)053yfTH})A#NUJC5ai8o_Pk&j(z}+wi$K+ diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/2-1.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/2-1.values deleted file mode 100644 index bc90c4a93dcbc741d7eb6cd59e0c7ead21f1c9fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 93 zcmZQzU=TDdbV;)eNjI?Y_bB(TEJ_MvU|`_&PWH_UD~Sv!Pfsok0Sa&j7N%$Bdzcgz rr=|nB!bzbXN#TA4L3v(oxk08?De1nEAZ?}rhW@!>{>B-eh5?=clcgDO diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/2-2.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/2-2.values deleted file mode 100644 index 91d34a9bc93f40b2f371f6cedf4c9e64ae3e7440..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20 bcmZQzU=VOD%C5BV%};aBE_2Or^GgN*GH(UW diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/2-3.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/2-3.values deleted file mode 100644 index 936dbf00ccbddf25100288c4c3684b42208449cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmZQzU=Yan%=LFnt+Grp@-_C!Pw{5}ieHziTn64IL7oMHNlu|a9-oniiD9|9Wo1N;TXID@NIoRb$TvMPB*4@O E0NDN;;Q#;t diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/2.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/2.keys deleted file mode 100644 index 2a9e7d8b2adb879b8ead1864b4139b2215913dbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 455 zcmY+ATW^9e7>1i&ZgaS~{e@+hSUKJ-fq`Lw0*X$&Sc1p^Ifw#+{Q8xoBwLf_N#7@5 z+q?jPk(MdjP%>@*YL!6O57?(@O^T0~qZ721KD{u_YH z$%ZQ=y_V)N9(YC^7HX-9VSL)CoOLkW9d>Vs53Femc|2CPnIFhDHt&eHn}9FbAF|>5 zHwctIWy{3<5?J=kNT*#g(XSUg^Md%;&{y@iD!AIH<0y*UBbKj-#D2BDoS?|lAMvN5 zWPj8!aY`YTX~QRL$JgyMb}Zt+3){5KDhkRr6=6Xm5-TY4`pgI`vU0|fj#bCIjG@{@ z`X@RECI$tYnWs31n*l|H3yfS7vjdzB3*9OW zee%pB4AUz?3WF>hT_en+g2R$cy|YV!B0@f;#fF(q;dyx}Udf4uPVNEaKv5pwLPtYy L7pF*fQ)6!caB3Yk diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/3-1.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/3-1.values deleted file mode 100644 index 9e0790f42773863fe77d7f4a0abf13d4ebe3b76e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15 WcmZQzVBj_~DJZE(jx5Y8F9iS?83a`T diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/3-2.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/3-2.values deleted file mode 100644 index c5e4f426290f862463b8d7d47a0db9be607a8a9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmZQzVBiTU4GT{W^z{sNHZEsiVBjwdjPec2DGN05^$H3K4gm^rl_dsb<+@ZD<^%wF Te9ooC+4;$V9yxBwktOZ`H@6ZC diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/3-3.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/3-3.values deleted file mode 100644 index b620e6eee42d5d84db9b47efbb93254d0457adcc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45 zcmZQzU=Vf=GjuU=sx%JBPD?HcbF?UMb!1>*5HbrWa0|`%DReDKHx2X&NHY%v0Qq1H A00000 diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/3.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/3.keys deleted file mode 100644 index ddd63b495983de618ffa8b95e4e717cbb7095a5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 344 zcmYk0U2lRg6o#AZZn{j}#eTr{14fGxvMXh+B&@)|;^2;tO{KDxsG$D(m82v)N%JJn zd)|`*04D5wv`#799dMe=PZp*c0N_TxZpP^kPW;Rc-ZzTEet)| zjsv_``xD9GMNlzEQ~ldK`^tC4ArhRsZBmhq*B^S8eq1jMLT8Q>QO$(edX}rwtK_Y5 wEe}i7qN+bdyGjn@e diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/4-1.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/4-1.values deleted file mode 100644 index 472a79141eecb0c9dae3df0b6dfb0dfd3161f573..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55 zcmZQzVBj~22n{JrDb5QFDDgCM%4PrxCFLYXl$V6(hB;Y8WLK2|g?RJxO3J*=TwQbg HDnd&Dnq&{$ diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/4-2.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/4-2.values deleted file mode 100644 index c98bf1774b5e7ce80b45e620683919823e29b696..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 109 zcmZQzVBq)ii88FrDkzN%jBpDoc4uH<5YA8YbFK)^iK;L$2@S}0w{SKv0Sfb`C3zL4 zmpeN7SeSWd00sDrv&+-GEDNgKQ=QDrBS9h|rD5qw!7gqkd5NYeWk3-wr(DPK6eHI% Gk8%JV7#$n{ diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/4-3.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/4-3.values deleted file mode 100644 index e4859a42dd8f8a63601f0d0b9a1dcfe7e4a4749e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30 lcmZQzVBjk7t@I9a@eHl3Vqjq4@vX8fGz|%@2uRD$003)X2onGR diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/4.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/4.keys deleted file mode 100644 index 7f78d6d176784b382d95169b2af5f5b9445e7c67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 425 zcmYk1&2EA~6h>#!Ra+}=5(p4iMAPRyEFq_676fkNPi!e{$AsLh2T8i?@vmsLx%IC$5Pt@~L2=g)td1ypTzEgIvo+2C1NgpcWnu+f}J^xSU diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/4.metadata b/sei-db/db_engine/litt/test/testdata/v0/test/segments/4.metadata deleted file mode 100644 index f0a757d5440e71f227bd90747326ec9f61a09aa9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ZcmZQz00WjeEq|mWY+bz$RMx*>1OO?L1;79R diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/5-0.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/5-0.values deleted file mode 100644 index ed28004dc9f0616c93e23b710047dde3b7c72653..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 103 zcmZQzU=Rw)5AZ4sF-i6)DD^haGSBxYW?*0tEG#wjjI64RiUC@N%NU=T1ebBoLk$jXi^HZ{!4u(SY*@g|297W(_8m6ZlN HmXrVhcAXCb diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/5-2.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/5-2.values deleted file mode 100644 index 214fc38d5d5cc556d3a6627ba910e71a6e544a2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33 ocmZQzVBj|~vM9B5b~USt$_dO5cV}Q=;0lc>Nea%*iVO$>0D4adY5)KL diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/5-3.values b/sei-db/db_engine/litt/test/testdata/v0/test/segments/5-3.values deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/5.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/5.keys deleted file mode 100644 index a0f5bf12efe21e698ed8580deedd75c11d68f8b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 255 zcmYj|%?g4*6h>#$rVOm0Cur9ujoLdoqm`3c>FBbuA4iSS)bi<@V2Cb!95{yy0BBC3 zQdKTtI}8A5@O`iCVs?F3s-hyrgk1bW9D6~2uwgd8W~m50PFba8qSF$-vBpfpp8P#Y zxj**E_#VR{*sM_s(jLrd?ofr~P=4=zQGT=TSo9Ei|MHp~Oy5sAiyC_M- lmckD?yLGy+*Pss&Tdw>cp1oAxySHZ$4}$FYy2X diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/5.metadata b/sei-db/db_engine/litt/test/testdata/v0/test/segments/5.metadata deleted file mode 100644 index aefc272f27cc12125cda6485c59b28cbe43b750a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ZcmZQz00Wju5vYSH;V`hb7x>+;CJ>4$Tu*{cFs?+@G#BG0Sa*&hg-Urmb)8Aco+b= kTxRAOSw=1?enl2Qo={4*Pqw#PPLf}7P)53QlzVXj06y*&K>z>% diff --git a/sei-db/db_engine/litt/test/testdata/v0/test/segments/6.keys b/sei-db/db_engine/litt/test/testdata/v0/test/segments/6.keys deleted file mode 100644 index 9760a7224e9a7b403763653ddbfe4295bc23c49d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 256 zcmXYmOACTP6h`l=MbdlSreENcFt&<}$};mwBkeSNU^1H8gMNKCmQa2i~-S0%y>Ih;QZnVq?E`>5q6S#r?`a?@ptL}5K%umS zCJr>lkpoAL965L9$QXxy0Y89o;Ae1lV%OTc``Cm){=esW*3+(M{R{I4<+uL;0Ng!a zt?~;r2l8YdIyZJj=pAn-EWiFj??B5wuq$QFtKx1wrR+5oe!*(gcyK1pq&Hn9mD&VP z$zfe|x=ZeOFydp_HRi&+qGdhDjktV{`-Rfqx$e@~RqQ*U*}oFKSl^5kCu9fedR?Kn z;1N57q{y(tiLZ1?zXBL&u&$`eO2BoZ^IYv&6={Q~>49H)j6$%RVn1{Eer|IW{Q+nn z7LjcXN%GuhPU{F4Z&?L@3fjv}FjXo0cv(ctkwH?@rGnorA6ABk*37#Zr+95ngHeU< zz=PVwvV_^OgN$EzmEH$6(b1$J!s8k8mr0uX9QCAVL*Mu9Bdmk=8`N*H6c6zp zu^n8MN^XIcFX`l^GZHy3rVQqS7Zoe-X}c1$BN;G@MP$6@+<^uikwoAuNy$0x4Q-HI;hgiJPM-g7^3qG%+KK7$Y0qxM9GLtkgeYoVi|;4i@d(B5Y^YbmfY<_P_xg^Pp+ zD?P&+p~a^HQ>F{G`-R%pt`|DBF+XAL)i9-5>Hpv(O@;nsA{pCl+SAZz!CD`Ir=Y`S znuUd~!)?5L!7Y{7mEM5*dfH!j3NH8qZdNVz0n~9V5Ax``K5mb%wH`qoTi_;@Fk;Tk zkR`w+%1sGF-AdN-=sfYx`>M)2P``2unl{6^2|YpY|>E?q%n#=e}GouUx0yVJEw`Rw0+{PUka1pq6Xfmf~kfMz0GrXw#rnF2Kr z6dSqImmvmqq2n+2hana?9W;s0a(jx4%7$bUYhUbF+r6+r;{)LvaNi$w^Src$C2}Pw zegf)##-HiY#XD1{6m|pUK4_0Oz21zZg2}jui120%k)uM$g65$hnHetfx{(B|qBB)q zc}6X)J13%agjwp~5~A&cNiFb5D$8LUc7@epvtyCpL+}>Vr}Q8S950H6FN8M_jCm+( zI?G9~Eq(U8fBpT}DF9*_0WY)%wL_mMqS0VCy`Z`ODkR{Z&4kEIcZ3+gHlX;X>`)Sv zEx+k3U1Hx8L^MP%@e5LtuUlth7*#y{TQKifgY&wp`H7`g$L1z-)VtwHt{1#_a6 zTh&7wG`!WolxM`1F#Jpr@QS<#4~|#ti$h9a?206zS?s;896SL*WdojH-Gc_9r#808(#P2 zr(6o}&}O_=coNO+*B~h!_{^w^&`nK6+z8iv&A4dTpK0qfqBx11PIaj}z}5!oz(F3Z1xs=Lh7LN0^{F;``pgoS$2eSd>_jU&O?~%*ev9Y~pbaHU>r} JMrI}!1^~s!4paaD diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/keymap/initialized b/sei-db/db_engine/litt/test/testdata/v1/test/keymap/initialized deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/keymap/keymap-type.txt b/sei-db/db_engine/litt/test/testdata/v1/test/keymap/keymap-type.txt deleted file mode 100644 index 02d4ce5d35..0000000000 --- a/sei-db/db_engine/litt/test/testdata/v1/test/keymap/keymap-type.txt +++ /dev/null @@ -1 +0,0 @@ -LevelDBKeymap \ No newline at end of file diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/0-0.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/0-0.values deleted file mode 100644 index 6131fc5d00035f2d3c981770b0f86adafd8632cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 112 zcmZQzVBj;(E>H8aEU0o%buu%LWME+63M-O^k= zay>$TqQd!Ue$ExaIZ+iRCZPe@?iS7lCO~09v$CiRGbalZ17AOja0}Oz3Xpk0g~cAh JE`DA~5dbtI9HjsN diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/0-1.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/0-1.values deleted file mode 100644 index f554d4793dcd8877e26f5189d3c13af250e7d5ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 85 zcmZQzVBiTU4GT{W^z{sNHZEsiVBoGQs>}*X&yF;9vIKJZbBdgd`~xZ?3d$TU-Cc`- kLW0Kbra_KrrWWC$xrHIFfvG7#L9Rkq=lt@ZwDc+i0F_-9R{#J2 diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/0-2.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/0-2.values deleted file mode 100644 index 18c5c08b11721431f5bf910afe5898c06661b4f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmZQzU=T{l_R02k%SrMp4$4S(j&d(9U|?Y2cMfs$C@V?KsPxP;aCYsOL4u9t7}`=m|E zFbu1%7j79}^-$c5vvlb*_cMsF9y$m>D@CRfA*H+<(^KYZE!J{oh7Fxr(ouuaZOr+` z0SCuJ$p!Ax{da2+CzWw=h5Y77X_ELsO7Vr1m43v@akHB_ajB~iA!^U0eIA#xrRmc} z?r?HWg(rQ|6AP}L!WdVz3nyDjL(-9nL6~WdsPAsys~AX^$e{d2I>cTT1yfnBCGCVN z!Me6o-#hhpg$b4DaP}&H7RZWyrus_Cs;y9NSJ^c<9nqIr%&2vFgdE>CTB@rp@G=S# zY0rv3?V{zi3VU?6yV>4Pxk}+S7yvrYNgsp>H1}eYs1aSeKlO9)5hZyO@`-3=f3Kro D9pYGR diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/0.metadata b/sei-db/db_engine/litt/test/testdata/v1/test/segments/0.metadata deleted file mode 100644 index b3a083bc5ccc51dd705b0710af7b560ae62fe8f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33 pcmZQzU|?imU|>0yu-LjgCeraA$K(m;5`_;**j;<1{>b?NBLJNR3)=ty diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/1-0.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/1-0.values deleted file mode 100644 index 90b6b5973a7b1e25ef6986f9efc5606a64958ae6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmZQzVBjsTj0*ItEHW`K3G*;vU|`^LE-lW^PY(3RaZ8RYaR-WUml#*M8n~N9goU{S E07X#^FaQ7m diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/1-1.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/1-1.values deleted file mode 100644 index b7b640b048d6d33d08215e2e6e11065b4bdad8fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 zcmZQzU=VUF$HX8`gFd@H@fTs%W7tAIRS(*Q&N+%SLR3{S%VPoRKMNPd7< zVTehxM?tB#d6s#;M=?m$$Slbu&!Z|dDbFpbC^0?R%mpYaU}WYNnH!Lm9a(H@n3rK` F0RYqu9F+h7 diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/1-3.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/1-3.values deleted file mode 100644 index d483dd7ee07c1d6d7635e9a177af8c51b641974e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56 zcmZQzVBjgu@U+bLD|e47^ABQRU=XTuEyxUsEcDIuHF0z;2uw{b28!|p`X@RECI$tY KnWs31n*ji!BM&G5 diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/1.keys b/sei-db/db_engine/litt/test/testdata/v1/test/segments/1.keys deleted file mode 100644 index 2e08ff0c27133a0515235592cec9f1c2be24e57e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 403 zcmXw!O;5rw0EX*X5$3^@HxoUX;6Cg)j;&*oHg$Y#j2js%Y)%Hc?_Y15lqPSU^nLO+ zDF8rejc#77|ICIq-)Wle3IMxHswd6?GdsPlhygFIe~{vl zbEJlK?u7NUbFIvqQA4^n&Rf>S%i0Y#dkkg$%Bj#9J58a#&=Y^RD>u#cyU$#X@~E_a fkU^7i6D4@{D~Gli`r)intrLq=79l&ykd)Cs^B_%S diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/1.metadata b/sei-db/db_engine/litt/test/testdata/v1/test/segments/1.metadata deleted file mode 100644 index c7324a3e05caf2481e7a6b39158badb9c4dee08e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33 pcmZQzU|?imU|>0`Xm$JN-Gyws^~*%-d2Pfc?5;i1;F^De5dfAP3W5Lt diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/2-0.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/2-0.values deleted file mode 100644 index 52f7b9ac80f0197683152e146a7a093da0bc30a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 110 zcmZQzU=Z*%EjCE5bTkU}GR`V4aj9ZpVBqmBbTssKaf);|HTDMbxk4jKl7e%yA_Ibe zJi)ArASb^-f8PQR*P`rVuTm4Bpio4nuc1jmMXF%{y-iY`1A#n&Y?sh7GYgMg3j=dER~P3j01Y?` AmH+?% diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/2-2.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/2-2.values deleted file mode 100644 index b979b71a838658448e65acf9754d6deb63b6d94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmZQzU=Vf=GjuU=sx%JBPD?HcbF?UMb!1>*;Ei&xN)IY^FEuqya*G5C@T53Lqz9V> m=Y;3w=7acU73Imsc_t-Ag~l!*4QV;$W}Y4yp_vwbxlsW7Cl}rT diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/2-3.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/2-3.values deleted file mode 100644 index 92a984f8fa9eafaeef782d781c7f2c38b973f6b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51 zcmZQzU=T73C~ynS_bGHONjDAj2}m;!WME+64lGR1%=a)UDo#xYa=FqX%grrI13Ys5 E08ohyu>b%7 diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/2.keys b/sei-db/db_engine/litt/test/testdata/v1/test/segments/2.keys deleted file mode 100644 index b253a651dd3b77fe55dd3a5f76ad45ca7078b21d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 447 zcmYk0OK*Ze6h=w6wwh?uZn|s}mv+F{vOEP5P#hjjx=@gUh=5c;etl<>A#sw)mz*=- zol8+v&)1SwW=Y06gRut%ilQFS#iyT?H+QQDI`EW9>e4C$5p8XUfmz-FV`*+a?{FX1 zf82EkqC(hxe_c6Yb#J@eERJM(We34^3>T#LigIuqi6wMF?0e!NtW0rhw7)$g{kUIF z%+R2fXfA4`HpHBU)v-F&`!q<~ab3)TNjtNGS1VqN$@@2yPjPIy#a?GGa(GFIc*liW zG&#-@*mYpBgacdvmKeCxn{AIhp&(+0a=>J#)SudGPrYUJK>-ZQ5RDh<`OqqJz|O~9 zEbEIiQ7^Jr`uPXT CBvr)# diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/2.metadata b/sei-db/db_engine/litt/test/testdata/v1/test/segments/2.metadata deleted file mode 100644 index 5b4ba83de318c59d0af4b95378e5ebf68acfc320..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33 pcmZQzU|?imU|=~nVF%+&C9T(wPan2bs4$C>u)Fq1!?p7QBLJrY3+ey> diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-0.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-0.values deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-1.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-1.values deleted file mode 100644 index 2f690f74e61b08ace27eb3744cd2751a3e10100c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35 qcmZQzVBj?=$xF#E3Nwt%Dao&5U|`@g@-Q(hH@B>e$Z<=qNCyC&3JI$K diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-2.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-2.values deleted file mode 100644 index bc393a19545a4c996d621cd67777160de2ec09d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmZQzU=Z^5%kV4rt4s<`FEGf+Do(7-U|?Y2GVnGD@+=5Uata0Vcmh3)QVN4osyxiY FiU4V#4io?Y diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-3.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/3-3.values deleted file mode 100644 index 7e909cc5464838954acae1821b039199fcb90fcd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 103 zcmZQzU=Yan%=LFnt+Grp@-_C!Pw{79VBii5F(?W43pX?`^8#}DO^hr`EuCG>s-kiN z^TXXiDl!e7BHi7B(|nBsfLsC3kbJi=-@@`lqw@T~wBih)7*|N1k#BlpNPwvm02f0V A4gdfE diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/3.keys b/sei-db/db_engine/litt/test/testdata/v1/test/segments/3.keys deleted file mode 100644 index 9cc99a1f46fc0078845b0078b2ee725b065f1194..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 294 zcmXxZ+fIW(6ouhQyfZ{=HNJp8K%u43OP~lHDl&?#^bQ*=42N(mI#2I5*-kR~ve!=t znRK-G%rtL4sLps0e-c72;Qu{|&a$wq422(OC%FIjsW;ySiDq|EDaylFN#9zmci`pH zl*jS?nTJofK7dkoc3aEr(^hW=+?U|gNmSL>biQ#!vB-b+2E%HDlS*i7f4+5h`;Obe zZjB8f*O4N#MKPF4^t$SE7t;-Rr3Il;=Q2H1$;l3}+=G&5tqOiji<&wX?vLQ@z`mKH Q#&sO0qv(eh;b)kmU&MMjQvd(} diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/3.metadata b/sei-db/db_engine/litt/test/testdata/v1/test/segments/3.metadata deleted file mode 100644 index bae71de01839d1c74e4c35b65a80f36418e6dbf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33 ocmZQzU|?imU|{*jc3Ugn+(AxIIWU4JUvq_o-L*#=6%zs&0dgw{y8r+H diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/4-0.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/4-0.values deleted file mode 100644 index 363f10f1701c70cf5fa1fca53c4c6df2d044b5de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 114 zcmZQzU=Z{xarO(0a&#^A%B%{^h=}lEU|`@j4!3kKEq6DL@Gt;!`O8frN_`3pjoj1C z3c_=8fI`Am`8g&TMZU>d-Wew45l-O-5hfswC@N%NVBq)ii88FrDkzN%jBpDob_W2X2Wd5Qg{AQ>#P|{R5?^p8N{hTVr$^(ZnXk4}>0CwQj6U)r}hc^;uy9Sr{JX zeRg0N008U50u8++N~XBd0RVTTrpM@KVX<=+sOVl!`fJW+E0nvzQH^4~tEhOK25=+? zYq?6pcE7n9U=%wE<96&yZ*ATD=a+I^*RGOe$8L-KsF_pwLO6?M%WP~XZoE@gNGeqv zA+I{UT+cP!?GK7)E?`e30btrp%GK|ruf?-RbDr=X=V~i{8ACbJ^qFv0Xz!LA`^zf% zKXn^S)f*u{0-LwfO)fW0dJK^QlD5dfL&3u^!X diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/5-0.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/5-0.values deleted file mode 100644 index 6ff7ba379c0015ff8d06f7710ebf3e5039def60a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55 zcmZQzU=VOD%C5BV%};aBE_2Or^Gjx6VBoDtH1iA%jz~%_tVqcR3h;%LhNUM3ySSC) JC7Py`0RWxN57__! diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/5-1.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/5-1.values deleted file mode 100644 index da21673e37a8202b08dc74fa89a179c7e2973cbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70 zcmZQzVBj~22n{JrDb5QFDDgCM%4T3-;5ITTD5*$}EX*q}1#)?lLkbK1{nE-xgB?ps WfCBu5fl6HLI{v#Iv diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/5-3.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/5-3.values deleted file mode 100644 index 9dbfcb736486e9bd35ca5346bb639ccb5b3794ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34 pcmZQzVBiZ)Ow4yKGstr^b197oWME+6@vX8fGz|%@2uRD$004~z2_XOg diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/5.keys b/sei-db/db_engine/litt/test/testdata/v1/test/segments/5.keys deleted file mode 100644 index a39cf60325a5ac5a1ea9d42fee45e193ed837a83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmYj|NpFHc7(nOJ3)a{z>Agu4k1T_hQ&U-_C_-6;@rED@h?SO2etm~znmEaqmwE5| z004v21a`-nuwRrJ0N@5s|0ucEj()X=%M|~5`-JDN(={_zceE41oY$5TX&8XAr@GO` z;m-4}?0xV>BjIPuxXCYaX-@f%&vEqBhcRkO*J Jy}=N_{R3oiMBe}a diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/5.metadata b/sei-db/db_engine/litt/test/testdata/v1/test/segments/5.metadata deleted file mode 100644 index 29c76dfc5f6bca2fcc83974ab2f2aa316e824f37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33 pcmZQzU|?imU|=Z;%%VA((;0v;Fbd4~N3Jyy)_0BE@iU|3X78_n9Vi!`-JuSf>~+o21Z diff --git a/sei-db/db_engine/litt/test/testdata/v1/test/segments/6-2.values b/sei-db/db_engine/litt/test/testdata/v1/test/segments/6-2.values deleted file mode 100644 index f518be3e20d8c447edb85d4f469c755a02d07b7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 zcmZQzVBj|iarZEBtMUjB4$U*oPiA0X5cDk#Fi0=+^$1SNHZ=^lH1-1u@S!3KbOt(p-K) lMHQ|^oY_n(XZLT6Wy;L0*S|JJ z|Gy+;h*(hwz{J9RT3&w(iRx&_v@f zoaKuhvz2<^dtvUtJy8V71kKT%{0V&Yd+JdRS;XSi0L!&c%+qAu@6T`|m`;ia3$Nx# zsmZsXLC2ewYjaLInbznXc-m!Gd(P1k;&Ow7jS84vlWou*T(Ev@tV!7o>7lw@*3>)D zyfE5$Y|*5$F~}PJDY!@bD!;*!)zGQIUxOys_2;|&2npQowuX(r{{0`63P9uKV_UEc zkGegyHzwZK3hFqPuTWgo3A9|V*cJN}L+Cl?*LWMWHpCUXq+%aGGD_wAroX2%F0#@s zCIq$k4s@J7y^xozDr}cL;Vg-;<~rax*)NN3Z_XU{W_$>HrovUlgYG^D9d{Kmxq|wI zJlL*QbMrOS2ha%Z@!9CjS9u_P^4BgzPTsKV?tF#q`kX-36b_o#Sd2$#AKMHs)xN?Q zA3-x+BU^mw=EvTp+SJ>ZG*LYd^60WWYz}Pggahq_JM*L$9xaYg0@>^D!{#U8R@1pD6Sj~0Ko^)h)g9Ebc1HZ zDw`MSOg&xb(^M6)T6zasIum%;9O)r+kFB}^ir;|epvz>sjf5+gS$nz0%;l=PZtN3} z3i2AK6MI+e7MmTXoobiw!IOSDk5dQn6WUpf(lISo#{ycu2M=Q+^rutN+-%amUKQn* z-6OpcR7nn)Zgf)AzFqtK95jf@@PwUkk6$D;`g8E$vtwuFCkteS37%II7-%>J#jMdu z=IzxQ{R%uF`w$l>dNlRr9{yTD5;Vlks234EW6!>3BY$!Zu(|jH9D&ZW?S~Mq3oDk1Y|4k?W zO+-U2BB6wwnpGYB0x$W2=E*4M51Co5{yw-*ws_iesB2Wz;5*O?L&Hv%5_y_>r(KQT zfi`aoeIMUVFN5i@zmmE&Rrbf`>S`HdSStaq(eeb_NKe6{ltgTGcn+&-z;xb#2V9L#0Ewds&DzxdaG|MVjOep$Z51*al-^cF))nqe2r^fQ@5 zVb0%zENJfwoSLBmYnVwu%SJU^Zd8NR*`t~atl7Tmg%>nLyJIU}$}C>B!VP^A#BsqG zw809*^-vf&YSl41pe3^Tgmi3CJEP_C*>9T%a9{^2a=7KsRW)wt{ebM{xh@9t zD$g7ERP1H~HSwjy>K27?*&Z)2(Hq%Pdq|d0TY8wWS~Vvi-T|F4x;P#s%w6v@#nY`* zzqa`jbQE)vBBTAr^*1&>UI%o|J(d?8LJtK|^3rZ<_b8!ez5<;~|H>Wogvg~l^nKqs z)Z8=ZNR!Q;#1$1=D~@xv^6FT?OeAoRIrKI5xYT`3;p;Eo{N-y60JRjrRb8>Se&%;IzXzkeq&l|*4s+P9=8@` z7S|S^foFctE<8%c=yh3BmmTCzRp%Eg#9%fyel^X$OIN22;%`957Y+Q}B?ZQd36nab z)p&y3d(iYV_B1BX-ibJ-b)dK9{c@sInd_yNEUdXpzNA*KX_Q9fr8`n3jKN5)x~`!w z0yO#YFbZ5Rin+p;A7&O&W=39_QNT{5YNv0mni%hzi?qlhO{{W1=Q`EO@`Z2cW3A%0uR{ksILOp#(2Os1`jME85{5f7>sRj zR(XOfvW>FH!{jxx%PtQPsUyY5Tvz2tN0z?tAN-H@zy9*}hu_`3`QF{#-Fdr8*{?ujxZsYnq;F35VU7L{H1>V0 zh=$ZwIKQAzpl$D&rLy8?;&vsF_KJMrz6SRwJ`*-r;!<{PM*TGL|NQ|}X?XiF&L#}C znV6_9p|NYE^C^@DkOfcfLeGxKkitjdMCSIdOp{hk+FkIO6(<<*)kGrL)e*?|aXO^Xbr z#{1xDfiRRP$zIw`tsX7b%opI^ybKnG+%K+t4dS5bXWVHtJbNednAR`{o`VxTQ}|wL zD&m^Iuuu_O)T##YpFjWe=eI<@hp8%0qr9LwymSXM z8Dp`bwuRELpXA9uVoVFDGWVD8$S5czGpTg^Zf?LU4Di z;T5?^*3@Ur>v0c*kq%a<5M+{M|RZ| zQ0XUSGA+v57zC~r^l_wIYpvgcCZeGxnb2ZRPpj5~3Lijcz7B*LX&=s7G#?rSDV=Mb zA$V9aYn@-ti#|#qZjGDxRlWPiEn{DoM&Rj`7d!>zcp@(squ4o|vuV{f--j${qKiDp zqs!{BIdIU<4Q?NYBr6eupi4apSs8>=bB~~f7+FLc+3?B^0&XnhHC6gyTyZ8V0o#pE z>I}DDnR|0forz8NLRC`;y}Sc0!4h$w*iA0|35C0Ix0Zij_9S`5E~$hQM^>$h3{`#u z9!F&8PbQMF*`)a5<&Dd?qU4DhI#*_i>0NKj&ud$c-~rLujYV7y19zC0*x!Q&6K`C{ z;_Y-?Ee`0R4;q`Rqh+jax*}2A_y8UjQZ!-^nd7V(6V*5i8g@amYjm7>`&o_t3^YQt zJ2K;y!V%S^L(5&zOxMVkSULHzchPEL4Ri!lRMrHOSi54k-0XPmRFm#czv+DPw_8EK zEp5QlDlce7)_JgFaCzO$t+hC>G=2bSaF5x{HTL+_sS5KE><@c+zL0`>m3|1m0}X5u z9}7egv{?^&yoo*sT{c@-Na#B3+RHU|u2ds=(`iu|8d_8DY8>O0DFnk;#U>hu;WS_F z*sc6xuLGJZp|5!g%KH>sB?B7zC1|V0I7J5gjpJ`DX0#5N+ENEJB0~+uh0d^2l_#k2 z6?mBSkSw9M43%+OHFY;jPZrWsu_zrP){HubRZl>M0!_Z_&v*L)5;)zehi-;CqBJU4 zozXdwydDZYN6p&z??J17!SGmL4;3e5sM%^&Q{RBj;&L9PHsU9Yy&R+?MtTWzYXALD zfBZOkQt2C>c6mWl7*SE+cu~xcN6^$8NP*6HjpI{-3?}0u!osUDsP^%Ve2}<&JhUxo zc2@N2)gb;Bv9cd;GLi}b6#XDp5mE@7ySc#SV>9>Ipy_w;74?YI$}tEgWn z{jKZHjVc+CYlAi+=I9Y8lWgu|8Z%(4tqHjnXkJ)tG%}f?y3wmbL--jyEzt>c62#?6 zJFf$zni9x-4(^jJk@jr*8daZo2!2t1;HEn%*2jt(FG6Qg)fqBhf=6T@5+cnECce@m z{5qUpfL6kvg`pQ7O`cQ(#jc6~b-o4d5xP7cWz1RcGu2y|r>e^#M}YPPzw(DgLgsQF z`o3=;YLgOZUSla9pg6XnF4ZoFDkymJmXs+^u?uGSnZl#Bg7#lQ`|hu|$@@bo2~Rb7 z_ZlI|myNSF3@G~vB*1g3UQ`6PW83!f;+)FGw2B6@KPrD9)UHLHR=tIvSc@*o{-5T9 zdrf@OqZ1(@*=jbS&X=GeI_0!x2p#RK5r8OGZXq`Ct~t^}m>ySE1 zYX2MBmdBg@kWgpXTD9%7nOAW`ZUP>{P`8qmJUmUj)2@!>5j+ygd=Q5{ez{+7nQDnb zg&&t&|2Xj!Z`M5@Pu*lgRsSiF`W0yH3xb}aBBvWkz$kjvmyl|K2gfUR#XiLlW{$n2 z`pgoS$2eSd>_jU&O?~%*ev9Y~pbaHU>r} JMrI}!1^~s!4paaD diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/MANIFEST-000001 b/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/MANIFEST-000001 new file mode 100644 index 0000000000000000000000000000000000000000..f2e47a479896194ae68a95f575bb82053ec9f971 GIT binary patch literal 39 ucmZ1|Uhbv9z{n_-lUkOVlai$8R9TW*o>`pgoS$2eSd>_jU&PGB!T;M1& literal 55 zcmZQzVBm?Ua!L;H4UMWSs&rytU=Z*%EjCE5bTkU}GR`V4aj61|@jHjOd6bnTW>k9S J88|!o0RV@H4)g#3 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-2.values index 769fba71dfbda556bb39778a38525a72883007a9..44c3cdd1822d33f2c5e6ef21306d5cff3b75cc92 100644 GIT binary patch literal 59 zcmZQzU=VUF$o|^ z`33s>7I?T8Wfyyung9ib+&wb$q9W3K!`;)O3e$>QL$g5I^F4F@9aF0;Q;d9#eezTM E0TZJhDF6Tf diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-3.values index cd7e0b8995f319e32ec336349ddfedb329651cfa..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 22 dcmZQzU=Z>tEjG+_3eU?+@k&lKbaD?U2LL^S21x(_ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/0.keys index aa0911cde1b3f505ad3826463d058eb93073d245..65cab9c89bc4afaa67aa7cd2874ae76a7d826db4 100644 GIT binary patch literal 290 zcmYk0(F%ev6o$RlqBQ6cy6GlpnbDnOtfpp*O1#rDt!$W?g-_oZEb73=f41*uOp+w^ z?Ci$nz_jOSZtQ2}u$F$K!7977cw5DSI!K5vq{@v|Ei?a_Ap0T=k0vL^X|md}u^*UK z{wEdK8;BhC!LzQijk6GrKga11hJ$qGAuFzL?g8tsa4sr6QBlk-zSD>9yX-2|6q0{c xVLGZabCQtqt6Ff~2Go#Qffr$FClN8i$oLleARB-@98q#YkK-hS6Q4DpeE{yLE?58n literal 294 zcmYk1O%s7o6o&6QjgKt+0Xv)O-pGzjB8DU>JNhuXBGV9ly_2~!oSAo?cjh@~aS%d0 z&L~|JyL5b9O6WIDsGRyvaswAQwSEE#&}%2jzFBl4dow#B#rjWIp$kT&D2tw&OpW)M z(ARdjVjC@B9a7P=I1GGqe>bK~mEa*l`gr+{sW0Wg>|T95CmXg=9)8n(5+!pZ%?haA zw+{#A+rS!xe~#Cqk*8~`*wvWp02>evEA}iVdD!1GGXR!9@uqlk(#udz0`bV43#@+t DV?-__ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/0.metadata index 6706f4e809f3124225f0dd613d96ae60462e922f..8a8e7ddf335d17d4e6adec1aa63253577265132c 100644 GIT binary patch literal 37 scmZQzU|?ckU|{hqXQ|4(FS~2Ysw*W=r53eFtS$??^jlT{D96PJ0L)nn!vFvP literal 37 scmZQzU|?ckU|?}MqoWYwm^HPr?}h8Ex3O#z_UCr)Nep6O1WGah0Jb0sYXATM diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-0.values index b1192c27f06f30bea1c7b04ab908708d7cdd745f..12e110e188b249a888beeb1fc9118810c61e790a 100644 GIT binary patch literal 41 wcmZQzU=T{l_R02k%SrMp4$4S(j&d(9U|?Y2Hwkg~FmbE$2oDa;GtEy10O92ecK`qY literal 17 YcmZQzVBk$l@+wL%cXaZxF!Rm;03g)_U;qFB diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-1.values index b581776a29baec001797849ffca41d13fe49498b..a8d54a9950c17c5aaf1dcef7154230222f335894 100644 GIT binary patch literal 107 zcmZQzU=S=UHS~6V`{sp}Lc zquh%NfTH{+5uqW4DaCn#0VSSBPT4>qt{lT4vr=!9ROdjDHgCTSzjD9Iq~P=dgN&@= H#L5f+WLqA} diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-3.values index e631469b7987af89a9734fa9fb7c06298a5aed66..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 76 zcmZQzVBqnsvMe+W39Sf7%g$h6U=U6U^+*c$D+tQ-a?1@etx8GvjRXqw=M*^^`3F=) c6qGqyy1Nzuh4`FHi?j2S13hxwk|Rsp0S*5ZdjJ3c diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/1.keys index dc3e47642811823580477de2a25105f3cfddb333..c8ac100441749e970f09c8aa717005b254f7ae95 100644 GIT binary patch literal 366 zcmXw!T~mTU6o%-c zf*>}bva^&bA+7%^2*MSlKev!k66{zlFZJ2#_+lFcJpJnd+(qPuCY1wHzX(I`lTt5Q)@z>#L5fEEFcbJ}jteFmP|1LP&)SCJxve6+uC{L>ZS~zpqR8vL+`d?P+>J z2u*h3GE96`*$(S^<@5-lJAe)j81Ik6WhfeXp?mTP7HH&w8I6h7%UxqDYHheFiy$-x zM*25C2Tdwl*}o!0h5qFb^TSHXMvI7+vkd~6UOKxLWSEPdQ5Jqx=A!Rnmu-0jPXS>c zpN-a)PJ{ED#h>vmahtuvls=mtPZK}b*h$R8+>7Olf~_^{D(hTd z+10D0$jP#ESbG6K09p0Op+x`v3p{ literal 37 scmZQzU|?ckU|{)LWVXrYS7D|so1ahkYRg#?_UCr)SrVne2$W<10KkO`$p8QV diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-0.values index e7b7736fc0cf16846cb741a9b655bd90d0616645..a1fa22180a2634888f2ae79e819d357556b46c0c 100644 GIT binary patch literal 82 zcmZQzVBj_~DJZE(jx5Y8FJ)k0;0h`%_6TU@_3_4%QAADlRbmHlT-450zAG| hmW8Gvp%npX*%?5-K(&E501Bk#l$&{aWQ1l~_~k|c0FF-y4gdfE diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-1.values index 688921541979c0c19b740b489334a6da5f6ad5e3..98fbe59a9e4f7c9a8f867f4e3b9af4d0774a6663 100644 GIT binary patch literal 102 zcmZQzU=Z{xarO(0a&#^A%B%{^h=}lEU|xd)VkM9ovm0)za$-5s->-O^k=ay>$TqFhe7j^!yvu4NwO0GQ<* AC;$Ke literal 60 zcmZQzU=Z{+stC$-@(VQe^-D50O)++2U|`^J%L#WWO0P;S&L}Db@`atl3|&l|DvblO N(~?WV94!i59Ra?x59t5^ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-2.values index af1500f7c7b4dc63d550a9b011af28b619491010..ca0e85a50333946b1e54235a7b075cca859b2d44 100644 GIT binary patch literal 17 YcmZQzVBjtCOieT>^C=F@^C|EF03o3Sy8r+H literal 87 zcmZQzU=Z{z4KPSA^YsW$$~H9&w>0)+U|`_!Ep#;Wc5#YyH#PPK^0~u83`&Ci!VS&K myntM;pu%F0U>85HqzE8S(AeEH$T7{-B0My=FvK-5H3a}|=M@S7 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-3.values index a2cad8b576e6507d91b6e8f738d81d0fb7e72787..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 105 zcmZQzVBiYLGxAMO3<)rGVqjq4Ps&M-C@%@m4Rf-H$gU~_3UP%MDiISPL?3aw8(OE%hCXkTt5)6(A7D=JSZ)_$^fJ^urNI{-@~M+I5iyrh%X!6 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2.keys index a3304f056b69b2e74af19145959eb5b3eabd09fe..ed5b06dfb19e63096cfa62c7f5e294e7d2c8832b 100644 GIT binary patch literal 338 zcmYj~(N4lJ7)Bc}CkV`V=^GeB+TrSriCf(WREBi8vAgMz4Ow6r($S~)Us4mBoSdfT zONtQcIL+{R5m=t(hz&yM0%*^mHRn9o`i=d8&O7Uh> zHUAb}xc5~+Vz!)Sr5EK&a;p0c_!=;%+SWdiq@3$=2R4DLV(g|_Q71UFc%JLp0~^5L z1E2la+a1P}pEr4M(^L;`!R^Pr3OMs+1_1Ce?Bzq zSX8R@zTF4Oezq)0$17AC=zGmku0xbnN*GABteD)t4i@%|Jjyd&H~l231y3Uu3e^RA zN@Tc}y;TRh(s6|~(JxSO9`tBBF8NYS=Rrl(8@>jZOq0VXs{$19Mw$|f6SxkB?WYC@ViTWUlK}9YapNgbsHYeU*0H=e)q|HR)b|Y?8Xt!@Q$RNufc0ZBmI~(J2XyO^- dC%3@yiVB-#yBL{hImEz1t({Ddjf@d xGZI5GN<7`%a|4YM4JSy*@}?zu6{VLuI{8?bd1nAsaEFB$lmz>Q8=9AS0Ra8>8aDs{ delta 83 zcmXR;ooFZF%V*?aVpwi&Ss9VzmRym}z`($ppI1`mZRYBl<5v+{0u)>Q gCmL`6(72rg=F47=RHE literal 77 zcmZQzU=YZ52`w|T@W{0=Fn4oxan533VBkq{jz|wS3C;=6%gqP!`O8frN_`3pjoj1C d3c_=8fI>n>W=SS_9#x@9d2UHXiRsB^E&$xc6mI|k diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-2.values index 098182c3d5340aca76bb9c73f7413b1ffd8a1166..91d59f96e602397ce081944c498fe08aecd27888 100644 GIT binary patch literal 45 zcmZQzVBiWX$n{S*O)-m1WME+6jdHI_4=QypH8o9giv$XArA3yTTb2fRs^R5eW literal 76 zcmZQzVBiXkC`k&=&58^NVqjnpGB?RfNsr35tjzVT$jCD&E+_+udV5*s_?8=4lmr=P bnmShn`=Ea106dV_;z53$k!@jWCZ24of!m&MpOt2$`GYrKCq?TUO@!R%GNE m6c>~MMR_8soRR~4L!&B-DxE<30{s)60~3RS&CFAr!_5G%h8ENS literal 83 zcmZQzU=T7-DGLnp_jY&8a&}8|^~m)IVPIh3GVnGD@+=5Uata0VcuF%oE%W`#-J{C< hgMfVAz`!WWm;iX!cIhG9B{+{Hy6ivE|2k-<{mjD0& literal 577 zcmYk2+irqD5Qa&5XAff2_6eHw7C{Airv+LL9zkWfgNo&(A|ODaoHN%QutR zS%zWmoiH&Ml7Fb|%o(jkXnv%VNGK7V{xZ{4|KV|nR3+M0r5K5 z+w-SgYb$qSiBtiY4x~-^?!1?sMm$-_Rr*2oBM`gq#F;b9)2`v|!!OmL_6dk{ZXJB9uFfwzC%niuOjx07c%*(K}0Ey*$=K4FPR#~PP c`5OD=r}zWK_?<)CJjzNEGb%mv44fVP0QX=NcmMzZ literal 53 zcmZQzVBiZW4NFf7c5y4oOEgU>V_;z5O%5q6^!H0ED-CumDFF)b1z9+{Mwmwhhb5bO HXO{v1c}5PY diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-2.values index 01d8dda56d1a83b368db5d99e9f943ad53a63e1a..60f42b9e6126b0e2a1c279288e132c2bdf870623 100644 GIT binary patch literal 59 zcmZQzU=T73C~ynS_bGHONjDAj2}m;!WME+6@hx;T^mcKIbT>8j2J!{HjVgjNo%{k# Mef^TmO;e1W0H(MOc>n+a literal 19 acmZQzVBmN53dlDw%XZFBvG6d>%K-o-#{|*< diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-3.values index fc14618ca6b237bb4afce5023758a53d35ed7b14..1eab4a8104cf77b0e57d3b2e10316501f111ba9e 100644 GIT binary patch literal 101 zcmZQzU=T7gOESsxs0vNWb4w~pOiwm*VPIh3H!-p(wRCnhtBT4A%nx@53JK?@`8ihv z=R{SQn1lvoyIVLLm;i;j3VbWQ!(2Q=E2}_?oWl%VOq?o>1G3YSOTrv23S1olC+Zrq literal 22 dcmZQzU=WJP^ffdIs7Q4za4AoBF3%6o0RTGs266xZ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.keys index a44c53136c84350ba96b8d851e737dba0a3f3bb0..8433e98cab11b10d7165eb034e25c09dcbf4d3b0 100644 GIT binary patch literal 482 zcmXw#%Wi@|6oy%JrM99beS{|6!GNZ8RiHC93X0qmcS2DvUa$(NPv0|UoaE1+GvB$* za2&^PgR{EB{b?-JL2S5x9LGI@=;?wQ@(N#zWK>3dh#usHl7S}HwP$87VdNFO4Qk3> zal9dG?ARhhVE1;tOdypPp!_!?aZ)?PwLF$Wt6LymsiZuZB-i<|2p8i_V;qd5b6Zl8 z=aYK5Bb(`?J>9fNSvVdzi6xCvg-jr(`@YkAP-iy(DUrHgN9j7idYoaFK#O@$b332q zhUa5qIt;ymcRCkq7#F@M;H5Ay&IUh2tfZz8W38}l=t0;?v z4P&$~9oaQZ{YHH34~>uO;pW%Uf@OSxH$eR0BKHeF)~qPUiXDcGe}dD$?s}KAUanAj Q!mFiP>ezhz34MR>A5ivBn*aa+ literal 331 zcmYk1+irqD5Qg`nSGCmQ3wY5NP?r?AYk;L&VSy4|R_{C{MKM;h^#D)rtXUE#`SVZa zo6G?r)Gg<(NE7R76`ON5#t5M&kcwB(+rF`b1jm#Ya!WEEK&|BlY_eKU2LptxpB%sMq4KgH5`I>K<3eNLS{!1XG3?iEbNtTcn81#>!#m7 f)v6|Qix0}*@kH}a&0nOzoZ-W|I8EBGa$x2SptUs6 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.metadata index c2566987d842033a0f61d2f870cf779682aa4122..7971d6f7614f7829110262d875bb65d8e0322d05 100644 GIT binary patch literal 37 scmZQzU|?ckU|_MC_1#&bW)ki2Z%!Tz>wXdA(01?9c7oyV9M55h%$30INC*C;$Ke diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-0.values index f4e56928dfcc09920cae0fe68386569a5ec3c8ab..82b669d005f1ab6cf13e0f4f4cdefd4be63047e3 100644 GIT binary patch literal 69 zcmZQzU=Z*O$#)C$Ei6woD$fs0E6!kGVBk#-DJ=B&ODii4b}T6Y3UHMr24v;BR2b$2 V0C{}QrN!C#$$=g@Zpo1)?f{#x6Y>B6 literal 112 zcmZQzVBjtCOieT>^C=F@^C|FQU|nEy^zTDm4KK8oQeYIi{If zgoox9hPVc%rT_(ny!|r#%Ka*ng3}8OGO~&jD>Hzid?BS_=}EyZZY6n%rYU6rV?P|E literal 35 qcmZQzVBj_~DJZE(jx5Y8FJ)k05HK=xi_8tk%8o2HHO$Mfv;Y8_oe6gU diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-2.values index 91d34a9bc93f40b2f371f6cedf4c9e64ae3e7440..dc8b7042120dd0ff077100e6a75c7fdadb8c109b 100644 GIT binary patch literal 52 zcmZQzVBiV#FiI&5N~!WN4=Z9|VBif5jIvBF3~((p3JVJY3h;aRL>X3Q6_iE>Mz{qP Gy8{49HVwQ0 literal 20 bcmZQzU=VOD%C5BV%};aBE_2Or^GgN*GH(UW diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-3.values index 564dd6775bf9ef604cecbfd2872e96f5e2dab5f1..7b0731a3ee1b654659ffcceeee00e7cb7d3aa9dd 100644 GIT binary patch literal 94 zcmZQzVBk&5DL3=<$Oz4}@XL*2U|`_SDRMIM52%PJD08%QcP#=5m77GA`V<%%xu=^I sgy-Y{g@lUo&3$u1LtMN{j4PepO*}0tfTFy`l~I9yl|?4zC1D;W0F4J3XaE2J literal 36 rcmZQzVBj|~vM9B5b~USt$_dO5cV}Q=;4Q9<3iPWiGBGa+^DqGbmR|`* diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5.keys index b1379d1daa960130305751ef76bde19f403e79df..12b77bafcc4563642df83315c6ecdc2b5d41dda7 100644 GIT binary patch literal 527 zcmYk3OK*Ze6ouJz(@^ozKhUI2x~wu3Ty!Cb=m!6wbHWe9?B2VzSE)vZWTMyeJMtZRyr((AZT{Yz9~|KRjm0E-y{bgYi>-I-<*Gd*ICAp7l*?b1<~%}Zf5>b;Q=<^El?;W-p@{2 wKF$+L>2l8l4mf)?vCN#TBP(dtE(m8bcm*VF7Hxk#LIv{ZgpF literal 338 zcmYk2Ur&QD6vg}E%gmh2FX7{0WsVmUfetg7l}#e^!GsY0bW@NqTE?gM)^y35+?>;% zUvh4W5YiIEotstdu+4%`G3EjxbOj^NwVZN>`)}LIUyggYo}*jvgPE-h5w3Rci;H9g ze%$}O`mV=l6HWTw@AA64Aco+FYu(_Dn-hyaZweJ^pm#8uGySYtWU8ha#^|NEC-jtS$??lF4xcC@07W0MGFYod5s; literal 37 scmZQzU|?ckU|?ZyOqu6iy+gZ@E&OND!;exD_UCr)y}fh-BT$k70Kaz&=Kufz diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-0.values index 65fd4613e5f66cc7c050a107d0c9585edd2f1202..a35d9087954b433de41ecdaeea41426b828bd34e 100644 GIT binary patch literal 17 YcmZQzVBpQqD=G6fb9K$}s|YOt03z4~+W-In literal 104 zcmZQzU=T73C~ynS_bGHONjDAj2}m;!WME+6HV(IRFD-XBj_@!5a)lgAvNIyhQk`7N zy|MzFEh7uTqE)U1nIVydzInbTj;;lPsmaAawZbOZE=Hzd-d^sJAzl%F!O2C@N%NVBj?=$xF#E3Nwt%Dao$_3J52KdL)JW6$IsZx#b3# KR;8r-Mgjo2CJ>nb literal 77 zcmZQzU=TDdbV;)eNjI?Y_bB(TEJ_MvU|`@Wt0+%4&NC?~Dl~Qh^7&0d+&xU(syxDj dL-S1YlYv5lekIO+fl-dGrCym;ff*4IJ^%!B6!!oC diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-2.values index 03c60030aa508fc663183e69621bbb292400fda7..3573e68e11010a924dad5ac0c989000416ba51ce 100644 GIT binary patch literal 110 zcmZQzU=Yp^_RA>5+_DSGax4QJ zJ%L<7v$CiRGbalZ17AOja0}Oz3Xqx-<0@AJce9AFFn1tVsLHhwj76-nnkRHlrfPI z)FaSVgAqyv+muzJhGb8z#3iJg;2WIvJSaJ%COU$1OJ6IG=|3fyfRd-tO?a zH998f`zPD&C5zZsVtedq8tS3Rl&732f?-Dd$IWLAFD?di#aR`xq&p(28k literal 392 zcmYk1PfvqD5XJZ8!P1}-^%Lls0=f`S0!3P=AXq?dN-31|4@D@*r+3yYiJQE<$^2%r zZxBKwX;~h7!L@vEf)F|bk#_~U=p8ZAm)2@$gn8fEGV}({LCwbEY+6}%T={ic2>2gn zp&qAZo;krDN3nV;DZBw6fjDb##<}iF)3o2cCgx-NY0wccbO{;@fwBI;KVkTgOus3- z24~2?W)a|;S8XFNJ>=Pw#%_oNSEwJny4jm0J&-lSO5S3 literal 37 scmZQzU|?ckU|?xf5Z`w+AQ1DX_~rT*gt-R<7KCOehq^+gb$~P%5DOTEm*u#GmpN6s kIc9md`n+a diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/7.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/7.metadata index a7c788777cc77f75f7bee7b05ea623886c90fe47..a962c20776faa3f5f2e97ea340e5dfecf2d8e49a 100644 GIT binary patch literal 37 scmZQzU|?ckU|`9gbf>1JFnIgZ=lPGG?n!r+SX~x&<(*XnP>z8S0QRO0(*OVf literal 37 scmZQzU|?ckU|?a6zv86Ry3_v8hxC|R&aTHK?9c7o7o}ss2$W<10LG#VQUCw| From 366b06ece802a63a1aef68a619aa759690cefdf6 Mon Sep 17 00:00:00 2001 From: Cody Littley Date: Fri, 1 May 2026 11:57:50 -0500 Subject: [PATCH 2/3] change address format --- sei-db/db_engine/litt/disktable/disk_table.go | 4 + .../litt/disktable/keymap/keymap_test.go | 21 +- .../litt/disktable/keymap/pebble_db_keymap.go | 8 +- .../litt/disktable/segment/address_test.go | 233 +++++++++++++++++- .../litt/disktable/segment/key_file.go | 47 ++-- .../litt/disktable/segment/key_file_test.go | 36 ++- .../litt/disktable/segment/segment.go | 14 +- .../litt/disktable/segment/segment_version.go | 6 +- .../db_engine/litt/littbuilder/build_utils.go | 4 + sei-db/db_engine/litt/littdb_config.go | 9 +- sei-db/db_engine/litt/littdb_config_test.go | 37 +++ .../testdata/v2/test/keymap/data/000002.log | Bin 2687 -> 0 bytes .../test/testdata/v2/test/segments/0-0.values | Bin 35 -> 0 bytes .../test/testdata/v2/test/segments/0-1.values | Bin 103 -> 0 bytes .../test/testdata/v2/test/segments/0-2.values | Bin 59 -> 0 bytes .../test/testdata/v2/test/segments/0.keys | Bin 290 -> 0 bytes .../test/testdata/v2/test/segments/0.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/1-0.values | Bin 41 -> 0 bytes .../test/testdata/v2/test/segments/1-1.values | Bin 107 -> 0 bytes .../test/testdata/v2/test/segments/1-2.values | Bin 70 -> 0 bytes .../test/testdata/v2/test/segments/1.keys | Bin 366 -> 0 bytes .../test/testdata/v2/test/segments/1.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/2-0.values | Bin 82 -> 0 bytes .../test/testdata/v2/test/segments/2-1.values | Bin 102 -> 0 bytes .../test/testdata/v2/test/segments/2-2.values | Bin 17 -> 0 bytes .../test/testdata/v2/test/segments/2.keys | Bin 338 -> 0 bytes .../test/testdata/v2/test/segments/2.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/3-0.values | Bin 115 -> 0 bytes .../test/testdata/v2/test/segments/3-1.values | Bin 67 -> 0 bytes .../test/testdata/v2/test/segments/3-2.values | Bin 45 -> 0 bytes .../test/testdata/v2/test/segments/3-3.values | Bin 88 -> 0 bytes .../test/testdata/v2/test/segments/3.keys | Bin 532 -> 0 bytes .../test/testdata/v2/test/segments/3.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/4-0.values | Bin 75 -> 0 bytes .../test/testdata/v2/test/segments/4-1.values | Bin 77 -> 0 bytes .../test/testdata/v2/test/segments/4-2.values | Bin 59 -> 0 bytes .../test/testdata/v2/test/segments/4-3.values | Bin 101 -> 0 bytes .../test/testdata/v2/test/segments/4.keys | Bin 482 -> 0 bytes .../test/testdata/v2/test/segments/4.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/5-0.values | Bin 69 -> 0 bytes .../test/testdata/v2/test/segments/5-1.values | Bin 101 -> 0 bytes .../test/testdata/v2/test/segments/5-2.values | Bin 52 -> 0 bytes .../test/testdata/v2/test/segments/5-3.values | Bin 94 -> 0 bytes .../test/testdata/v2/test/segments/5.keys | Bin 527 -> 0 bytes .../test/testdata/v2/test/segments/5.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/6-0.values | Bin 17 -> 0 bytes .../test/testdata/v2/test/segments/6-1.values | Bin 56 -> 0 bytes .../test/testdata/v2/test/segments/6-2.values | Bin 110 -> 0 bytes .../test/testdata/v2/test/segments/6-3.values | Bin 93 -> 0 bytes .../test/testdata/v2/test/segments/6.keys | Bin 480 -> 0 bytes .../test/testdata/v2/test/segments/6.metadata | Bin 37 -> 0 bytes .../test/testdata/v2/test/segments/7-0.values | 0 .../test/testdata/v2/test/segments/7-1.values | 0 .../test/testdata/v2/test/segments/7.keys | 0 .../test/testdata/v2/test/segments/7.metadata | Bin 37 -> 0 bytes .../testdata/v3/test/keymap/data/000002.log | Bin 0 -> 3210 bytes .../testdata/{v2 => v3}/test/keymap/data/LOCK | 0 .../test/keymap/data/MANIFEST-000001 | Bin .../test/keymap/data/OPTIONS-000003 | 0 .../data/marker.format-version.000001.013 | 0 .../marker.manifest.000001.MANIFEST-000001 | 0 .../{v2 => v3}/test/keymap/initialized | 0 .../{v2 => v3}/test/keymap/keymap-type.txt | 0 .../test/testdata/v3/test/segments/0-0.values | Bin 0 -> 68 bytes .../test/testdata/v3/test/segments/0-1.values | Bin 0 -> 107 bytes .../test/testdata/v3/test/segments/0-2.values | Bin 0 -> 30 bytes .../test/testdata/v3/test/segments/0-3.values | Bin 0 -> 77 bytes .../test/testdata/v3/test/segments/0.keys | Bin 0 -> 494 bytes .../test/testdata/v3/test/segments/0.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/1-0.values | Bin 0 -> 14 bytes .../test/testdata/v3/test/segments/1-1.values | Bin 0 -> 103 bytes .../test/testdata/v3/test/segments/1-2.values | Bin 0 -> 34 bytes .../test/testdata/v3/test/segments/1-3.values | Bin 0 -> 71 bytes .../test/testdata/v3/test/segments/1.keys | Bin 0 -> 420 bytes .../test/testdata/v3/test/segments/1.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/2-0.values | Bin 0 -> 99 bytes .../test/testdata/v3/test/segments/2-1.values | Bin 0 -> 79 bytes .../test/testdata/v3/test/segments/2-2.values | Bin 0 -> 19 bytes .../test/testdata/v3/test/segments/2-3.values | Bin 0 -> 114 bytes .../test/testdata/v3/test/segments/2.keys | Bin 0 -> 501 bytes .../test/testdata/v3/test/segments/2.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/3-0.values | Bin 0 -> 102 bytes .../test/testdata/v3/test/segments/3-1.values | Bin 0 -> 62 bytes .../test/testdata/v3/test/segments/3-2.values | Bin 0 -> 48 bytes .../test/testdata/v3/test/segments/3-3.values | Bin 0 -> 62 bytes .../test/testdata/v3/test/segments/3.keys | Bin 0 -> 455 bytes .../test/testdata/v3/test/segments/3.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/4-0.values | Bin 0 -> 60 bytes .../test/testdata/v3/test/segments/4-1.values | Bin 0 -> 114 bytes .../test/segments/4-2.values} | 0 .../test/testdata/v3/test/segments/4-3.values | Bin 0 -> 74 bytes .../test/testdata/v3/test/segments/4.keys | Bin 0 -> 399 bytes .../test/testdata/v3/test/segments/4.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/5-0.values | Bin 0 -> 74 bytes .../test/testdata/v3/test/segments/5-1.values | Bin 0 -> 119 bytes .../test/testdata/v3/test/segments/5-2.values | Bin 0 -> 53 bytes .../test/testdata/v3/test/segments/5-3.values | Bin 0 -> 79 bytes .../test/testdata/v3/test/segments/5.keys | Bin 0 -> 560 bytes .../test/testdata/v3/test/segments/5.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/6-0.values | Bin 0 -> 36 bytes .../test/segments/6-1.values} | 0 .../test/testdata/v3/test/segments/6-2.values | Bin 0 -> 104 bytes .../test/segments/6-3.values} | 0 .../test/testdata/v3/test/segments/6.keys | Bin 0 -> 225 bytes .../test/testdata/v3/test/segments/6.metadata | Bin 0 -> 37 bytes .../test/testdata/v3/test/segments/7-0.values | Bin 0 -> 15 bytes .../test/testdata/v3/test/segments/7-1.values | Bin 0 -> 18 bytes .../{v2 => v3}/test/segments/7-2.values | 0 .../{v2 => v3}/test/segments/7-3.values | 0 .../test/testdata/v3/test/segments/7.keys | Bin 0 -> 61 bytes .../test/testdata/v3/test/segments/7.metadata | Bin 0 -> 37 bytes .../testdata/{v2 => v3}/test/table.metadata | Bin sei-db/db_engine/litt/types/address.go | 78 ++++-- sei-db/db_engine/litt/types/scoped_key.go | 5 +- 114 files changed, 414 insertions(+), 88 deletions(-) create mode 100644 sei-db/db_engine/litt/littdb_config_test.go delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/000002.log delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/0-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/0-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/0-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/0.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/0.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/1-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/1-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/1-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/1.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/1.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/2-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/2-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/2-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/2.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/2.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/3-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/3-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/3-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/3-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/3.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/3.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/4-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/4-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/4-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/4-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/4.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/4.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/5-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/5-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/5-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/5-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/5.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/5.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/6-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/6-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/6-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/6-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/6.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/6.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/7-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/7-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/7.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v2/test/segments/7.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/000002.log rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/data/LOCK (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/data/MANIFEST-000001 (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/data/OPTIONS-000003 (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/data/marker.format-version.000001.013 (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/data/marker.manifest.000001.MANIFEST-000001 (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/initialized (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/keymap/keymap-type.txt (100%) create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/0-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/0-1.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/0-2.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/0-3.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/0.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/0.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/1-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/1-1.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/1-2.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/1-3.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/1.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/1.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/2-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/2-1.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/2-2.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/2-3.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/2.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/2.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/3-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/3-1.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/3-2.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/3-3.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/3.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/3.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/4-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/4-1.values rename sei-db/db_engine/litt/test/testdata/{v2/test/segments/0-3.values => v3/test/segments/4-2.values} (100%) create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/4-3.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/4.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/4.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-1.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-2.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-3.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6-0.values rename sei-db/db_engine/litt/test/testdata/{v2/test/segments/1-3.values => v3/test/segments/6-1.values} (100%) create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6-2.values rename sei-db/db_engine/litt/test/testdata/{v2/test/segments/2-3.values => v3/test/segments/6-3.values} (100%) create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6.metadata create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7-0.values create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7-1.values rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/segments/7-2.values (100%) rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/segments/7-3.values (100%) create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7.keys create mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7.metadata rename sei-db/db_engine/litt/test/testdata/{v2 => v3}/test/table.metadata (100%) diff --git a/sei-db/db_engine/litt/disktable/disk_table.go b/sei-db/db_engine/litt/disktable/disk_table.go index 1d759b1564..b96f9f1fa9 100644 --- a/sei-db/db_engine/litt/disktable/disk_table.go +++ b/sei-db/db_engine/litt/disktable/disk_table.go @@ -635,6 +635,10 @@ func (d *DiskTable) SetShardingFactor(shardingFactor uint32) error { if shardingFactor == 0 { return fmt.Errorf("sharding factor must be greater than 0") } + if shardingFactor > litt.MaxShardingFactor { + return fmt.Errorf("sharding factor must be at most %d, got %d", + litt.MaxShardingFactor, shardingFactor) + } request := &controlLoopSetShardingFactorRequest{ shardingFactor: shardingFactor, diff --git a/sei-db/db_engine/litt/disktable/keymap/keymap_test.go b/sei-db/db_engine/litt/disktable/keymap/keymap_test.go index a81ecdbc73..9cb0911b73 100644 --- a/sei-db/db_engine/litt/disktable/keymap/keymap_test.go +++ b/sei-db/db_engine/litt/disktable/keymap/keymap_test.go @@ -38,6 +38,15 @@ func buildPebbleDBKeymap(logger *slog.Logger, path string) (Keymap, error) { return kmap, nil } +func randomAddress(rand *util.TestRandom) types.Address { + return types.NewAddress( + rand.Uint32(), + rand.Uint32(), + uint8(rand.Uint32Range(0, 256)), + rand.Uint32(), + ) +} + func testBasicBehavior(t *testing.T, keymap Keymap) { rand := util.NewTestRandom() @@ -49,7 +58,7 @@ func testBasicBehavior(t *testing.T, keymap Keymap) { if choice < 0.5 { // Write a random value key := []byte(rand.String(32)) - address := types.Address(rand.Uint64()) + address := randomAddress(rand) err := keymap.Put([]*types.ScopedKey{{Key: key, Address: address}}) require.NoError(t, err) @@ -78,7 +87,7 @@ func testBasicBehavior(t *testing.T, keymap Keymap) { pairs := make([]*types.ScopedKey, numberToWrite) for i := 0; i < int(numberToWrite); i++ { key := []byte(rand.String(32)) - address := types.Address(rand.Uint64()) + address := randomAddress(rand) pairs[i] = &types.ScopedKey{Key: key, Address: address} expected[string(key)] = address } @@ -150,7 +159,7 @@ func TestRestart(t *testing.T) { if choice < 0.5 { // Write a random value key := []byte(rand.String(32)) - address := types.Address(rand.Uint64()) + address := randomAddress(rand) err := keymap.Put([]*types.ScopedKey{{Key: key, Address: address}}) require.NoError(t, err) @@ -179,7 +188,7 @@ func TestRestart(t *testing.T) { pairs := make([]*types.ScopedKey, numberToWrite) for i := 0; i < int(numberToWrite); i++ { key := []byte(rand.String(32)) - address := types.Address(rand.Uint64()) + address := randomAddress(rand) pairs[i] = &types.ScopedKey{Key: key, Address: address} expected[string(key)] = address } @@ -225,7 +234,7 @@ func TestRestart(t *testing.T) { if choice < 0.5 { // Write a random value key := []byte(rand.String(32)) - address := types.Address(rand.Uint64()) + address := randomAddress(rand) err := keymap.Put([]*types.ScopedKey{{Key: key, Address: address}}) require.NoError(t, err) @@ -254,7 +263,7 @@ func TestRestart(t *testing.T) { pairs := make([]*types.ScopedKey, numberToWrite) for i := 0; i < int(numberToWrite); i++ { key := []byte(rand.String(32)) - address := types.Address(rand.Uint64()) + address := randomAddress(rand) pairs[i] = &types.ScopedKey{Key: key, Address: address} expected[string(key)] = address } diff --git a/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go b/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go index 222f67848c..40e2bb88cb 100644 --- a/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go +++ b/sei-db/db_engine/litt/disktable/keymap/pebble_db_keymap.go @@ -133,19 +133,19 @@ func (p *PebbleDBKeymap) Get(key []byte) (types.Address, bool, error) { val, closer, err := p.db.Get(key) if err != nil { if errors.Is(err, pebble.ErrNotFound) { - return 0, false, nil + return types.Address{}, false, nil } - return 0, false, fmt.Errorf("failed to get key from PebbleDB: %w", err) + return types.Address{}, false, fmt.Errorf("failed to get key from PebbleDB: %w", err) } // Clone the bytes before closing, since the slice is only valid until closer.Close(). cloned := bytes.Clone(val) if cerr := closer.Close(); cerr != nil { - return 0, false, fmt.Errorf("failed to close PebbleDB get closer: %w", cerr) + return types.Address{}, false, fmt.Errorf("failed to close PebbleDB get closer: %w", cerr) } address, err := types.DeserializeAddress(cloned) if err != nil { - return 0, false, fmt.Errorf("failed to deserialize address: %w", err) + return types.Address{}, false, fmt.Errorf("failed to deserialize address: %w", err) } return address, true, nil diff --git a/sei-db/db_engine/litt/disktable/segment/address_test.go b/sei-db/db_engine/litt/disktable/segment/address_test.go index 47ffcfa4cf..bed7a2d576 100644 --- a/sei-db/db_engine/litt/disktable/segment/address_test.go +++ b/sei-db/db_engine/litt/disktable/segment/address_test.go @@ -3,6 +3,8 @@ package segment import ( + "encoding/binary" + "math" "testing" "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/types" @@ -10,14 +12,241 @@ import ( "github.com/stretchr/testify/require" ) -func TestAddress(t *testing.T) { +// randomAddress builds an Address with each field independently randomized over its full domain. +func randomAddress(rand *util.TestRandom) types.Address { + return types.NewAddress( + rand.Uint32(), + rand.Uint32(), + uint8(rand.Uint32Range(0, 256)), + rand.Uint32(), + ) +} + +// assertRoundTrip serializes the input, deserializes the result, and asserts equality in both directions. +func assertRoundTrip(t *testing.T, address types.Address) { + t.Helper() + + serialized := address.Serialize() + require.Len(t, serialized, types.AddressSerializedSize) + + deserialized, err := types.DeserializeAddress(serialized) + require.NoError(t, err) + require.Equal(t, address, deserialized) + + // Going the other direction (bytes -> Address -> bytes) should also be stable. + reserialized := deserialized.Serialize() + require.Equal(t, serialized, reserialized) +} + +func TestAddressGetters(t *testing.T) { t.Parallel() rand := util.NewTestRandom() index := rand.Uint32() offset := rand.Uint32() - address := types.NewAddress(index, offset) + shardID := uint8(rand.Uint32Range(0, 256)) + valueSize := rand.Uint32() + address := types.NewAddress(index, offset, shardID, valueSize) require.Equal(t, index, address.Index()) require.Equal(t, offset, address.Offset()) + require.Equal(t, shardID, address.ShardID()) + require.Equal(t, valueSize, address.ValueSize()) +} + +// TestAddressZeroValueRoundTrip verifies that the zero Address (which is what callers see for keymap misses) +// roundtrips cleanly through serialize/deserialize. +func TestAddressZeroValueRoundTrip(t *testing.T) { + t.Parallel() + + zero := types.Address{} + require.Equal(t, uint32(0), zero.Index()) + require.Equal(t, uint32(0), zero.Offset()) + require.Equal(t, uint8(0), zero.ShardID()) + require.Equal(t, uint32(0), zero.ValueSize()) + + serialized := zero.Serialize() + require.Len(t, serialized, types.AddressSerializedSize) + for i, b := range serialized { + require.Equal(t, byte(0), b, "byte %d should be zero", i) + } + + deserialized, err := types.DeserializeAddress(serialized) + require.NoError(t, err) + require.Equal(t, zero, deserialized) +} + +// TestAddressBoundaryRoundTrips covers the corners of the value domain to make sure +// no field-truncation or sign-extension bugs sneak in. +func TestAddressBoundaryRoundTrips(t *testing.T) { + t.Parallel() + + cases := []types.Address{ + types.NewAddress(0, 0, 0, 0), + types.NewAddress(math.MaxUint32, math.MaxUint32, math.MaxUint8, math.MaxUint32), + types.NewAddress(math.MaxUint32, 0, 0, 0), + types.NewAddress(0, math.MaxUint32, 0, 0), + types.NewAddress(0, 0, math.MaxUint8, 0), + types.NewAddress(0, 0, 0, math.MaxUint32), + types.NewAddress(1, 2, 3, 4), + types.NewAddress(math.MaxUint32, 0, math.MaxUint8, 0), + types.NewAddress(0, math.MaxUint32, 0, math.MaxUint32), + } + + for i, addr := range cases { + addr := addr + t.Run("", func(t *testing.T) { + t.Parallel() + assertRoundTrip(t, addr) + require.NotPanicsf(t, func() { _ = addr.String() }, "case %d", i) + }) + } +} + +// TestAddressAllShardIDsRoundTrip exhaustively covers every legal shard ID (0..255) so that we know +// the single byte slot is wired up for every value it can take. +func TestAddressAllShardIDsRoundTrip(t *testing.T) { + t.Parallel() + rand := util.NewTestRandom() + + for shard := 0; shard < 256; shard++ { + address := types.NewAddress(rand.Uint32(), rand.Uint32(), uint8(shard), rand.Uint32()) + assertRoundTrip(t, address) + require.Equal(t, uint8(shard), address.ShardID()) + } +} + +// TestAddressRandomRoundTrips fuzzes the round trip with a large batch of independently random addresses. +func TestAddressRandomRoundTrips(t *testing.T) { + t.Parallel() + rand := util.NewTestRandom() + + for i := 0; i < 1000; i++ { + assertRoundTrip(t, randomAddress(rand)) + } +} + +// TestAddressSerializeWireFormat pins down the on-disk byte layout so an accidental change to the wire format +// is caught by tests rather than by silently corrupting persisted data. +func TestAddressSerializeWireFormat(t *testing.T) { + t.Parallel() + + const ( + index uint32 = 0x01020304 + offset uint32 = 0x05060708 + shardID uint8 = 0x09 + valueSize uint32 = 0x0A0B0C0D + ) + + expected := []byte{ + 0x01, 0x02, 0x03, 0x04, // index + 0x05, 0x06, 0x07, 0x08, // offset + 0x09, // shardID + 0x0A, 0x0B, 0x0C, 0x0D, // valueSize + } + require.Len(t, expected, types.AddressSerializedSize) + + address := types.NewAddress(index, offset, shardID, valueSize) + require.Equal(t, expected, address.Serialize()) + + deserialized, err := types.DeserializeAddress(expected) + require.NoError(t, err) + require.Equal(t, address, deserialized) +} + +// TestAddressDeserializeSerializeRoundTrip confirms that arbitrary 13-byte buffers are stable when +// fed through deserialize → serialize. +func TestAddressDeserializeSerializeRoundTrip(t *testing.T) { + t.Parallel() + rand := util.NewTestRandom() + + for i := 0; i < 1000; i++ { + raw := rand.Bytes(types.AddressSerializedSize) + + address, err := types.DeserializeAddress(raw) + require.NoError(t, err) + + require.Equal(t, raw, address.Serialize()) + + // Sanity: every byte is reachable through one of the getters and big-endian decoding. + require.Equal(t, binary.BigEndian.Uint32(raw[0:4]), address.Index()) + require.Equal(t, binary.BigEndian.Uint32(raw[4:8]), address.Offset()) + require.Equal(t, raw[8], address.ShardID()) + require.Equal(t, binary.BigEndian.Uint32(raw[9:13]), address.ValueSize()) + } +} + +// TestAddressSerializeReturnsFreshBuffer guards against a future "optimization" that returns a shared +// underlying array, which would silently cause callers (e.g. the key file writer) to see corrupted data +// if they retain the slice across calls. +func TestAddressSerializeReturnsFreshBuffer(t *testing.T) { + t.Parallel() + rand := util.NewTestRandom() + + address := randomAddress(rand) + + first := address.Serialize() + second := address.Serialize() + require.Equal(t, first, second) + + // Mutating the first slice must not affect a subsequent serialization, nor the Address itself. + original := append([]byte{}, first...) + for i := range first { + first[i] ^= 0xFF + } + + require.Equal(t, original, second, "second serialization should not share memory with the first") + require.Equal(t, original, address.Serialize(), "third serialization should match the original bytes") +} + +// TestAddressDeserializeIsIndependentOfInput guards against deserialize aliasing the caller-owned input +// slice. Mutating the source bytes after Deserialize returns must not perturb the resulting Address. +func TestAddressDeserializeIsIndependentOfInput(t *testing.T) { + t.Parallel() + rand := util.NewTestRandom() + + source := rand.Bytes(types.AddressSerializedSize) + address, err := types.DeserializeAddress(source) + require.NoError(t, err) + + expected := address + for i := range source { + source[i] ^= 0xFF + } + + require.Equal(t, expected, address) +} + +// TestDeserializeAddressLengthError checks that DeserializeAddress rejects every length that is not exactly +// AddressSerializedSize, including the legacy 8-byte address length. +func TestDeserializeAddressLengthError(t *testing.T) { + t.Parallel() + + badLengths := []int{ + 0, + 1, + 8, // the pre-refactor uint64 length, included as a regression guard + types.AddressSerializedSize - 1, + types.AddressSerializedSize + 1, + 32, + 1024, + } + + for _, badLength := range badLengths { + _, err := types.DeserializeAddress(make([]byte, badLength)) + require.Errorf(t, err, "expected error for length %d", badLength) + } +} + +// TestAddressString provides smoke coverage for the String formatter so that the human-readable form +// is at least guaranteed to mention every field. +func TestAddressString(t *testing.T) { + t.Parallel() + + address := types.NewAddress(11, 22, 33, 44) + s := address.String() + + for _, want := range []string{"11", "22", "33", "44"} { + require.Contains(t, s, want, "String() = %q should contain %q", s, want) + } } diff --git a/sei-db/db_engine/litt/disktable/segment/key_file.go b/sei-db/db_engine/litt/disktable/segment/key_file.go index 482b51617c..e77160e362 100644 --- a/sei-db/db_engine/litt/disktable/segment/key_file.go +++ b/sei-db/db_engine/litt/disktable/segment/key_file.go @@ -63,7 +63,7 @@ func createKeyFile( logger: logger, index: index, segmentPath: segmentPath, - segmentVersion: ValueSizeSegmentVersion, + segmentVersion: LatestSegmentVersion, swap: swap, } @@ -189,23 +189,16 @@ func (k *keyFile) write(scopedKey *types.ScopedKey) error { return fmt.Errorf("failed to write key to key file: %w", err) } - // Write the address. - err = binary.Write(k.writer, binary.BigEndian, scopedKey.Address) + // Write the serialized address (which includes the shard ID and value size). + _, err = k.writer.Write(scopedKey.Address.Serialize()) if err != nil { return fmt.Errorf("failed to write address to key file: %w", err) } - // Write the size of the value. - err = binary.Write(k.writer, binary.BigEndian, scopedKey.ValueSize) - if err != nil { - return fmt.Errorf("failed to write value size to key file: %w", err) - } - k.size += uint64( 4 /* uint32 size of key */ + len(scopedKey.Key) + - 8 /* uint64 address */ + - 4 /* uint32 size of value */) + types.AddressSerializedSize) return nil } @@ -284,36 +277,24 @@ func (k *keyFile) readKeys() ([]*types.ScopedKey, error) { keyLength := int(binary.BigEndian.Uint32(keyBytes[index : index+4])) index += 4 - if k.segmentVersion < ValueSizeSegmentVersion { - // We need to read the key, as well as the 8 byte address. - if index+keyLength+8 > len(keyBytes) { - // There are insufficient bytes left in the file to read the key and address. - break - } - } else { - // We need to read the key, as well as the 8 byte address and 4 byte value size. - if index+keyLength+12 > len(keyBytes) { - // There are insufficient bytes left in the file to read the key, address, and value size. - break - } + // We need to read the key, as well as the serialized address (which embeds the shard ID and value size). + if index+keyLength+types.AddressSerializedSize > len(keyBytes) { + // There are insufficient bytes left in the file to read the key and address. + break } key := keyBytes[index : index+keyLength] index += keyLength - address := types.Address(binary.BigEndian.Uint64(keyBytes[index : index+8])) - index += 8 - - var valueSize uint32 - if k.segmentVersion >= ValueSizeSegmentVersion { - valueSize = binary.BigEndian.Uint32(keyBytes[index : index+4]) - index += 4 + address, err := types.DeserializeAddress(keyBytes[index : index+types.AddressSerializedSize]) + if err != nil { + return nil, fmt.Errorf("failed to deserialize address: %w", err) } + index += types.AddressSerializedSize keys = append(keys, &types.ScopedKey{ - Key: key, - Address: address, - ValueSize: valueSize, + Key: key, + Address: address, }) } diff --git a/sei-db/db_engine/litt/disktable/segment/key_file_test.go b/sei-db/db_engine/litt/disktable/segment/key_file_test.go index 3a08604f5e..7c78a3b16f 100644 --- a/sei-db/db_engine/litt/disktable/segment/key_file_test.go +++ b/sei-db/db_engine/litt/disktable/segment/key_file_test.go @@ -25,9 +25,13 @@ func TestReadWriteKeys(t *testing.T) { keys := make([]*types.ScopedKey, keyCount) for i := 0; i < int(keyCount); i++ { key := rand.VariableBytes(1, 100) - address := types.Address(rand.Uint64()) - valueSize := rand.Uint32() - keys[i] = &types.ScopedKey{Key: key, Address: address, ValueSize: valueSize} + address := types.NewAddress( + rand.Uint32(), + rand.Uint32(), + uint8(rand.Uint32Range(0, 256)), + rand.Uint32(), + ) + keys[i] = &types.ScopedKey{Key: key, Address: address} } segmentPath, err := NewSegmentPath(directory, "", "table") @@ -65,7 +69,7 @@ func TestReadWriteKeys(t *testing.T) { } // Create a new in-memory instance from the on-disk file and verify that it behaves the same. - file2, err := loadKeyFile(logger, index, []*SegmentPath{segmentPath}, ValueSizeSegmentVersion) + file2, err := loadKeyFile(logger, index, []*SegmentPath{segmentPath}, LatestSegmentVersion) require.NoError(t, err) require.Equal(t, file.Size(), file2.Size()) @@ -99,9 +103,13 @@ func TestReadingTruncatedKeyFile(t *testing.T) { keys := make([]*types.ScopedKey, keyCount) for i := 0; i < int(keyCount); i++ { key := rand.VariableBytes(1, 100) - address := types.Address(rand.Uint64()) - valueSize := rand.Uint32() - keys[i] = &types.ScopedKey{Key: key, Address: address, ValueSize: valueSize} + address := types.NewAddress( + rand.Uint32(), + rand.Uint32(), + uint8(rand.Uint32Range(0, 256)), + rand.Uint32(), + ) + keys[i] = &types.ScopedKey{Key: key, Address: address} } segmentPath, err := NewSegmentPath(directory, "", "table") @@ -181,9 +189,13 @@ func TestSwappingKeyFile(t *testing.T) { keys := make([]*types.ScopedKey, keyCount) for i := 0; i < int(keyCount); i++ { key := rand.VariableBytes(1, 100) - address := types.Address(rand.Uint64()) - valueSize := rand.Uint32() - keys[i] = &types.ScopedKey{Key: key, Address: address, ValueSize: valueSize} + address := types.NewAddress( + rand.Uint32(), + rand.Uint32(), + uint8(rand.Uint32Range(0, 256)), + rand.Uint32(), + ) + keys[i] = &types.ScopedKey{Key: key, Address: address} } segmentPath, err := NewSegmentPath(directory, "", "table") @@ -221,7 +233,7 @@ func TestSwappingKeyFile(t *testing.T) { } // Create a new in-memory instance from the on-disk file and verify that it behaves the same. - file2, err := loadKeyFile(logger, index, []*SegmentPath{segmentPath}, ValueSizeSegmentVersion) + file2, err := loadKeyFile(logger, index, []*SegmentPath{segmentPath}, LatestSegmentVersion) require.NoError(t, err) require.Equal(t, file.Size(), file2.Size()) @@ -271,7 +283,7 @@ func TestSwappingKeyFile(t *testing.T) { require.Equal(t, actualSize, reportedSize) // Verify the contents of the new file. Reload it from disk just to ensure that we aren't "cheating" somehow. - file2, err = loadKeyFile(logger, index, []*SegmentPath{segmentPath}, ValueSizeSegmentVersion) + file2, err = loadKeyFile(logger, index, []*SegmentPath{segmentPath}, LatestSegmentVersion) require.NoError(t, err) readKeys, err = file2.readKeys() require.NoError(t, err) diff --git a/sei-db/db_engine/litt/disktable/segment/segment.go b/sei-db/db_engine/litt/disktable/segment/segment.go index 9a0ddfba2f..6edfd1f1dd 100644 --- a/sei-db/db_engine/litt/disktable/segment/segment.go +++ b/sei-db/db_engine/litt/disktable/segment/segment.go @@ -266,11 +266,11 @@ func (s *Segment) sealLoadedSegment(now time.Time) error { badKeys := make([]*types.ScopedKey, 0, len(scopedKeys)) for _, scopedKey := range scopedKeys { - shard := s.GetShard(scopedKey.Key) + shard := scopedKey.Address.ShardID() requiredValueFileLength := uint64(scopedKey.Address.Offset()) + 4 /* value size uint32 */ + - uint64(scopedKey.ValueSize) + uint64(scopedKey.Address.ValueSize()) if s.shards[shard].Size() < requiredValueFileLength { badKeys = append(badKeys, scopedKey) @@ -421,7 +421,7 @@ func (s *Segment) Write(data *types.KVPair) (keyCount uint32, keyFileSize uint64 s.maxShardSize = s.shardSizes[shard] } s.keyCount++ - s.keyFileSize += uint64(len(data.Key)) + 4 /* uint32 length */ + 8 /* uint64 Address */ + 4 /* uint32 ValueSize */ + s.keyFileSize += uint64(len(data.Key)) + 4 /* uint32 length */ + types.AddressSerializedSize // Forward the value to the shard control loop, which asynchronously writes it to the value file. shardRequest := &valueToWrite{ @@ -436,9 +436,8 @@ func (s *Segment) Write(data *types.KVPair) (keyCount uint32, keyFileSize uint64 // Forward the value to the key and its address file control loop, which asynchronously writes it to the key file. keyRequest := &types.ScopedKey{ - Key: data.Key, - Address: types.NewAddress(s.index, firstByteIndex), - ValueSize: uint32(len(data.Value)), + Key: data.Key, + Address: types.NewAddress(s.index, firstByteIndex, uint8(shard), uint32(len(data.Value))), } err = util.Send(s.errorMonitor, s.keyFileChannel, keyRequest) @@ -459,8 +458,7 @@ func (s *Segment) GetMaxShardSize() uint64 { // // It is only thread safe to read from a segment if the key being read has previously been flushed to disk. func (s *Segment) Read(key []byte, dataAddress types.Address) ([]byte, error) { - shard := s.GetShard(key) - values := s.shards[shard] + values := s.shards[dataAddress.ShardID()] value, err := values.read(dataAddress.Offset()) if err != nil { diff --git a/sei-db/db_engine/litt/disktable/segment/segment_version.go b/sei-db/db_engine/litt/disktable/segment/segment_version.go index b172effb37..8565a1492a 100644 --- a/sei-db/db_engine/litt/disktable/segment/segment_version.go +++ b/sei-db/db_engine/litt/disktable/segment/segment_version.go @@ -16,7 +16,11 @@ const ( // ValueSizeSegmentVersion adds the length of values to the key file. Previously, only the key and the address were // stored in the key file. It also adds the key count to the segment metadata file. ValueSizeSegmentVersion SegmentVersion = 2 + + // ShardedAddressSegmentVersion replaces the legacy 8-byte address+separate value size in the key file with the + // 13-byte sharded Address layout (index, offset, shardID, valueSize). The keymap also stores the new layout. + ShardedAddressSegmentVersion SegmentVersion = 3 ) // LatestSegmentVersion always refers to the latest version of the segment serialization format. -const LatestSegmentVersion = ValueSizeSegmentVersion +const LatestSegmentVersion = ShardedAddressSegmentVersion diff --git a/sei-db/db_engine/litt/littbuilder/build_utils.go b/sei-db/db_engine/litt/littbuilder/build_utils.go index 646e6580ec..2ed53b4d93 100644 --- a/sei-db/db_engine/litt/littbuilder/build_utils.go +++ b/sei-db/db_engine/litt/littbuilder/build_utils.go @@ -205,6 +205,10 @@ func buildTable( if config.ShardingFactor < 1 { return nil, fmt.Errorf("sharding factor must be at least 1") } + if config.ShardingFactor > litt.MaxShardingFactor { + return nil, fmt.Errorf("sharding factor must be at most %d, got %d", + litt.MaxShardingFactor, config.ShardingFactor) + } kmap, keymapDirectory, keymapTypeFile, requiresReload, err := buildKeymap(config, logger, name) if err != nil { diff --git a/sei-db/db_engine/litt/littdb_config.go b/sei-db/db_engine/litt/littdb_config.go index af3c2b5e73..eec3f803ad 100644 --- a/sei-db/db_engine/litt/littdb_config.go +++ b/sei-db/db_engine/litt/littdb_config.go @@ -16,6 +16,10 @@ import ( "github.com/sei-protocol/sei-chain/sei-db/db_engine/litt/util" ) +// MaxShardingFactor is the largest legal value for Config.ShardingFactor. The shard ID is encoded as a single byte +// inside the on-disk Address, which limits the number of distinct shards to 2^8 = 256. +const MaxShardingFactor = 256 + // Config is configuration for a litt.DB. type Config struct { // The context for the database. If nil, context.Background() is used. @@ -77,7 +81,7 @@ type Config struct { // have multiple shard files. If the sharding factor is smaller than the number of paths, then some paths may not // always have an actively written shard file. // - // The default is 8. Must be at least 1. + // The default is 8. Must be in the range [1, MaxShardingFactor]. ShardingFactor uint32 // The random number generator used for generating sharding salts. The default is a standard rand.New() @@ -248,6 +252,9 @@ func (c *Config) SanityCheck() error { if c.ShardingFactor == 0 { return fmt.Errorf("sharding factor must be at least 1") } + if c.ShardingFactor > MaxShardingFactor { + return fmt.Errorf("sharding factor must be at most %d, got %d", MaxShardingFactor, c.ShardingFactor) + } if c.ControlChannelSize == 0 { return fmt.Errorf("control channel size must be at least 1") } diff --git a/sei-db/db_engine/litt/littdb_config_test.go b/sei-db/db_engine/litt/littdb_config_test.go new file mode 100644 index 0000000000..3a0c4994b0 --- /dev/null +++ b/sei-db/db_engine/litt/littdb_config_test.go @@ -0,0 +1,37 @@ +//go:build littdb_wip + +package litt + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestSanityCheckShardingFactorBounds(t *testing.T) { + t.Parallel() + + t.Run("zero is rejected", func(t *testing.T) { + t.Parallel() + config, err := DefaultConfig("/tmp/litt-test") + require.NoError(t, err) + config.ShardingFactor = 0 + require.Error(t, config.SanityCheck()) + }) + + t.Run("MaxShardingFactor is accepted", func(t *testing.T) { + t.Parallel() + config, err := DefaultConfig("/tmp/litt-test") + require.NoError(t, err) + config.ShardingFactor = MaxShardingFactor + require.NoError(t, config.SanityCheck()) + }) + + t.Run("MaxShardingFactor + 1 is rejected", func(t *testing.T) { + t.Parallel() + config, err := DefaultConfig("/tmp/litt-test") + require.NoError(t, err) + config.ShardingFactor = MaxShardingFactor + 1 + require.Error(t, config.SanityCheck()) + }) +} diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/000002.log b/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/000002.log deleted file mode 100644 index 1b7abab4dc1dc41f25a0b0842599b28e236ea7bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2687 zcmYjT$&TvS8LpG$wmJn>1=Q`EO@`Z2cW3A%0uR{ksILOp#(2Os1`jME85{5f7>sRj zR(XOfvW>FH!{jxx%PtQPsUyY5Tvz2tN0z?tAN-H@zy9*}hu_`3`QF{#-Fdr8*{?ujxZsYnq;F35VU7L{H1>V0 zh=$ZwIKQAzpl$D&rLy8?;&vsF_KJMrz6SRwJ`*-r;!<{PM*TGL|NQ|}X?XiF&L#}C znV6_9p|NYE^C^@DkOfcfLeGxKkitjdMCSIdOp{hk+FkIO6(<<*)kGrL)e*?|aXO^Xbr z#{1xDfiRRP$zIw`tsX7b%opI^ybKnG+%K+t4dS5bXWVHtJbNednAR`{o`VxTQ}|wL zD&m^Iuuu_O)T##YpFjWe=eI<@hp8%0qr9LwymSXM z8Dp`bwuRELpXA9uVoVFDGWVD8$S5czGpTg^Zf?LU4Di z;T5?^*3@Ur>v0c*kq%a<5M+{M|RZ| zQ0XUSGA+v57zC~r^l_wIYpvgcCZeGxnb2ZRPpj5~3Lijcz7B*LX&=s7G#?rSDV=Mb zA$V9aYn@-ti#|#qZjGDxRlWPiEn{DoM&Rj`7d!>zcp@(squ4o|vuV{f--j${qKiDp zqs!{BIdIU<4Q?NYBr6eupi4apSs8>=bB~~f7+FLc+3?B^0&XnhHC6gyTyZ8V0o#pE z>I}DDnR|0forz8NLRC`;y}Sc0!4h$w*iA0|35C0Ix0Zij_9S`5E~$hQM^>$h3{`#u z9!F&8PbQMF*`)a5<&Dd?qU4DhI#*_i>0NKj&ud$c-~rLujYV7y19zC0*x!Q&6K`C{ z;_Y-?Ee`0R4;q`Rqh+jax*}2A_y8UjQZ!-^nd7V(6V*5i8g@amYjm7>`&o_t3^YQt zJ2K;y!V%S^L(5&zOxMVkSULHzchPEL4Ri!lRMrHOSi54k-0XPmRFm#czv+DPw_8EK zEp5QlDlce7)_JgFaCzO$t+hC>G=2bSaF5x{HTL+_sS5KE><@c+zL0`>m3|1m0}X5u z9}7egv{?^&yoo*sT{c@-Na#B3+RHU|u2ds=(`iu|8d_8DY8>O0DFnk;#U>hu;WS_F z*sc6xuLGJZp|5!g%KH>sB?B7zC1|V0I7J5gjpJ`DX0#5N+ENEJB0~+uh0d^2l_#k2 z6?mBSkSw9M43%+OHFY;jPZrWsu_zrP){HubRZl>M0!_Z_&v*L)5;)zehi-;CqBJU4 zozXdwydDZYN6p&z??J17!SGmL4;3e5sM%^&Q{RBj;&L9PHsU9Yy&R+?MtTWzYXALD zfBZOkQt2C>c6mWl7*SE+cu~xcN6^$8NP*6HjpI{-3?}0u!osUDsP^%Ve2}<&JhUxo zc2@N2)gb;Bv9cd;GLi}b6#XDp5mE@7ySc#SV>9>Ipy_w;74?YI$}tEgWn z{jKZHjVc+CYlAi+=I9Y8lWgu|8Z%(4tqHjnXkJ)tG%}f?y3wmbL--jyEzt>c62#?6 zJFf$zni9x-4(^jJk@jr*8daZo2!2t1;HEn%*2jt(FG6Qg)fqBhf=6T@5+cnECce@m z{5qUpfL6kvg`pQ7O`cQ(#jc6~b-o4d5xP7cWz1RcGu2y|r>e^#M}YPPzw(DgLgsQF z`o3=;YLgOZUSla9pg6XnF4ZoFDkymJmXs+^u?uGSnZl#Bg7#lQ`|hu|$@@bo2~Rb7 z_ZlI|myNSF3@G~vB*1g3UQ`6PW83!f;+)FGw2B6@KPrD9)UHLHR=tIvSc@*o{-5T9 zdrf@OqZ1(@*=jbS&X=GeI_0!x2p#RK5r8OGZXq`Ct~t^}m>ySE1 zYX2MBmdBg@kWgpXTD9%7nOAW`ZUP>{P`8qmJUmUj)2@!>5j+ygd=Q5{ez{+7nQDnb zg&&t&|2Xj!Z`M5@Pu*lgRsSiF`W0yH3xb}aBBvWkz$kjvmyl|K2gfUR#XiLlW{$n2 z;M1& diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-2.values deleted file mode 100644 index 44c3cdd1822d33f2c5e6ef21306d5cff3b75cc92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmZQzU=VUF$9yX-2|6q0{c xVLGZabCQtqt6Ff~2Go#Qffr$FClN8i$oLleARB-@98q#YkK-hS6Q4DpeE{yLE?58n diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/0.metadata deleted file mode 100644 index 8a8e7ddf335d17d4e6adec1aa63253577265132c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ckU|{hqXQ|4(FS~2Ysw*W=r53eFtS$??^jlT{D96PJ0L)nn!vFvP diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-0.values deleted file mode 100644 index 12e110e188b249a888beeb1fc9118810c61e790a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41 wcmZQzU=T{l_R02k%SrMp4$4S(j&d(9U|?Y2Hwkg~FmbE$2oDa;GtEy10O92ecK`qY diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-1.values deleted file mode 100644 index a8d54a9950c17c5aaf1dcef7154230222f335894..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 107 zcmZQzU=S=UHS~6V`{sp}L-c zf*>}bva^&bA+7%^2*MSlKev!k66{zlFZJ2#_+lFcJpJnd+(qPuCY1wHzX(I`lTt5Q)@z>#L5fEEFcbJp0Op+x`v3p{ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-0.values deleted file mode 100644 index a1fa22180a2634888f2ae79e819d357556b46c0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82 zcmZQzVBj_~DJZE(jx5Y8FJ)k0;0h`%_6TU@_3_4%QAADlRbmHlT-450zAG| hmW8Gvp%npX*%?5-K(xd)VkM9ovm0)za$-5s->-O^k=ay>$TqFhe7j^!yvu4NwO0GQ<* AC;$Ke diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-2.values deleted file mode 100644 index ca0e85a50333946b1e54235a7b075cca859b2d44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 YcmZQzVBjtCOieT>^C=F@^C|EF03o3Sy8r+H diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/2.keys deleted file mode 100644 index ed5b06dfb19e63096cfa62c7f5e294e7d2c8832b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338 zcmYj~(N4lJ7)Bc}CkV`V=^GeB+TrSriCf(WREBi8vAgMz4Ow6r($S~)Us4mBoSdfT zONtQcIL+{R5m=t(hz&yM0%*^mHRn9o`i=d8&O7Uh> zHUAb}xc5~+Vz!)Sr5EK&a;p0c_!=;%+SWdiq@3$=2R4DLV(g|_Q71UFc%JLp0~^5L z1E2la+a1P}pEr4M(^L;`!R^PrpF diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-1.values deleted file mode 100644 index c2c0d3509cfb8d6b4a060be363ec25be1a2ae725..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmZQzVBpFz3^FVAHc533WME+6GtMqg^Rg_ca!++KGmiv{@RU`QCmZLPloS;jy8!w8 T&Rzle24>mL`6(72rg=F47=RHE diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-2.values deleted file mode 100644 index 91d59f96e602397ce081944c498fe08aecd27888..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45 zcmZQzVBiWX$n{S*O)-m1WME+6jdHI_4=QypH8o9giv$XArA3yTTb2fRs^R5eW diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/3-3.values deleted file mode 100644 index fd7c5e0699cfae18c79ae3b4b1f55f20778f164c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 88 zcmZQzVBm5w@pW>Ea106dV_;z53$k!@jWCZ24of!m&MpOt2$`GYrKCq?TUO@!R%GNE m6c>~MMR_8soRR~4L!&B-DxE<30{s)60~3RS&CFAr!_5G%h8ENS diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/3.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/3.keys deleted file mode 100644 index b3c346a148a42f348c59f01653061c23082e1a60..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 532 zcmYk2S&xD+6opCV&0Qy%*YOWbf+!YVCK-_eD&jJN_$FXc#BoRP*UxQI5}TZyw%_e? zF2`}zNYV^zwNOs}@s^CQ9LK$Z=qP|n?ZqQ{#Hn{AM;+F$tbXoE*hIsjZMI~=bCAyp zD&SN#!Aau2lk_tD6X}{IzFg3Nc~uQYGiwrIKE6z6qWgmB+l6H)-w@$b88h+${tl`Q z-I2IM2P5qovKUxA<4tgSahXV2C%u~@I^$``;1>m;iX!cIhG9B{+{Hy6ivE|2k-<{mjD0& diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/3.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/3.metadata deleted file mode 100644 index 03e611b9de38bbecb5e02e5a33c7b3139d8e41cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ckU|_kRWxQeUwk%%1t%7BNtCs(iSX~x&`JBWFpqvmR0L=Cb761SM diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-0.values deleted file mode 100644 index 10d25de74e989c2767f38d882d0872bd823ef7da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 75 zcmZQzVBkxO2y@9wGx0F?aSVvcXJB9uE--RU%nooiEOe_h^vN@iFifum3iG5mN2CXv b1m}e3<${#)8F`o(mYZ8vM&!69SEK^~!od^6 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-1.values deleted file mode 100644 index 18bedaf41a263d8cedb33d4d3795d725d31b9a0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmZQzVBj;WNG&Ti_Hm0ewMef>XJB9uFfwzC%niuOjx07c%*(K}0Ey*$=K4FPR#~PP c`5OD=r}zWK_?<)CJjzNEGb%mv44fVP0QX=NcmMzZ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-2.values deleted file mode 100644 index 60f42b9e6126b0e2a1c279288e132c2bdf870623..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmZQzU=T73C~ynS_bGHONjDAj2}m;!WME+6@hx;T^mcKIbT>8j2J!{HjVgjNo%{k# Mef^TmO;e1W0H(MOc>n+a diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4-3.values deleted file mode 100644 index 1eab4a8104cf77b0e57d3b2e10316501f111ba9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmZQzU=T7gOESsxs0vNWb4w~pOiwm*VPIh3H!-p(wRCnhtBT4A%nx@53JK?@`8ihv z=R{SQn1lvoyIVLLm;i;j3VbWQ!(2Q=E2}_?oWl%VOq?o>1G3YSOTrv23S1olC+Zrq diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.keys deleted file mode 100644 index 8433e98cab11b10d7165eb034e25c09dcbf4d3b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 482 zcmXw#%Wi@|6oy%JrM99beS{|6!GNZ8RiHC93X0qmcS2DvUa$(NPv0|UoaE1+GvB$* za2&^PgR{EB{b?-JL2S5x9LGI@=;?wQ@(N#zWK>3dh#usHl7S}HwP$87VdNFO4Qk3> zal9dG?ARhhVE1;tOdypPp!_!?aZ)?PwLF$Wt6LymsiZuZB-i<|2p8i_V;qd5b6Zl8 z=aYK5Bb(`?J>9fNSvVdzi6xCvg-jr(`@YkAP-iy(DUrHgN9j7idYoaFK#O@$b332q zhUa5qIt;ymcRCkq7#F@M;H5Ay&IUh2tfZz8W38}l=t0;?v z4P&$~9oaQZ{YHH34~>uO;pW%Uf@OSxH$eR0BKHeF)~qPUiXDcGe}dD$?s}KAUanAj Q!mFiP>ezhz34MR>A5ivBn*aa+ diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/4.metadata deleted file mode 100644 index 7971d6f7614f7829110262d875bb65d8e0322d05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ckU|_MC_B6 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-1.values deleted file mode 100644 index afc7333b1c69da541874e4db2c2c46535fac3e16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmZQzVBj~22n{JrDb5QFDDgCM%4T3-5X`Cwa`FrG_bu>nEy^zTDm4KK8oQeYIi{If zgoox9hPVc%rT_(ny!|r#%Ka*ng3}8OGO~&jD>Hzid?BS_=}EyZZY6n%rYU6rV?P|E diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-2.values deleted file mode 100644 index dc8b7042120dd0ff077100e6a75c7fdadb8c109b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmZQzVBiV#FiI&5N~!WN4=Z9|VBif5jIvBF3~((p3JVJY3h;aRL>X3Q6_iE>Mz{qP Gy8{49HVwQ0 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-3.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5-3.values deleted file mode 100644 index 7b0731a3ee1b654659ffcceeee00e7cb7d3aa9dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94 zcmZQzVBk&5DL3=<$Oz4}@XL*2U|`_SDRMIM52%PJD08%QcP#=5m77GA`V<%%xu=^I sgy-Y{g@lUo&3$u1LtMN{j4PepO*}0tfTFy`l~I9yl|?4zC1D;W0F4J3XaE2J diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5.keys deleted file mode 100644 index 12b77bafcc4563642df83315c6ecdc2b5d41dda7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 527 zcmYk3OK*Ze6ouJz(@^ozKhUI2x~wu3Ty!Cb=m!6wbHWe9?B2VzSE)vZWTMyeJMtZRyr((AZT{Yz9~|KRjm0E-y{bgYi>-I-<*Gd*ICAp7l*?b1<~%}Zf5>b;Q=<^El?;W-p@{2 wKF$+L>2l8l4mf)?vCN#TBP(dtE(m8bcm*VF7Hxk#LIv{ZgpF diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/5.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/5.metadata deleted file mode 100644 index 0c178d951eb14c930b688fdfe94a3d6b978c85af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ckU|_ks^C`cX>tWU8ha#^|NEC-jtS$??lF4xcC@07W0MGFYod5s; diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-0.values deleted file mode 100644 index a35d9087954b433de41ecdaeea41426b828bd34e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 YcmZQzVBpQqD=G6fb9K$}s|YOt03z4~+W-In diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-1.values deleted file mode 100644 index 6b940ec0636c41c99567102c1143e112401c678e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56 zcmZQzVBm4f33n+C@N%NVBj?=$xF#E3Nwt%Dao$_3J52KdL)JW6$IsZx#b3# KR;8r-Mgjo2CJ>nb diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-2.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/6-2.values deleted file mode 100644 index 3573e68e11010a924dad5ac0c989000416ba51ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 110 zcmZQzU=Yp^_RA>5+_DSGax4QJ zJ%L<7v$CiRGbalZ17AOja0}Oz3Xqx-<0@AJce9AFFn1tVsLHhwj76-nnkRHlrfPI z)FaSVgAqyv+muzJhGb8z#3iJg;2WIvJSaJ%COU$1OJ6IG=|3fyfRd-tO?a zH998f`zPD&C5zZsVtedq8tS3Rl&732f?-Dd$IWLAFD?di#aR`xq&p(28k diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/6.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/6.metadata deleted file mode 100644 index b69c1e738d9968942751471fb0bc945137c7ed75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ckU|^Z(9PB@lNp@<`?G-Y2BZA&ZtS$??vi_?CP)>jm0J&-lSO5S3 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/7-0.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/7-0.values deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/7-1.values b/sei-db/db_engine/litt/test/testdata/v2/test/segments/7-1.values deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/7.keys b/sei-db/db_engine/litt/test/testdata/v2/test/segments/7.keys deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/7.metadata b/sei-db/db_engine/litt/test/testdata/v2/test/segments/7.metadata deleted file mode 100644 index a962c20776faa3f5f2e97ea340e5dfecf2d8e49a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ckU|`9gbf>1JFnIgZ=lPGG?n!r+SX~x&<(*XnP>z8S0QRO0(*OVf diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/000002.log b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/000002.log new file mode 100644 index 0000000000000000000000000000000000000000..cc44a0fe2012aeba1d22e12afe0d7427926fdd57 GIT binary patch literal 3210 zcmYM0%g*aa5rF@mVL-~|&uthagoFk-Gw1+PVmq-jGcZbGJBee*&c${dG155B#de&; zx!H-AJOFFv(z$$72p|^^P=9V)4sST?s!ev%lnvR zQI^reV?t?z$+(uH0-!P~>$gkiYE#}>u;;C7M^K&;Z$P4gUOU{@>-QCNy}s7ON>*2k1@v`_z5(<=FQHHLM2W#fMY}zR)!g^&?=mad|J5yG14jc8_Pw^)Y zT=A=7q+8T>>4+;go`_RTPeoo~)f~zy>sBq`YR10z|J{Oi1{IrXf3$V(!kjUx?nauX zsuJ*5R8qU^eVZMPnbpX)FSA%n1%3$v+0QQT+rNDr`gid=3=lxYM3J<0Z&jTxnO$9y zdGZx7xKuy|cix<-L*~YqUZhF%6T>0kW$jVbYMvG~-8)-)l@`sX04$qFh2?Okghp2z zh5FXfg(t=oZ>w}{bE3iy28L2=QVWxHQi0NAUwO(9*A{y>&AKC;Q}{!GIaJUop(!h> zd#zrr8ZW1qeyp9{H<%=7H#dU|$qo2g2EU7_;-C1jCe^MpO5jRQnSU!8yO` zxf|8kv$J_Sdcq2XC5tN8(QQQ4?a;Q}IJsQaWay>(P0+_%bC!V^k7zH^8k^;EYHm^i z9vms4++xs}xEd{aO_3BFd^X{c`{S_on}0t}>r?y=gOq4#WOlDqYrl59wIy^`K8Yu| zMCz@GGL3dEj&;SKim)0XkJa+y8Wo-SjnIsG6E}qwfVk4UUdLW~=Q*`xWcNuwe7BPh zJwF~*##!y7k*m*6q$a@j4?v)dvTeP09G@Gr;hqGVEQ<+7`89WEZdaww9>o!f0Kks` z=22NzI*DiqMo;GMhs22KS?U<~Sh~E6?$%TiRLYSW2aA>&QZr!VEx2Apx%REv8mo-R zv?ovdBxog6Y}}Z7Xsp_rvlW`-#Ui!-F1a&Y;-9;8Oz%jwfYmSXgyyuL1h&~?*;9i* zE&^JHpg44JH`T7_m$dj zS(z7FeNU^gBym9hE6^`}^@o27e|nrf3*vYb@I<+rIO%j|LVL6}+F%f*$)kkI-BrCl zWI4azO#)_nH(R5p#Jey_Rd2f6w6fkU@E+ z7kAsXrHn6{K~9J)4KCw0>?sC&skUX&4LOs)&`GNOW3UbxFqfkP>+_RIV3IhKZGv_V z<(K!f$GQA@;Bz8LS%4n{%%U8v$9^2#7KinL^h02;cw(QjT(@~*POLkaldb^hdw}qr zBZTXvV@dY4OL{P%p8(3C;=q#Y9=q$`8vSN{sa8{8KL?I|)s>(lP-?GdjfEhE-zMu~ zcf##<7|(a&MkQAjeEt+36_gFk(N@+CK~yHG+6Zix{`%+7fA#Cfaf3;kPQMO6;(o+*`|46 z*VS8-1QW9XAN2ZYO1*fmROX&NJFj=x}LXr=&lE#V+WTQ0Z2`O9%bT#cI6uJkLI)%H*W; zsB+#fl4@-#9`1D}*3;gGPeC@VX-^+psQ>`4{?BFR%ix$BDBunQ+X)^1Nm z4jbQ*KG*H5bG;Kfhf6dh`3$P$3dC1GWkvySM(w-U@_SvCbYHS6mch|22updaYQ9(v zPNQ+%N}c{bgerq7gMDxA@){$oaAR_Mjo2o+0T$k6O^%w-Gw#gGF+U^?9N5o5y@>w` ztHoo9vSPm7#4Y zTqeP^ZL*wl0mq00IEGJgPWOe=K%So_mz7VE)B{|?6GyZdSeMpLsH>}LY^~%e**5Tx z9_pFdt)-i4Be_ed;h#RvqL`@kjMoRtooKpAEOROU5_km_yxRDvZF|&gF!q_4Bqta) z0Kfi?9<;lU4F~ug27Jf=b-EE9sdls8+4j{QxiTOUWZ>3)50$V**O_(mMtVMB5JJ+w JaaF;2{trn060`sS literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/LOCK b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/LOCK similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/LOCK rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/LOCK diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/MANIFEST-000001 b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/MANIFEST-000001 similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/MANIFEST-000001 rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/MANIFEST-000001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/OPTIONS-000003 b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/OPTIONS-000003 similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/OPTIONS-000003 rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/OPTIONS-000003 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/marker.format-version.000001.013 b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/marker.format-version.000001.013 similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/marker.format-version.000001.013 rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/marker.format-version.000001.013 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/marker.manifest.000001.MANIFEST-000001 b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/marker.manifest.000001.MANIFEST-000001 similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/data/marker.manifest.000001.MANIFEST-000001 rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/marker.manifest.000001.MANIFEST-000001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/initialized b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/initialized similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/initialized rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/initialized diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/keymap/keymap-type.txt b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/keymap-type.txt similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/keymap/keymap-type.txt rename to sei-db/db_engine/litt/test/testdata/v3/test/keymap/keymap-type.txt diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-0.values new file mode 100644 index 0000000000000000000000000000000000000000..169686b7368073d41f55c0a131727ff3ab58361e GIT binary patch literal 68 zcmZQzVBmN53dlDw%XZFBvG6d>%VA((;Bv}!EKf0VE%PV`@^}LSqb!pP16&J@!oq@p U0(@o_sb$5+K5mhw7U>n~05DJydH?_b literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-1.values new file mode 100644 index 0000000000000000000000000000000000000000..2bfb41a777bca750899b63a444f7175ad32784a0 GIT binary patch literal 107 zcmZQzVBiTU4GT{W^z{sNHZEsiU=VWm$jpn1Nb?PMPm3x{D{>9Z0*O|+7G#D*7W(G- znmD=^1g0hz14X$CU7hpGgVNHg41hd7&L|B+R E01fsW;s5{u literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-2.values new file mode 100644 index 0000000000000000000000000000000000000000..fba1a5be507b12fc38b2cffc954f27a2d2ce7938 GIT binary patch literal 30 lcmZQzVBkuNEH}3-4e-eIV_;z5@hx;T^mcKIbT>8j1^{A!2H5}r literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-3.values new file mode 100644 index 0000000000000000000000000000000000000000..f4011228bf81fa4209e0ae2c7a027d9bd21494f7 GIT binary patch literal 77 zcmZQzVBpR)bc%F$3r_Pj4q#wl5HbrWa0|`%DReDKHx2X&NHY%viV8c28M>G_RT>9m drzMw!Ia(CBIs%1xqui^~gG${?O-+;BA_3386Vm_y literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.keys new file mode 100644 index 0000000000000000000000000000000000000000..ac8a5936627bfb488cb8879612c6050a4a4121de GIT binary patch literal 494 zcmYk1TT_Bi6oskY#B2V79_m@S1kUuL1OiGTf*I4x5k(M(yaDO2@2p9izL|A6v)4N8 zy%~mK6TYR)wsTvT-k5*X=)K~r%c<$R=VxBx78kRLZ;7fL=lWjh9izRx%PuB!M=vZS zc-!5Xvj-EWeer7W?ji5{sAPnT4=VAynW9?P$Ri?XP*vn4HVo@M3^UQwX$8E%u23~d zs`~a^cZRF^KqhlJfemh`%2W+$SnxYhKICpJOw_Jcz@IX z)k*?UPus}M0uf~jhoeeW;zef=3Wr69phT&oC-$l-8%bCPu4DyYt5Igaq&!{y=DMZj z-UpW~0&N);6V0`~-w0DhXUxr7VYj`J+tXD4+ZyjNRlPGZ#z}BeePP;)R;Ej9z(fGE YHAej~?MY)tSdIxf&I%hgpF literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.metadata new file mode 100644 index 0000000000000000000000000000000000000000..39a2143fc763ac1375cd16471b912ad03cfc6a9e GIT binary patch literal 37 scmZQzU|?ooU|jm0O!dK7ytkO literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-0.values new file mode 100644 index 0000000000000000000000000000000000000000..7417db336e553a5db83978b3f23884d8ac6645bd GIT binary patch literal 14 VcmZQzVBjiC49LoLsW8k5000$a1F`@B literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-1.values new file mode 100644 index 0000000000000000000000000000000000000000..47831c390500d5babd62fcd68b33cce2b875c9e8 GIT binary patch literal 103 zcmZQzVBpQqD=G6fb9K$}s|YP&U|`@2vT$^bFpmljOE&e+E(MD4lvR``8|Rsn6crk~ z0QtP80fzp$VgAM$o`wOQKmq=oA}1sNfQpEMGDk~y*CLRf6z7QaV3XjS@Vwl708@1v A9smFU literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-2.values new file mode 100644 index 0000000000000000000000000000000000000000..6484ee367d548b578ab11ffe6f62b94af179d140 GIT binary patch literal 34 pcmZQzVBj~22n{JrDb5QFDDgCM%4T3-;5H7obT2J;H;(Wy004~g2!j9s literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-3.values new file mode 100644 index 0000000000000000000000000000000000000000..422626311bb07abbd44a5ed02edcc9934829df97 GIT binary patch literal 71 zcmZQzVBiZW4NFf7c5y4oOEgU>V_;wqa4gEMwD8SObI&ew&2aNe28!{Ugt&W{xK(+C W2Z!dF=7WT|Lh_7!(-T7iOq~FvffDxs literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1.keys new file mode 100644 index 0000000000000000000000000000000000000000..d69009762999ae75c84843d71d3df64638bfd3f3 GIT binary patch literal 420 zcmXw#$!@|h5Qg3MR-l3M2$g!yO6n^LDaz`!BqrRlK$5a31p+irUk`E)pKQ(d%i|e@ z(6DtavYD^NMXv5O%P|l_4-E9k5P))pm%gXoR9an#rLfZ7Ke5XTW0VA9jE|`lR;M@= z6_a)ehz%G*?(N+=`XoUeZnJRKd3K^_#^`tYVY<3)N3MkBl?HkxWLkQ&=c3i(~#3q&uhkK>#-#bjyb~nX^ecp2S3cnvR#y>~ni&#>#B+lBp zT~i~kdFCB5uz|sPUKW0I(3h*}rL$w$PmeKff?FVKNu4C+wLLd}>s71_%`v=ipD@dJ i<~2~NmQ0E~U(kXl42VIGeriv?OQKj6Ha#xseZYT)-bHKx literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1.metadata new file mode 100644 index 0000000000000000000000000000000000000000..9c0a07935de17e2c90234a33fc01f5e7a217bc80 GIT binary patch literal 37 scmZQzU|?ooU|?}n)Ve5qAgq%$^;(GMfolsTR@d2VzqRlMP>z=o0J(Mx&;S4c literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-0.values new file mode 100644 index 0000000000000000000000000000000000000000..e609a7d8ff489fcd9d2bb64ca9229c839e860f56 GIT binary patch literal 99 zcmZQzU=WJP^ffdIs7Q4za4AoBF3%6oVPIh3%}5N%DDiZ2&kZz6Gz1C=`jt5Q1x7i# xmU?AY1!hD<_y7fkd`gQAGo8Zo@>0B#6Ahi*1Ij^qi#$^k4a$6q1M_?ed;mCS8@>Pl literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-1.values new file mode 100644 index 0000000000000000000000000000000000000000..edd96b11b8fe7cfa2201ba58cd499278e11fd2ce GIT binary patch literal 79 zcmZQzVBj|~vM9B5b~USt$_dO5cV}Q=5YA8YbFK)^iK;L$2@S}0w{SKv0SXKFnid-* fS2`MndKqUGm$*~`#dy7wee=RfA_L0PlM6!t4uusg literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-2.values new file mode 100644 index 0000000000000000000000000000000000000000..d433f189c945d4f75b4c95cd316fba185f976919 GIT binary patch literal 19 acmZQzVBmKSaq}oENzAD9%rkIy^aB7YJp~#7 literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-3.values new file mode 100644 index 0000000000000000000000000000000000000000..84f831ba39290a25df9f710dc20f57000fa6b1db GIT binary patch literal 114 zcmZQzU=T1ebBoLk$jXi^HZ{!4u(V)cVBiWWEcOU?@$*WG0P=*2^38p7LPK1-@sYQ5b LZefUPU}_2giCZ3@ literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.keys new file mode 100644 index 0000000000000000000000000000000000000000..e4227e12e774748ca3d8b0504ae2fd6d193680c8 GIT binary patch literal 501 zcmXw#+irqD5Qewy9j&%t(+B8HlU^wxVA3?TBEMIxuC?=D?0{vDX_ z-RC@&zV2f~VPaX4WJ{zeP z9geuuoH1AzTi($CXz~ZC?25LRmQu3g$S$=mW-PFe-5lOJC&qGpD4h17lPh)$(NR1A literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.metadata new file mode 100644 index 0000000000000000000000000000000000000000..37fa77636e36b92849dec693cdca22018a764499 GIT binary patch literal 37 scmZQzU|?ooU|_jb%7 literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-0.values new file mode 100644 index 0000000000000000000000000000000000000000..a1aafe90d2108141115d231b245d7e2f195e533e GIT binary patch literal 102 zcmZQzVBj({&&V=zN%1SPU;y%R41>%{y-iY`1A#p5s-nuQp!DoWV<$@>mnWjiDLKG5 zG^(AT0dEY3a5{QhUo z9WFwMKB}H9PZi0HdICm` zzg&zGweF#F5aQviAl3qdK}y+0%SAYt|7r%YH!xV)7=|XF2y5f`VRZSW&62<;1THt8 xSh=ilwyuX`B`5j>e;szy?Om3Qs@Ymy+3y5j03UEsdEjQ|#8*_yBL>fbn13HNMjQYD literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3.metadata new file mode 100644 index 0000000000000000000000000000000000000000..3d89a38cf8788c50a124ec376ba6869560d7c738 GIT binary patch literal 37 scmZQzU|?ooU|?CqJma9&?4Iqv{%@}>KodMO`e literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/0-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-2.values similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/segments/0-3.values rename to sei-db/db_engine/litt/test/testdata/v3/test/segments/4-2.values diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-3.values new file mode 100644 index 0000000000000000000000000000000000000000..7cddf7676a733a31db9a011086de8d1fc0067a2b GIT binary patch literal 74 zcmZQzVBj_~DJZE(jx5Y8FJ)k05cDk#Fi0=+^$1SNHZ=^lH1-1u3VHiw_?7!rCIzP# a7-VD>Cst+vMR@`}j8Y1NQmQ=6!-@dkMijOH literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.keys new file mode 100644 index 0000000000000000000000000000000000000000..b4e21630bb3511df1e32e9a3f3cdb6419c3687ef GIT binary patch literal 399 zcmXwz-BW@<6velxCn8Io=`X0KUPLgVx8f_8Fj0&hrx(ORJ_bY@tQ-l%@Wsk6kGIvhIFDHK*L z9$=S>BcXB_{|;KkV5kG7eZav`lSlbZjTS~NN>bf02fCz>YjCWGN0S(7@s2B}DOBHQ zjz{RYq2i|VeXH*$b6aBQ7Q(RkuEYoHZJX=}mYsO!ubJTi3~)E6*El6rD1F2XJ^$D8 zma3$2uuThWstmqBjt7-Q{IbPj<5ljIK@*a&wcC!4IA4}>^VuX(6!|%GJkfbRxnE}M V(?D>IJoAb?5j+Pw%<~N`y+4ByK_dVF literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.metadata new file mode 100644 index 0000000000000000000000000000000000000000..4325755e1bec70f27e555154994653ccc748048f GIT binary patch literal 37 scmZQzU|?ooU|>mi^t{n|uf+Fnp!kC`;{N;+tLtobY`rc4l;dRt0Le=WW&i*H literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-0.values new file mode 100644 index 0000000000000000000000000000000000000000..ec4586c596424de4eca165058b4447fc3772791f GIT binary patch literal 74 zcmZQzU=Rw)5AZ4sF-i6)DD^haGSBxYW?*0tG%a*VvkXZ$u<-XN_pdBU3IhuAxaEYq a6s1?C7H1R{0{PrwAqFMEe&L4ZWnKW`ClpHn literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-1.values new file mode 100644 index 0000000000000000000000000000000000000000..a385eb2dd2553e2efe4a24fa1a6f27826b45d33a GIT binary patch literal 119 zcmZQzVBk$l@+wL%cXaZxF!Rn}U|`^KG4XYBiEs=F_5<<43Ud9^O;gMw6M;N|Y?sh7 zGYgMg3j=dER~P3jkc!ZVlBD3=tjK^MAdfdKr`*ibBO^4^!Y?-pC?K2^>X8)gR}hrv O<(3;{T9uOS8wmiVdme!R literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-2.values new file mode 100644 index 0000000000000000000000000000000000000000..8aac08ea6d494cef9dd0e97068f6316831c893c4 GIT binary patch literal 53 zcmZQzVBkxO2y@9wGx0F?aSVvcXJBC9FE@!O^(inka!)ra2+zp@3i0?>Sr(dxgjNKk HWoG~YS#=H( literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-3.values new file mode 100644 index 0000000000000000000000000000000000000000..f4bc006fcbd9ae73c9263f6f4b9a437e706e2380 GIT binary patch literal 79 zcmZQzU=Vc7F)wipF3fN(39TqEv+%cI01BFwMP-;dS(q63`dNfqxTaJ91^EjDqkMyM e$^uP%y@G;*Lx4hjMjj@H<>r=^5jk$j73lyY)fCGB literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5.keys new file mode 100644 index 0000000000000000000000000000000000000000..768551e6405d0a61c543ab5353cc443ea51c171d GIT binary patch literal 560 zcmXw$&r^ax6vwxkE~#NUb?wxprkPkVa+(eyASHo{itDKamH1&Q3c_FCTW2|Z=k2`D zcXz-079mtxWR8`ntb_xKgUaP=A;|`P(XA7t_q0rUpgP=bktruf4jtp+2$+CFF;jnC!uU7Ql`H9 zTE}cM0~Ca6AWm`hf!Xubr*PXJGzqk5vfJW-dUvHwJ-H_+^E@&f?K%BXndb)T@p)xz zH6|~ytf#UOF!)FhsDerXY467T&`o`lv3vS74s;PO#XbKcXJO7zjZTE3%1HISEX6!l zc&(V%0{~Q}Gzi8do|)42!`nvCpqbx`%pAddUkLXSCWF>4&=`NC*V1X%x(&TI7nPVq zc{E)_pVpRHUZJ8Ah#Qd>S=eIJ%H>VFmoa`v0wRsOKo&vohoso$?Xe|lF+tgf@!$(&UIloMhE0Ny7I9RL6T literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-0.values new file mode 100644 index 0000000000000000000000000000000000000000..61fcbf16d68a3e2bc53e1fb9d8f18694f4b03dfa GIT binary patch literal 36 rcmZQzVBj?=$xF#E3Nwt%Dao&5U|`_)@`*C6%ql3242*CKDs~3|t!@fl literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/1-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-1.values similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/segments/1-3.values rename to sei-db/db_engine/litt/test/testdata/v3/test/segments/6-1.values diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-2.values new file mode 100644 index 0000000000000000000000000000000000000000..aa7662b63390d31a53d4e916143ac7d86cdb877b GIT binary patch literal 104 zcmZQzU=T7-DGLnp_jY&8a&}8|^~m)IVE~F6nI)Ozc~pfa<+&vlC8j5vxd27^lX8+H z%1gp?!<;N4va8B~Lc&$~IVKrJzR6kM87AcsPT>X-CO~1n(8R=i=Q4vlM>Chwh(G|r Ci5(>X literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/segments/2-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-3.values similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/segments/2-3.values rename to sei-db/db_engine/litt/test/testdata/v3/test/segments/6-3.values diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.keys new file mode 100644 index 0000000000000000000000000000000000000000..15c45399cce621d8355501dce0460ce914a46667 GIT binary patch literal 225 zcmZQzU=YZwGI#Ma_VEY{FV1oe2y13wT8 z4B(2Wa10IiH>;}jf=cOtq`-Qs{EZ`ALcLRR-NG}f%6%-L3hY4&gh7fj4TA~;vOSC< Qyo0h#%7dZuVIX-v057s7tN;K2 literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.metadata new file mode 100644 index 0000000000000000000000000000000000000000..6e105055e281bec2a238a3381916cd34ce025951 GIT binary patch literal 37 scmZQzU|?ooU|?D5|G1|_e!(~XR49j>e`YX_gfMKt5QK5y;>J E07qmA0ssI2 literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/7.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/7.metadata new file mode 100644 index 0000000000000000000000000000000000000000..d6731be3d2b664080c4c6a618210a6a5c3dcaea2 GIT binary patch literal 37 scmZQzU|?ooU|{)N{(qzWa0O`35lK=n! literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v2/test/table.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/table.metadata similarity index 100% rename from sei-db/db_engine/litt/test/testdata/v2/test/table.metadata rename to sei-db/db_engine/litt/test/testdata/v3/test/table.metadata diff --git a/sei-db/db_engine/litt/types/address.go b/sei-db/db_engine/litt/types/address.go index dc3a6dfcb3..b9fe6ed1f8 100644 --- a/sei-db/db_engine/litt/types/address.go +++ b/sei-db/db_engine/litt/types/address.go @@ -7,41 +7,83 @@ import ( "fmt" ) -// Address describes the location of data on disk. -// The first 4 bytes are the file ID, and the second 4 bytes are the offset of the data within the file. -type Address uint64 +// AddressSerializedSize is the on-disk size of a serialized Address in bytes. +// Layout: index(4) | offset(4) | shardID(1) | valueSize(4) +const AddressSerializedSize = 13 -// NewAddress creates a new address -func NewAddress(index uint32, offset uint32) Address { - return Address(uint64(index)<<32 | uint64(offset)) +// Address describes the location of a value on disk. +// +// An Address identifies the file the value lives in (Index), the byte offset of the value's length prefix +// within that file (Offset), the shard within the segment that owns the value (ShardID), and the size of +// the value itself in bytes (ValueSize). +type Address struct { + // index is the segment index that owns the value. Combined with the shardID, it identifies the value file + // that contains the value's bytes. + index uint32 + // offset is the byte position of the value's length prefix within the shard's value file. The value's + // bytes immediately follow the 4-byte length prefix. + offset uint32 + // shardID is the index of the shard within the segment that holds the value. Encoded as a single byte, + // which caps the maximum sharding factor at 256. + shardID uint8 + // valueSize is the length of the value in bytes (not counting the 4-byte length prefix on disk). + valueSize uint32 } -// DeserializeAddress converts a byte slice to an address. +// NewAddress creates a new Address. +func NewAddress(index uint32, offset uint32, shardID uint8, valueSize uint32) Address { + return Address{ + index: index, + offset: offset, + shardID: shardID, + valueSize: valueSize, + } +} + +// DeserializeAddress converts a byte slice to an Address. The slice must be exactly AddressSerializedSize bytes. func DeserializeAddress(bytes []byte) (Address, error) { - if len(bytes) != 8 { - return 0, fmt.Errorf("invalid address length: %d", len(bytes)) + if len(bytes) != AddressSerializedSize { + return Address{}, fmt.Errorf("invalid address length: %d", len(bytes)) } - return Address(binary.BigEndian.Uint64(bytes)), nil + return Address{ + index: binary.BigEndian.Uint32(bytes[0:4]), + offset: binary.BigEndian.Uint32(bytes[4:8]), + shardID: bytes[8], + valueSize: binary.BigEndian.Uint32(bytes[9:13]), + }, nil } -// Index returns the file index of the value address. +// Index returns the segment index of the value. func (a Address) Index() uint32 { - return uint32(a >> 32) + return a.index } -// Offset returns the offset of the value address. +// Offset returns the byte offset of the value within its shard's value file. func (a Address) Offset() uint32 { - return uint32(a) + return a.offset +} + +// ShardID returns the shard within the segment that owns the value. +func (a Address) ShardID() uint8 { + return a.shardID +} + +// ValueSize returns the size of the value in bytes. +func (a Address) ValueSize() uint32 { + return a.valueSize } // String returns a string representation of the address. func (a Address) String() string { - return fmt.Sprintf("(%d:%d)", a.Index(), a.Offset()) + return fmt.Sprintf("(%d:%d@%d, %d)", a.index, a.offset, a.shardID, a.valueSize) } -// Serialize converts the address to a byte slice. +// Serialize converts the address to a byte slice of length AddressSerializedSize. func (a Address) Serialize() []byte { - bytes := make([]byte, 8) - binary.BigEndian.PutUint64(bytes, uint64(a)) + bytes := make([]byte, AddressSerializedSize) + binary.BigEndian.PutUint32(bytes[0:4], a.index) + binary.BigEndian.PutUint32(bytes[4:8], a.offset) + bytes[8] = a.shardID + binary.BigEndian.PutUint32(bytes[9:13], a.valueSize) return bytes } diff --git a/sei-db/db_engine/litt/types/scoped_key.go b/sei-db/db_engine/litt/types/scoped_key.go index 418e8aaab7..0ccb471a61 100644 --- a/sei-db/db_engine/litt/types/scoped_key.go +++ b/sei-db/db_engine/litt/types/scoped_key.go @@ -2,12 +2,11 @@ package types -// ScopedKey is a key, plus additional information about the value associated with the key. +// ScopedKey is a key paired with the Address that locates its value on disk. +// The value's size and the owning shard are both stored within the Address itself. type ScopedKey struct { // A key in the DB. Key []byte // The location where the value associated with the key is stored. Address Address - // The length of the value associated with the key. - ValueSize uint32 } From 8b34524285e95e25c4468a23736f29a3ed30330c Mon Sep 17 00:00:00 2001 From: Cody Littley Date: Fri, 1 May 2026 12:43:18 -0500 Subject: [PATCH 3/3] round robin sharding --- sei-db/db_engine/litt/README.md | 38 ++-- sei-db/db_engine/litt/cli/prune_test.go | 8 +- .../db_engine/litt/disktable/control_loop.go | 10 - sei-db/db_engine/litt/disktable/disk_table.go | 11 -- .../litt/disktable/disk_table_test.go | 9 +- .../litt/disktable/segment/metadata_file.go | 183 +++--------------- .../disktable/segment/metadata_file_test.go | 13 +- .../litt/disktable/segment/segment.go | 38 ++-- .../litt/disktable/segment/segment_test.go | 76 +++++++- .../litt/disktable/segment/segment_version.go | 22 +-- sei-db/db_engine/litt/docs/architecture.md | 22 +-- sei-db/db_engine/litt/go.mod | 1 - sei-db/db_engine/litt/go.sum | 2 - sei-db/db_engine/litt/littdb_config.go | 12 -- sei-db/db_engine/litt/test/table_test.go | 2 - .../testdata/v3/test/keymap/data/000002.log | Bin 3210 -> 3141 bytes .../test/testdata/v3/test/segments/0-0.values | Bin 68 -> 105 bytes .../test/testdata/v3/test/segments/0-1.values | Bin 107 -> 94 bytes .../test/testdata/v3/test/segments/0-2.values | Bin 30 -> 91 bytes .../test/testdata/v3/test/segments/0-3.values | Bin 77 -> 93 bytes .../test/testdata/v3/test/segments/0.keys | Bin 494 -> 648 bytes .../test/testdata/v3/test/segments/0.metadata | Bin 37 -> 21 bytes .../test/testdata/v3/test/segments/1-0.values | Bin 14 -> 108 bytes .../test/testdata/v3/test/segments/1-1.values | Bin 103 -> 98 bytes .../test/testdata/v3/test/segments/1-2.values | Bin 34 -> 94 bytes .../test/testdata/v3/test/segments/1-3.values | Bin 71 -> 88 bytes .../test/testdata/v3/test/segments/1.keys | Bin 420 -> 656 bytes .../test/testdata/v3/test/segments/1.metadata | Bin 37 -> 21 bytes .../test/testdata/v3/test/segments/2-0.values | Bin 99 -> 114 bytes .../test/testdata/v3/test/segments/2-1.values | Bin 79 -> 94 bytes .../test/testdata/v3/test/segments/2-2.values | Bin 19 -> 100 bytes .../test/testdata/v3/test/segments/2-3.values | Bin 114 -> 85 bytes .../test/testdata/v3/test/segments/2.keys | Bin 501 -> 675 bytes .../test/testdata/v3/test/segments/2.metadata | Bin 37 -> 21 bytes .../test/testdata/v3/test/segments/3-0.values | Bin 102 -> 100 bytes .../test/testdata/v3/test/segments/3-1.values | Bin 62 -> 114 bytes .../test/testdata/v3/test/segments/3-2.values | Bin 48 -> 81 bytes .../test/testdata/v3/test/segments/3-3.values | Bin 62 -> 99 bytes .../test/testdata/v3/test/segments/3.keys | Bin 455 -> 677 bytes .../test/testdata/v3/test/segments/3.metadata | Bin 37 -> 21 bytes .../test/testdata/v3/test/segments/4-0.values | Bin 60 -> 76 bytes .../test/testdata/v3/test/segments/4-1.values | Bin 114 -> 65 bytes .../test/testdata/v3/test/segments/4-2.values | Bin 0 -> 79 bytes .../test/testdata/v3/test/segments/4-3.values | Bin 74 -> 57 bytes .../test/testdata/v3/test/segments/4.keys | Bin 399 -> 459 bytes .../test/testdata/v3/test/segments/4.metadata | Bin 37 -> 21 bytes .../test/testdata/v3/test/segments/5-0.values | Bin 74 -> 0 bytes .../test/testdata/v3/test/segments/5-1.values | Bin 119 -> 0 bytes .../test/testdata/v3/test/segments/5-2.values | Bin 53 -> 0 bytes .../test/testdata/v3/test/segments/5-3.values | Bin 79 -> 0 bytes .../test/testdata/v3/test/segments/5.keys | Bin 560 -> 0 bytes .../test/testdata/v3/test/segments/5.metadata | Bin 37 -> 0 bytes .../test/testdata/v3/test/segments/6-0.values | Bin 36 -> 0 bytes .../test/testdata/v3/test/segments/6-1.values | 0 .../test/testdata/v3/test/segments/6-2.values | Bin 104 -> 0 bytes .../test/testdata/v3/test/segments/6-3.values | 0 .../test/testdata/v3/test/segments/6.keys | Bin 225 -> 0 bytes .../test/testdata/v3/test/segments/6.metadata | Bin 37 -> 0 bytes .../test/testdata/v3/test/segments/7-0.values | Bin 15 -> 0 bytes .../test/testdata/v3/test/segments/7-1.values | Bin 18 -> 0 bytes .../test/testdata/v3/test/segments/7-2.values | 0 .../test/testdata/v3/test/segments/7-3.values | 0 .../test/testdata/v3/test/segments/7.keys | Bin 61 -> 0 bytes .../test/testdata/v3/test/segments/7.metadata | Bin 37 -> 0 bytes sei-db/db_engine/litt/util/hashing.go | 74 ------- 65 files changed, 152 insertions(+), 369 deletions(-) delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/5.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/6.metadata delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7-0.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7-1.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7-2.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7-3.values delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7.keys delete mode 100644 sei-db/db_engine/litt/test/testdata/v3/test/segments/7.metadata delete mode 100644 sei-db/db_engine/litt/util/hashing.go diff --git a/sei-db/db_engine/litt/README.md b/sei-db/db_engine/litt/README.md index 4a3740330a..190e98227f 100644 --- a/sei-db/db_engine/litt/README.md +++ b/sei-db/db_engine/litt/README.md @@ -233,18 +233,13 @@ the [value](#value) associated with a [key](#key) can be retrieved from disk. An address is encoded in a 64-bit integer. It contains two pieces of information: - the [segment](#segment) [index](#segment-index) where the [value](#value) is stored +- the [shard](#shard) within that segment that holds the [value](#value) - the offset within the [value file](#segment-value-files) where the first byte of the [value](#value) is stored +- the length of the [value](#value) in bytes -This information is not enough by itself to retrieve the [value](#value) from disk if there is more than one -[shard](#shard) in the [table](#table). When there is more than one [shard](#shard), the following information -must also be known in order to retrieve the [value](#value) (i.e. to figure out which [shard](#shard) to look in): - -- the [sharding factor](#sharding-factor) for the [segment](#segment) where the [value](#value) is stored - (stored in the [segment metadata file](#segment-metadata-file)) -- the [sharding salt](#sharding-salt) for the [table](#table) where the [value](#value) is stored - (stored in the [table metadata file](#table-metadata-file)) -- the [key](#key) that the [value](#value) is associated with +All four pieces are packed into the address itself, so retrieving a [value](#value) is a self-contained +operation that does not need to consult any segment-level metadata or recompute anything from the [key](#key). ## Atomicity @@ -432,7 +427,6 @@ Each metadata contains the following information: - the [segment index](#segment-index) - serialization version (in case the format changes in the future) - the [sharding factor](#sharding-factor) for the segment -- the [salt](#sharding-salt) used for the segment - the [timestamp](#segment-timestamp) of the last element written in the segment. the [TTL](#ttl) of any data contained within it. - whether or not the segment is [immutable](#segment-mutability) @@ -462,26 +456,22 @@ The file name of a value file is `X-Y.values`, where `X` is the [segment index]( LittDB supports sharding. That is to say, it can break the data into smaller pieces and spread those pieces across multiple locations. -In order to determine the shard that a particular [key](#key) is in, a hash function is used. The data that goes -into the hash function is the [key](#key) itself, as well as a [sharding salt](#sharding-salt) that is unique to -each [segment](#segment). +Within a [segment](#segment), [values](#value) are assigned to shards in round-robin order at write time: the first +write goes to shard 0, the second to shard 1, and so on, wrapping around once every shard has been used. Each +[value's](#value) shard is recorded in its [address](#address), so reads do not need to recompute the assignment. -The [sharding salt](#sharding-salt) is chosen randomly. Its purpose is to make the mapping between [keys](#key) and -shards unpredictable to an outside attacker. Without this sort of randomness, an attacker could intentionally craft -keys that all map to the same shard, causing a hot spot in the database and potentially degrading performance. +This scheme produces a perfectly even distribution of [values](#value) across shards regardless of the +[keys](#key) being written. As a side benefit, an outside attacker cannot craft a sequence of [keys](#key) that +all land in the same shard, since the shard chosen for a given [value](#value) depends only on the order in which +it was written, not on the contents of its [key](#key). ### Sharding Factor -The number of [shards](#shard) in a [segment](#segment) is called the "sharding factor". The sharding factor must be -a positive, non-zero integer. The sharding factor can be changed at runtime without restarting the database or +The number of [shards](#shard) in a [segment](#segment) is called the "sharding factor". The sharding factor must +be a positive, non-zero integer no larger than 256 (the limit imposed by encoding the shard ID as a single byte +inside the [address](#address)). The sharding factor can be changed at runtime without restarting the database or performing a data migration. -### Sharding Salt - -A random number chosen to make the [shard](#shard) hash function unpredictable to an outside attacker. This number -does not need to be chosen via a cryptographically secure random number generator, as long as it is not publicly -known. - ## Table A table in LittDB is a unique namespace. Two [keys](#key) with identical values do not conflict with each other as diff --git a/sei-db/db_engine/litt/cli/prune_test.go b/sei-db/db_engine/litt/cli/prune_test.go index dcd5d88648..0432dd4938 100644 --- a/sei-db/db_engine/litt/cli/prune_test.go +++ b/sei-db/db_engine/litt/cli/prune_test.go @@ -114,10 +114,10 @@ func TestPrune(t *testing.T) { seg := segments[i] metadataPath := seg.GetMetadataFilePath() - // Overwrite the old metadata file. The timestamp is encoded at [24:32] in nanoseconds since the epoch. + // Overwrite the old metadata file. The timestamp is encoded at [8:16] in nanoseconds since the epoch. data, err := os.ReadFile(metadataPath) require.NoError(t, err) - binary.BigEndian.PutUint64(data[24:32], sixHoursAgo) + binary.BigEndian.PutUint64(data[8:16], sixHoursAgo) // write the modified metadata file back to disk. err = os.WriteFile(metadataPath, data, 0644) @@ -278,10 +278,10 @@ func TestPruneSubset(t *testing.T) { seg := segments[i] metadataPath := seg.GetMetadataFilePath() - // Overwrite the old metadata file. The timestamp is encoded at [24:32] in nanoseconds since the epoch. + // Overwrite the old metadata file. The timestamp is encoded at [8:16] in nanoseconds since the epoch. data, err := os.ReadFile(metadataPath) require.NoError(t, err) - binary.BigEndian.PutUint64(data[24:32], sixHoursAgo) + binary.BigEndian.PutUint64(data[8:16], sixHoursAgo) // write the modified metadata file back to disk. err = os.WriteFile(metadataPath, data, 0644) diff --git a/sei-db/db_engine/litt/disktable/control_loop.go b/sei-db/db_engine/litt/disktable/control_loop.go index deb3123ed3..0cdf6c2782 100644 --- a/sei-db/db_engine/litt/disktable/control_loop.go +++ b/sei-db/db_engine/litt/disktable/control_loop.go @@ -5,7 +5,6 @@ package disktable import ( "fmt" "log/slog" - "math/rand" "sync" "sync/atomic" "time" @@ -84,9 +83,6 @@ type controlLoop struct { // The table's metadata. metadata *tableMetadata - // A source of randomness used for generating sharding salt. - saltShaker *rand.Rand - // whether fsync mode is enabled. fsync bool @@ -320,11 +316,6 @@ func (c *controlLoop) expandSegments() error { c.immutableSegmentSize += c.segments[c.highestSegmentIndex].Size() // Create a new segment. - salt := [16]byte{} - _, err = c.saltShaker.Read(salt[:]) - if err != nil { - return fmt.Errorf("failed to read salt: %w", err) - } newSegment, err := segment.CreateSegment( c.logger, c.errorMonitor, @@ -332,7 +323,6 @@ func (c *controlLoop) expandSegments() error { c.segmentPaths, c.snapshottingEnabled, c.metadata.GetShardingFactor(), - salt, c.fsync) if err != nil { return err diff --git a/sei-db/db_engine/litt/disktable/disk_table.go b/sei-db/db_engine/litt/disktable/disk_table.go index b96f9f1fa9..15d478d470 100644 --- a/sei-db/db_engine/litt/disktable/disk_table.go +++ b/sei-db/db_engine/litt/disktable/disk_table.go @@ -7,7 +7,6 @@ import ( "fmt" "log/slog" "math" - "math/rand" "os" "path" "sync" @@ -229,12 +228,6 @@ func NewDiskTable( } else { nextSegmentIndex = highestSegmentIndex + 1 } - salt := [16]byte{} - _, err = config.SaltShaker.Read(salt[:]) - if err != nil { - return nil, fmt.Errorf("failed to read salt: %w", err) - } - mutableSegment, err := segment.CreateSegment( config.Logger, errorMonitor, @@ -242,7 +235,6 @@ func NewDiskTable( segmentPaths, snapshottingEnabled, metadata.GetShardingFactor(), - salt, config.Fsync) if err != nil { return nil, fmt.Errorf("failed to create mutable segment: %w", err) @@ -261,8 +253,6 @@ func NewDiskTable( } } - tableSaltShaker := rand.New(rand.NewSource(config.SaltShaker.Int63())) - var upperBoundSnapshotFile *BoundaryFile if config.SnapshotDirectory != "" { // Initialize snapshot files if snapshotting is enabled. @@ -307,7 +297,6 @@ func NewDiskTable( clock: config.Clock, segmentPaths: segmentPaths, snapshottingEnabled: snapshottingEnabled, - saltShaker: tableSaltShaker, metadata: metadata, fsync: config.Fsync, metrics: metrics, diff --git a/sei-db/db_engine/litt/disktable/disk_table_test.go b/sei-db/db_engine/litt/disktable/disk_table_test.go index 749bcfa6f4..ed8960d78d 100644 --- a/sei-db/db_engine/litt/disktable/disk_table_test.go +++ b/sei-db/db_engine/litt/disktable/disk_table_test.go @@ -106,7 +106,6 @@ func buildMemKeyDiskTableSingleShard( config.TargetSegmentFileSize = 100 // intentionally use a very small segment size config.GCPeriod = time.Millisecond config.Fsync = false - config.SaltShaker = util.NewTestRandom().Rand config.Logger = logger table, err := NewDiskTable( @@ -153,7 +152,6 @@ func buildMemKeyDiskTableMultiShard( config.TargetSegmentFileSize = 100 // intentionally use a very small segment size config.GCPeriod = time.Millisecond config.Fsync = false - config.SaltShaker = util.NewTestRandom().Rand config.ShardingFactor = 4 config.Logger = logger @@ -200,7 +198,6 @@ func buildPebbleDBKeyDiskTableSingleShard( config.TargetSegmentFileSize = 100 // intentionally use a very small segment size config.GCPeriod = time.Millisecond config.Fsync = false - config.SaltShaker = util.NewTestRandom().Rand config.Logger = logger table, err := NewDiskTable( @@ -246,7 +243,6 @@ func buildPebbleDBKeyDiskTableMultiShard( config.TargetSegmentFileSize = 100 // intentionally use a very small segment size config.GCPeriod = time.Millisecond config.Fsync = false - config.SaltShaker = util.NewTestRandom().Rand config.ShardingFactor = 4 config.Logger = logger @@ -1214,10 +1210,9 @@ func truncatedValueFileTest(t *testing.T, tableBuilder *tableBuilder) { // Find a shard that has at least one key in the last segment (truncating an empty file is boring) keysInLastFile, err := segments[highestSegmentIndex].GetKeys() require.NoError(t, err) - diskTable := table.(*DiskTable) nonEmptyShards := make(map[uint32]struct{}) for key := range keysInLastFile { - keyShard := diskTable.controlLoop.segments[highestSegmentIndex].GetShard(keysInLastFile[key].Key) + keyShard := uint32(keysInLastFile[key].Address.ShardID()) nonEmptyShards[keyShard] = struct{}{} } var shard uint32 @@ -1243,7 +1238,7 @@ func truncatedValueFileTest(t *testing.T, tableBuilder *tableBuilder) { // Figure out which keys are expected to be missing missingKeys := make(map[string]struct{}) for _, key := range keysInLastFile { - keyShard := diskTable.controlLoop.segments[diskTable.controlLoop.highestSegmentIndex].GetShard(key.Key) + keyShard := uint32(key.Address.ShardID()) if keyShard != shard { // key does not belong to the shard that was truncated continue diff --git a/sei-db/db_engine/litt/disktable/segment/metadata_file.go b/sei-db/db_engine/litt/disktable/segment/metadata_file.go index 15ee163170..0aca7e3eee 100644 --- a/sei-db/db_engine/litt/disktable/segment/metadata_file.go +++ b/sei-db/db_engine/litt/disktable/segment/metadata_file.go @@ -24,33 +24,14 @@ const ( // deleted. MetadataSwapExtension = MetadataFileExtension + util.SwapFileExtension - // V0MetadataSize is the size the metadata file at version 0 (aka OldHashFunctionSegmentVersion) - // This is a constant, so it's convenient to have it here. - // - 4 bytes for version - // - 4 bytes for the sharding factor - // - 4 bytes for salt - // - 8 bytes for lastValueTimestamp - // - and 1 byte for sealed. - V0MetadataSize = 21 - - // V1MetadataSize is the size of the metadata file at version 1 (aka SipHashSegmentVersion). - // This is a constant, so it's convenient to have it here. - // - 4 bytes for version - // - 4 bytes for the sharding factor - // - 16 bytes for salt - // - 8 bytes for lastValueTimestamp - // - and 1 byte for sealed. - V1MetadataSize = 33 - - // V2MetadataSize is the size of the metadata file at version 2 (aka ValueSizeSegmentVersion). - // This is a constant, so it's convenient to have it here. - // - 4 bytes for version - // - 4 bytes for the sharding factor - // - 16 bytes for salt - // - 8 bytes for lastValueTimestamp - // - 4 bytes for keyCount - // - and 1 byte for sealed. - V2MetadataSize = 37 + // V3MetadataSize is the size of the metadata file at LatestSegmentVersion (ShardedAddressSegmentVersion). + // Layout: + // - 4 bytes for version + // - 4 bytes for the sharding factor + // - 8 bytes for lastValueTimestamp + // - 4 bytes for keyCount + // - 1 byte for sealed + V3MetadataSize = 21 ) // metadataFile contains metadata about a segment. This file contains metadata about the data segment, such as @@ -66,15 +47,6 @@ type metadataFile struct { // The sharding factor for this segment. This value is encoded in the file. shardingFactor uint32 - // A random number, used to make the sharding hash function hard for an attacker to predict. - // This value is encoded in the file. Note: after the hash function change, this value is - // only used for data written with the old hash function. - legacySalt uint32 - - // A random byte array, used to make the sharding hash function hard for an attacker to predict. - // This value is encoded in the file. - salt [16]byte - // The time when the last value was written into the segment, in nanoseconds since the epoch. A segment can // only be deleted when all values within it are expired, and so we only need to keep track of the // lastValueTimestamp of the last value (which always expires last). This value is irrelevant if the segment is @@ -102,7 +74,6 @@ type metadataFile struct { func createMetadataFile( index uint32, shardingFactor uint32, - salt [16]byte, path *SegmentPath, fsync bool, ) (*metadataFile, error) { @@ -115,7 +86,6 @@ func createMetadataFile( file.segmentVersion = LatestSegmentVersion file.shardingFactor = shardingFactor - file.salt = salt err := file.write() if err != nil { return nil, fmt.Errorf("failed to write metadata file: %v", err) @@ -170,14 +140,7 @@ func getMetadataFileIndex(fileName string) (uint32, error) { // Size returns the size of the metadata file in bytes. func (m *metadataFile) Size() uint64 { - switch m.segmentVersion { - case OldHashFunctionSegmentVersion: - return V0MetadataSize - case SipHashSegmentVersion: - return V1MetadataSize - default: - return V2MetadataSize - } + return V3MetadataSize } // Name returns the file name for this metadata file. @@ -203,119 +166,23 @@ func (m *metadataFile) seal(now time.Time, keyCount uint32) error { return nil } -func (m *metadataFile) serializeV0Legacy() []byte { - data := make([]byte, V0MetadataSize) - - // Write the version - binary.BigEndian.PutUint32(data[0:4], uint32(m.segmentVersion)) - - // Write the sharding factor - binary.BigEndian.PutUint32(data[4:8], m.shardingFactor) - - // Write the salt - binary.BigEndian.PutUint32(data[8:12], m.legacySalt) - - // Write the lastValueTimestamp - binary.BigEndian.PutUint64(data[12:20], m.lastValueTimestamp) - - // Write the sealed flag - if m.sealed { - data[20] = 1 - } else { - data[20] = 0 - } - - return data -} - -func (m *metadataFile) serializeV1Legacy() []byte { - data := make([]byte, V1MetadataSize) - - // Write the version - binary.BigEndian.PutUint32(data[0:4], uint32(m.segmentVersion)) - - // Write the sharding factor - binary.BigEndian.PutUint32(data[4:8], m.shardingFactor) - - // Write the salt - copy(data[8:24], m.salt[:]) - - // Write the lastValueTimestamp - binary.BigEndian.PutUint64(data[24:32], m.lastValueTimestamp) - - // Write the sealed flag - if m.sealed { - data[32] = 1 - } else { - data[32] = 0 - } - - return data -} - // serialize serializes the metadata file to a byte array. func (m *metadataFile) serialize() []byte { - if m.segmentVersion == OldHashFunctionSegmentVersion { - return m.serializeV0Legacy() - } else if m.segmentVersion == SipHashSegmentVersion { - return m.serializeV1Legacy() - } + data := make([]byte, V3MetadataSize) - data := make([]byte, V2MetadataSize) - - // Write the version binary.BigEndian.PutUint32(data[0:4], uint32(m.segmentVersion)) - - // Write the sharding factor binary.BigEndian.PutUint32(data[4:8], m.shardingFactor) - - // Write the salt - copy(data[8:24], m.salt[:]) - - // Write the lastValueTimestamp - binary.BigEndian.PutUint64(data[24:32], m.lastValueTimestamp) - - // Write the key count - binary.BigEndian.PutUint32(data[32:36], m.keyCount) - - // Write the sealed flag + binary.BigEndian.PutUint64(data[8:16], m.lastValueTimestamp) + binary.BigEndian.PutUint32(data[16:20], m.keyCount) if m.sealed { - data[36] = 1 + data[20] = 1 } else { - data[36] = 0 + data[20] = 0 } return data } -func (m *metadataFile) deserializeV0Legacy(data []byte) error { - // TODO (cody.littley): delete this after all data is migrated - if len(data) != V0MetadataSize { - return fmt.Errorf("metadata file is not the correct size, expected %d, got %d", - V0MetadataSize, len(data)) - } - - m.shardingFactor = binary.BigEndian.Uint32(data[4:8]) - m.legacySalt = binary.BigEndian.Uint32(data[8:12]) - m.lastValueTimestamp = binary.BigEndian.Uint64(data[12:20]) - m.sealed = data[20] == 1 - return nil -} - -func (m *metadataFile) deserializeV1Legacy(data []byte) error { - // TODO (cody.littley): delete this after all data is migrated - if len(data) != V1MetadataSize { - return fmt.Errorf("metadata file is not the correct size, expected %d, got %d", - V1MetadataSize, len(data)) - } - - m.shardingFactor = binary.BigEndian.Uint32(data[4:8]) - m.salt = [16]byte(data[8:24]) - m.lastValueTimestamp = binary.BigEndian.Uint64(data[24:32]) - m.sealed = data[32] == 1 - return nil -} - // deserialize deserializes the metadata file from a byte array. func (m *metadataFile) deserialize(data []byte) error { if len(data) < 4 { @@ -323,26 +190,20 @@ func (m *metadataFile) deserialize(data []byte) error { } m.segmentVersion = SegmentVersion(binary.BigEndian.Uint32(data[0:4])) - if m.segmentVersion > LatestSegmentVersion { - return fmt.Errorf("unsupported serialization version: %d", m.segmentVersion) + if m.segmentVersion != LatestSegmentVersion { + return fmt.Errorf("unsupported segment version: %d (only version %d is supported)", + m.segmentVersion, LatestSegmentVersion) } - if m.segmentVersion == OldHashFunctionSegmentVersion { - return m.deserializeV0Legacy(data) - } else if m.segmentVersion == SipHashSegmentVersion { - return m.deserializeV1Legacy(data) - } - - if len(data) != V2MetadataSize { + if len(data) != V3MetadataSize { return fmt.Errorf("metadata file is not the correct size, expected %d, got %d", - V2MetadataSize, len(data)) + V3MetadataSize, len(data)) } m.shardingFactor = binary.BigEndian.Uint32(data[4:8]) - m.salt = [16]byte(data[8:24]) - m.lastValueTimestamp = binary.BigEndian.Uint64(data[24:32]) - m.keyCount = binary.BigEndian.Uint32(data[32:36]) - m.sealed = data[36] == 1 + m.lastValueTimestamp = binary.BigEndian.Uint64(data[8:16]) + m.keyCount = binary.BigEndian.Uint32(data[16:20]) + m.sealed = data[20] == 1 return nil } diff --git a/sei-db/db_engine/litt/disktable/segment/metadata_file_test.go b/sei-db/db_engine/litt/disktable/segment/metadata_file_test.go index ec7e62d27d..897a89e9cc 100644 --- a/sei-db/db_engine/litt/disktable/segment/metadata_file_test.go +++ b/sei-db/db_engine/litt/disktable/segment/metadata_file_test.go @@ -17,7 +17,6 @@ func TestUnsealedSerialization(t *testing.T) { index := rand.Uint32() shardingFactor := rand.Uint32() - salt := ([16]byte)(rand.Bytes(16)) timestamp := rand.Uint64() segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) @@ -27,7 +26,6 @@ func TestUnsealedSerialization(t *testing.T) { index: index, segmentVersion: LatestSegmentVersion, shardingFactor: shardingFactor, - salt: salt, lastValueTimestamp: timestamp, sealed: false, segmentPath: segmentPath, @@ -64,7 +62,6 @@ func TestSealedSerialization(t *testing.T) { index := rand.Uint32() shardingFactor := rand.Uint32() - salt := ([16]byte)(rand.Bytes(16)) timestamp := rand.Uint64() segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) @@ -74,7 +71,6 @@ func TestSealedSerialization(t *testing.T) { index: index, segmentVersion: LatestSegmentVersion, shardingFactor: shardingFactor, - salt: salt, lastValueTimestamp: timestamp, sealed: true, segmentPath: segmentPath, @@ -109,14 +105,12 @@ func TestFreshFileSerialization(t *testing.T) { rand := util.NewTestRandom() directory := t.TempDir() - salt := ([16]byte)(rand.Bytes(16)) - index := rand.Uint32() segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) err = segmentPath.MakeDirectories(false) require.NoError(t, err) - m, err := createMetadataFile(index, 1234, salt, segmentPath, false) + m, err := createMetadataFile(index, 1234, segmentPath, false) require.NoError(t, err) require.Equal(t, index, m.index) @@ -151,14 +145,12 @@ func TestSealing(t *testing.T) { rand := util.NewTestRandom() directory := t.TempDir() - salt := ([16]byte)(rand.Bytes(16)) - index := rand.Uint32() segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) err = segmentPath.MakeDirectories(false) require.NoError(t, err) - m, err := createMetadataFile(index, 1234, salt, segmentPath, false) + m, err := createMetadataFile(index, 1234, segmentPath, false) require.NoError(t, err) // seal the file @@ -170,7 +162,6 @@ func TestSealing(t *testing.T) { require.Equal(t, LatestSegmentVersion, m.segmentVersion) require.True(t, m.sealed) require.Equal(t, uint64(sealTime.UnixNano()), m.lastValueTimestamp) - require.Equal(t, salt, m.salt) require.Equal(t, uint32(1234), m.shardingFactor) require.Equal(t, uint32(987), m.keyCount) diff --git a/sei-db/db_engine/litt/disktable/segment/segment.go b/sei-db/db_engine/litt/disktable/segment/segment.go index 6edfd1f1dd..fd41da9ffc 100644 --- a/sei-db/db_engine/litt/disktable/segment/segment.go +++ b/sei-db/db_engine/litt/disktable/segment/segment.go @@ -94,6 +94,16 @@ type Segment struct { // If true, then sync the file system for atomic operations. Should always be true in production, but can // be set to false for tests to save time. fsync bool + + // nextShard is the shard index that will receive the next value written to this segment. After each Write, + // it is incremented modulo metadata.shardingFactor, producing a perfectly even round-robin distribution of + // values across shards regardless of the keys being written. This counter is only meaningful for the + // mutable segment (sealed segments never accept further writes), so we do not persist it to disk and we do + // not bother reconstructing it when loading a sealed segment from disk. + // + // Write is only ever invoked from the disk_table control loop, which is single-threaded with respect to + // any given segment, so we do not guard nextShard with atomics or a lock. + nextShard uint32 } // CreateSegment creates a new data segment. @@ -104,14 +114,13 @@ func CreateSegment( segmentPaths []*SegmentPath, snapshottingEnabled bool, shardingFactor uint32, - salt [16]byte, fsync bool) (*Segment, error) { if len(segmentPaths) == 0 { return nil, errors.New("no segment paths provided") } - metadata, err := createMetadataFile(index, shardingFactor, salt, segmentPaths[0], fsync) + metadata, err := createMetadataFile(index, shardingFactor, segmentPaths[0], fsync) if err != nil { return nil, fmt.Errorf("failed to open metadata file: %v", err) } @@ -378,22 +387,6 @@ func (s *Segment) SetNextSegment(nextSegment *Segment) { s.nextSegment = nextSegment } -// GetShard returns the shard number for a key. -func (s *Segment) GetShard(key []byte) uint32 { - if s.metadata.shardingFactor == 1 { - // Shortcut: if we have one shard, we don't need to hash the key to figure out the mapping. - return 0 - } - - if s.metadata.segmentVersion == OldHashFunctionSegmentVersion { - return util.LegacyHashKey(key, s.metadata.legacySalt) % s.metadata.shardingFactor - } - - hash := util.HashKey(key, s.metadata.salt) - - return hash % s.metadata.shardingFactor -} - // Write records a key-value pair in the data segment, returning the maximum size of all shards within this segment. // // This method does not ensure that the key-value pair is actually written to disk, only that it will eventually be @@ -403,7 +396,14 @@ func (s *Segment) Write(data *types.KVPair) (keyCount uint32, keyFileSize uint64 return 0, 0, fmt.Errorf("segment is sealed, cannot write data") } - shard := s.GetShard(data.Key) + // Shard assignment is round-robin: each successive call deposits the value into the next shard, wrapping around + // after metadata.shardingFactor calls. This is safe to do without locking because Write is invoked exclusively + // from the disk_table control loop goroutine. + shard := s.nextShard + s.nextShard++ + if s.nextShard == s.metadata.shardingFactor { + s.nextShard = 0 + } currentSize := s.shardSizes[shard] if currentSize > math.MaxUint32 { diff --git a/sei-db/db_engine/litt/disktable/segment/segment_test.go b/sei-db/db_engine/litt/disktable/segment/segment_test.go index 30005a821b..c5ff479832 100644 --- a/sei-db/db_engine/litt/disktable/segment/segment_test.go +++ b/sei-db/db_engine/litt/disktable/segment/segment_test.go @@ -48,7 +48,6 @@ func TestWriteAndReadSegmentSingleShard(t *testing.T) { expectedLargestShardSize := uint64(0) - salt := ([16]byte)(rand.Bytes(16)) segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) err = segmentPath.MakeDirectories(false) @@ -60,7 +59,6 @@ func TestWriteAndReadSegmentSingleShard(t *testing.T) { []*SegmentPath{segmentPath}, false, 1, - salt, false) require.NoError(t, err) @@ -199,7 +197,6 @@ func TestWriteAndReadSegmentMultiShard(t *testing.T) { // a map from keys to addresses addressMap := make(map[string]types.Address) - salt := ([16]byte)(rand.Bytes(16)) segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) err = segmentPath.MakeDirectories(false) @@ -211,7 +208,6 @@ func TestWriteAndReadSegmentMultiShard(t *testing.T) { []*SegmentPath{segmentPath}, false, shardCount, - salt, false) require.NoError(t, err) @@ -359,7 +355,6 @@ func TestWriteAndReadColdShard(t *testing.T) { // a map from keys to addresses addressMap := make(map[string]types.Address) - salt := ([16]byte)(rand.Bytes(16)) segmentPath, err := NewSegmentPath(directory, "", "table") require.NoError(t, err) err = segmentPath.MakeDirectories(false) @@ -371,7 +366,6 @@ func TestWriteAndReadColdShard(t *testing.T) { []*SegmentPath{segmentPath}, false, shardCount, - salt, false) require.NoError(t, err) @@ -467,7 +461,6 @@ func TestGetFilePaths(t *testing.T) { index := rand.Uint32() shardingFactor := rand.Uint32Range(1, 10) - salt := make([]byte, 16) segmentPath, err := NewSegmentPath(t.TempDir(), "", "table") require.NoError(t, err) @@ -482,7 +475,6 @@ func TestGetFilePaths(t *testing.T) { []*SegmentPath{segmentPath}, false, shardingFactor, - ([16]byte)(salt), false) require.NoError(t, err) @@ -522,3 +514,71 @@ func TestGetFilePaths(t *testing.T) { require.Equal(t, segment.shards[i].path(), valueFiles[i]) } } + +// TestRoundRobinShardAssignment writes exactly `valuesPerShard * shardingFactor` keys to a segment and verifies +// that each shard received exactly `valuesPerShard` of them, in round-robin insertion order. This is the core +// guarantee of the round-robin shard assignment scheme: it does not rely on the contents of the keys at all. +func TestRoundRobinShardAssignment(t *testing.T) { + t.Parallel() + + ctx := t.Context() + rand := util.NewTestRandom() + logger := slog.Default() + directory := t.TempDir() + + const shardingFactor uint32 = 7 + const valuesPerShard = 13 + const valueCount = int(shardingFactor) * valuesPerShard + + segmentPath, err := NewSegmentPath(directory, "", "table") + require.NoError(t, err) + err = segmentPath.MakeDirectories(false) + require.NoError(t, err) + + seg, err := CreateSegment( + logger, + util.NewErrorMonitor(ctx, logger, nil), + rand.Uint32(), + []*SegmentPath{segmentPath}, + false, + shardingFactor, + false) + require.NoError(t, err) + + // Capture the address that the segment assigns to each write, in insertion order. + insertionOrderShards := make([]uint8, 0, valueCount) + + for i := 0; i < valueCount; i++ { + key := rand.PrintableVariableBytes(8, 32) + value := rand.PrintableVariableBytes(8, 32) + _, _, err := seg.Write(&types.KVPair{Key: key, Value: value}) + require.NoError(t, err) + + flushFn, err := seg.Flush() + require.NoError(t, err) + flushed, err := flushFn() + require.NoError(t, err) + // Each iteration above should produce exactly one new flushed key (the one we just wrote). + require.Len(t, flushed, 1) + insertionOrderShards = append(insertionOrderShards, flushed[0].Address.ShardID()) + } + + // The i-th key written should land in shard (i % shardingFactor). + for i, gotShard := range insertionOrderShards { + expectedShard := uint8(uint32(i) % shardingFactor) + require.Equal(t, expectedShard, gotShard, + "value at insertion index %d landed in shard %d, expected shard %d", + i, gotShard, expectedShard) + } + + // And each shard should have received exactly valuesPerShard values. + perShardCounts := make(map[uint8]int) + for _, s := range insertionOrderShards { + perShardCounts[s]++ + } + require.Len(t, perShardCounts, int(shardingFactor)) + for s := uint8(0); s < uint8(shardingFactor); s++ { + require.Equal(t, valuesPerShard, perShardCounts[s], + "shard %d received %d values, expected %d", s, perShardCounts[s], valuesPerShard) + } +} diff --git a/sei-db/db_engine/litt/disktable/segment/segment_version.go b/sei-db/db_engine/litt/disktable/segment/segment_version.go index 8565a1492a..a7cc21ecbb 100644 --- a/sei-db/db_engine/litt/disktable/segment/segment_version.go +++ b/sei-db/db_engine/litt/disktable/segment/segment_version.go @@ -4,21 +4,19 @@ package segment // SegmentVersion is used to indicate the serialization version of a segment. Whenever serialization formats change // in segment files, this version should be incremented. +// +// Versions 0, 1, and 2 are no longer supported and have been removed from the codebase. The current code can only +// read and write segments at LatestSegmentVersion. The constant numbers below are kept implicitly (no constant is +// declared for them) so that LatestSegmentVersion still increases monotonically as a historical record. type SegmentVersion uint32 const ( - // OldHashFunctionSegmentVersion is the serialization version for the old hash function. - OldHashFunctionSegmentVersion SegmentVersion = 0 - - // SipHashSegmentVersion is the version when the siphash hash function was introduced for sharding. - SipHashSegmentVersion SegmentVersion = 1 - - // ValueSizeSegmentVersion adds the length of values to the key file. Previously, only the key and the address were - // stored in the key file. It also adds the key count to the segment metadata file. - ValueSizeSegmentVersion SegmentVersion = 2 - - // ShardedAddressSegmentVersion replaces the legacy 8-byte address+separate value size in the key file with the - // 13-byte sharded Address layout (index, offset, shardID, valueSize). The keymap also stores the new layout. + // ShardedAddressSegmentVersion is the on-disk format that: + // - Replaces the legacy 8-byte address + separate value size in the key file with the 13-byte sharded + // Address layout (index, offset, shardID, valueSize). The keymap stores the same layout. + // - Drops the per-segment hashing salt from the metadata file. Shards are assigned to values in + // round-robin order at write time, which makes the key->shard mapping unpredictable to outside + // callers without needing a hash function or any randomness in the metadata. ShardedAddressSegmentVersion SegmentVersion = 3 ) diff --git a/sei-db/db_engine/litt/docs/architecture.md b/sei-db/db_engine/litt/docs/architecture.md index a769670e48..45424bae54 100644 --- a/sei-db/db_engine/litt/docs/architecture.md +++ b/sei-db/db_engine/litt/docs/architecture.md @@ -190,20 +190,20 @@ spread those pieces across multiple locations. Key files and metadata files are small. For the sake of simplicity, let's not bother sharding those. Value files are big. Break apart value files, and have one value file per shard. -When writing data, the first thing to do will be to figure out which shard the data belongs in. Do this by taking a -hash of the key modulo the number of shards. +When writing data, the first thing to do will be to figure out which shard the data belongs in. We assign shards in +round-robin order: the first write into a fresh segment goes to shard 0, the second to shard 1, and so on, wrapping +around once we have used every shard. -When reading data, we need to do the reverse. Take a hash of the key modulo the number of shards to figure out which -shard to look in. As a consequence, the address alone is no longer enough information to find the data. We also need -to know the key when looking up data. But this isn't a problem, since we always have access to the key when we are -looking up data. +When reading data, we need to know which shard the value lives in. To avoid having to recompute or look anything up, +the address itself records the shard ID alongside the offset. So the address is a self-contained pointer to the +value: given just the address, we know exactly which file to open and where in that file to seek. -From a security perspective, sharding with a predictable hash is dangerous. An attacker could, in theory, craft keys -that all map to the same shard, causing a hot spot in the database. To prevent this, the database chooses a random -"salt" value that it includes in the hash function. As long as an attacker does not know the salt value, they cannot -predict which shard a key will map to. +Round-robin assignment has a nice security side effect for free. A predictable key-to-shard hash is dangerous because +an attacker could craft keys that all map to the same shard and create a hot spot. With round-robin, the shard chosen +for a given value depends only on the order in which it was written, not on the contents of its key, so this attack +is not even expressible. -We already have a metadata file for each segment. We can go ahead and save the sharding factor and salt in the metadata +We already have a metadata file for each segment. We can go ahead and save the sharding factor in the metadata file. This will give us enough information to find data contained within the segment. ## Iteration 9: Multi-table support diff --git a/sei-db/db_engine/litt/go.mod b/sei-db/db_engine/litt/go.mod index 5d17a909b7..669427e11a 100644 --- a/sei-db/db_engine/litt/go.mod +++ b/sei-db/db_engine/litt/go.mod @@ -33,7 +33,6 @@ go 1.25.6 require ( github.com/cockroachdb/pebble/v2 v2.1.3 - github.com/dchest/siphash v1.2.3 github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 diff --git a/sei-db/db_engine/litt/go.sum b/sei-db/db_engine/litt/go.sum index a447a0b859..08fb3195ec 100644 --- a/sei-db/db_engine/litt/go.sum +++ b/sei-db/db_engine/litt/go.sum @@ -45,8 +45,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6N github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA= -github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= diff --git a/sei-db/db_engine/litt/littdb_config.go b/sei-db/db_engine/litt/littdb_config.go index eec3f803ad..5b3471b12c 100644 --- a/sei-db/db_engine/litt/littdb_config.go +++ b/sei-db/db_engine/litt/littdb_config.go @@ -7,7 +7,6 @@ import ( "fmt" "log/slog" "math" - "math/rand" "time" "github.com/docker/go-units" @@ -84,10 +83,6 @@ type Config struct { // The default is 8. Must be in the range [1, MaxShardingFactor]. ShardingFactor uint32 - // The random number generator used for generating sharding salts. The default is a standard rand.New() - // seeded by the current time. - SaltShaker *rand.Rand - // The size of the cache for tables that have not had their write cache size set. A write cache is used // to store recently written values for fast access. The default is 0 (no cache). // Cache size is in bytes, and includes the size of both the key and the value. Cache size can be set @@ -184,9 +179,6 @@ func DefaultConfig(paths ...string) (*Config, error) { // DefaultConfigNoPaths returns a Config with default values, and does not require any paths to be provided. // If paths are not set prior to use, then the DB will return an error at startup. func DefaultConfigNoPaths() *Config { - seed := time.Now().UnixNano() - saltShaker := rand.New(rand.NewSource(seed)) - return &Config{ CTX: context.Background(), Logger: slog.Default(), @@ -194,7 +186,6 @@ func DefaultConfigNoPaths() *Config { GCPeriod: 5 * time.Minute, GCBatchSize: 10_000, ShardingFactor: 8, - SaltShaker: saltShaker, KeymapType: keymap.PebbleDBKeymapType, ControlChannelSize: 64, TargetSegmentFileSize: math.MaxUint32, @@ -270,9 +261,6 @@ func (c *Config) SanityCheck() error { if c.GCPeriod == 0 { return fmt.Errorf("gc period must be at least 1") } - if c.SaltShaker == nil { - return fmt.Errorf("salt shaker cannot be nil") - } if (c.MetricsEnabled || c.MetricsRegistry != nil) && c.MetricsUpdateInterval == 0 { return fmt.Errorf("metrics update interval must be at least 1 if metrics are enabled") } diff --git a/sei-db/db_engine/litt/test/table_test.go b/sei-db/db_engine/litt/test/table_test.go index 2db5402831..f157385a31 100644 --- a/sei-db/db_engine/litt/test/table_test.go +++ b/sei-db/db_engine/litt/test/table_test.go @@ -138,7 +138,6 @@ func buildMemKeyDiskTable( config.Clock = clock config.Fsync = false config.DoubleWriteProtection = true - config.SaltShaker = util.NewTestRandom().Rand config.TargetSegmentFileSize = 100 // intentionally use a very small segment size config.Logger = logger @@ -185,7 +184,6 @@ func buildPebbleDBKeyDiskTable( config.Clock = clock config.Fsync = false config.DoubleWriteProtection = true - config.SaltShaker = util.NewTestRandom().Rand config.TargetSegmentFileSize = 100 // intentionally use a very small segment size config.Logger = logger diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/000002.log b/sei-db/db_engine/litt/test/testdata/v3/test/keymap/data/000002.log index cc44a0fe2012aeba1d22e12afe0d7427926fdd57..123ad6e771152cbcf8bd12d20bb88288e6f0960d 100644 GIT binary patch literal 3141 zcmYLL%g*aa5&rwYY;yT?`I$32IEaI0#6^?XPHb}oOcL8k96NR{j^k{=aW1ywB+kuF zEF^>k;vHbgQ}70eH(Gd3-CFZ|V4UsZLvyZ`X-hW-0@pS^o|dCB1k<8wSw zjb4p?1-*K`j=l0O3u?tEuA8Di1JxX=Xx+`B&5p**dSu(zd90@fKL*u2Do_)8&Rqm0 z7KXbN`zgqlQQ@|xw(Qc0PxX5i5|1HVt{j*6mo6RC`^@7no{5&c`uL>pdenR{_L(>% zG9dVh@^&IfYq}e`hjFU+YtYM~!gA1@xH>I+yfjQP8T1OMxDeMfc`;3zG)t{gP=99m zN*#8rB8aWNr`K68MI}(g)f;s9z<1mrl)If2Q$ezTDh?%ZjpM1~O{9osm?%yS7NDE| zPw+eY&(BW$0erxNbmE&|lOn^Sb}L6(yYWPt>IN_&9x@83@CengMK_oYeY+?U7Av6o_HP|cw- zWk!KuM(u~x@_Sv4{05*|eJ-U=z%srwWmV_6)o!Gj0QmyctEhZPSYb#jy_tFOMSUiu z?%zPVh>GJn65p?$Bl#u_6r?a4MJegy^Z zL9&P{_CZ|e%idVoE(e^w*I5a3c_eEtPD9)J%5mr8yJUpsZ-z8-Er-DI@c~6 z{*dCo1P3`(+$@yn$oj%$5}4U0{0fxu-rJ*^#h;gT!@F2Ujh3>#V4m6L)lI7&aP`@t zm(_Uy!nn?fM$ZLfu-Z$eo5Tv23J*Z|4dumfvvMrizIC%251+E71>G0V17&fZT-QFu zrcCj=&E8JUOTAFCm0H-cME5H@$Ujx?=VXSs{%N+F!v^LZy{4i%wLVZ*+Ej ztw;Kdz>t0(z1>Fl5!J9m+jisRdef32IfcOF6P~zZ@@=Dc8ef|8;em8GK+R|V1v=dA zhVf!AZMCd=pTOV^6%EOEA2C&@#CortM$Lk30hKTEb7i zd>7CCvC3o!#8^R9yyJ?{^|Z^pmL$r3d%9;9porVoxL-RroANHAy=dJ!qDrbryu*U4 zxZBOF%TjBf`|f$4(%(QEUptpMJyYp$W!|PF58! z?Q&Qqwfa;#9?bB#tD7U4{AWP@1iDr9#)QFf#hN2Wd4%`1Ofl_jJHCDvJHN9!*I9kK zihV7Os|7Cb9yZ(cIL42dX%^Qv7=SCwi+bly`|6&#(=BChmHCL?Swr_>p2FpP;FI6(yBHzk6%|*Hi^sXb zW#DrXNtJ-lbn=HLlLT#kJGhenoIsFB8I^pl+t(IGCv=Y2Xh@PFFeH=1XUuS~hO@3d z3XPp(koO_LvL7&nu`;jqM?2>sE|^)(-O8jHf%}2f z5al-yXA()X`AQ*I89*N)UrY_GYilnyv~?}E*2znu7!NkgWyNPj;6am=>gDA#@c%#1X$%4Y literal 3210 zcmYM0%g*aa5rF@mVL-~|&uthagoFk-Gw1+PVmq-jGcZbGJBee*&c${dG155B#de&; zx!H-AJOFFv(z$$72p|^^P=9V)4sST?s!ev%lnvR zQI^reV?t?z$+(uH0-!P~>$gkiYE#}>u;;C7M^K&;Z$P4gUOU{@>-QCNy}s7ON>*2k1@v`_z5(<=FQHHLM2W#fMY}zR)!g^&?=mad|J5yG14jc8_Pw^)Y zT=A=7q+8T>>4+;go`_RTPeoo~)f~zy>sBq`YR10z|J{Oi1{IrXf3$V(!kjUx?nauX zsuJ*5R8qU^eVZMPnbpX)FSA%n1%3$v+0QQT+rNDr`gid=3=lxYM3J<0Z&jTxnO$9y zdGZx7xKuy|cix<-L*~YqUZhF%6T>0kW$jVbYMvG~-8)-)l@`sX04$qFh2?Okghp2z zh5FXfg(t=oZ>w}{bE3iy28L2=QVWxHQi0NAUwO(9*A{y>&AKC;Q}{!GIaJUop(!h> zd#zrr8ZW1qeyp9{H<%=7H#dU|$qo2g2EU7_;-C1jCe^MpO5jRQnSU!8yO` zxf|8kv$J_Sdcq2XC5tN8(QQQ4?a;Q}IJsQaWay>(P0+_%bC!V^k7zH^8k^;EYHm^i z9vms4++xs}xEd{aO_3BFd^X{c`{S_on}0t}>r?y=gOq4#WOlDqYrl59wIy^`K8Yu| zMCz@GGL3dEj&;SKim)0XkJa+y8Wo-SjnIsG6E}qwfVk4UUdLW~=Q*`xWcNuwe7BPh zJwF~*##!y7k*m*6q$a@j4?v)dvTeP09G@Gr;hqGVEQ<+7`89WEZdaww9>o!f0Kks` z=22NzI*DiqMo;GMhs22KS?U<~Sh~E6?$%TiRLYSW2aA>&QZr!VEx2Apx%REv8mo-R zv?ovdBxog6Y}}Z7Xsp_rvlW`-#Ui!-F1a&Y;-9;8Oz%jwfYmSXgyyuL1h&~?*;9i* zE&^JHpg44JH`T7_m$dj zS(z7FeNU^gBym9hE6^`}^@o27e|nrf3*vYb@I<+rIO%j|LVL6}+F%f*$)kkI-BrCl zWI4azO#)_nH(R5p#Jey_Rd2f6w6fkU@E+ z7kAsXrHn6{K~9J)4KCw0>?sC&skUX&4LOs)&`GNOW3UbxFqfkP>+_RIV3IhKZGv_V z<(K!f$GQA@;Bz8LS%4n{%%U8v$9^2#7KinL^h02;cw(QjT(@~*POLkaldb^hdw}qr zBZTXvV@dY4OL{P%p8(3C;=q#Y9=q$`8vSN{sa8{8KL?I|)s>(lP-?GdjfEhE-zMu~ zcf##<7|(a&MkQAjeEt+36_gFk(N@+CK~yHG+6Zix{`%+7fA#Cfaf3;kPQMO6;(o+*`|46 z*VS8-1QW9XAN2ZYO1*fmROX&NJFj=x}LXr=&lE#V+WTQ0Z2`O9%bT#cI6uJkLI)%H*W; zsB+#fl4@-#9`1D}*3;gGPeC@VX-^+psQ>`4{?BFR%ix$BDBunQ+X)^1Nm z4jbQ*KG*H5bG;Kfhf6dh`3$P$3dC1GWkvySM(w-U@_SvCbYHS6mch|22updaYQ9(v zPNQ+%N}c{bgerq7gMDxA@){$oaAR_Mjo2o+0T$k6O^%w-Gw#gGF+U^?9N5o5y@>w` ztHoo9vSPm7#4Y zTqeP^ZL*wl0mq00IEGJgPWOe=K%So_mz7VE)B{|?6GyZdSeMpLsH>}LY^~%e**5Tx z9_pFdt)-i4Be_ed;h#RvqL`@kjMoRtooKpAEOROU5_km_yxRDvZF|&gF!q_4Bqta) z0Kfi?9<;lU4F~ug27Jf=b-EE9sdls8+4j{QxiTOUWZ>3)50$V**O_(mMtVMB5JJ+w JaaF;2{trn060`sS diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-0.values index 169686b7368073d41f55c0a131727ff3ab58361e..331a14864d8aab667500dab950791e44cb6bc4d7 100644 GIT binary patch literal 105 zcmZQzVBj;WNG&Ti_Hm0ewMef>X8?+Xl!m1z1-rPFlmSHqlari^Oe4w@UD7L4 zN~_Fs+<=0-X-Qs1>E(`2J{D%)89)J^6z7QaV3XjS@Vwl7AfMaFq@biCIkGUXyc7W1 CJsn&C literal 68 zcmZQzVBmN53dlDw%XZFBvG6d>%VA((;Bv}!EKf0VE%PV`@^}LSqb!pP16&J@!oq@p U0(@o_sb$5+K5mhw7U>n~05DJydH?_b diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-1.values index 2bfb41a777bca750899b63a444f7175ad32784a0..37ad8c80a93a294caa3d2b9e2cd2aed7e59c73a6 100644 GIT binary patch literal 94 zcmZQzU=S+GH}}m64RP@*F|KrWH}SNrU;v6bmSkr{nx#6qlzU|bI9o;*8URJPf(na0 qf?fQ)k|IEAd`gQAGo8Zo@>0B#6Ahi*1Ij^aoN^t@Q;b~8JjwxxZy7QG literal 107 zcmZQzVBiTU4GT{W^z{sNHZEsiU=VWm$jpn1Nb?PMPm3x{D{>9Z0*O|+7G#D*7W(G- znmD=^1g0hz14X$CU7hpGgVNHg41hd7&L|B+R E01fsW;s5{u diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-2.values index fba1a5be507b12fc38b2cffc954f27a2d2ce7938..e0dcd18ce557e3a631bd1e2265c86e646392d8fb 100644 GIT binary patch literal 91 zcmZQzVBjsTj0*ItEHW`K3G*;vU|)E*C)n literal 30 lcmZQzVBkuNEH}3-4e-eIV_;z5@hx;T^mcKIbT>8j1^{A!2H5}r diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0-3.values index f4011228bf81fa4209e0ae2c7a027d9bd21494f7..403726f7e6cd0579a23d3d5641ee17dcba27a963 100644 GIT binary patch literal 93 zcmZQzU=T7l$xBI(%C@Y`^{vRrGbk=7V_;wqG%JhBFmtjnG4S=X2)A%esQ?NJWV?ix snOS(`S{RtSxw<%K0mZn|BFoJ!O9MP|{eV24Ko6so!l0BY5A(1h0B7YGH~;_u literal 77 zcmZQzVBpR)bc%F$3r_Pj4q#wl5HbrWa0|`%DReDKHx2X&NHY%viV8c28M>G_RT>9m drzMw!Ia(CBIs%1xqui^~gG${?O-+;BA_3386Vm_y diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.keys index ac8a5936627bfb488cb8879612c6050a4a4121de..1b20c9cb4e4a229fedba9a9d1b926cf760dc89ba 100644 GIT binary patch literal 648 zcmYjNO?RR&6s6OhQd?&+zhJs*7c~h2vzgQKRRINMtdt!^oCGaORj~Z}$?HH*-#IUN z$-Q~^<_Ut(A+hnkqxLb8gfG$Kbzj3#QFtUt^Kwe(;oB$UjHBOyagyHc?R>9PUbSY7 z#oM;UH(p%uymFphiOH{{({Q9pOYg2Fobv)&T+&Dly$Lyy1uK0UH#k7ThY2=*k`H$e zu1R;wLOOkamESO~LAlFQL;((! zz3x`}WZi%_APu&}V~YODFG*DlPOUE$NHDmLQfGS$SNOGU`m6o$B^%5NfBlF;XO@ww zeM&$SM%ImM-Au7n(tO5`5WhhaEQ>GBFrYrRnQBe|;bFrf^1O(Q^vRC?)I%(zCEW7x z+u!z3zLs6xxF0cpAhZ9dV1nw$ARSHJWC`8uY)fmvF~~yaeu8vG+7=oM%n}n)Rt+P9 Gz55STCTAA_ literal 494 zcmYk1TT_Bi6oskY#B2V79_m@S1kUuL1OiGTf*I4x5k(M(yaDO2@2p9izL|A6v)4N8 zy%~mK6TYR)wsTvT-k5*X=)K~r%c<$R=VxBx78kRLZ;7fL=lWjh9izRx%PuB!M=vZS zc-!5Xvj-EWeer7W?ji5{sAPnT4=VAynW9?P$Ri?XP*vn4HVo@M3^UQwX$8E%u23~d zs`~a^cZRF^KqhlJfemh`%2W+$SnxYhKICpJOw_Jcz@IX z)k*?UPus}M0uf~jhoeeW;zef=3Wr69phT&oC-$l-8%bCPu4DyYt5Igaq&!{y=DMZj z-UpW~0&N);6V0`~-w0DhXUxr7VYj`J+tXD4+ZyjNRlPGZ#z}BeePP;)R;Ej9z(fGE YHAej~?MY)tSdIxf&I%hgpF diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/0.metadata index 39a2143fc763ac1375cd16471b912ad03cfc6a9e..59f5cc7e3980d012f19fb4ede56a1644b081067d 100644 GIT binary patch literal 21 bcmZQzU|?ooU|^A0-LU+D>+KalwkRV2DdhyP literal 37 scmZQzU|?ooU|jm0O!dK7ytkO diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-0.values index 7417db336e553a5db83978b3f23884d8ac6645bd..5021c4a0e1b0edeaa2e13b8257f07d068157914e 100644 GIT binary patch literal 108 zcmZQzVBqmBbTssKaf);|HTGs;VBpFz3^FVAHc5331oDLQ)BKz(f^(uOOiV%pvfVA5 z4NQQ-Lf&4MIlkpa79~N(nWoNF!TzZrt%a`6`Q<@r=~V_m9)C`elaYTwMMOcFqouoR F5ddR(8&UuO literal 14 VcmZQzVBjiC49LoLsW8k5000$a1F`@B diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-1.values index 47831c390500d5babd62fcd68b33cce2b875c9e8..2c2322eec8085941115981dd3edeb20283008499 100644 GIT binary patch literal 98 zcmZQzVBm8uEzZtQ4)n-zOO7mYXJB9u3ds-fDhx46_9!UzHqSE8_b3L63i_2e`vpch xx|VunRt086MEC#&xy;NnvW#3({E94qJmISR9FvS9-{dUs43qK*r*MM^696J#8z2Ax literal 103 zcmZQzVBpQqD=G6fb9K$}s|YP&U|`@2vT$^bFpmljOE&e+E(MD4lvR``8|Rsn6crk~ z0QtP80fzp$VgAM$o`wOQKmq=oA}1sNfQpEMGDk~y*CLRf6z7QaV3XjS@Vwl708@1v A9smFU diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-2.values index 6484ee367d548b578ab11ffe6f62b94af179d140..a3a0a1cc52950cf1ed211b99df0a6fb1972e484e 100644 GIT binary patch literal 94 zcmZQzU=Yp^_RAME4%A!gq0QB)2IRF3v literal 34 pcmZQzVBj~22n{JrDb5QFDDgCM%4T3-;5H7obT2J;H;(Wy004~g2!j9s diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1-3.values index 422626311bb07abbd44a5ed02edcc9934829df97..d6e12ce43a8528d14915dba5e309091959480c46 100644 GIT binary patch literal 88 zcmZQzVBj|iarZEBtMUjB4$U*oPiA0X;58}9OUW+^GmOkB$*%$m@Pw3xg(nC4dWJe1 mmxC1K=arOso4LB?_*I0K00sEHe4-31vkFQh10&pmiroS8!WbL? delta 55 zcma!WS7Tsc;0q}YOHT@RaVyD7G)*Z3iU>FsWmj7G=BK%5m$_!R`6W*fB`8jL{v^_^#CIOom` z+{@he?&COahd$e~Bjm4XI0Wg8!|gHFjl*|`ouUkvLK zh4u79n_&Ifd7^?lFux<{{Vf$4Ckw?+4!LulQT_*10DOOcQP7KI>C5nhRd6UxwDY~j|yX0NW@ zSof?vHb?HkxWLkQ&=c3i(~#3q&uhkK>#-#bjyb~nX^ecp2S3cnvR#y>~ni&#>#B+lBp zT~i~kdFCB5uz|sPUKW0I(3h*}rL$w$PmeKff?FVKNu4C+wLLd}>s71_%`v=ipD@dJ i<~2~NmQ0E~U(kXl42VIGeriv?OQKj6Ha#xseZYT)-bHKx diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/1.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/1.metadata index 9c0a07935de17e2c90234a33fc01f5e7a217bc80..ceb0472df221baf3660db8f73a33f0a19d634a8f 100644 GIT binary patch literal 21 bcmZQzU|?ooU|^A0-LU+@O#1*JTa*z1CNTsM literal 37 scmZQzU|?ooU|?}n)Ve5qAgq%$^;(GMfolsTR@d2VzqRlMP>z=o0J(Mx&;S4c diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-0.values index e609a7d8ff489fcd9d2bb64ca9229c839e860f56..a6213d16ef072e753bf665f64a7219d90614ddc0 100644 GIT binary patch literal 114 zcmZQzVBj?kF!aw2^Eb}$Gz{=$U|G^a)5a4+M$|mL L`6(72rg=F4UR53x literal 99 zcmZQzU=WJP^ffdIs7Q4za4AoBF3%6oVPIh3%}5N%DDiZ2&kZz6Gz1C=`jt5Q1x7i# xmU?AY1!hD<_y7fkd`gQAGo8Zo@>0B#6Ahi*1Ij^qi#$^k4a$6q1M_?ed;mCS8@>Pl diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-1.values index edd96b11b8fe7cfa2201ba58cd499278e11fd2ce..9acdd2b3b0b20cf396b6e0b539a3ef2bfadfe0aa 100644 GIT binary patch literal 94 zcmZQzVBpP249O_*baT%QG)gpNU|1bM?se2my+6hlLoF1p9>> snwNQj6h&nE8kz)Dq&gP3l&3qF=ZEJ2Mfrj(99<*Kqk_YdO}(>A0a^hVlK=n! literal 79 zcmZQzVBj|~vM9B5b~USt$_dO5cV}Q=5YA8YbFK)^iK;L$2@S}0w{SKv0SXKFnid-* fS2`MndKqUGm$*~`#dy7wee=RfA_L0PlM6!t4uusg diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2-2.values index d433f189c945d4f75b4c95cd316fba185f976919..26f273a2a29107e158a7682a278890ceb8cbe3e4 100644 GIT binary patch literal 100 zcmZQzU=Z*%EjCE5bTkU}GR`V4aj9Yeig||QyM_4{mM0pO=Le=0X8^_cO(H@=3R8;n y0s~4sjhwQ9Lc#?`u8G+J&W43-@sYQ5b LZefUPU}_2giCZ3@ diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.keys index e4227e12e774748ca3d8b0504ae2fd6d193680c8..b075b9adaf3cb31406ffccfb806f3016257d54d9 100644 GIT binary patch literal 675 zcmXw#TXUj75QW*@w^f%!_dg_$FmkOtg$N>d5LA5G0>lsy0}-O~>vx74s5&$?=VSVG z69hp9Ko$+t&RVJs>4iZM#80UHnZWntDBPJ_YqET;xbN_wcYh!UYFd8ZLtm3^kZ9az zI5(JJKoIwU#N8OS+N6?`6td{W@c{gSA0*U>397mSj=uJ2>^;ItOp*LF*F7QnY}O}V z+VXR!Endi1%kIP!_wB2Tk-tNPnSNIH*}`Guv@5Md<*t!}nHfrf+Kn~p z!!OUTAWx`a%qMu>&oI^JhLiI0B`mvge=N227j)3|PbkI+VV$WtM>VDV15>h^vB1DH zqR^P+A=rG^KoZ%vVr8r6!AAkm1+&(@xqywTD9Wx~)7qW&fteRriQiBoDNt+g!tJbc zfjw^6!+2g5g>~JR%DX-6@dY)XK}`ZB&+b=11DRGO{40-IkD(qeTBA!@QSUUt&7CO5 zzzWuW$B(rnC?>D#8TBEMIxuC?=D?0{vDX_ z-RC@&zV2f~VPaX4WJ{zeP z9geuuoH1AzTi($CXz~ZC?25LRmQu3g$S$=mW-PFe-5lOJC&qGpD4h17lPh)$(NR1A diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/2.metadata index 37fa77636e36b92849dec693cdca22018a764499..c6c01a5bb1ae27f1d72e016e60703f3c4cc3ae8f 100644 GIT binary patch literal 21 bcmZQzU|?ooU|^A0-LU+@bA<~)wkRV2D#!%C literal 37 scmZQzU|?ooU|_jb%7 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-0.values index a1aafe90d2108141115d231b245d7e2f195e533e..736194f339b7ffdbcec9be52db42ef2a0c48bcb6 100644 GIT binary patch literal 100 zcmZQzVBk;6NscHl3C|64vWUp8Dq~<^;0lc>Nea%*iVO$>@d|t^y~A8QLo2I*Jl^Dx w!a{$)w6fA*$C47D0KbWmMX9B;t65c4PGEkxJ4lUpvTt5kNn}8IdU9b109gYY=>Px# literal 102 zcmZQzVBj({&&V=zN%1SPU;y%R41>%{y-iY`1A#p5s-nuQp!DoWV<$@>mnWjiDLKG5 zG^(0)+016hC8hS=nRYpaG2NwmE7zCOF1$m>~tI~r? z-AhePliVVK0zxU-KH1)GIZ1xSK^f`JQSQYBKvC{YL#If0x8O8i;{YI+FVH{HIWRFO L*vve|Iou2Ywyqu{ literal 62 zcmZQzU=Z*O$#)C$Ei6woD$fs0E6!j5isgIe`a7mpS*95I8vEp@_yfg+980n@BF$2r OT*|$&0-P-)3k?7bvk_ka diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-2.values index f62a19890e7f2f8626e4441bff7d49259f145549..64f9fb58247e4e0c50876f0ab3cc99d85e0e303e 100644 GIT binary patch literal 81 zcmZQzVBjtCOieT>^C=F@^C|FQU|`@Wt0+%4&NC?~Dl~Qh^0^GWO@cfN0+XCVfjr){ foN_ZykBrbv3%}ebkU(Hylx1>ZfNP;qSXdAMO70aL literal 48 zcmZQzVBk#-DJ=B&ODii4b}T7jU|`@W&G59$_bYdgD)SEl^0~{6+_DSGax4QJJpne6 B4Ke@# diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3-3.values index ecf045ba1c45e75622190502223c031c5d0ec967..e3e316f029895d5e0a8028d239625828c5db05c4 100644 GIT binary patch literal 99 zcmZQzU=Vf=GjuU=sx%JBPD?HcbF?UMb!1>*;4e3cDD^2YG;&WjD+tfY0SXD5WV;xd xhIxCrM}~Ms_ys3td3%CX76wN72IZ6mn)rGJ1qFuyg}AGVDzk#pvm=e2ECJ<08X^Dy literal 62 zcmZQzU=Ylz2y*fZ^!F|Ba4pI%_9``DU|`@2^iOmSObiM(Gf#02Hv@_Y7Z|xFW(PPM Q7P?g$`sA5M7^YVO0Puhik^lez diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3.keys index 18fd750b38b2a4b9dbe9870ddf6d8ee56c7e78af..521be251394c2ef907c41eec82790aa6b4df58ca 100644 GIT binary patch literal 677 zcmX|8O>?3^6lAkEqHd{`$~o6uB7%aIO8^Ja1&PY1r^OhRKokd%k6*tt)DWtgnW^sg z`t=M&QM6l#mSc>oazRnlZ-n~$gZ}h#4GRG0Yn?-I9P{&H^n$)7TfdZ5txL2!rpjn+C5HE{xB#e3Zb5V z^6F|nlYCEKr|))S`+`(;-+pr5RRhLUE@vmcgp9LVtVoAf?A=4?b8&Rp^Umr+E92sG zG32D?ZC;v-zYje*wHb4te;K4+Y|_(XiOF+I|1z85-jJlem{xF8p)92*C|omAx5B>n z2wh&w+3QG1Zf3x3fT-j|@%G~?%qEb7{ORwuc@7i1;_BXc6ZwwF^Kd-9?jlwzZ=`&K X);fIK(jyrR4OR8lAR_EPY~T409G-38 literal 455 zcmXxhOH+bS6bJBI?SdMy+PP^}Gi?YZa9RoSQV@^?ac3Ix@(G3d>AT0dEY3a5{QhUo z9WFwMKB}H9PZi0HdICm` zzg&zGweF#F5aQviAl3qdK}y+0%SAYt|7r%YH!xV)7=|XF2y5f`VRZSW&62<;1THt8 xSh=ilwyuX`B`5j>e;szy?Om3Qs@Ymy+3y5j03UEsdEjQ|#8*_yBL>fbn13HNMjQYD diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/3.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/3.metadata index 3d89a38cf8788c50a124ec376ba6869560d7c738..731f63f0c83b8cc3c87cd09f3bc3e145aae0c76e 100644 GIT binary patch literal 21 bcmZQzU|?ooU|^A0-LU+jLxBX4Eyf4{BYOj~ literal 37 scmZQzU|?ooU|?CqJma9&?4Iqv{%@}>9r+HZxRJo@*nVCld RMYxT_E!|7Y-HjtW3;-GQ5T^hD literal 114 zcmZQzVBj+FHVN`92uyMcWnf?sHpzA|G7aKodMO`e diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-2.values index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..be061c6a2d13e1d4570988dcd7cbbcdf1b01369b 100644 GIT binary patch literal 79 zcmZQzU=VOD%C5BV%};aBE_2Or^Gjx6VBqnsvMe+W39Sf7%gzAu1s!wDOB{m>Gh9nT fE6U3({4IcjLhc@!c~KE*zTxg^QH5zmuAx}~Ss50( literal 0 HcmV?d00001 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4-3.values index 7cddf7676a733a31db9a011086de8d1fc0067a2b..33525506ca0687d055410c3df3fcd43a85ba2a9b 100644 GIT binary patch literal 57 zcmZQzVBm5w@pW>Ea106dV_;wq^fsyp%5?GzH1+jMGB-^zb^;0t8JQ)SCst+vMR@`}j8Y1NQmQ=6!-@dkMijOH diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.keys index b4e21630bb3511df1e32e9a3f3cdb6419c3687ef..5d0f0a0fa8029f3809d65f4e684c0c9fa6494ea6 100644 GIT binary patch literal 459 zcmXw#+irqD5QevhD=mt)4`9+hfKjM&Sr9y+AVmH>T3~y;G_VzWmP~n@#FDpmy?pE_37*Vu#vM!B zE$wK6J44j8T)_?21Kun~7ipPO{supIA*v^9Bc5BftSn5*8sOdn{->Cd4v?eoCdh#97|S1r8O=fBl}OMRi*h5)|p Ee=-+Iga7~l literal 399 zcmXwz-BW@<6velxCn8Io=`X0KUPLgVx8f_8Fj0&hrx(ORJ_bY@tQ-l%@Wsk6kGIvhIFDHK*L z9$=S>BcXB_{|;KkV5kG7eZav`lSlbZjTS~NN>bf02fCz>YjCWGN0S(7@s2B}DOBHQ zjz{RYq2i|VeXH*$b6aBQ7Q(RkuEYoHZJX=}mYsO!ubJTi3~)E6*El6rD1F2XJ^$D8 zma3$2uuThWstmqBjt7-Q{IbPj<5ljIK@*a&wcC!4IA4}>^VuX(6!|%GJkfbRxnE}M V(?D>IJoAb?5j+Pw%<~N`y+4ByK_dVF diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/4.metadata index 4325755e1bec70f27e555154994653ccc748048f..03885bbf3ffd658ab6e9e39371bd3c02e29d070c 100644 GIT binary patch literal 21 bcmZQzU|?ooU|^A0-LU-Oj4uvAHa{Z(D!Bx& literal 37 scmZQzU|?ooU|>mi^t{n|uf+Fnp!kC`;{N;+tLtobY`rc4l;dRt0Le=WW&i*H diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-0.values deleted file mode 100644 index ec4586c596424de4eca165058b4447fc3772791f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74 zcmZQzU=Rw)5AZ4sF-i6)DD^haGSBxYW?*0tG%a*VvkXZ$u<-XN_pdBU3IhuAxaEYq a6s1?C7H1R{0{PrwAqFMEe&L4ZWnKW`ClpHn diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-1.values deleted file mode 100644 index a385eb2dd2553e2efe4a24fa1a6f27826b45d33a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmZQzVBk$l@+wL%cXaZxF!Rn}U|`^KG4XYBiEs=F_5<<43Ud9^O;gMw6M;N|Y?sh7 zGYgMg3j=dER~P3jkc!ZVlBD3=tjK^MAdfdKr`*ibBO^4^!Y?-pC?K2^>X8)gR}hrv O<(3;{T9uOS8wmiVdme!R diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-2.values deleted file mode 100644 index 8aac08ea6d494cef9dd0e97068f6316831c893c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53 zcmZQzVBkxO2y@9wGx0F?aSVvcXJBC9FE@!O^(inka!)ra2+zp@3i0?>Sr(dxgjNKk HWoG~YS#=H( diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5-3.values deleted file mode 100644 index f4bc006fcbd9ae73c9263f6f4b9a437e706e2380..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmZQzU=Vc7F)wipF3fN(39TqEv+%cI01BFwMP-;dS(q63`dNfqxTaJ91^EjDqkMyM e$^uP%y@G;*Lx4hjMjj@H<>r=^5jk$j73lyY)fCGB diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/5.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/5.keys deleted file mode 100644 index 768551e6405d0a61c543ab5353cc443ea51c171d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 560 zcmXw$&r^ax6vwxkE~#NUb?wxprkPkVa+(eyASHo{itDKamH1&Q3c_FCTW2|Z=k2`D zcXz-079mtxWR8`ntb_xKgUaP=A;|`P(XA7t_q0rUpgP=bktruf4jtp+2$+CFF;jnC!uU7Ql`H9 zTE}cM0~Ca6AWm`hf!Xubr*PXJGzqk5vfJW-dUvHwJ-H_+^E@&f?K%BXndb)T@p)xz zH6|~ytf#UOF!)FhsDerXY467T&`o`lv3vS74s;PO#XbKcXJO7zjZTE3%1HISEX6!l zc&(V%0{~Q}Gzi8do|)42!`nvCpqbx`%pAddUkLXSCWF>4&=`NC*V1X%x(&TI7nPVq zc{E)_pVpRHUZJ8Ah#Qd>S=eIJ%H>VFmoa`v0wRsOKo&vohoso$?Xe|lF+tgf@!$(&UIloMhE0Ny7I9RL6T diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-0.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-0.values deleted file mode 100644 index 61fcbf16d68a3e2bc53e1fb9d8f18694f4b03dfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 rcmZQzVBj?=$xF#E3Nwt%Dao&5U|`_)@`*C6%ql3242*CKDs~3|t!@fl diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-1.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-1.values deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-2.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-2.values deleted file mode 100644 index aa7662b63390d31a53d4e916143ac7d86cdb877b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104 zcmZQzU=T7-DGLnp_jY&8a&}8|^~m)IVE~F6nI)Ozc~pfa<+&vlC8j5vxd27^lX8+H z%1gp?!<;N4va8B~Lc&$~IVKrJzR6kM87AcsPT>X-CO~1n(8R=i=Q4vlM>Chwh(G|r Ci5(>X diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-3.values b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6-3.values deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.keys b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.keys deleted file mode 100644 index 15c45399cce621d8355501dce0460ce914a46667..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 225 zcmZQzU=YZwGI#Ma_VEY{FV1oe2y13wT8 z4B(2Wa10IiH>;}jf=cOtq`-Qs{EZ`ALcLRR-NG}f%6%-L3hY4&gh7fj4TA~;vOSC< Qyo0h#%7dZuVIX-v057s7tN;K2 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/6.metadata deleted file mode 100644 index 6e105055e281bec2a238a3381916cd34ce025951..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ooU|?D5|G1|_e!(~XR49j>e`YX_gfMKt5QK5y;>J E07qmA0ssI2 diff --git a/sei-db/db_engine/litt/test/testdata/v3/test/segments/7.metadata b/sei-db/db_engine/litt/test/testdata/v3/test/segments/7.metadata deleted file mode 100644 index d6731be3d2b664080c4c6a618210a6a5c3dcaea2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37 scmZQzU|?ooU|{)N{(qzWa0O`35lK=n! diff --git a/sei-db/db_engine/litt/util/hashing.go b/sei-db/db_engine/litt/util/hashing.go deleted file mode 100644 index dfd210d59e..0000000000 --- a/sei-db/db_engine/litt/util/hashing.go +++ /dev/null @@ -1,74 +0,0 @@ -//go:build littdb_wip - -package util - -import ( - "encoding/binary" - - "github.com/dchest/siphash" -) - -// Perm64 computes A permutation (invertible function) on 64 bits. -// The constants were found by automated search, to -// optimize avalanche. Avalanche means that for a -// random number x, flipping bit i of x has about a -// 50 percent chance of flipping bit j of perm64(x). -// For each possible pair (i,j), this function achieves -// a probability between 49.8 and 50.2 percent. -// -// Warning: this is not a cryptographic hash function. This hash function may be suitable for hash tables, but not for -// cryptographic purposes. It is trivially easy to reverse this function. -// -// Algorithm borrowed from https://github.com/hiero-ledger/hiero-consensus-node/blob/main/platform-sdk/swirlds-common/src/main/java/com/swirlds/common/utility/NonCryptographicHashing.java -// (original implementation is under Apache 2.0 license, algorithm designed by Leemon Baird) -func Perm64(x uint64) uint64 { - // This is necessary so that 0 does not hash to 0. - // As a side effect this constant will hash to 0. - x ^= 0x5e8a016a5eb99c18 - - x += x << 30 - x ^= x >> 27 - x += x << 16 - x ^= x >> 20 - x += x << 5 - x ^= x >> 18 - x += x << 10 - x ^= x >> 24 - x += x << 30 - return x -} - -// Perm64Bytes hashes a byte slice using perm64. -func Perm64Bytes(b []byte) uint64 { - x := uint64(0) - - for i := 0; i < len(b); i += 8 { - var next uint64 - if i+8 <= len(b) { - // grab the next 8 bytes - next = binary.BigEndian.Uint64(b[i:]) - } else { - // insufficient bytes, pad with zeros - nextBytes := make([]byte, 8) - copy(nextBytes, b[i:]) - next = binary.BigEndian.Uint64(nextBytes) - } - x = Perm64(next ^ x) - } - - return x -} - -// LegacyHashKey hash a key using the original littDB hash function. Once all data stored using the original -// hash function is deleted, this function can be removed. -func LegacyHashKey(key []byte, salt uint32) uint32 { - return uint32(Perm64(Perm64Bytes(key) ^ uint64(salt))) -} - -// HashKey hashes a key using perm64 and a salt. -func HashKey(key []byte, salt [16]byte) uint32 { - leftSalt := binary.BigEndian.Uint64(salt[:8]) - rightSalt := binary.BigEndian.Uint64(salt[8:]) - hash := siphash.Hash(leftSalt, rightSalt, key) - return uint32(hash) -}