Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #329 from helium/jg/handle_compressed_snaps
Browse files Browse the repository at this point in the history
switching to all compressed snaps
  • Loading branch information
madninja authored May 13, 2022
2 parents 95e9b46 + 0e790f4 commit c4aa18f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{"1.2.0",
[{<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},2},
[{<<"acceptor_pool">>,
{git,"https://github.com/novalabsxyz/acceptor_pool",
{ref,"1f0a0c0ff43ab8a0cb074e71d9319237b155afe7"}},
2},
{<<"backoff">>,{pkg,<<"backoff">>,<<"1.1.6">>},2},
{<<"base32">>,{pkg,<<"base32">>,<<"0.1.0">>},4},
{<<"base64url">>,{pkg,<<"base64url">>,<<"1.0.1">>},0},
{<<"blockchain">>,
{git,"https://github.com/helium/blockchain-core.git",
{ref,"256ba67cd18ea6f763e505f540595dc8d89feb41"}},
{ref,"de79b0869a19d053edc7399e2c42c1c863e36bdd"}},
0},
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.9.0">>},1},
{<<"chatterbox">>,
{git,"https://github.com/andymck/chatterbox",
{ref,"b56a2a08b8a31b7ab0d536e5e8a55d5abe70390f"}},
{git,"https://github.com/novalabsxyz/chatterbox",
{ref,"9055e611d509eec2f182bbf52a54ec821b17ac59"}},
2},
{<<"clique">>,
{git,"https://github.com/helium/clique.git",
Expand Down Expand Up @@ -74,8 +77,8 @@
{ref,"a77686b55b60b052d6c7cd927d04dde429bbdabf"}},
2},
{<<"grpcbox">>,
{git,"https://github.com/andymck/grpcbox.git",
{ref,"fbf689bb9c25fc2943155c891974e1f745ce5ac7"}},
{git,"https://github.com/novalabsxyz/grpcbox.git",
{ref,"5cca01a52b6bb4c8dbadf1fe7f6441a350308235"}},
1},
{<<"h3">>,
{git,"https://github.com/helium/erlang-h3.git",
Expand All @@ -84,7 +87,7 @@
{<<"hackney">>,{pkg,<<"hackney">>,<<"1.17.0">>},0},
{<<"helium_proto">>,
{git,"https://github.com/helium/proto.git",
{ref,"ff36c415bcc5056dc306eb50d7afa83e52016df8"}},
{ref,"73ed90cc875451ddcdff968a368c586e55eb730a"}},
1},
{<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.2.3">>},3},
{<<"idna">>,{pkg,<<"idna">>,<<"6.1.1">>},1},
Expand All @@ -100,7 +103,7 @@
{<<"lager">>,{pkg,<<"lager">>,<<"3.9.2">>},0},
{<<"libp2p">>,
{git,"https://github.com/helium/erlang-libp2p.git",
{ref,"059ab21518633b1a99dbf17d6d5ca510d8e50f6f"}},
{ref,"95fd37f967e6d83b9fd7796ef7d060abff47a018"}},
1},
{<<"libp2p_crypto">>,
{git,"https://github.com/helium/libp2p-crypto.git",
Expand Down Expand Up @@ -156,7 +159,6 @@
1}]}.
[
{pkg_hash,[
{<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>},
{<<"backoff">>, <<"83B72ED2108BA1EE8F7D1C22E0B4A00CFE3593A67DBC792799E8CCE9F42F796B">>},
{<<"base32">>, <<"044F6DC95709727CA2176F3E97A41DDAA76B5BC690D3536908618C0CB32616A2">>},
{<<"base64url">>, <<"F8C7F2DA04CA9A5D0F5F50258F055E1D699F0E8BF4CFDB30B750865368403CF6">>},
Expand Down Expand Up @@ -200,7 +202,6 @@
{<<"throttle">>, <<"E881B46D9836AFB70F3E2FA3BE9B0140805BA324ED26AA734FF6C5C1568C6CA7">>},
{<<"unicode_util_compat">>, <<"BC84380C9AB48177092F43AC89E4DFA2C6D62B40B8BD132B1059ECC7232F9A78">>}]},
{pkg_hash_ext,[
{<<"acceptor_pool">>, <<"0CBCD83FDC8B9AD2EEE2067EF8B91A14858A5883CB7CD800E6FCD5803E158788">>},
{<<"backoff">>, <<"CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39">>},
{<<"base32">>, <<"10A73951D857D8CB1ECEEA8EB96C6941F6A76E105947AD09C2B73977DEE07638">>},
{<<"base64url">>, <<"F9B3ADD4731A02A9B0410398B475B33E7566A695365237A6BDEE1BB447719F5C">>},
Expand Down
4 changes: 2 additions & 2 deletions src/be_db_block.erl
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ maybe_write_snapshot(_, <<>>, _, _Chain) ->
maybe_write_snapshot(Height, SnapshotHash, SnapshotDir, Chain) ->
{ok, BinSnap} =
case blockchain:get_snapshot(SnapshotHash, Chain) of
{error, not_found} -> blockchain:get_snapshot(Height, Chain);
{error, NF} when NF =:= not_found; NF =:= file_not_found -> blockchain:get_snapshot(Height, Chain);
Other -> Other
end,
Filename = filename:join([SnapshotDir, io_lib:format("snap-~p", [Height])]),
ok = blockchain:save_bin_snapshots(Filename, BinSnap),
ok = blockchain:save_compressed_bin_snapshot(Filename, BinSnap),
{ok, Sz, FHash} = blockchain:maybe_get_compressed_snapdata(Filename),
LatestMap = #{
height => Height,
Expand Down

0 comments on commit c4aa18f

Please sign in to comment.