ostore.agree
Class RingState

java.lang.Object
  |
  +--ostore.agree.RingState

public class RingState
extends Object

The state associated with a given ring (public key). Logically, this class is a subclass of ThresholdByzantine. It's in a separate file only to make the programming easier. (I often edit the two simultaneously.)

Version:
$Id: RingState.java,v 1.9 2002/12/07 03:18:04 srhea Exp $
Author:
Sean C. Rhea

Field Summary
 SortedMap agreement_states
          Maps sequence numbers (Longs) to their AgreementStates.
 Set already_seen_digests
           
 long current_view
          The current view.
 Map digest_to_seq
          Maps the digests (SecureHashes) of ongoing requests to their sequence numbers (Longs) in the current view.
 Map guid_to_member
          Maps the guids of the machines in this ring (SecureHashes) to their member numbers (Integers).
 long highest_active_seq
          The largest sequence number of all of the agreements seen so far in this view.
 KeyShare key_share
          Our share of the private key used to create signatures.
 long last_dispatched_req
          The sequence number of the last request that was sent to the inner ring to be executed.
 long lowest_active_seq
          The sequence number of the agreement with the lowest sequence number which is still not in the CERTIFIED_STATE.
 int max_fail
          The maximum number of failures that can occur under the Byzantine assumption.
 int member_count
          The number of members in this ring.
 int member_num
          My own member number in this ring.
 SecureHash[] members_guids
          Maps member numbers to their machine guids.
 QSPublicKey[] members_pkeys
          The public keys of each of the members in the ring.
 LinkedList pending_agreements
          Agreements that we have not yet started due to the number of active requests being equal to the window size.
 SecureHash ring_id
          The hash of the public key used to verify signatures from this ring.
 QSPublicKey ring_pkey
          The public key used to verify signatures from this ring.
 int window_size
          The number of active agreements we allow to be in some state other than CERTIFIED_STATE.
 
Constructor Summary
RingState(SecureHash ring_id, long initial_view, long initial_seq, QSPublicKey ring_public_key, QSPublicKey[] member_public_keys, KeyShare private_key_share, QSPublicKey this_machine_pkey, int window_size)
          Construct a new RingState.
 
Method Summary
 long active_seqs()
          The number of agreements which have been initiated but not yet reached the CERTIFIED_STATE.
 AgreementState alloc_agreement_state(long seq)
          Allocate a new AgreementState object.
 void free_agreement_state(AgreementState as)
          Deallocate an AgreementState object.
 int general_num()
          The member number of the general in this view.
 boolean general()
          Are we the general in this view?
 boolean in_window(long seq)
          Is the given sequence number allowable, given the currently active agreements?
 long window_top()
          The highest allowable sequence number, given the currently active agreements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ring_id

public SecureHash ring_id
The hash of the public key used to verify signatures from this ring.


guid_to_member

public Map guid_to_member
Maps the guids of the machines in this ring (SecureHashes) to their member numbers (Integers).


member_count

public int member_count
The number of members in this ring.


member_num

public int member_num
My own member number in this ring.


max_fail

public int max_fail
The maximum number of failures that can occur under the Byzantine assumption.


current_view

public long current_view
The current view.


window_size

public int window_size
The number of active agreements we allow to be in some state other than CERTIFIED_STATE.


members_guids

public SecureHash[] members_guids
Maps member numbers to their machine guids.


ring_pkey

public QSPublicKey ring_pkey
The public key used to verify signatures from this ring.


members_pkeys

public QSPublicKey[] members_pkeys
The public keys of each of the members in the ring.


key_share

public KeyShare key_share
Our share of the private key used to create signatures.


digest_to_seq

public Map digest_to_seq
Maps the digests (SecureHashes) of ongoing requests to their sequence numbers (Longs) in the current view.


already_seen_digests

public Set already_seen_digests

highest_active_seq

public long highest_active_seq
The largest sequence number of all of the agreements seen so far in this view.


lowest_active_seq

public long lowest_active_seq
The sequence number of the agreement with the lowest sequence number which is still not in the CERTIFIED_STATE.


last_dispatched_req

public long last_dispatched_req
The sequence number of the last request that was sent to the inner ring to be executed.


agreement_states

public SortedMap agreement_states
Maps sequence numbers (Longs) to their AgreementStates.


pending_agreements

public LinkedList pending_agreements
Agreements that we have not yet started due to the number of active requests being equal to the window size.

Constructor Detail

RingState

public RingState(SecureHash ring_id,
                 long initial_view,
                 long initial_seq,
                 QSPublicKey ring_public_key,
                 QSPublicKey[] member_public_keys,
                 KeyShare private_key_share,
                 QSPublicKey this_machine_pkey,
                 int window_size)
Construct a new RingState.

Method Detail

general

public final boolean general()
Are we the general in this view?


general_num

public final int general_num()
The member number of the general in this view.


active_seqs

public final long active_seqs()
The number of agreements which have been initiated but not yet reached the CERTIFIED_STATE.


window_top

public final long window_top()
The highest allowable sequence number, given the currently active agreements.


in_window

public final boolean in_window(long seq)
Is the given sequence number allowable, given the currently active agreements?


alloc_agreement_state

public AgreementState alloc_agreement_state(long seq)
Allocate a new AgreementState object. Since there are never any more of these than the window size, and since they're rather large, we keep a list of the one's we've already allocated. Otherwise, every request would require garbage collecting another one. The above is no longer true, as it was the spawning ground for a hord of bugs. We now just use new and the gc, as God intended. --srhea 12/02/2002


free_agreement_state

public void free_agreement_state(AgreementState as)
Deallocate an AgreementState object. See the comments in alloc_agreement_state.