reth icon indicating copy to clipboard operation
reth copied to clipboard

fix(db): upgrade to libmdbx 0.12.2;

Open galaio opened this issue 2 years ago • 3 comments

This pr tries to fix the compile error described in https://github.com/paradigmxyz/reth/discussions/368. I had tried some previous libmdbx versions, and v0.12.1 is not work in x86_64, reth should use the latest version, it works.

I upgrade libmdbx version steps as below:

  1. Visit release page libmdbx 0.12.2;
  2. Download libmdbx-amalgamated-0_12_2.zip;
  3. Unzip source code, and replace in path crates/storage/libmdbx-rs/mdbx-sys/libmdbx;
  4. Test it, cargo clean & cargo test --all;

galaio avatar Dec 10 '22 11:12 galaio

Great you found the fix! but we need to follow the procedure from here: https://github.com/paradigmxyz/reth/tree/main/crates/storage/libmdbx-rs (I think it trims down some files)

rakita avatar Dec 10 '22 17:12 rakita

Appreciate you taking the time.

Let's not rush with merging also - would like to understand what changed / why this if a fix, and if there's any license issues.

gakonst avatar Dec 10 '22 17:12 gakonst

Great you found the fix! but we need to follow the procedure from here: https://github.com/paradigmxyz/reth/tree/main/crates/storage/libmdbx-rs (I think it trims down some files)

Hi @rakita , I reproduce libmdbx code by the below steps, it gets the same files, with no change to release v0.12.2.

cd crates/storage/libmdbx-rs
git clone https://gitflic.ru/project/erthink/libmdbx.git ~/libmdbx --branch v0.12.2
make -C ~/libmdbx dist
rm -rf mdbx-sys/libmdbx
cp -R ~/libmdbx/dist mdbx-sys/libmdbx
git add mdbx-sys/libmdbx

galaio avatar Dec 10 '22 18:12 galaio

This helped resolve many of the errors I had trying to build on Windows 10, but I am left with two involving afl.rs. They are the exact same as reported in this open issue with an older version: https://github.com/rust-fuzz/afl.rs/issues/186 .

shedrick4570 avatar Dec 11 '22 02:12 shedrick4570

Yikes - but yeah this is expected given we use a c library and try to go cross platform. Appreciate the patience until we dig into this and eventually switch to a pure Rust db like https://github.com/cberner/redb.

gakonst avatar Dec 11 '22 10:12 gakonst