diff --git a/BinaryFormats.txt b/BinaryFormats.txt index e671410944..a80d2e8062 100644 --- a/BinaryFormats.txt +++ b/BinaryFormats.txt @@ -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. diff --git a/Ledger.h b/Ledger.h index 2b8e07854f..6af9bc737d 100644 --- a/Ledger.h +++ b/Ledger.h @@ -93,7 +93,7 @@ public: Ledger::pointer closeLedger(uint64 timestamp); bool isCompatible(boost::shared_ptr other); - bool signLedger(std::vector &signature, const LocalHanko &hanko, int32 confidence); + bool signLedger(std::vector &signature, const LocalHanko &hanko); static bool unitTest(void); }; diff --git a/newcoin.proto b/newcoin.proto index d91626af5a..e1298153b6 100644 --- a/newcoin.proto +++ b/newcoin.proto @@ -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 {