mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user