Check consensus hash consistency (RIPD-1456):

These changes use the hash of the consensus transaction set when
characterizing the mismatch between a locally built ledger and fully
validated network ledger. This allows detection of non-determinism in
transaction process, in which consensus succeeded, but a node somehow
generated a different subsequent ledger.
This commit is contained in:
Brad Chase
2018-03-01 13:22:45 -05:00
committed by seelabs
parent 3a5a6c3637
commit 1507ed66a8
20 changed files with 402 additions and 86 deletions

View File

@@ -28,6 +28,7 @@ namespace ripple {
STValidation::STValidation(
uint256 const& ledgerHash,
uint256 const& consensusHash,
NetClock::time_point signTime,
PublicKey const& publicKey,
NodeID const& nodeID,
@@ -36,6 +37,7 @@ STValidation::STValidation(
{
// Does not sign
setFieldH256 (sfLedgerHash, ledgerHash);
setFieldH256 (sfConsensusHash, consensusHash);
setFieldU32 (sfSigningTime, signTime.time_since_epoch().count());
setFieldVL (sfSigningPubKey, publicKey.slice());
@@ -65,6 +67,11 @@ uint256 STValidation::getLedgerHash () const
return getFieldH256 (sfLedgerHash);
}
uint256 STValidation::getConsensusHash () const
{
return getFieldH256 (sfConsensusHash);
}
NetClock::time_point
STValidation::getSignTime () const
{