diff --git a/src/machi_chain_manager1.erl b/src/machi_chain_manager1.erl index f19e04b..a6462ee 100644 --- a/src/machi_chain_manager1.erl +++ b/src/machi_chain_manager1.erl @@ -1171,7 +1171,7 @@ react_to_env_A29(Retries, P_latest, LatestUnanimousP, ReadExtra, ?REACT({a29, ?LINE, [{zerf_filler, true}, {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{ flap=P_current#projection_v1.flap}, 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}, {repairing_latest_i,Repairing_latest_i}]}), LatestSameEnough_p = - (UPI_latest_i ++ Repairing_latest_i) == - (UPI_current_x ++ Repairing_current_x) - andalso + %% Experiment: With chain length=5, this check is a pain, + %% e.g. when make_zerf() verifies last + %% 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, CurrentHasInner_and_LatestIsDisjoint_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)}, {3,inner_projection_exists(P_newprop)}, {4,MyUniquePropCount}, - {5,{MyName, P_newprop_AllHosedPlus}}, - %% {6,UnanimousLatestInnerNotRelevant_p}, + {5,S#ch_mgr.flap_count}, + {6,{MyName, P_newprop_AllHosedPlus}}, {7,P_current#projection_v1.down}, {8,P_newprop#projection_v1.down}, {9,{CurrentZerfInStatus_p,CurrentEpoch}}]}), diff --git a/src/machi_projection.erl b/src/machi_projection.erl index 08b20ab..10ded7c 100644 --- a/src/machi_projection.erl +++ b/src/machi_projection.erl @@ -121,8 +121,15 @@ update_checksum(P) -> %% accidentally encourage someone else sometime later) by %% replacing flapping information with our own local view at %% 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, term_to_binary(P#projection_v1{epoch_csum= <<>>, + creation_time=undefined, flap=undefined, dbg2=[]})), P#projection_v1{epoch_csum=CSum}.