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

Commit

Permalink
Merge pull request #1796 from helium/adt/validator1.13.7
Browse files Browse the repository at this point in the history
Prepare for validator 1.13.7
  • Loading branch information
evanmcc authored Aug 10, 2022
2 parents 74aee29 + 3d62787 commit 760bb04
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions config/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
{fetch_latest_from_snap_source, true},
{honor_quick_sync, true},
{quick_sync_mode, blessed_snapshot},
{blessed_snapshot_block_height, 1353314},
{blessed_snapshot_block_height, 1471681},
{blessed_snapshot_block_hash,
<<93,22,91,124,187,181,233,151,28,123,43,11,80,212,121,199,167,221,207,157,29,241,227,3,69,14,43,205,97,206,91,65>>},
<<136,139,194,2,69,194,236,22,135,91,228,52,218,201,55,195,37,173,212,164,174,245,94,219,126,252,225,126,134,90,217,137>>},
{listen_addresses, ["/ip4/0.0.0.0/tcp/44158"]},
{key, {ecc, [{key_slot, 0}, {onboarding_key_slot, 15}, {bus, "i2c-1"}, {address, 16#60}]}}, %% don't make this the last line in the stanza because sed and keep it on one line
{base_dir, "/var/data"},
Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{<<"base64url">>,{pkg,<<"base64url">>,<<"1.0.1">>},1},
{<<"blockchain">>,
{git,"https://github.com/helium/blockchain-core.git",
{ref,"0caf2295d0576c0ef803258e834bf6ec3b3e74bc"}},
{ref,"14eecaec37a33d8cff70025259177f2f58993879"}},
0},
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.9.0">>},2},
{<<"chatterbox">>,
Expand Down Expand Up @@ -114,7 +114,7 @@
0},
{<<"helium_proto">>,
{git,"https://github.com/helium/proto.git",
{ref,"3de41dd9ebe9a67b170d08ab70eecea201e6aa92"}},
{ref,"a0a58da6420b3cfb47778d549af4b0cd256e7ece"}},
1},
{<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.2.3">>},3},
{<<"http2_client">>,
Expand Down Expand Up @@ -180,7 +180,7 @@
1},
{<<"sibyl">>,
{git,"https://github.com/helium/sibyl.git",
{ref,"31338293d61bf525c2a653516d1b683b330ca029"}},
{ref,"47cfe7b896f83f5da2993d859d070fb5cee68c44"}},
0},
{<<"sidejob">>,{pkg,<<"sidejob">>,<<"2.1.0">>},2},
{<<"small_ints">>,{pkg,<<"small_ints">>,<<"0.1.0">>},4},
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/miner_hbbft_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ metadata(Version, Meta, Chain) ->
Infos = blockchain_ledger_snapshot_v1:get_infos(Chain),
case blockchain_ledger_snapshot_v1:snapshot(Ledger, Blocks, Infos) of
{ok, Snapshot} ->
{ok, _SnapHeight, SnapHash} = blockchain:add_snapshot(Snapshot, Chain),
{ok, {_SnapHeight, SnapHash, SnapSize}} = blockchain:add_snapshot(Snapshot, Chain),
lager:info("snapshot hash is ~p", [SnapHash]),
maps:put(snapshot_hash, SnapHash, ChainMeta0);
_Err ->
Expand Down
2 changes: 1 addition & 1 deletion src/miner.erl
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ remove_consensus() ->
version() ->
%% format:
%% MMMmmmPPPP
0010130003.
0010130007.

%% ------------------------------------------------------------------
%% gen_server
Expand Down
2 changes: 2 additions & 0 deletions src/miner_restart_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ init(_Opts) ->
"local_poc_keys_cf"
]
},
{ok, PoCCache} = cream:new(1000),
persistent_term:put(poc_cache, PoCCache),
[
?WORKER(miner_poc_mgr_db_owner, [POCOpts]),
?WORKER(miner_poc_mgr, [])
Expand Down
12 changes: 6 additions & 6 deletions src/poc/miner_poc_mgr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ active_pocs() ->
OnionKeyHash :: binary()
) -> false | {true, binary()} | {error, any()}.
check_target(Challengee, BlockHash, OnionKeyHash) ->
LocalPOC = e2qc:cache(
local_pocs,
PoCCache = persistent_term:get(poc_cache),
LocalPOC = cream:cache(
PoCCache,
OnionKeyHash,
30,
fun() -> ?MODULE:local_poc(OnionKeyHash) end
),
Res =
Expand All @@ -164,13 +164,13 @@ check_target(Challengee, BlockHash, OnionKeyHash) ->
%% clients should retry after a period of time
{error, <<"queued_poc">>};
{ok, #local_poc{block_hash = BlockHash, target = Challengee, onion = Onion}} ->
e2qc:evict(local_pocs, OnionKeyHash),
cream:evict(PoCCache, OnionKeyHash),
{true, Onion};
{ok, #local_poc{block_hash = BlockHash, target = _OtherTarget}} ->
e2qc:evict(local_pocs, OnionKeyHash),
cream:evict(PoCCache, OnionKeyHash),
false;
{ok, #local_poc{block_hash = _OtherBlockHash, target = _Target}} ->
e2qc:evict(local_pocs, OnionKeyHash),
cream:evict(PoCCache, OnionKeyHash),
{error, <<"mismatched_block_hash">>}
end;
_ ->
Expand Down

0 comments on commit 760bb04

Please sign in to comment.