Skip to content

Commit

Permalink
Misc edits for peer behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Dec 8, 2024
1 parent f8d5c8f commit 5168647
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions convex-core/src/main/java/convex/core/cpos/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ public class Order extends ARecordGeneric {
private static final int IX_CONSENSUS = 1;
private static final int IX_BLOCKS = 2;

/**
* Timestamp of this Order, i.e. the timestamp of the peer at the time it was created
*/
private final long timestamp;

/**
* Array of consensus points for each consensus level. The first element (block count)
* is ignored.
*/
private final long [] consensusPoints;

/**
* Timestamp of this Order, i.e. the timestamp of the peer at the time it was created
*/
private final long timestamp;

private static final long[] EMPTY_CONSENSUS_ARRAY = new long[CPoSConstants.CONSENSUS_LEVELS];

@SuppressWarnings("unchecked")
Expand Down
5 changes: 2 additions & 3 deletions convex-core/src/main/java/convex/core/cvm/Peer.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,8 @@ public Peer mergeBeliefs(Belief... beliefs) throws InvalidDataException {
Order newOrder=newBelief.getOrder(peerKey);
long ncp=newOrder.getConsensusPoint(CPoSConstants.CONSENSUS_LEVEL_FINALITY);
if (ocp>ncp) {
// This probably shouldn't happen, but just in case.....
System.err.println("Receding consensus? Old CP="+ocp +", New CP="+ncp);

// TODO: check cases where this can occur
// System.err.println("Receding consensus? Old CP="+ocp +", New CP="+ncp);
}
Peer p= updateBelief(newBelief);
if (p==this) return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public void testGossipConsensus() throws Exception {
boolean ANALYSIS = false;
int GOSSIP_NUM = 1;
final int TX_ROUNDS = 180;
final int SETTLE_ROUNDS = 20;
final int SETTLE_ROUNDS = 25;
final int NUM_INITIAL_TRANS = 3;

Peer[] bs0 = initialBeliefs();
Expand Down

0 comments on commit 5168647

Please sign in to comment.