Skip to content

Conversation

@Harrm
Copy link

@Harrm Harrm commented Nov 6, 2024

  • Introduce merkle tree implementation with RocksDb as storage, two modes, archive and nomt, are provided
  • Add -Werror and remove warnings
  • Use GCC 14 on CI
  • Enable thin LTO on appropriate build types
  • Use another BLAKE library
  • Update cmake presets
  • Rename namespace jam to morum

@Harrm Harrm marked this pull request as ready for review June 19, 2025 16:52
@Harrm Harrm requested review from iceseer and xDimon and removed request for xDimon June 20, 2025 08:47
@kamilsa kamilsa requested a review from Copilot June 20, 2025 12:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new merkle tree implementation that uses RocksDb for storage, adds support for two modes (archive and nomt), updates compiler flags and CI configuration, and performs a namespace rename from “jam” to “morum”. Key changes include dependency and build configuration updates in vcpkg, extensive namespace renaming across source/test files, and the complete implementation of the merkle tree functionality.

Reviewed Changes

Copilot reviewed 147 out of 148 changed files in this pull request and generated 1 comment.

File Description
vcpkg.json Updated package name and dependencies; dependency renames and removals performed.
vcpkg-overlay/* Updated portfile and package names to align with new namespace.
test/* and src/* Renamed namespaces (from jam to morum) and integrated new merkle tree implementation changes.

Comment on lines +79 to +80
return qtils::FixedByteSpanMut<DISK_PAGE_SIZE>{
reinterpret_cast<uint8_t *>(this), DISK_PAGE_SIZE};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return qtils::FixedByteSpanMut<DISK_PAGE_SIZE>{
reinterpret_cast<uint8_t *>(this), DISK_PAGE_SIZE};
return {reinterpret_cast<uint8_t *>(this), DISK_PAGE_SIZE};

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't compile because this constructor is explicit.

std::copy_n(value.begin(), value.size(), value_hash.begin());
std::fill_n(value_hash.begin() + value.size(), 32 - value.size(), 0);
} else {
bytes[0] = 0x3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bytes[0] = 0x3;
bytes[0] = 0b00000011;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's easy enough to image 3 in binary system, I'd like to mostly stick to hex, because it's more compact.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, refactor it after merge of master.
Move tests into unit directory.
Please, use google-test framework where it possible.

int main(int argc, char **argv) {
char arg0_default[] = "benchmark";
char *args_default = arg0_default;
if (!argv) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (argc == 1)
argv это массив указателей и он не может быть равен nullptr. А argv[0] это путь к исполняемому файлу

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was meant to be !*argv. argc can equal zero.

{
ZoneNamedN(setter_zone, "set", true);
for (auto &[k, v] : insertions) {
tree->set(k, qtils::ByteVec{v}).value();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно тут стоит вставить ассерт на наличие результата

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will throw an exception and kill the benchmark, which in this place works fine in my opinion.

ZoneNamedN(setter_zone, "initial insertions", true);

for (int i = 0; i < INSERTION_NUM; i++) {
tree->set(random_hash(), qtils::ByteVec{random_vector()}).value();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно тут стоит вставить ассерт на наличие результата

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will throw an exception and kill the benchmark, which in this place works fine in my opinion.

ZoneNamedN(getter_zone, "get", true);

for (auto &[k, v] : insertions) {
tree->get(k).value();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно тут стоит вставить ассерт на наличие результата

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will throw an exception and kill the benchmark, which in this place works fine in my opinion.

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Copy link
Member

@xDimon xDimon Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't off extensions, please. We are using "statement expressions" in some places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants