Bugfix: first new CP experiments with chain len=5

This commit is contained in:
Scott Lystig Fritchie 2015-08-29 22:40:18 +09:00
parent 94394d3429
commit 5c8b255da9
2 changed files with 22 additions and 6 deletions

View file

@ -1171,7 +1171,7 @@ react_to_env_A29(Retries, P_latest, LatestUnanimousP, ReadExtra,
?REACT({a29, ?LINE, ?REACT({a29, ?LINE,
[{zerf_filler, true}, [{zerf_filler, true},
{zerf_in, machi_projection:make_summary(Zerf)}]}), {zerf_in, machi_projection:make_summary(Zerf)}]}),
io:format(user, "zerf_in: A29: ~p: ~w\n\t~p\n", [MyName, machi_projection:make_summary(Zerf), get(yyy_hack)]), %% io:format(user, "zerf_in: A29: ~p: ~w\n\t~p\n", [MyName, machi_projection:make_summary(Zerf), get(yyy_hack)]),
P_current2 = Zerf#projection_v1{ P_current2 = Zerf#projection_v1{
flap=P_current#projection_v1.flap}, flap=P_current#projection_v1.flap},
S2 = set_proj(S, P_current2), S2 = set_proj(S, P_current2),
@ -1422,9 +1422,18 @@ a30_make_inner_projection(P_current, P_newprop3, P_latest, Up,
{upi_latest_i, UPI_latest_i}, {upi_latest_i, UPI_latest_i},
{repairing_latest_i,Repairing_latest_i}]}), {repairing_latest_i,Repairing_latest_i}]}),
LatestSameEnough_p = LatestSameEnough_p =
(UPI_latest_i ++ Repairing_latest_i) == %% Experiment: With chain length=5, this check is a pain,
(UPI_current_x ++ Repairing_current_x) %% e.g. when make_zerf() verifies last
andalso %% history of [c,d,e] *and no inner*, and now
%% others have proposed *with an inner* with
%% [a/witness,d,e] and bigger epoch. So, the
%% experiment is that if we choose something
%% insane here, other steps will figure that
%% out and do something safe instead.
%%
%% ({UPI_latest_i, Repairing_latest_i} ==
%% {UPI_current_x, Repairing_current_x})
%% andalso
Epoch_latest_i >= P_current_ios#projection_v1.epoch_number, Epoch_latest_i >= P_current_ios#projection_v1.epoch_number,
CurrentHasInner_and_LatestIsDisjoint_p = CurrentHasInner_and_LatestIsDisjoint_p =
P_current_has_inner_p P_current_has_inner_p
@ -1777,8 +1786,8 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP,
{2,inner_projection_exists(P_latest)}, {2,inner_projection_exists(P_latest)},
{3,inner_projection_exists(P_newprop)}, {3,inner_projection_exists(P_newprop)},
{4,MyUniquePropCount}, {4,MyUniquePropCount},
{5,{MyName, P_newprop_AllHosedPlus}}, {5,S#ch_mgr.flap_count},
%% {6,UnanimousLatestInnerNotRelevant_p}, {6,{MyName, P_newprop_AllHosedPlus}},
{7,P_current#projection_v1.down}, {7,P_current#projection_v1.down},
{8,P_newprop#projection_v1.down}, {8,P_newprop#projection_v1.down},
{9,{CurrentZerfInStatus_p,CurrentEpoch}}]}), {9,{CurrentZerfInStatus_p,CurrentEpoch}}]}),

View file

@ -121,8 +121,15 @@ update_checksum(P) ->
%% accidentally encourage someone else sometime later) by %% accidentally encourage someone else sometime later) by
%% replacing flapping information with our own local view at %% replacing flapping information with our own local view at
%% this instant in time. %% this instant in time.
%% * creation_time: With CP mode & inner projections, it's damn annoying
%% to have to copy this around 100% correctly. {sigh}
%% That's a negative state of the code. However, there
%% isn't a safety violation if the creation_time is
%% altered for any reason: it's there only for human
%% benefit for debugging.
CSum = crypto:hash(sha, CSum = crypto:hash(sha,
term_to_binary(P#projection_v1{epoch_csum= <<>>, term_to_binary(P#projection_v1{epoch_csum= <<>>,
creation_time=undefined,
flap=undefined, flap=undefined,
dbg2=[]})), dbg2=[]})),
P#projection_v1{epoch_csum=CSum}. P#projection_v1{epoch_csum=CSum}.