-
Notifications
You must be signed in to change notification settings - Fork 972
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3434 from graydon/bug-3412-protocol-vnext
Move XDR files to separate subdirs for vCurr and vNext Reviewed-by: MonsieurNicolas
- Loading branch information
Showing
15 changed files
with
3,193 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright 2015 Stellar Development Foundation and contributors. Licensed | ||
// under the Apache License, Version 2.0. See the COPYING file at the root | ||
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
%#include "xdr/Stellar-types.h" | ||
|
||
namespace stellar | ||
{ | ||
|
||
typedef opaque Value<>; | ||
|
||
struct SCPBallot | ||
{ | ||
uint32 counter; // n | ||
Value value; // x | ||
}; | ||
|
||
enum SCPStatementType | ||
{ | ||
SCP_ST_PREPARE = 0, | ||
SCP_ST_CONFIRM = 1, | ||
SCP_ST_EXTERNALIZE = 2, | ||
SCP_ST_NOMINATE = 3 | ||
}; | ||
|
||
struct SCPNomination | ||
{ | ||
Hash quorumSetHash; // D | ||
Value votes<>; // X | ||
Value accepted<>; // Y | ||
}; | ||
|
||
struct SCPStatement | ||
{ | ||
NodeID nodeID; // v | ||
uint64 slotIndex; // i | ||
|
||
union switch (SCPStatementType type) | ||
{ | ||
case SCP_ST_PREPARE: | ||
struct | ||
{ | ||
Hash quorumSetHash; // D | ||
SCPBallot ballot; // b | ||
SCPBallot* prepared; // p | ||
SCPBallot* preparedPrime; // p' | ||
uint32 nC; // c.n | ||
uint32 nH; // h.n | ||
} prepare; | ||
case SCP_ST_CONFIRM: | ||
struct | ||
{ | ||
SCPBallot ballot; // b | ||
uint32 nPrepared; // p.n | ||
uint32 nCommit; // c.n | ||
uint32 nH; // h.n | ||
Hash quorumSetHash; // D | ||
} confirm; | ||
case SCP_ST_EXTERNALIZE: | ||
struct | ||
{ | ||
SCPBallot commit; // c | ||
uint32 nH; // h.n | ||
Hash commitQuorumSetHash; // D used before EXTERNALIZE | ||
} externalize; | ||
case SCP_ST_NOMINATE: | ||
SCPNomination nominate; | ||
} | ||
pledges; | ||
}; | ||
|
||
struct SCPEnvelope | ||
{ | ||
SCPStatement statement; | ||
Signature signature; | ||
}; | ||
|
||
// supports things like: A,B,C,(D,E,F),(G,H,(I,J,K,L)) | ||
// only allows 2 levels of nesting | ||
struct SCPQuorumSet | ||
{ | ||
uint32 threshold; | ||
NodeID validators<>; | ||
SCPQuorumSet innerSets<>; | ||
}; | ||
} |
Oops, something went wrong.