Skip to content

Commit

Permalink
Merge pull request #73 from helium/adt/5mb-proposal-size
Browse files Browse the repository at this point in the history
Hardcode max rpc proposal size to 5mb, temporarily
  • Loading branch information
Vagabond committed Nov 16, 2021
2 parents 1b32631 + 5deaebc commit 3a7f806
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/hbbft.erl
Original file line number Diff line number Diff line change
Expand Up @@ -859,17 +859,17 @@ combine_shares(F, SK, SharesForThisBundle, Ciphertext) ->
end.

encode_list(L) ->
encode_list(L, []).
encode_list(L, 5*1024*1024, []).

encode_list([], Acc) ->
encode_list([], _, Acc) ->
list_to_binary(lists:reverse(Acc));
encode_list([H | T], Acc) ->
encode_list([H | T], Count, Acc) ->
Sz = byte_size(H),
case Sz >= 16#ffffff of
case Sz >= 16#ffffff orelse (Count - Sz) =< 0 of
true ->
encode_list(T, Acc);
encode_list(T, Count, Acc);
false ->
encode_list(T, [<<Sz:24/integer-unsigned-little, H/binary>> | Acc])
encode_list(T, Count - Sz, [<<Sz:24/integer-unsigned-little, H/binary>> | Acc])
end.

decode_list(<<>>, Acc) ->
Expand Down

0 comments on commit 3a7f806

Please sign in to comment.