Clean up the propose/avalanche phase.

This commit is contained in:
JoelKatz
2011-12-06 21:25:44 -08:00
parent 81fa075582
commit ee51968820
3 changed files with 26 additions and 7 deletions

View File

@@ -65,10 +65,7 @@ Fields:
4) 32-byte hash of root of the transaction tree for this ledger
5) 32-byte hash of root of the account tree for this ledger
6) 8-byte closing timestamp
7) 4-byte confidence, unsigned BE integer (0 = closed/accepted)
8) Signature:
Accepted: Prefix (0x4C475200) of 120 byte fields 1-6
Proposed: Prefix (0x4C475000) of 120 byte fields 1-8
7) Signature: Prefix (0x4C475000) of 116 byte fields 1-6
4) Account status (ledger format)
@@ -111,7 +108,19 @@ Account State Leaf Node Fields:
2) 2-byte length (32)
3) 32-byte account status in ledger format
7) Contact block
7) Propose ledger:
1) 4-byte closing ledger sequence number
2) 4-byte seconds since ledger close time
3) 32-byte previous ledger hash
4) 32-byte current ledger hash
5) Zero or more transaction change objects (optional) each:
32-byte transaction ID
1-byte operation (0=removed, 1=added)
6) 20-byte hanko of signing node
7) 72-byte prefix 0x41564C00 signature of above
8) Contact block
These are used to pass node contact information around the network and are
signed so nodes can prove they are operational.

View File

@@ -93,7 +93,7 @@ public:
Ledger::pointer closeLedger(uint64 timestamp);
bool isCompatible(boost::shared_ptr<Ledger> other);
bool signLedger(std::vector<unsigned char> &signature, const LocalHanko &hanko, int32 confidence);
bool signLedger(std::vector<unsigned char> &signature, const LocalHanko &hanko);
static bool unitTest(void);
};

View File

@@ -21,7 +21,7 @@ enum MessageType {
GET_LEDGER= 31;
LEDGER= 32;
PROPOSE_LEDGER= 33;
CLOSE_LEDGER= 34;
CLOSE_LEDGER= 35;
// data replication and synchronization
GET_VALIDATIONS= 40;
@@ -73,6 +73,16 @@ message TMTransaction {
optional bytes conflictingTransaction = 13;
}
message TMProposeLedger {
required uint32 closingSeq = 1;
required uint32 secondsSinceClose = 2;
required bytes previousLedgerHash = 3; // 0 if first proposal
required bytes currentLedgerHash = 4;
required bytes hanko = 5;
repeated bytes addedTransactions = 6;
repeated bytes removedTransactions = 7;
required bytes signature = 8;
}
// Used to propose/validate during ledger close
message TMValidation {