LCL history request and response. (#59)

Detect and request missing lcl history from another random node.
Sending lcl history response to a asked node.
Getting lcl history response and applying it.
Delete lcl that exceeds max ledger sequence.
This commit is contained in:
Asanka Indrajith
2019-11-19 07:50:33 -05:00
committed by GitHub
parent 0439ec93e2
commit 95683035b9
18 changed files with 1006 additions and 98 deletions

View File

@@ -12,7 +12,7 @@ table UserSubmittedMessageGroup {
messages:[UserSubmittedMessage];
}
union Message { NonUnl_Proposal_Message, Proposal_Message, Npl_Message } //message content type
union Message { NonUnl_Proposal_Message, Proposal_Message, Npl_Message, History_Request_Message, History_Response_Message } //message content type
table Content {
message:Message;
@@ -35,6 +35,25 @@ table Npl_Message { //NPL type message schema
data:[ubyte];
}
table History_Request_Message { //Ledger History request type message schema
minimum_lcl:[ubyte];
required_lcl:[ubyte];
}
table History_Response_Message { //Ledger History request type message schema
hist_ledgers:[HistoryLedgerPair];
}
table HistoryLedgerPair { //A key, value pair of byte[].
seq_no:uint64;
ledger:HistoryLedger;
}
table HistoryLedger {
lcl:[ubyte];
raw_ledger:[ubyte];
}
table StateDifference { //Represent state difference by tracking created,updated and deleted state files.
created: [BytesKeyValuePair]; //list of { fn => hash }
updated: [BytesKeyValuePair];